scg3  0.6
scg::Group Class Reference

A group node to be used as root of a sub-tree of nodes (composite node). More...

#include "Group.h"

Inheritance diagram for scg::Group:
[legend]
Collaboration diagram for scg::Group:
[legend]

Public Member Functions

 Group ()
 
virtual ~Group ()
 
GroupaddCore (CoreSP core)
 
virtual void accept (Traverser *traverser)
 
virtual void acceptPost (Traverser *traverser)
 
virtual void render (RenderState *renderState)
 
virtual void renderPost (RenderState *renderState)
 
- Public Member Functions inherited from scg::Composite
 Composite ()
 
virtual ~Composite ()=0
 
virtual void destroy ()
 
CompositeaddChild (NodeSP child)
 
CompositeremoveChild (Node *node, bool &result)
 
CompositeremoveChild (Node *node)
 
virtual void traverse (Traverser *traverser)
 
- Public Member Functions inherited from scg::Node
 Node ()
 
virtual ~Node ()=0
 
virtual void clear ()
 
int getNCores () const
 
const std::string & getMetaInfo (const std::string &key) const
 
void setMetaInfo (const std::string &key, const std::string &value)
 
bool isVisible () const
 
void setVisible (bool isVisible=true)
 

Static Public Member Functions

static GroupSP create ()
 

Additional Inherited Members

- Protected Member Functions inherited from scg::Node
void addSibling_ (NodeSP sibling)
 
void removeSibling_ (Node *node, bool &result)
 
void processCores_ (RenderState *renderState)
 
void postProcessCores_ (RenderState *renderState)
 
- Protected Attributes inherited from scg::Composite
NodeSP leftChild_
 
- Protected Attributes inherited from scg::Node
NodeSP rightSibling_
 
Compositeparent_
 
std::vector< CoreSPcores_
 
bool isVisible_
 
std::unordered_map< std::string, std::string > metaInfo_
 

Detailed Description

A group node to be used as root of a sub-tree of nodes (composite node).

Allowed core types: ColorCore, MaterialCore, ShaderCore, TextureCore.

Note: When the node is rendered, its cores are procesed in the order they have been added to the node.

Examples
scg3_minimal_example.cpp, and scg3_table_scene_example.cpp.

Definition at line 41 of file Group.h.

Constructor & Destructor Documentation

◆ Group()

scg::Group::Group ( )

Constructor.

◆ ~Group()

virtual scg::Group::~Group ( )
virtual

Destructor.

Member Function Documentation

◆ accept()

virtual void scg::Group::accept ( Traverser traverser)
virtual

Accept traverser (visitor pattern).

Reimplemented from scg::Node.

◆ acceptPost()

virtual void scg::Group::acceptPost ( Traverser traverser)
virtual

Accept traverser after traversing sub-tree (visitor pattern).

Reimplemented from scg::Composite.

◆ addCore()

Group* scg::Group::addCore ( CoreSP  core)

Add core to be applied to sub-tree.

Note: When the node is rendered, its cores are processed in the order they have been added to the node.

Allowed core types: ColorCore, MaterialCore, ShaderCore, TextureCore.

Returns
this pointer for method chaining
Examples
scg3_table_scene_example.cpp.

◆ create()

static GroupSP scg::Group::create ( )
static

Create shared pointer.

Examples
scg3_table_scene_example.cpp.

◆ render()

virtual void scg::Group::render ( RenderState renderState)
virtual

Render group, i.e., process cores.

Reimplemented from scg::Node.

◆ renderPost()

virtual void scg::Group::renderPost ( RenderState renderState)
virtual

Render group after traversing sub-tree, i.e., post-process cores to restore previous state.

Reimplemented from scg::Composite.


The documentation for this class was generated from the following file: