BaseDrawHelp Class Reference

#include <c4d_basedraw.h>

详细描述

Contains useful data for drawing into a BaseDraw view. Passed by the framework to methods that need it.

注意
Has to be created with Alloc() and destroyed with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

公共成员函数

BaseDocument GetDocument (void)
BaseTag GetActiveTag (void)
const 矩阵 GetMg (void)
maxon::Block < const 矩阵 GetMatrices (void)
void  SetMg (const 矩阵 &mg)
BaseContainer   GetDisplay (void)
void  SetDisplay ( BaseContainer *bc)
const maxon::Color32 GetVertexColor ()
void  SetVertexColor ( maxon::Color32 *vertexcolor, Bool perPolygon)
Bool   GetVertexColorShading ()
void  SetVertexColorShading ( Bool vertexcolorShading)
DISPLAYMODE   GetDisplayMode ( Bool original) const
void  SetDisplayMode ( DISPLAYMODE 模式, Bool original)
Float32   GetLod () const
void  SetLod ( Float32 lod)
Int32   GetVectorDisplayMode () const
void  SetVectorDisplayMode ( Int32 vectorDisplayMode)
void  SetActiveFlags ( Bool active, Bool hierarchyActive, Bool highlighted, Bool hierarchyHighlighted)
DRAWFLAGS   GetViewSchedulerFlags () const
Bool   IsRenderOnlyGeometry () const
Bool   IsActive () const
Bool   IsHighlight () const
BaseObject GetColorObject () const
void  SetColorObject ( BaseObject *colorObject)
BaseObject GetPainterMesh ( Bool &enabled) const

静态公共成员函数

static BaseDrawHelp Alloc ( BaseDraw *bd, BaseDocument *doc)
static void  Free ( BaseDrawHelp *&p)

私有成员函数

  BaseDrawHelp ()
  ~BaseDrawHelp ()

构造函数 & 析构函数文档编制

◆  BaseDrawHelp()

BaseDrawHelp ( )
private

Constructor.

◆  ~BaseDrawHelp()

~ BaseDrawHelp ( )
private

Destructor.

成员函数文档编制

◆  Alloc()

static BaseDrawHelp * Alloc ( BaseDraw bd ,
BaseDocument doc  
)
static

Allocates a BaseDrawHelp . Destroy the allocated BaseDrawHelp with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in] bd The BaseDraw the BaseDrawHelp is assigned to.
[in] doc The document of the BaseDraw .
返回
The allocated BaseDrawHelp ,或 nullptr if the allocation failed.

◆  Free()

static void Free ( BaseDrawHelp *&  p )
static

Destructs BaseDrawHelp instances allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in,out] p The BaseDrawHelp to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  GetDocument()

BaseDocument * GetDocument ( void  )

Gets the relevant document for the current draw operation, i.e. the currently active document.

注意
Never returns nullptr .
返回
The document for the current draw operation. Cinema 4D owns the pointed document.

◆  GetActiveTag()

BaseTag * GetActiveTag ( void  )

Gets the active tag, or nullptr if no tag is active. (Similar to calling GetDocument() -> GetActiveTag() but more efficient since the active tag is cached.)

返回
The active tag. Cinema 4D owns the pointed tag.

◆  GetMg()

const 矩阵 & GetMg ( void  )

Gets the global matrix of the object to be drawn. (Similar to op -> GetMg() but more efficient since the matrix is cached.)

返回
The global matrix of the object to be drawn.

◆  GetMatrices()

maxon::Block <const 矩阵 > GetMatrices ( void  )

Gets the global matrices of the object to be drawn (one matrix for each render instance).

返回
The global matrices of the object to be drawn.

◆  SetMg()

void SetMg ( const 矩阵 mg )

Sets the matrix returned by GetMg() .

参数
[in] mg The new global matrix of the object to be drawn.

◆  GetDisplay()

BaseContainer GetDisplay ( void  )

Gets a container with the display mode for the object to be drawn. See Tdisplay.h for values.

