Web Analytics Made Easy - Statcounter
Skip to content

Class SBGRenderNode#

ClassList > SBGRenderNode

The class SBGRenderNode is the base class to describe a node in SAMSON's render graph.More...

  • #include <SBGRenderNode.hpp>

Inherits the following classes: SBCReferenceTarget

Inherited by the following classes: SBGRenderStructuralModel

Public Types#

Type Name
enum Type
Available render node types.

Public Functions#

Type Name
virtual void display (SBNode::RenderingPass renderingPass) = 0
Display the node.
virtual void forEachNodeDepthFirst (void(*)(SBGRenderNode *node) action)
Performs the action on this render node.
virtual void forEachNodeDepthFirst (SBCClass * object, void(SBCClass::*)(SBGRenderNode *node) action)
Performs the object 'saction on this render node.
virtual void getNodes (std::vector< SBGRenderNode * > & selection)
Populates selection with this node.
virtual void getNodes (std::vector< SBGRenderNode * > & selection, SBGRenderNode::Type type)
Populates selection with this node if it has the render node typetype __
virtual void getNodes (std::vector< SBGRenderNode * > & selection, bool(*)(SBGRenderNode *) selectionRule)
Populates selection with this node based on theselectionRule __
virtual void getNodes (std::vector< SBGRenderNode * > & selection, bool(*)(SBGRenderNode *) visitRule, bool(*)(SBGRenderNode *) selectionRule)
Populates selection with this node based on thevisitRule andselectionRule __
virtual SBGRenderNode * getParent () const
Return parent of the render node.
virtual Type getType () const
Return type of the render node.
virtual void print (unsigned int offset=0) const
Print debug information.
virtual void requestViewportUpdate ()
Request a viewport update.

Public Functions inherited from SBCReferenceTarget#

See SBCReferenceTarget

Type Name
SBCReferenceTarget ()
Builds the reference target.
unsigned int getMemoryFootprint () const
Returns the memory footprint.
void printReferencesToOwners () const
Prints the references to the owners of this reference target.
virtual ~SBCReferenceTarget ()
Destructor.

Public Static Functions#

Type Name
void forEachNodeInSelection (std::vector< SBGRenderNode * > & selection, void(*)(SBGRenderNode *node) action)
Performs the action on each render node inselection __
void forEachNodeInSelection (std::vector< SBGRenderNode * > & selection, SBCClass * object, void(SBCClass::*)(SBGRenderNode *node) action)
Performs the object 'saction on each render node in `selection.
std::string getTypeString (Type type)
Return string representation of the type of the render node.

Protected Attributes inherited from SBCReferenceTarget#

See SBCReferenceTarget

Type Name
SBCReferenceTargetData * dataPointer
A pointer to the private data.

Protected Functions#

Type Name
SBGRenderNode ()
Build a base object.
virtual ~SBGRenderNode ()
Destructor.

Protected Functions inherited from SBCReferenceTarget#

See SBCReferenceTarget

Type Name
SBCReferenceTarget (SBCReferenceTargetData * dataPointer)
Protected constructor.
void removeAllReferenceOwners ()
Stops all the reference owners from referencing this reference target.

Detailed Description#

The render graph contains information to render data graph nodes in SAMSON's data graph.

Short name: SBRenderNode

Public Types Documentation#

enum Type#

Available render node types.

enum SBGRenderNode::Type {
    Undefined = 0,
    DocumentManager = 1,
    Document = 2,
    Folder = 3,
    Controller = 4,
    Label = 5,
    Presentation = 6,
    Light = 7,
    StructuralModel = 31,
    VisualModel = 32,
    Mesh = 320,
    DynamicalModel = 33,
    InteractionModel = 34,
    PropertyModel = 35,
    Simulator = 36,
    StateUpdater = 37
};


Public Functions Documentation#

function display#

Display the node.

virtual void SBGRenderNode::display (
    SBNode::RenderingPass renderingPass
) = 0


function forEachNodeDepthFirst [1/2]#

Performs the action on this render node.

virtual void SBGRenderNode::forEachNodeDepthFirst (
    void(*)( SBGRenderNode *node) action
) 

Performs an action on this node in a depth-first traversal.

Parameters:

  • action Pointer to a function that will be called with this node as its argument.

function forEachNodeDepthFirst [2/2]#

Performs the object 'saction on this render node.

virtual void SBGRenderNode::forEachNodeDepthFirst (
    SBCClass * object,
    void(SBCClass::*)( SBGRenderNode *node) action
) 

Performs an action on this node in a depth-first traversal using a member function.

