VertexColorTag Class Reference

#include <c4d_vertexcolortag.h>

Inheritance diagram for VertexColorTag:

Public Types

typedef BaseTag SUPER
 
- Public Types inherited from BaseTag
typedef BaseList2D SUPER
 
- Public Types inherited from BaseList2D
typedef GeListNode SUPER
 
- Public Types inherited from GeListNode
typedef PrivateChunk SUPER
 

Public Member Functions

virtual Bool IsInstanceOf (cineware::Int32 id) const
 
ConstVertexColorHandle GetDataAddressR ()
 
VertexColorHandle GetDataAddressW ()
 
Bool IsPerPointColor ()
 
Bool SetPerPointMode (Bool perPointColor)
 
Int32 GetDataCount ()
 
Bool Resize (Int32 newcnt, Int32 datasize)
 
- Public Member Functions inherited from BaseTag
 BaseTag (Int32 id=NOTOK, Int32 pD=NOTOK)
 
virtual ~BaseTag ()
 
BaseTagGetNext ()
 
BaseTagGetPred ()
 
virtual Int32 GetType () const
 
virtual Int32 GetDiskType () const
 
virtual BaseList2DGetClone (COPYFLAGS flags, AliasTrans *trans)
 
virtual Bool CopyDataV (BaseTag *dest, COPYFLAGS flags, AliasTrans *trans)
 
virtual Bool GetDParameter (const DescID &id, GeData &data)
 
virtual Bool SetDParameter (const DescID &id, const GeData &data)
 
BaseObjectGetObject ()
 
- Public Member Functions inherited from BaseList2D
 BaseList2D ()
 
virtual ~BaseList2D ()
 
BaseList2DGetNext ()
 
BaseList2DGetPred ()
 
NodeDataGetNodeData ()
 
void SetNodeData (NodeData *data)
 
void SetBit (Int32 mask)
 
Bool GetBit (Int32 mask)
 
void DelBit (Int32 mask)
 
void ToggleBit (Int32 mask)
 
Int32 GetAllBits ()
 
void SetAllBits (Int32 bits)
 
BaseContainer GetData ()
 
BaseContainerGetDataInstance ()
 
BaseContainerGetDataInstanceRef ()
 
const StringGetName ()
 
void SetName (const String &new_name)
 
const GeMarkerGetMarker () const
 
void SetMarker (const GeMarker &m)
 
Bool AddUniqueID (Int32 appid, const Char *const mem, Int bytes)
 
Bool FindUniqueID (Int32 appid, const Char *&mem, Int &bytes) const
 
Int32 GetUniqueIDCount () const
 
Bool GetUniqueIDIndex (Int32 idx, Int32 &id, const Char *&mem, Int &bytes) const
 
BaseShaderGetFirstShader ()
 
Bool InsertShader (BaseShader *shader, BaseShader *pred=nullptr)
 
Bool InsertShaderLast (BaseShader *shader)
 
RootCTrackGetCTrackRoot ()
 
CTrackGetFirstCTrack ()
 
CTrackFindCTrack (const DescID &id)
 
Bool AppendCTrack (CTrack *t)
 
void InsertTrackSorted (CTrack *track)
 
LayerObjectGetLayerObject ()
 
void SetLayerObject (LayerObject *layer)
 
const LayerDataGetLayerData (BaseDocument *doc, Bool rawdata=false)
 
Bool SetLayerData (BaseDocument *doc, const LayerData &data)
 
DynamicDescriptionGetDynamicDescription ()
 
virtual Bool IsBaseList ()
 
virtual void Remove ()
 
Bool SetDescIDState (const DescID &id, DESCIDSTATE descidstate)
 
DESCIDSTATE GetDescIDState (const DescID &id, Bool tolerant) const
 
RootPluginNodeGetOverrideRoot ()
 
BaseOverrideGetFirstOverride ()
 
virtual Bool TranslateDescID (const DescID &id, DescID &res_id, GeListNode *&res_at)
 
- Public Member Functions inherited from GeListNode
 GeListNode ()
 
 ~GeListNode ()
 
virtual Bool GetNBit (Int32 bit) const
 
virtual Bool ChangeNBit (NBIT bit, NBITCONTROL bitmode)
 
BaseDocumentGetDocument ()
 
GeListNodeGetPred ()
 
GeListNodeGetNext ()
 
GeListNodeGetUp ()
 
GeListNodeGetDown ()
 
GeListNodeGetDownLast ()
 
void InsertBefore (GeListNode *op)
 
void InsertAfter (GeListNode *op)
 
