Sceneview
 All Classes Functions Variables Enumerations Enumerator Groups Pages
Public Member Functions | Protected Member Functions | Friends | List of all members
sv::SceneNode Class Referenceabstract

Pure virtual class that all scene graph nodes inherit. More...

#include <sceneview/scene_node.hpp>

Inheritance diagram for sv::SceneNode:
sv::CameraNode sv::DrawNode sv::GroupNode sv::LightNode

Public Member Functions

 SceneNode (const SceneNode &)=delete
 
SceneNodeoperator= (const SceneNode &)=delete
 
virtual SceneNodeType NodeType () const =0
 Retrieve the node type.
 
const QString Name () const
 Retrieve the node name.
 
const QVector3D & Translation () const
 Retrieve the translation component of the node to parent transform.
 
const QQuaternion & Rotation () const
 Retrieve the rotation component of the node to parent transform.
 
const QVector3D & Scale () const
 Retrieve the scale component of the node to parent transform.
 
const QMatrix4x4 & WorldTransform ()
 Retrieve the transform from node coordinates to world coordinates. More...
 
bool Visible () const
 Check if the node is visible or not.
 
virtual void SetTranslation (const QVector3D &vec)
 Sets the translation component of the node transform.
 
void SetTranslation (double x, double y, double z)
 Sets the translation component of the node transform.
 
virtual void SetRotation (const QQuaternion &quat)
 Sets the rotation component of the node to parent transform.
 
virtual void SetScale (const QVector3D &vec)
 Sets the scale component of the node to parent transform.
 
void SetScale (double x, double y, double z)
 Sets the scale component of the node to parent transform.
 
virtual void SetVisible (bool visible)
 Sets the node visibility. More...
 
GroupNodeParentNode ()
 Retrieve the parent of this node.
 
void SetParentNode (GroupNode *parent)
 Sets the node's parent. More...
 
void SetSelectionMask (int64_t mask)
 Sets the selection mask for this node. More...
 
int64_t GetSelectionMask () const
 Retrieve the selection mask for this node.
 
virtual const AxisAlignedBoxWorldBoundingBox ()=0
 Retrieve the world-space bounding box of the node and all of its children (if applicable). More...
 

Protected Member Functions

 SceneNode (const QString &name)
 Constructs a scene node with an identity transform.
 
virtual void TransformChanged ()
 Internal method, used to enable lazy matrix computations. More...
 
virtual void BoundingBoxChanged ()
 Internal method, used to enable lazy bounding box computations. More...
 

Friends

class GroupNode
 

Detailed Description

Pure virtual class that all scene graph nodes inherit.

The SceneNode class maintains state common to all scene graph nodes:

Member Function Documentation

virtual void sv::SceneNode::BoundingBoxChanged ( )
protectedvirtual

Internal method, used to enable lazy bounding box computations.

Called when the node's bounding box changes, or when a child's bounding box changes.

Reimplemented in sv::DrawNode.

void sv::SceneNode::SetParentNode ( GroupNode parent)

Sets the node's parent.

This is typically automatically handled by the Scene graph.

void sv::SceneNode::SetSelectionMask ( int64_t  mask)
inline

Sets the selection mask for this node.

The default selection mask for all nodes is 0.

For information on how to use this, see SelectionQuery.

virtual void sv::SceneNode::SetVisible ( bool  visible)
virtual

Sets the node visibility.

Invisible nodes are not drawn during a render cycle, along with their children.

virtual void sv::SceneNode::TransformChanged ( )
protectedvirtual

Internal method, used to enable lazy matrix computations.

Called when the node's transform changes (e.g., via SetTranslation, SetRotation, or SetScale) or when a parent's transform changes. Also triggers a call to BoundingBoxChanged()

Reimplemented in sv::GroupNode.

virtual const AxisAlignedBox& sv::SceneNode::WorldBoundingBox ( )
pure virtual

Retrieve the world-space bounding box of the node and all of its children (if applicable).

Used internally in view frustum culling and selection queries.

Implemented in sv::CameraNode, sv::LightNode, sv::DrawNode, and sv::GroupNode.

const QMatrix4x4& sv::SceneNode::WorldTransform ( )

Retrieve the transform from node coordinates to world coordinates.

The world transform is obtained by chaining the node to parent transforms of all nodes from this node until the root.


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