PolygonObject Class Reference

#include <c4d_polygonobject.h>

Inheritance diagram for PolygonObject:

Public Types

typedef PointObject SUPER
 
- Public Types inherited from PointObject
typedef BaseObject SUPER
 
- Public Types inherited from BaseObject
typedef BaseList4D SUPER
 
- Public Types inherited from BaseList4D
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 (melange::Int32 id) const
 
- Public Member Functions inherited from PointObject
BaseSelectGetPointS ()
 
BaseSelectGetPointH ()
 
const VectorGetPointR ()
 
VectorGetPointW ()
 
Int32 GetPointCount ()
 
Bool ResizeObject (Int32 pcnt)
 
- Public Member Functions inherited from BaseObject
BaseObjectGetNext ()
 
BaseObjectGetPred ()
 
BaseObjectGetUp ()
 
BaseObjectGetDown ()
 
BaseObjectGetDownLast ()
 
virtual BaseList2DGetClone (COPYFLAGS flags, AliasTrans *trans)
 
Vector GetAbsPos () const
 
void SetAbsPos (const Vector &v)
 
Vector GetAbsScale () const
 
void SetAbsScale (const Vector &v)
 
Vector GetAbsRot () const
 
void SetAbsRot (const Vector &v)
 
Vector GetFrozenPos () const
 
void SetFrozenPos (const Vector &v)
 
Vector GetFrozenScale () const
 
void SetFrozenScale (const Vector &v)
 
Vector GetFrozenRot () const
 
void SetFrozenRot (const Vector &v)
 
Vector GetRelPos () const
 
void SetRelPos (const Vector &v)
 
Vector GetRelScale () const
 
void SetRelScale (const Vector &v)
 
Vector GetRelRot () const
 
void SetRelRot (const Vector &v)
 
const MatrixGetMl () const
 
void SetMl (const Matrix &m)
 
Matrix GetFrozenMln () const
 
Matrix GetRelMln () const
 
Matrix GetRelMl () const
 
void SetRelMl (const Matrix &m)
 
Matrix GetMg ()
 
void SetMg (const Matrix &m)
 
Matrix GetMln () const
 
Matrix GetMgn ()
 
Matrix GetUpMg ()
 
void CopyMatrixTo (BaseObject *dest)
 
void SetRotationOrder (ROTATIONORDER order)
 
ROTATIONORDER GetRotationOrder () const
 
void SetQuaternionRotationMode (Bool active)
 
Bool IsQuaternionRotationMode ()
 
Bool SynchronizeVectorTrackKeys (Int32 vectorTrackID, BaseTime startRange=BaseTime(-108000, 1), BaseTime endRange=BaseTime(108000, 1))
 
Bool FindBestEulerAngle (Int32 rotationTrackID, Bool bAdjustTangent, BaseTime startRange=BaseTime(-108000, 1), BaseTime endRange=BaseTime(108000, 1))
 
Int32 GetEditorMode ()
 
void SetEditorMode (Int32 mode)
 
Int32 GetRenderMode ()
 
void SetRenderMode (Int32 mode)
 
Bool GetDeformMode ()
 
void SetDeformMode (Bool mode)
 
BaseTagGetFirstTag ()
 
BaseTagGetTag (Int32 type, Int32 nr=0)
 
BaseTagMakeTag (Int32 type, BaseTag *pred=nullptr)
 
void InsertTag (BaseTag *tp, BaseTag *pred=nullptr)
 
void KillTag (Int32 type, Int32 nr=0)
 
BaseObjectGetCache ()
 
BaseObjectGetDeformCache ()
 
void GetColorProperties (ObjectColorProperties *prop)
 
void SetColorProperties (ObjectColorProperties *prop)
 
virtual Bool Execute ()
 
Bool HasChanged ()
 
- Public Member Functions inherited from BaseList4D
BaseList4DGetUp ()
 
BaseList4DGetDown ()
 
BaseList4DGetDownLast ()
 
void InsertBefore (BaseList4D *bl)
 
void InsertAfter (BaseList4D *bl)
 
void InsertUnder (BaseList4D *bl)
 
void InsertUnderLast (BaseList4D *bl)
 
virtual void Remove ()
 
- 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 ()
 
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 ()
 
virtual Int32 GetInfo ()
 
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 ()
 

Protected Member Functions

 PolygonObject ()
 
- Protected Member Functions inherited from PointObject
 PointObject ()
 
- Protected Member Functions inherited from BaseObject
virtual Bool HandleSubChunk (HyperFile *hf, Int32 id, Int32 level)
 
virtual Bool Write (HyperFile *hf)
 
virtual Int32 GetInstanceType () const
 
 BaseObject ()
 
 BaseObject (Int32 id)
 
virtual ~BaseObject ()
 
- Protected Member Functions inherited from BaseList4D
 BaseList4D ()
 
 ~BaseList4D ()
 
- Protected Member Functions inherited from BaseList2D
void SetID (Int32 id)
 

Private Member Functions

virtual Int32 GetDiskType () const
 

Friends

class BaseObject
 

Alloc/Free

static PolygonObjectAlloc (Int32 pcnt, Int32 vcnt)
 
static void Free (PolygonObject *&bl)
 

Type

virtual Int32 GetType () const
 

Polygon Data

BaseSelectGetPolygonS ()
 
BaseSelectGetPolygonH ()
 
BaseSelectGetEdgeS ()
 
BaseSelectGetEdgeH ()
 
BaseSelectGetPhongBreak ()
 
const CPolygonGetPolygonR ()
 
CPolygonGetPolygonW ()
 
Int32 GetPolygonCount ()
 

Resize

