Open Search
    BaseDrawHelp Class Reference

    #include <c4d_basedraw.h>

    Detailed Description

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

    Note
    Has to be created with Alloc() and destroyed with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

    Public Member Functions

    BaseDocumentGetDocument ()
     
    BaseTagGetActiveTag ()
     
    const MatrixGetMg ()
     
    maxon::Block< const MatrixGetMatrices ()
     
    void SetMg (const Matrix &mg)
     
    BaseContainer GetDisplay ()
     
    void SetDisplay (BaseContainer *bc)
     
    const maxon::Color32GetVertexColor ()
     
    void SetVertexColor (maxon::Color32 *vertexcolor, Bool perPolygon)
     
    Bool GetVertexColorShading ()
     
    void SetVertexColorShading (Bool vertexcolorShading)
     
    DISPLAYMODE GetDisplayMode (Bool original) const
     
    void SetDisplayMode (DISPLAYMODE mode, 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
     
    BaseObjectGetColorObject () const
     
    void SetColorObject (BaseObject *colorObject)
     
    BaseObjectGetPainterMesh (Bool &enabled) const
     

    Static Public Member Functions

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

    Private Member Functions

     BaseDrawHelp ()
     
     ~BaseDrawHelp ()
     

    Constructor & Destructor Documentation

    ◆ BaseDrawHelp()

    BaseDrawHelp ( )
    private

    Constructor.

    ◆ ~BaseDrawHelp()

    ~BaseDrawHelp ( )
    private

    Destructor.

    Member Function Documentation

    ◆ Alloc()

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

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

    Parameters
    [in]bdThe BaseDraw the BaseDrawHelp is assigned to.
    [in]docThe document of the BaseDraw.
    Returns
    The allocated BaseDrawHelp, or nullptr if the allocation failed.

    ◆ Free()

    static void Free ( BaseDrawHelp *&  p)
    static

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

    Parameters
    [in,out]pThe BaseDrawHelp to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

    ◆ GetDocument()

    BaseDocument* GetDocument ( )

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

    Note
    Never returns nullptr.
    Returns
    The document for the current draw operation. Cinema 4D owns the pointed document.

    ◆ GetActiveTag()

    BaseTag* GetActiveTag ( )

    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.)

    Returns
    The active tag. Cinema 4D owns the pointed tag.

    ◆ GetMg()

    const Matrix& GetMg ( )

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

    Returns
    The global matrix of the object to be drawn.

    ◆ GetMatrices()

    maxon::Block<const Matrix> GetMatrices ( )

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

    Returns
    The global matrices of the object to be drawn.

    ◆ SetMg()

    void SetMg ( const Matrix mg)

    Sets the matrix returned by GetMg().

    Parameters
    [in]mgThe new global matrix of the object to be drawn.

    ◆ GetDisplay()

    BaseContainer GetDisplay ( )

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

    Returns
    The display mode container.

    ◆ SetDisplay()

    void SetDisplay ( BaseContainer bc)

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

    Parameters
    [in]bcThe 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.

    Returns
    Vertex colors.

    ◆ SetVertexColor()

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

    Sets the vertex color for the object.

    Parameters
    [in]vertexcolorVertex colors.
    [in]perPolygonTrue, 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.

    Returns
    True, if vertex color shading is active, false otherwise.

    ◆ SetVertexColorShading()

    void SetVertexColorShading ( Bool  vertexcolorShading)

    Sets the vertex color shading mode.

    Parameters
    [in]vertexcolorShadingTrue, if vertex color shading should hapen, false otherwise.

    ◆ GetDisplayMode()

    DISPLAYMODE GetDisplayMode ( Bool  original) const

    Gets the current display mode.

    Parameters
    [in]originalIf true, the returned display mode is the original mode of the object.
    Returns
    The current display mode.

    ◆ SetDisplayMode()

    void SetDisplayMode ( DISPLAYMODE  mode,
    Bool  original 
    )

    Sets the current display mode.

    Parameters
    [in]modeThe new display mode.
    [in]originalIf true, the original display mode is overwritten.

    ◆ GetLod()

    Float32 GetLod ( ) const

    Gets the current level of detail.

    Returns
    The current level of detail.

    ◆ SetLod()

    void SetLod ( Float32  lod)

    Sets the current level of detail.

    Parameters
    [in]lodThe new level of detail.

    ◆ GetVectorDisplayMode()

    Int32 GetVectorDisplayMode ( ) const

    Gets the vector display mode.

    Returns
    The vector display mode.

    ◆ SetVectorDisplayMode()

    void SetVectorDisplayMode ( Int32  vectorDisplayMode)

    Sets the vector display mode.

    Parameters
    [in]vectorDisplayModeThe new vector display mode.

    ◆ SetActiveFlags()

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

    Sets the active flags.

    Parameters
    [in]activeIf true, the active flag is set, otherwise it's reset.
    [in]hierarchyActiveIf true, the hierarchy-active flag is set, otherwise it's reset.
    [in]highlightedIf true, the highlighted flag is set, otherwise it's reset.
    [in]hierarchyHighlightedIf true, the hierarchy-highlighted flag is set, otherwise it's reset.

    ◆ GetViewSchedulerFlags()

    DRAWFLAGS GetViewSchedulerFlags ( ) const

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

    Returns
    A combination of the view scheduler flags: DRAWFLAGS

    ◆ IsRenderOnlyGeometry()

    Bool IsRenderOnlyGeometry ( ) const

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

    Returns
    true if render only geometry is enabled, otherwise false.

    ◆ IsActive()

    Bool IsActive ( ) const

    Checks if the current object is active.

    Returns
    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).

    Returns
    true if the current object is highlighted, otherwise false.

    ◆ GetColorObject()

    BaseObject* GetColorObject ( ) const

    Gets the color object.

    Returns
    The color object.

    ◆ SetColorObject()

    void SetColorObject ( BaseObject colorObject)

    Sets the color object.

    Parameters
    [in]colorObjectThe color object.

    ◆ GetPainterMesh()

    BaseObject* GetPainterMesh ( Bool enabled) const

    Gets the current painter mesh.

    Parameters
    [out]enabledTrue, if the mesh is enabled, false otherwise.
    Returns
    The painter mesh.