void Remove ()
 
void InsertUnder (GeListNode *op)
 
void InsertUnderLast (GeListNode *op)
 
RootList2DGetListHead ()
 
Int32 GetNodeID (Int32 index=0) const
 
- Public Member Functions inherited from PrivateChunk
 PrivateChunk ()
 
Bool ReadChunk (HyperFile *hf, Bool keepin=false, Bool noheader=false)
 
virtual Bool IsListHead ()
 
Bool ReadObject (HyperFile *hf, Bool readheader)
 
Bool WriteObject (HyperFile *hf, Int32 type)
 
Bool CopyTo (PrivateChunk *dest, COPYFLAGS flags, AliasTrans *trans)
 
Bool GetParameter (Int32 id, GeData &data)
 
Bool SetParameter (Int32 id, const GeData &data)
 
Bool GetParameter (const DescID &id, GeData &data)
 
Bool SetParameter (const DescID &id, const GeData &data)
 
virtual Int32 GetChunkLevel ()
 
- Public Member Functions inherited from GeTempPublicNode2D< PrivateChunk >
PrivateChunkGetNext () const
 
PrivateChunkGetPrev () const
 
void InsertBefore (PrivateChunk *n)
 
void InsertAfter (PrivateChunk *n)
 
void Remove ()
 

Static Public Member Functions

static void Get (ConstVertexColorHandle dataptr, Int32 i, VertexColorStruct &res)
 
static void Set (VertexColorHandle dataptr, Int32 i, const VertexColorStruct &s)
 
static VertexColorTagAlloc (Int32 count)
 
static void Free (VertexColorTag *&bl)
 
- Static Public Member Functions inherited from BaseTag
static BaseTagAlloc (Int32 type)
 
static void Free (BaseTag *&bl)
 

Private Attributes

Float32vdata
 
Int32 vCount
 

Constructor

 VertexColorTag ()
 
 ~VertexColorTag ()
 

Private

virtual Bool CopyToX (PrivateChunk *dst, COPYFLAGS flags, AliasTrans *trans)
 
virtual Bool HandleSubChunk (HyperFile *hf, Int32 id, Int32 level)
 
Bool Write (HyperFile *hf)
 
virtual Int32 GetInfo ()
 

Additional Inherited Members

- Protected Member Functions inherited from BaseTag
virtual Int32 GetInstanceType () const
 
- Protected Member Functions inherited from BaseList2D
void SetID (Int32 id)
 
- Protected Attributes inherited from BaseTag
BaseObjectparent_op
 
- Protected Attributes inherited from BaseList2D
Int32 m_id
 
RootShader mp_rootshader
 
RootShader mp_rootshader_hidden
 
RootShader root_shader_repository
 
Int32 l_bitfeld
 
RootCTrack mp_rootctrack
 
RootPluginNode root_override
 
NotifyListnotify_events
 
DescIdStorekeyframestore
 
DescIdStorepropstore
 
BaseContainer m_bc
 
NodeDatam_data
 
- Protected Attributes inherited from GeListNode
GeAliasGoal m_xgoal
 
UInt32 m_bits [4]
 
RootList2Dt_rootlist_parent
 
RootList2Dm_children
 
BaseDocumentparent_doc
 
void * unknownData
 
Int unknownDataSize
 
Int32 unknownDataLevel
 
Int32 pluginID
 

Detailed Description

VertexColorTag is a Variable Tag used to store colors (RGBA) into the mesh structure. It can store data in 2 ways: per polygon vertex and per mesh vertex.

Using per polygon vertex mode the tag provides all methods to set/get color per polygons or per vertex(average). It also provides some convenience functions to get/set just color or just alpha value in both modes.

Since
18.002
Note
Has to be created with Alloc() and destroyed with Free().

Member Typedef Documentation

◆ SUPER

typedef BaseTag SUPER

Constructor & Destructor Documentation

◆ VertexColorTag()

Default constructor.

◆ ~VertexColorTag()

Default destructor.

Member Function Documentation

◆ IsInstanceOf()

virtual Bool IsInstanceOf ( cineware::Int32  id) const
virtual

Reimplemented from BaseTag.

◆ GetDataAddressR()

ConstVertexColorHandle GetDataAddressR ( )

Gets the read-only data handle. It automatically recognizes if the tag is per vertex or per polygon vertex.

Returns
The handle to the read-only VertexColor data. The tag owns the pointed data.

◆ GetDataAddressW()

VertexColorHandle GetDataAddressW ( )

Gets the writable data handle. It automatically recognizes if the tag is per vertex or per polygon vertex.