Bool ResizeObject (Int32 pcnt, Int32 vcnt)
 
Bool ResizeObject (Int32 pcnt, Int32 vcnt, Int32 ncnt)
 

N-gon

Int32 GetNgonCount ()
 
NgonBaseGetNgonBase ()
 

Miscellaneous

Vector32CreatePhongNormals ()
 
BaseTagMakeUVWTag (const String &name)
 

Additional Inherited Members

- Static Public Member Functions inherited from BaseObject
static BaseObjectAlloc (Int32 type)
 
static void Free (BaseObject *&bl)
 
- Protected Attributes inherited from BaseList2D
Int32 m_id
 
RootShader mp_rootshader
 
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

Represents Cinema 4D's polygon object.

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

Member Typedef Documentation

◆ SUPER

typedef PointObject SUPER

Constructor & Destructor Documentation

◆ PolygonObject()

PolygonObject ( )
protected

Member Function Documentation

◆ IsInstanceOf()

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

Reimplemented from PointObject.

◆ GetDiskType()

virtual Int32 GetDiskType ( ) const
privatevirtual

Gets the unique disk type of the base list.

Note
Normally this is the same as GetType() but there are exceptions.
Returns
The disk type, for example Ocube.

Reimplemented from PointObject.

◆ Alloc()

static PolygonObject* Alloc ( Int32  pcnt,
Int32  vcnt 
)
static

Allocates a polygon object. Destroy the allocated polygon object with Free().

Parameters
[in]pcntThe point count.
[in]vcntThe polygon count.
Returns
The allocated polygon object, or nullptr if the allocation failed.

◆ Free()

static void Free ( PolygonObject *&  bl)
static

Destructs polygon objects allocated with Alloc().

Parameters
[in,out]blThe polygon object to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆ GetType()

virtual Int32 GetType ( ) const
virtual

Gets the object type for a PolygonObject.

Note
Always returns Opolygon.
Returns
The object type for a PolygonObject i.e. Opolygon.

Reimplemented from PointObject.

◆ GetPolygonS()

BaseSelect* GetPolygonS ( )

Gets the selected polygons (visible ones only).

Returns
The selection of visible polygons. The polygon object owns the pointed base select.

◆ GetPolygonH()

BaseSelect* GetPolygonH ( )

Gets the hidden polygons.

Note
These are only hidden within the editor.
Returns
The selection of hidden polygons. The polygon object owns the pointed base select.

◆ GetEdgeS()

BaseSelect* GetEdgeS ( )

Gets the selected edges.
Edges are indexed by 4 * polygon + edge where polygon is the polygon index and edge is the edge index between 0 and 3.

Returns
The selection of visible edges. The polygon object owns the pointed base select.

◆ GetEdgeH()

BaseSelect* GetEdgeH ( )

Gets the hidden edges.
Edges are indexed by 4 * polygon + edge where polygon is the polygon index and edge is the edge index between 0 and 3.

Returns
The selection of hidden edges. The polygon object owns the pointed base select.

◆ GetPhongBreak()

BaseSelect* GetPhongBreak ( )

Gets the phong break edges.
Edges are indexed by 4 * polygon + edge where polygon is the polygon index and edge is the edge index between 0 and 3.

Returns
The selection of phong break edges. The polygon object owns the pointed base select.

◆ GetPolygonR()

const CPolygon* GetPolygonR ( )

Gets a pointer to the read-only buffer of polygons.

Returns
A pointer to the read-only buffer of polygons. The polygon object owns the pointed buffer.

◆ GetPolygonW()

CPolygon* GetPolygonW ( )

Gets a pointer to the writable array of polygons.

Returns
A pointer to the writable array of polygons. The polygon object owns the pointed buffer.

◆ GetPolygonCount()

Int32 GetPolygonCount ( )

Gets the number of polygons.

Returns
The number of polygons.

◆ ResizeObject() [1/2]

Bool ResizeObject ( Int32  pcnt,
Int32  vcnt 
)

Changes the number of points and polygons.

Parameters
[in]pcntThe new number of points.
[in]vcntThe new number of polygons.
Returns
true if successful, otherwise false.

◆ ResizeObject() [2/2]

Bool ResizeObject ( Int32  pcnt,
Int32  vcnt,
Int32  ncnt 
)

Changes the number of points, polygons and N-gons.

Parameters
[in]pcntThe new number of points.
[in]vcntThe new number of polygons.
[in]ncntThe new number of N-gons.
Returns
true if successful, otherwise false.

◆ GetNgonCount()

Int32 GetNgonCount ( )

Gets the number of N-gons in the polygon object, i.e. the number of polygons with more than 4 points.

Returns
The number of N-gons in the polygon object.

◆ GetNgonBase()

NgonBase* GetNgonBase ( )

Gets the NgonBase instance for the polygon object.

Returns
The N-gon base. The polygon object owns the pointed N-gon base.

◆ CreatePhongNormals()

Vector32* CreatePhongNormals ( )

Gets a buffer with the stored phong normals for the polygon object.
Buffer contains 4*GetPolygonCount() vectors, one for each point of each face (including the unused fourth point of a triangle). The buffer has to be freed afterwards with DeleteMem().

Note
This method is only valid if the object has a phong tag.
Returns
A pointer to the buffer with phong normals.

◆ MakeUVWTag()

BaseTag* MakeUVWTag ( const String name)

Creates a UVW tag for the object.

Parameters
[in]nameThe name for the new tag.
Returns
The UVW tag, or nullptr if an error occurred. Melange owns the pointed tag.

Friends And Related Function Documentation

◆ BaseObject

friend class BaseObject
friend