返回
The display mode container.

◆  SetDisplay()

void SetDisplay ( BaseContainer bc )

Sets the display mode for the object to be drawn. See Tdisplay.h for values.

参数
[in] bc The new display mode container.

◆  GetVertexColor()

const maxon::Color32 * GetVertexColor ( )

Gets a pointer to an array of vertex colors or nullptr if no vertex colors are set for the object.

返回
Vertex colors.

◆  SetVertexColor()

void SetVertexColor ( maxon::Color32 vertexcolor ,
Bool   perPolygon  
)

Sets the vertex color for the object.

参数
[in] vertexcolor Vertex colors.
[in] perPolygon True, if the vertex colors are pre vertex per polygon. Otherwise the vertices are per vertex.

◆  GetVertexColorShading()

Bool GetVertexColorShading ( )

Checks if vertex color shading is active.

返回
True, if vertex color shading is active, false otherwise.

◆  SetVertexColorShading()

void SetVertexColorShading ( Bool   vertexcolorShading )

Sets the vertex color shading mode.

参数
[in] vertexcolorShading True, if vertex color shading should hapen, false otherwise.

◆  GetDisplayMode()

DISPLAYMODE GetDisplayMode ( Bool   original ) const

Gets the current display mode.

参数
[in] original If true, the returned display mode is the original mode of the object.
返回
The current display mode.

◆  SetDisplayMode()

void SetDisplayMode ( DISPLAYMODE   mode ,
Bool   original  
)

Sets the current display mode.

参数
[in] mode The new display mode.
[in] original If true, the original display mode is overwritten.

◆  GetLod()

Float32 GetLod ( ) const

Gets the current level of detail.

返回
The current level of detail.

◆  SetLod()

void SetLod ( Float32   lod )

Sets the current level of detail.

参数
[in] lod The new level of detail.

◆  GetVectorDisplayMode()

Int32 GetVectorDisplayMode ( ) const

Gets the vector display mode.

返回
The vector display mode.

◆  SetVectorDisplayMode()

void SetVectorDisplayMode ( Int32   vectorDisplayMode )

Sets the vector display mode.

参数
[in] vectorDisplayMode The new vector display mode.

◆  SetActiveFlags()

void SetActiveFlags ( Bool   active ,
Bool   hierarchyActive ,
Bool   highlighted ,
Bool   hierarchyHighlighted  
)

Sets the active flags.

参数
[in] active If true, the active flag is set, otherwise it's reset.
[in] hierarchyActive If true, the hierarchy-active flag is set, otherwise it's reset.
[in] highlighted If true, the highlighted flag is set, otherwise it's reset.
[in] hierarchyHighlighted If true, the hierarchy-highlighted flag is set, otherwise it's reset.

◆  GetViewSchedulerFlags()

DRAWFLAGS GetViewSchedulerFlags ( ) const

Gets the flags which have been passed to DrawViews() .

返回
A combination of the view scheduler flags: DRAWFLAGS

◆  IsRenderOnlyGeometry()

Bool IsRenderOnlyGeometry ( ) const

Checks if the the draw pass is set to render only geometry.

返回
true if render only geometry is enabled, otherwise false .

◆  IsActive()

Bool IsActive ( ) const

Checks if the current object is active.

返回
true if the current object is active, otherwise false .

◆  IsHighlight()

Bool IsHighlight ( ) const

Checks if the current object is highlighted (i.e. when the user has moved the mouse over it).

返回
true if the current object is highlighted, otherwise false .

◆  GetColorObject()

BaseObject * GetColorObject ( ) const

Gets the color object.

返回
The color object.

◆  SetColorObject()

void SetColorObject ( BaseObject colorObject )

Sets the color object.

参数
[in] colorObject The color object.

◆  GetPainterMesh()

BaseObject * GetPainterMesh ( Bool enabled ) const

Gets the current painter mesh.

参数
[out] enabled True, if the mesh is enabled, false otherwise.
返回
The painter mesh.