Description
Namespaces
Classes
Enumerations
enum | NodeRendererResult {NODE_HANDLED, PASS_ON} Return type used by node renderer functions. |
enum | RenderFlags {BOUNDING_BOXES, NO_GEOMETRY, FRUSTUM_CULLING, SHOW_META_OBJECTS, SHOW_COORD_SYSTEM, USE_WORLD_MATRIX, NO_STATES, SKIP_RENDERER} |
Typedefs
typedef std::function< NodeRendererResult ( FrameContext &, Node *, const RenderParam &)> | NodeRenderer Type of a node renderer function used in rendering channels. |
typedef uint32_t | renderFlag_t RenderingFlags. |
typedef uint8_t | renderingLayerMask_t |
typedef _GenericDistancePriorityQueue < Node *, DistanceCalculators::NodeDistanceCalculator , std::less > | NodeDistancePriorityQueue_F2B |
typedef _GenericDistancePriorityQueue < Node *, DistanceCalculators::NodeDistanceCalculator , std::greater > | NodeDistancePriorityQueue_B2F |
Variables
const renderingLayerMask_t | RENDERING_LAYER_DEFAULT |
const renderingLayerMask_t | RENDERING_LAYER_BUILTIN_META_OBJ |
const unsigned | MESH_AUTO_CENTER |
const unsigned | MESH_AUTO_SCALE |
const unsigned | MESH_AUTO_CENTER_BOTTOM |
Functions
bool | conditionalFrustumTest(const Geometry::Frustum & frustum, const Geometry::Box & box, const RenderParam & rp) |
bool | initGeometrySerialization() Initialze serializers for objects from the Geometry library. |
void | changeParentKeepTransformation( Util::Reference < Node > child, GroupNode * newParent) |
Geometry::Box | combineNodesWorldBBs(const std::vector< Node * > & nodes) |
void | destroy( Node * rootNode) Destroys the given subtree by calling doDestroy() on every node. |
template< class node_type_t > | |
node_type_t * | getOriginalNode(node_type_t * node) |
void | initShaderState( ShaderState * shaderState, const std::vector< std::string > & vsFiles, const std::vector< std::string > & gsFiles, const std::vector< std::string > & fsFiles, uint32_t usageType, const Util::FileLocator & locator) |
Node * | loadModel(const Util::FileName & filename, unsigned flags, Geometry::Matrix4x4 * transMat) |
Node * | loadModel(const Util::FileName & filename, unsigned flags, Geometry::Matrix4x4 * transMat, const Util::FileLocator & locator) |
template< typename _T > | |
void | forEachNodeTopDown( Node * root, const std::function< void(_T *)> & func) Execute a function top-down for nodes in a subtree. |
template< > | |
void | forEachNodeTopDown< Node >( Node * root, const std::function< void( Node *)> & func) |
void | forEachNodeTopDown( Node * root, const std::function< void( Node *)> & func) |
template< typename _T > | |
void | forEachNodeBottomUp( Node * root, const std::function< void(_T *)> & func) Execute a function bottom-up for nodes in a subtree. |
template< typename _T > | |
void | traverseTopDown( Node * root, std::function< NodeVisitor::status (_T *)> func) Execute a function top-down for nodes in a subtree. |
template< > | |
void | traverseTopDown< Node >( Node * root, std::function< NodeVisitor::status ( Node *)> func) |
void | traverseTopDown( Node * root, const std::function< NodeVisitor::status ( Node *)> & func) |
std::deque< Node * > | collectClosedNodes( Node * root) |
std::deque< Node * > | collectClosedNodesAtPosition( Node * root, const Geometry::Vec3 & position) |
std::deque< Node * > | collectClosedNodesIntersectingBox( Node * root, const Geometry::Box & box) |
std::deque< GeometryNode * > | collectGeoNodesAtPosition( Node * root, const Geometry::Vec3 & position) |
std::deque< GeometryNode * > | collectGeoNodesIntersectingBox( Node * root, const Geometry::Box & box) |
std::deque< GeometryNode * > | collectGeoNodesIntersectingSphere( Node * root, const Geometry::Vec3 & pos, float radius) |
std::deque< GeometryNode * > | collectGeoNodesIntersectingRay( Node * node, const Geometry::Vec3 & pos, const Geometry::Vec3 & dir) |
std::deque< Node * > | collectInstances( Node * root, const Node * prototype) |
template< typename _T > | |
std::deque< _T * > | collectNodes(const Node * root) Collect all nodes in subtree with rootrootof type _T . |
std::deque< Node * > | collectNodesWithAttribute( Node * root, Util::StringIdentifier attrName) Collect all nodes in the given subtree which have a node attribute with the given name (. |
std::deque< Node * > | collectNodesReferencingAttribute( Node * root, Util::StringIdentifier attrName) Collect all nodes in the given subtree which reference a node attribute with the given name (. |
std::deque< Node * > | collectNextNodesReferencingAttribute( Node * root, Util::StringIdentifier attrName) Collect nodes below root that reference the given attribute; the traversal of a subtree is stopped if the subtree root is collected. (. |
template< typename _T > | |
std::deque< _T * > | collectNodesInFrustum( Node * root, const Geometry::Frustum & frustum, bool includeIntersectingNodes) Collect all nodes in subtree with rootrootof type _T , that intersect with the given frustum of cameracam. |
template< class State_t > | |
std::set< State_t * > | collectStates( Node * root) Get all states of a specific type used in the subtree. |
template< class State_t > | |
std::deque< State_t * > | collectStatesUpwards( Node * node) |
std::vector< GeometryNode * > | collectVisibleNodes( Node * root, FrameContext & context, float maxDistance, bool fillDepthBuffer, renderingLayerMask_t layers) |
uint32_t | countTriangles( Node * root) Sum up the number of triangles of all geometry nodes in the subtree starting with root. |
uint32_t | countTrianglesInFrustum( Node * root, const Geometry::Frustum & frustum) |
std::deque< Node * > | getChildNodes( Node * node) |
std::vector< uint32_t > | countNodesInLevels( Node * rootNode) |
void | moveTransformationsIntoClosedNodes( Node * root) moves all transformations into closed nodes, subtrees of closed nodes are not processed. |
void | moveTransformationsIntoLeaves( Node * root) moves all transformations into leaves |
void | moveStatesIntoClosedNodes( Node * root) moves all statis into closed nodes, subtrees of closed nodes are not processed. |
void | moveStatesIntoLeaves( Node * root) moves all statis into leaves |
uint32_t | getNodeLevel( Node * rootNode, Node * node) |
uint32_t | getTreeDepth( Node * rootNode) |
Documentation
enum
MinSG::NodeRendererResult
public |
enum NodeRendererResult |
Enumerator | Description | |
---|---|---|
Enumerator | Description | |
NODE_HANDLED | ||
PASS_ON |
Return type used by node renderer functions.
Defined in MinSG/Core/NodeRenderer.h:20
enum
MinSG::RenderFlags
public |
enum RenderFlags |
Enumerator | Description | |
---|---|---|
Enumerator | Description | |
BOUNDING_BOXES | = 1 « 0 | |
NO_GEOMETRY | = 1 « 1 | |
FRUSTUM_CULLING | = 1 « 2 | |
SHOW_META_OBJECTS | = 1 « 3 | |
SHOW_COORD_SYSTEM | = 1 « 5 | |
USE_WORLD_MATRIX | = 1 « 6 | |
NO_STATES | = 1 « 7 | |
SKIP_RENDERER | = 1 « 8 |
Defined in MinSG/Core/RenderParam.h:24
typedef
MinSG::NodeRenderer
public |
typedef std::function< NodeRendererResult ( FrameContext &, Node *, const RenderParam &)> NodeRenderer |
Type of a node renderer function used in rendering channels.
Defined in MinSG/Core/NodeRenderer.h:26
typedef
MinSG::renderFlag_t
public |
typedef uint32_t renderFlag_t |
RenderingFlags.
See also: RenderingLayer.h
Defined in MinSG/Core/Nodes/Node.h:41
typedef
MinSG::renderingLayerMask_t
public |
typedef uint8_t renderingLayerMask_t |
See also: RenderParam.h
Defined in MinSG/Core/Nodes/Node.h:42
typedef
MinSG::NodeDistancePriorityQueue_F2B
public |
typedef _GenericDistancePriorityQueue < Node *, DistanceCalculators::NodeDistanceCalculator , std::less > NodeDistancePriorityQueue_F2B |
Defined in MinSG/Helper/DistanceSorting.h:69
typedef
MinSG::NodeDistancePriorityQueue_B2F
public |
typedef _GenericDistancePriorityQueue < Node *, DistanceCalculators::NodeDistanceCalculator , std::greater > NodeDistancePriorityQueue_B2F |
Defined in MinSG/Helper/DistanceSorting.h:70
variable
MinSG::RENDERING_LAYER_DEFAULT
public | static |
const renderingLayerMask_t RENDERING_LAYER_DEFAULT |
Defined in MinSG/Core/RenderingLayer.h:17
variable
MinSG::RENDERING_LAYER_BUILTIN_META_OBJ
public | static |
const renderingLayerMask_t RENDERING_LAYER_BUILTIN_META_OBJ |
Defined in MinSG/Core/RenderingLayer.h:18
variable
MinSG::MESH_AUTO_CENTER
public | static |
const unsigned MESH_AUTO_CENTER |
Defined in MinSG/Helper/Helper.h:92
variable
MinSG::MESH_AUTO_SCALE
public | static |
const unsigned MESH_AUTO_SCALE |
Defined in MinSG/Helper/Helper.h:93
variable
MinSG::MESH_AUTO_CENTER_BOTTOM
public | static |
const unsigned MESH_AUTO_CENTER_BOTTOM |
Defined in MinSG/Helper/Helper.h:94
function
MinSG::conditionalFrustumTest
public | inline |
bool conditionalFrustumTest( | const Geometry::Frustum & | frustum, |
const Geometry::Box & | box, | |
const RenderParam & | rp | |
) |
Perform a test if a box intersects a frustum, if frustum culling is enabled.
Parameters
- frustum
- Frustum that the box is tested against
- box
- Box to be tested
- rp
- Rendering parameters that decide if frustum culling is enabled
Parameters
- true
- if frustum culling is disabled or the box intersects the frustum
- false
- if frustum culling is enabled and the box does not intersect the frustum
Defined in MinSG/Helper/FrustumTest.h:30
function
MinSG::initGeometrySerialization
public |
bool initGeometrySerialization( | ) |
Initialze serializers for objects from the Geometry library.
Defined in MinSG/Helper/GeometrySerialization.h:15
function
MinSG::changeParentKeepTransformation
public |
void changeParentKeepTransformation( | Util::Reference < Node > | child, |
GroupNode * | newParent | |
) |
removes a child from its present parent (if exists) and adds it to the given new Parent (if exists) such that the world matrix of the child does not change
Parameters
- child
- the child that shall be move to a new parent
- newParent
- the parent to which the child shall be added
Note: child->getParent() and newParent may be nullptr
Defined in MinSG/Helper/Helper.h:60
function
MinSG::combineNodesWorldBBs
public |
Geometry::Box combineNodesWorldBBs( | const std::vector< Node * > & | nodes ) |
Returns the combined world bounding boxes of the given nodes.
Defined in MinSG/Helper/Helper.h:63
function
MinSG::destroy
public |
void destroy( | Node * | rootNode ) |
Destroys the given subtree by calling doDestroy() on every node.
Defined in MinSG/Helper/Helper.h:66
function
MinSG::getOriginalNode
public |
template< class node_type_t > | ||
node_type_t * getOriginalNode( | node_type_t * | node ) |
Return the node itself or the prototype of the node if and only if the node is an instance.
Parameters
- node
- Node for which the original is requested
Returns
Original node (node itself or prototype)
Defined in MinSG/Helper/Helper.h:76
function
MinSG::initShaderState
public |
void initShaderState( | ShaderState * | shaderState, |
const std::vector< std::string > & | vsFiles, | |
const std::vector< std::string > & | gsFiles, | |
const std::vector< std::string > & | fsFiles, | |
uint32_t | usageType, | |
const Util::FileLocator & | locator | |
) |
Init the given shaderState with a new Shader loaded from the given filenames. The metadata of the State is set accordingly.
Defined in MinSG/Helper/Helper.h:85
function
MinSG::loadModel
public |
Node * loadModel( | const Util::FileName & | filename, |
unsigned | flags, | |
Geometry::Matrix4x4 * | transMat | |
) |
Load a Meshes from a file.
Parameters
- loader
- GenericLoader that reads the mesh-data (may not be nullptr!).
- flags
- Mesh modification flags (defined in MeshUtils).
- transMat
- Transformation matrix applied to the mesh.
- metaData
Defined in MinSG/Helper/Helper.h:103
function
MinSG::loadModel
public |
Node * loadModel( | const Util::FileName & | filename, |
unsigned | flags, | |
Geometry::Matrix4x4 * | transMat, | |
const Util::FileLocator & | locator | |
) |
Defined in MinSG/Helper/Helper.h:104
function
MinSG::forEachNodeTopDown
public |
template< typename _T = Node > | ||
void forEachNodeTopDown( | Node * | root, |
const std::function< void(_T *)> & | func | |
) |
Execute a function top-down for nodes in a subtree.
Execute the given functionfunc
for all nodes of type_T
in the subtree specified by its root noderoot
. A depth-first, pre-order tree walk is performed on the subtree.
Parameters
- _T
- The type of the nodes for which the function will be executed
Parameters
- root
- The root node of the subtree that will be traversed
- func
- The function that will be executed for each node
Author: Benjamin Eikel
Date: 2012-07-31
Defined in MinSG/Helper/StdNodeVisitors.h:49
function
MinSG::forEachNodeTopDown< Node >
public |
template< > | ||
void forEachNodeTopDown< Node >( | Node * | root, |
const std::function< void( Node *)> & | func | |
) |
Defined in MinSG/Helper/StdNodeVisitors.h:70
function
MinSG::forEachNodeTopDown
public | inline |
void forEachNodeTopDown( | Node * | root, |
const std::function< void( Node *)> & | func | |
) |
Defined in MinSG/Helper/StdNodeVisitors.h:71
function
MinSG::forEachNodeBottomUp
public |
template< typename _T = Node > | ||
void forEachNodeBottomUp( | Node * | root, |
const std::function< void(_T *)> & | func | |
) |
Execute a function bottom-up for nodes in a subtree.
Execute the given functionfunc
for all nodes of type_T
in the subtree specified by its root noderoot
. A depth-first, post-order tree walk is performed on the subtree.
Parameters
- _T
- The type of the nodes for which the function will be executed
Parameters
- root
- The root node of the subtree that will be traversed
- func
- The function that will be executed for each node
Author: Benjamin Eikel
Date: 2012-07-31
Defined in MinSG/Helper/StdNodeVisitors.h:89
function
MinSG::traverseTopDown
public |
template< typename _T = Node > | ||
void traverseTopDown( | Node * | root, |
std::function< NodeVisitor::status (_T *)> | func | |
) |
Execute a function top-down for nodes in a subtree.
Execute the given functionfunc
for all nodes of type_T
in the subtree specified by its root noderoot
. A depth-first, pre-order tree walk is performed on the subtree.
Parameters
- _T
- (optional) The type of the nodes for which the function will be executed
Parameters
- root
- The root node of the subtree that will be traversed
- func
- The function that will be executed for each node (
See also: NodeVisitor::status for the result)
Defined in MinSG/Helper/StdNodeVisitors.h:121
function
MinSG::traverseTopDown< Node >
public |
template< > | ||
void traverseTopDown< Node >( | Node * | root, |
std::function< NodeVisitor::status ( Node *)> | func | |
) |
Defined in MinSG/Helper/StdNodeVisitors.h:138
function
MinSG::traverseTopDown
public | inline |
void traverseTopDown( | Node * | root, |
const std::function< NodeVisitor::status ( Node *)> & | func | |
) |
Defined in MinSG/Helper/StdNodeVisitors.h:139
function
MinSG::collectClosedNodes
public |
std::deque< Node * > collectClosedNodes( | Node * | root ) |
collects all closed nodes reachable from the specified scene root to a vector
Parameters
- root
- : root of the scene graph
- nodes
- : vector to which the closed nodes are collected (pointers to the closed nodes)
Defined in MinSG/Helper/StdNodeVisitors.h:150
function
MinSG::collectClosedNodesAtPosition
public |
std::deque< Node * > collectClosedNodesAtPosition( | Node * | root, |
const Geometry::Vec3 & | position | |
) |
Defined in MinSG/Helper/StdNodeVisitors.h:151
function
MinSG::collectClosedNodesIntersectingBox
public |
std::deque< Node * > collectClosedNodesIntersectingBox( | Node * | root, |
const Geometry::Box & | box | |
) |
Defined in MinSG/Helper/StdNodeVisitors.h:152
function
MinSG::collectGeoNodesAtPosition
public |
std::deque< GeometryNode * > collectGeoNodesAtPosition( | Node * | root, |
const Geometry::Vec3 & | position | |
) |
Defined in MinSG/Helper/StdNodeVisitors.h:154
function
MinSG::collectGeoNodesIntersectingBox
public |
std::deque< GeometryNode * > collectGeoNodesIntersectingBox( | Node * | root, |
const Geometry::Box & | box | |
) |
Defined in MinSG/Helper/StdNodeVisitors.h:155
function
MinSG::collectGeoNodesIntersectingSphere
public |
std::deque< GeometryNode * > collectGeoNodesIntersectingSphere( | Node * | root, |
const Geometry::Vec3 & | pos, | |
float | radius | |
) |
Defined in MinSG/Helper/StdNodeVisitors.h:156
function
MinSG::collectGeoNodesIntersectingRay
public |
std::deque< GeometryNode * > collectGeoNodesIntersectingRay( | Node * | node, |
const Geometry::Vec3 & | pos, | |
const Geometry::Vec3 & | dir | |
) |
Defined in MinSG/Helper/StdNodeVisitors.h:157
function
MinSG::collectInstances
public |
std::deque< Node * > collectInstances( | Node * | root, |
const Node * | prototype | |
) |
Defined in MinSG/Helper/StdNodeVisitors.h:159
function
MinSG::collectNodes
public |
template< typename _T = Node > | ||
std::deque< _T * > collectNodes( | const Node * | root ) |
Collect all nodes in subtree with rootrootof type_T
.
Defined in MinSG/Helper/StdNodeVisitors.h:163
function
MinSG::collectNodesWithAttribute
public |
std::deque< Node * > collectNodesWithAttribute( | Node * | root, |
Util::StringIdentifier | attrName | |
) |
Collect all nodes in the given subtree which have a node attribute with the given name (.
See also: Node::getAttribute (…)).
Defined in MinSG/Helper/StdNodeVisitors.h:171
function
MinSG::collectNodesReferencingAttribute
public |
std::deque< Node * > collectNodesReferencingAttribute( | Node * | root, |
Util::StringIdentifier | attrName | |
) |
Collect all nodes in the given subtree which reference a node attribute with the given name (.
See also: Node::findAttribute (…)).
Defined in MinSG/Helper/StdNodeVisitors.h:174
function
MinSG::collectNextNodesReferencingAttribute
public |
std::deque< Node * > collectNextNodesReferencingAttribute( | Node * | root, |
Util::StringIdentifier | attrName | |
) |
Collect nodes below root that reference the given attribute; the traversal of a subtree is stopped if the subtree root is collected. (.
See also: collectNodesReferencingAttribute (…)).
Defined in MinSG/Helper/StdNodeVisitors.h:177
function
MinSG::collectNodesInFrustum
public |
template< typename _T > | ||
std::deque< _T * > collectNodesInFrustum( | Node * | root, |
const Geometry::Frustum & | frustum, | |
bool | includeIntersectingNodes | |
) |
Collect all nodes in subtree with rootrootof type_T
, that intersect with the given frustum of cameracam.
Defined in MinSG/Helper/StdNodeVisitors.h:181
function
MinSG::collectStates
public |
template< class State_t > | ||
std::set< State_t * > collectStates( | Node * | root ) |
Get all states of a specific type used in the subtree.
Defined in MinSG/Helper/StdNodeVisitors.h:231
function
MinSG::collectStatesUpwards
public |
template< class State_t > | ||
std::deque< State_t * > collectStatesUpwards( | Node * | node ) |
Collect all states of the type requested on a specific path. The path begins at the given node and ends at the root node. If a node on the path (excluding the given node, but including the root node) contains appropriate states, they are added to the resulting array.
Parameters
- State_t
- Type of the states to collect
Parameters
- node
- Start of the path; the end is the root node
Returns
Array containing the collected states (excluding states of the given node)
Author: Benjamin Eikel
Date: 2012-02-29
Defined in MinSG/Helper/StdNodeVisitors.h:257
function
MinSG::collectVisibleNodes
public |
std::vector< GeometryNode * > collectVisibleNodes( | Node * | root, |
FrameContext & | context, | |
float | maxDistance, | |
bool | fillDepthBuffer, | |
renderingLayerMask_t | layers | |
) |
See also: RenderingLayer.h Warning: may be slow! Collects visible Objects in Frustum (with occ-extension)
Parameters
- root
- Root node
- context
- Frame context to use (contains the used camera)
- maxDistance
- (optional) only collect nodes up to a certain distance (not exact, used for speeding up queries)
- fillDepthBuffer
- (optional) iff true, the screen is cleared and the potential visible nodes are rendered to the depth buffer.
- layers
- (optional) Only test nodes with this rendering layers (default=1).
Returns
Container of visible objects
Note: - Scene has to be rendered before execution (or fillDepthBuffer must be true)
- Scene has to be rendered with flag Node::USE_WORLD_MATRIX
Defined in MinSG/Helper/StdNodeVisitors.h:286
function
MinSG::countTriangles
public |
uint32_t countTriangles( | Node * | root ) |
Sum up the number of triangles of all geometry nodes in the subtree starting with root.
Defined in MinSG/Helper/StdNodeVisitors.h:291
function
MinSG::countTrianglesInFrustum
public |
uint32_t countTrianglesInFrustum( | Node * | root, |
const Geometry::Frustum & | frustum | |
) |
Sum up the number of triangles of the geometry nodes in the subtree starting with root, where the bounding box intersects with the given frustum.
Parameters
- root
- Root node of the subtree
- frustum
- Frustum that is used for intersection tests
Returns
Number of triangles
Defined in MinSG/Helper/StdNodeVisitors.h:301
function
MinSG::getChildNodes
public |
std::deque< Node * > getChildNodes( | Node * | node ) |
Returns
Direct child nodes of the givennode
Defined in MinSG/Helper/StdNodeVisitors.h:306
function
MinSG::countNodesInLevels
public |
std::vector< uint32_t > countNodesInLevels( | Node * | rootNode ) |
Count the number of nodes in the levels of the scene graph. The root node has level zero.
Parameters
- rootNode
- Root node of a MinSG subgraph
Returns
Array containing the number of nodes in leveli
at indexi
Defined in MinSG/Helper/StdNodeVisitors.h:315
function
MinSG::moveTransformationsIntoClosedNodes
public |
void moveTransformationsIntoClosedNodes( | Node * | root ) |
moves all transformations into closed nodes, subtrees of closed nodes are not processed.
Defined in MinSG/Helper/StdNodeVisitors.h:320
function
MinSG::moveTransformationsIntoLeaves
public |
void moveTransformationsIntoLeaves( | Node * | root ) |
moves all transformations into leaves
Defined in MinSG/Helper/StdNodeVisitors.h:323
function
MinSG::moveStatesIntoClosedNodes
public |
void moveStatesIntoClosedNodes( | Node * | root ) |
moves all statis into closed nodes, subtrees of closed nodes are not processed.
Defined in MinSG/Helper/StdNodeVisitors.h:326
function
MinSG::moveStatesIntoLeaves
public |
void moveStatesIntoLeaves( | Node * | root ) |
moves all statis into leaves
Defined in MinSG/Helper/StdNodeVisitors.h:329
function
MinSG::getNodeLevel
public |
uint32_t getNodeLevel( | Node * | rootNode, |
Node * | node | |
) |
gets the level of a node relative to the given root node. gives a warning if the node is not a child of the root node and returns the max. Integer
Parameters
Returns
The level of the node or 0xffffffffU (max. of uint32_t)
Defined in MinSG/Helper/StdNodeVisitors.h:342
function
MinSG::getTreeDepth
public |
uint32_t getTreeDepth( | Node * | rootNode ) |
gets the of the given subtree.
Parameters
- rootNode
- Root node of a MinSG subgraph
Returns
The depth of the given subtree
Defined in MinSG/Helper/StdNodeVisitors.h:351