Returns
The handle to the writable VertexColor data. The tag owns the pointed data.

◆ IsPerPointColor()

Bool IsPerPointColor ( )

Checks if the data is stored per vertex or per polygon vertex.

Returns
true if colors are stored per vertex, otherwise false.

◆ SetPerPointMode()

Bool SetPerPointMode ( Bool  perPointColor)

Sets wether the data is stored per vertex or per polygon vertex.

Note
The item count is automatically updated and the data converted if possible.
Warning
All handles are invalidated after this call.
Parameters
[in]perPointColorIf true the data will be stored per vertex otherwise per polygon vertex.
Returns
true if successfull, otherwise false.

◆ Get()

static void Get ( ConstVertexColorHandle  dataptr,
Int32  i,
VertexColorStruct res 
)
static

Retrieves the Vertex Colors for the polygon i in per polygon vertex mode.
Example:

ConstVertexColorHandle dataptr = ((VertexColorTag*)tag)->GetDataAddressR()
VertexColorStruct vcs;
for (Int32 i = 0; i < faceCount; ++i)
{
VertexColorTag::Get(dataptr, faces[i], vcs);
// Do something with vcs (you can just read values)
}
Parameters
[in]dataptrThe data handle.
[in]iThe polygon index.
[out]resThe retrieved Vertex Color data.

◆ Set()

static void Set ( VertexColorHandle  dataptr,
Int32  i,
const VertexColorStruct s 
)
static

Sets the Vertex Colors for the polygon i in per polygon vertex mode.
Example:

VertexColorHandle dataptr = ((VertexColorTag*)tag)->GetDataAddressW()
VertexColorStruct vcs;
for (Int32 i = 0; i < faceCount; ++i)
{
VertexColorTag::Get(dataptr, faces[i], vcs);
// Do something with vcs (e.g. write values)
for (Int32 a = 0; a < 4; ++a)
vcs[a] = Vecor4d32(1, 0, 0, 0.5);
// Do not forget to set values again
VertexColorTag::Set(dataptr, faces[i], vcs);
}
Parameters
[in]dataptrThe data handle.
[in]iThe polygon index.
[in]sThe Vertex Color data to be set to the polygon.

◆ Alloc()

static VertexColorTag* Alloc ( Int32  count)
static

Allocates a VertexColorTag instance. Destroy the allocated VertexColorTag instance with Free().

Parameters
[in]countThe element count in the tag. Must be equal to the object polygon count if in per polygon vertex storage, otherwise must be equal to the object point count.
Returns
The allocated VertexColorTag, or nullptr if the allocation failed.

◆ Free()

static void Free ( VertexColorTag *&  bl)
static

Destructs vertex color tags allocated with Alloc().

Parameters
[in]blThe VertexColorTag instance to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆ GetDataCount()

Int32 GetDataCount ( )

Private.

◆ Resize()

Bool Resize ( Int32  newcnt,
Int32  datasize 
)

Private.

◆ CopyToX()

virtual Bool CopyToX ( PrivateChunk dst,
COPYFLAGS  flags,
AliasTrans trans 
)
privatevirtual

Private.

Reimplemented from BaseTag.

◆ HandleSubChunk()

virtual Bool HandleSubChunk ( HyperFile hf,
Int32  id,
Int32  level 
)
privatevirtual

Private.

Reimplemented from BaseTag.

◆ Write()

Bool Write ( HyperFile hf)
privatevirtual

Private.

Reimplemented from BaseTag.

◆ GetInfo()

virtual Int32 GetInfo ( )
privatevirtual

Private.

Reimplemented from GeListNode.

Member Data Documentation

◆ vdata

Float32* vdata
private

◆ vCount

Int32 vCount
private
cineware::VertexColorTag::VertexColorTag
VertexColorTag()
Default constructor.
cineware::VertexColorTag::Get
static void Get(ConstVertexColorHandle dataptr, Int32 i, VertexColorStruct &res)
cineware::ConstVertexColorHandle
const typedef void * ConstVertexColorHandle
Handle for read-only vertex color data. See also: VertexColorTag.
Definition: c4d_vertexcolortag.h:18
cineware::VertexColorTag::Set
static void Set(VertexColorHandle dataptr, Int32 i, const VertexColorStruct &s)
cineware::Int32
int32_t Int32
32 bit signed integer datatype.
Definition: c4d_system.h:186
cineware::VertexColorHandle
void * VertexColorHandle
Handle for vertex color data. See also: VertexColorTag.
Definition: c4d_vertexcolortag.h:17