Cogs.Core
|
#include <CADAssetTexture.h>
Public Member Functions | |
CADAssetTexture (Cogs::Core::Context *context, bool powerOfTwoTextures=true) | |
CADAssetTexture (const CADAssetTexture &)=delete | |
CADAssetTexture & | operator= (const CADAssetTexture &)=delete |
ResourceId | getTextureId () const |
CADAttributeMap & | getAttributeMap () |
glm::uvec2 | getAttrSize () const |
size_t | getTagCount () const |
ITagEntry | getTagAt (size_t index) const |
bool | empty () const |
void | showAll () |
void | updateColorById (size_t index, glm::uvec3 color, bool recurse) |
void | updateAlphaById (size_t index, AttributeMapAlpha alpha, bool recurse) |
bool | updateAttributeMap () |
void | addTag (std::string_view name, int parentId, std::span< const int > children) |
Private Member Functions | |
void | release () |
Private Attributes | |
Cogs::Core::Context * | context |
CADAttributeMap | _attributeMap |
TagContainer | tagsTxtEntries |
ResourceId | textureId |
glm::uvec2 | currentAttrSize |
Texture resource adding support for Cogs Asset entity Twin way. The texture is used when displaying the asset mapping Asset Tags to displayed properties.
Definition at line 116 of file CADAssetTexture.h.
|
inline |
Initialized the Asset Texture creating the Cogs texture.
context | - Cogs Context object owning the texture. |
powerOfTwoTextures | - True if textures must be power of 2 |
Definition at line 123 of file CADAssetTexture.h.
References Cogs::Editor::CADAttributeMap::resize(), and updateAttributeMap().
|
inline |
Definition at line 135 of file CADAssetTexture.h.
|
inline |
Add definition of a CAD tag. Tags must be addef from ID=0 onwards.
name | - Name of tag. |
parentId | - ID of parent, -1 = no parents. |
children | - IDs of children |
Definition at line 229 of file CADAssetTexture.h.
References Cogs::Editor::TagContainer::addTag().
|
inline |
Definition at line 158 of file CADAssetTexture.h.
|
inline |
Gets the attribute map for tags.
Definition at line 146 of file CADAssetTexture.h.
|
inline |
Gets attr size. E.g. Texture dimension in X and Y.
Definition at line 149 of file CADAssetTexture.h.
References Cogs::Editor::CADAttributeMap::getAttrSize().
|
inline |
Definition at line 153 of file CADAssetTexture.h.
|
inline |
Definition at line 151 of file CADAssetTexture.h.
|
inline |
Gets the Cogs texture resource.
Definition at line 143 of file CADAssetTexture.h.
|
inlineprivate |
Definition at line 235 of file CADAssetTexture.h.
|
inline |
Reset attributes to show all data using default settings.
Definition at line 163 of file CADAssetTexture.h.
References Cogs::Editor::CADAttributeMap::getDefaultColor(), Cogs::Editor::CADAttributeMap::init(), and updateAttributeMap().
|
inline |
Update Alpha channel for tag at given index, optionally also updating all children.
index | - Tag index. |
alpha | - New Alpha. |
recurse | - True if also updating children of the tag. |
Definition at line 193 of file CADAssetTexture.h.
References Cogs::Editor::ITagEntry::children, Cogs::Editor::CADAttributeMap::growToContainIndex(), Cogs::Editor::CADAttributeMap::setAlpha(), and updateAlphaById().
Referenced by updateAlphaById().
|
inline |
Load Attribute map to Texture
Definition at line 210 of file CADAssetTexture.h.
References Cogs::Editor::CADAttributeMap::getAttributeMap(), Cogs::Editor::CADAttributeMap::getAttrSize(), Cogs::Core::LinearColorSpace, and Cogs::Core::NoMipMaps.
Referenced by CADAssetTexture(), and showAll().
|
inline |
Update attributes for tag at given index, optionally also updating all children.
index | - Tag index. |
color | - New color. RGB Range (0-255) |
recurse | - True if also updating children of the tag. |
Definition at line 174 of file CADAssetTexture.h.
References Cogs::Editor::ITagEntry::children, Cogs::Editor::CADAttributeMap::growToContainIndex(), Cogs::Editor::CADAttributeMap::setColor(), and updateColorById().
Referenced by updateColorById().
|
private |
Definition at line 245 of file CADAssetTexture.h.
|
private |
Definition at line 244 of file CADAssetTexture.h.
|
private |
Definition at line 248 of file CADAssetTexture.h.
|
private |
Definition at line 246 of file CADAssetTexture.h.
|
private |
Definition at line 247 of file CADAssetTexture.h.