Parameters:

  • object Pointer to an instance of SBCClass on which the member function will be invoked.
  • action Pointer to a member function of SBCClass that takes a SBGRenderNode* argument.

function getNodes [1/4]#

Populates selection with this node.

virtual void SBGRenderNode::getNodes (
    std::vector< SBGRenderNode * > & selection
) 

Adds this node to a selection vector.

This method appends the current node to the provided vector.

Parameters:

  • selection Reference to a vector that will receive the node.

function getNodes [2/4]#

Populates selection with this node if it has the render node typetype __

virtual void SBGRenderNode::getNodes (
    std::vector< SBGRenderNode * > & selection,
    SBGRenderNode::Type type
) 

Adds this node to a selection vector if its type matches a given type.

Parameters:

  • selection Reference to a vector that will receive the node if the type matches.
  • type The render node type to compare against.

function getNodes [3/4]#

Populates selection with this node based on theselectionRule __

virtual void SBGRenderNode::getNodes (
    std::vector< SBGRenderNode * > & selection,
    bool(*)( SBGRenderNode *) selectionRule
) 

Adds this node to a selection vector based on a custom selection rule.

Parameters:

  • selection Reference to a vector that will receive the node if the rule returns true.
  • selectionRule Pointer to a function that determines whether the node should be selected. The function receives a pointer to a SBGRenderNode and returns a bool.

function getNodes [4/4]#

Populates selection with this node based on thevisitRule andselectionRule __

virtual void SBGRenderNode::getNodes (
    std::vector< SBGRenderNode * > & selection,
    bool(*)( SBGRenderNode *) visitRule,
    bool(*)( SBGRenderNode *) selectionRule
) 

Adds this node to a selection vector based on visit and selection rules.

Parameters:

  • selection Reference to a vector that will receive the node if both rules return true.
  • visitRule Pointer to a function that determines whether the node should be visited. It receives a pointer to a SBGRenderNode and returns a bool.
  • selectionRule Pointer to a function that determines whether the node should be selected. It receives a pointer to a SBGRenderNode and returns a bool.

function getParent#

Return parent of the render node.

virtual SBGRenderNode * SBGRenderNode::getParent () const

Returns the parent of this render node.

The base implementation returns nullptr as there is no parent.

Returns:

Pointer to the parent render node, or nullptr if none.


function getType#

Return type of the render node.

virtual Type SBGRenderNode::getType () const

Returns the type of the render node.

This base implementation always returns Undefined.

Returns:

The type of the render node.


function print#

Print debug information.

virtual void SBGRenderNode::print (
    unsigned int offset=0
) const

Prints debug information for this node.

This method outputs details of the node with the specified indentation offset.

Parameters:

  • offset Number of spaces to indent the printed information.

function requestViewportUpdate#

Request a viewport update.

virtual void SBGRenderNode::requestViewportUpdate () 

Requests a viewport update from the rendering system.

This triggers a refresh of the display.


Public Static Functions Documentation#

function forEachNodeInSelection [1/2]#

Performs the action on each render node inselection __

static void SBGRenderNode::forEachNodeInSelection (
    std::vector< SBGRenderNode * > & selection,
    void(*)( SBGRenderNode *node) action
) 

Applies an action to each node in a selection vector.

Parameters:

  • selection Reference to a vector of render nodes to process.
  • action Pointer to a function that will be called for each node.

function forEachNodeInSelection [2/2]#

Performs the object 'saction on each render node in `selection.

static void SBGRenderNode::forEachNodeInSelection (
    std::vector< SBGRenderNode * > & selection,
    SBCClass * object,
    void(SBCClass::*)( SBGRenderNode *node) action
) 

Applies a member function to each node in a selection vector.

Parameters:

  • selection Reference to a vector of render nodes to process.
  • object Pointer to an instance of SBCClass on which the member function will be invoked.
  • action Pointer to a member function of SBCClass that takes a SBGRenderNode* argument.

function getTypeString#

Return string representation of the type of the render node.

static std::string SBGRenderNode::getTypeString (
    Type type
) 

Returns the string representation of a render node type.

This function maps known types to their textual names.

Parameters:

  • type The render node type to convert.

Returns:

A string describing the given type, or "Not assigned" for unknown types.


Protected Functions Documentation#

function SBGRenderNode#

Build a base object.

SBGRenderNode::SBGRenderNode () 

Constructs a SBGRenderNode object.

Default constructor for the render node base class.


function ~SBGRenderNode#

Destructor.

virtual SBGRenderNode::~SBGRenderNode () 

Destroys a SBGRenderNode object.

Default virtual destructor.