Qt3D Reference Documentation

QGLSceneNode Class Reference

The QGLSceneNode class defines a node in a 3D scene. More...

 #include <QGLSceneNode>

This class was introduced in Qt3D 4.8.

Public Types

enum Option { NoOptions, CullBoundingBox, ViewNormals, ReportCulling, HideNode }
flags Options

Properties

  • x : qreal
  • y : qreal
  • z : qreal

Public Functions

QGLSceneNode ( QObject * parent = 0 )
QGLSceneNode ( const QGeometryData & geometry, QObject * parent = 0 )
virtual ~QGLSceneNode ()
void addNode ( QGLSceneNode * node )
void addNodes ( const QList<QGLSceneNode *> & nodes )
void addTransform ( QGraphicsTransform3D * transform )
QList<QGLSceneNode *> allChildren () const
QGLSceneNode * allExcept ( const QString & name, QObject * parent = 0 ) const
QGLSceneNode * allExcept ( const QStringList & names, QObject * parent = 0 ) const
QGLMaterial * backMaterial () const
int backMaterialIndex () const
QBox3D boundingBox () const
QList<QGLSceneNode *> children () const
QGLSceneNode * clone ( QObject * parent = 0 ) const
QGLSceneNode * cloneNoChildren ( QObject * parent = 0 ) const
int count () const
virtual void draw ( QGLPainter * painter )
QGL::DrawingMode drawingMode () const
qreal drawingWidth () const
QGL::StandardEffect effect () const
QGeometryData geometry () const
bool hasEffect () const
QMatrix4x4 localTransform () const
QGLMaterial * material () const
int materialIndex () const
QGLSceneNode * only ( const QString & name, QObject * parent = 0 ) const
QGLSceneNode * only ( const QStringList & names, QObject * parent = 0 ) const
QGLSceneNode::Options options () const
QGLMaterialCollection * palette () const
QGLPickNode * pickNode () const
QVector3D position () const
void removeNode ( QGLSceneNode * node )
void removeNodes ( const QList<QGLSceneNode *> & nodes )
void setBackMaterial ( QGLMaterial * material )
void setBackMaterialIndex ( int material )
void setCount ( int count )
void setDrawingMode ( QGL::DrawingMode mode )
void setDrawingWidth ( qreal width )
void setEffect ( QGL::StandardEffect effect )
void setEffectEnabled ( bool enabled )
void setGeometry ( QGeometryData geometry )
void setLocalTransform ( const QMatrix4x4 & transform )
void setMaterial ( QGLMaterial * material )
void setMaterialIndex ( int material )
void setOption ( QGLSceneNode::Option option, bool value )
void setOptions ( QGLSceneNode::Options options )
void setPalette ( QGLMaterialCollection * palette )
void setPickNode ( QGLPickNode * node )
void setPosition ( const QVector3D & p )
void setStart ( int start )
void setTransforms ( const QList<QGraphicsTransform3D *> & transforms )
void setUserEffect ( QGLAbstractEffect * effect )
void setX ( qreal x )
void setY ( qreal y )
void setZ ( qreal z )
int start () const
QList<QGraphicsTransform3D *> transforms () const
QGLAbstractEffect * userEffect () const
qreal x () const
qreal y () const
qreal z () const

Signals

void culled ()
void displayed ()
void updated ()

Protected Functions

virtual void drawGeometry ( QGLPainter * painter )

Related Non-Members

void qDumpScene ( QGLSceneNode * node, bool detailed = true, int indent = 0, const QSet<QGLSceneNode *> & loop = QSet<QGLSceneNode *> () )

Detailed Description

The QGLSceneNode class defines a node in a 3D scene.

QGLSceneNode represents one component of a scene. The QGLSceneNode class manages materials, effects and transformations for itself and for its child nodes.

As a general approach to 3D applications, a tree of QGLSceneNodes may be constructed, geometry added to them, materials and transformations applied, all during application initialization; and then by simply calling the draw() function the scene is easily rendered for each frame.

Geometry

Multiple QGLSceneNodes can reference the same geometry, whilst applying different transformations and treatments to it. Since QGLSceneNode is a QObject sub class it cannot be copied directly, so instead use the clone() function for this purpose.

A scene node allows referencing into sub-parts of geometry, via the start and count properties.

The start index is an offset into the geometry at which drawing will start. The default start index is 0, so that drawing will start from the beginning of the geometry. The count dictates how many vertices will be drawn. The default count is 0, which instructs the underlying geometry to draw all vertices.

A node may have no geometry, that is geometry().count() == 0. This is useful for example to have one node controlling or collecting together several child nodes to be manipulated as a unit.

Materials

Also a node may have a local material. This allows drawing the same geometry with different materials (which includes different textures).

When accessing a QGLSceneNode via QML, or for simple applications, the pointer based material functions are convenient and intuitive, saving the trouble of adding the material pointer to the correct palette:

material() setMaterial() backMaterial() setBackMaterial()

For more complex applications; for example building model loaders, or for larger scenes; where you need to explicitly manage materials via a palette, use the index based functions:

materialIndex() setMaterialIndex() backMaterialIndex() setBackMaterialIndex()

The behaviour of both with respect to faces is the same - if a material() is specified but no backMaterial() is specified, then the material() is applied to both faces; if both material() and backMaterial() are non-null then they are applied to their specific faces.

Transformations

Typically the local transformation matrix is set by the process that constructed the node: in the case of an imported model, it is likely to have been specified by the model file. To make individual changes to the location or orientation of this node, use the position() and transforms() properties.

Scene Graph

Use childNodes() to obtain the list of child nodes, and add and remove child nodes by the addNode() and removeNode() methods. If a QGLSceneNode is constructed with a QGLSceneNode parent, then addNode() will be called implicitly on the parent.

A child may be a child multiple times, a child may be under more than one parent, and several parents may reference the same child. There is however no protection against cycles, so a child must not be a parent of itself, even if indirectly.

A child node for the purposes of rendering means a child added via the addNode() method. The default QGLSceneNode constructor will check to see if its parent is a QGLSceneNode and add itself via the addNode() function if it is.

To help debug a scene, use the qDumpScene() function to get a printout on stderr of the entire structure of the scene below the argument node.

Debugging Lighting Normals

The ViewNormals option is an advanced feature for use when inspecting and debugging models or geometry in a scene. The lighting normals are displayed as a straight line from the vertex pointing in the direction of the lighting normal. This is useful for example to show where normals are inverted or wrongly calculated.

The setting of the ViewNormals flag is not propagated to child nodes, instead set the flag to true for the node or nodes where its needed. To set the flag on all child nodes use code like:

 foreach (QGLSceneNode *node, scene.allChildren())
     node->setNormalViewEnabled(true);

See also QGLAbstractScene.

Member Type Documentation

enum QGLSceneNode::Option
flags QGLSceneNode::Options

This enum defines option flags for QGLSceneNode. By default the none of the flags are set, so the options() function returns QGLSceneNode::NoOptions

ConstantValueDescription
QGLSceneNode::NoOptions0x0000Do not enable any QGLSceneNode options.
QGLSceneNode::CullBoundingBox0x0001Perform a cull using boundingBox() before attempting to draw the geometry().
QGLSceneNode::ViewNormals0x0002Enables the display of lighting normals for debugging purposes.
QGLSceneNode::ReportCulling0x0004Send a signal when an object is displayed or culled.
QGLSceneNode::HideNode0x0008Hide this node so it, and all its children, are excluded from rendering.

The Options type is a typedef for QFlags<Option>. It stores an OR combination of Option values.

See also setOptions().

Property Documentation

backMaterial : QGLMaterial *

This property holds this property is a pointer to any QGLMaterial instance for this node's back faces.

This material is applied to the back faces, if non-null. The default value of this property is null. When this property is null, any non-null material set on the material() property will be applied to front and back faces.

To apply a material to the front faces use the material() property.

Getting this property is exactly equivalent to palette()->material(backMaterialIndex()).

Setting this property causes the material if not already in this nodes palette to be added, and then the corresponding index to be set for this scene node.

Setting this property is exactly equivalent to:

 int index = d->palette->indexOf(material);
 if (index == -1)
     index = d->palette->addMaterial(material);
 setBackMaterialIndex(index);

Access functions:

QGLMaterial * backMaterial () const
void setBackMaterial ( QGLMaterial * material )

Notifier signal:

void updated ()

material : QGLMaterial *

This property holds this property is a pointer to a QGLMaterial instance for this node.

This material is applied to all faces if the backMaterial() property is set to null, which is the default. If the backMaterial() property is non-null then this material is only applied to the front faces.

To apply a material to the back faces use the backMaterial() property.

Getting this property is exactly equivalent to palette()->material(materialIndex()).

Setting this property causes the material if not already in this nodes palette to be added, and then the corresponding index to be set for this scene node.

Setting this property is equivalent to:

 int index = d->palette->indexOf(material);
 if (index == -1)
     index = d->palette->addMaterial(material);
 setMaterialIndex(index);

If setting this property, when no palette exists one is created, as a convenience - but this is suitable only for experimental code and for very small numbers of nodes. In debug mode a warning is printed in this case.

Generally one common palette should be created, and set on each node. This also allows nodes to share materials and their textures.

Access functions:

QGLMaterial * material () const
void setMaterial ( QGLMaterial * material )

Notifier signal:

void updated ()

See also materialIndex() and setMaterialIndex().

options : Options

This property holds various option flags effecting rendering.

This property containst several flags that modify normal rendering and culling on a QGLSceneNode. See Options for a full description of the available flags.

Access functions:

QGLSceneNode::Options options () const
void setOptions ( QGLSceneNode::Options options )

Notifier signal:

void updated ()

See also setOption() and Options.

position : QVector3D

This property holds the amounts of x, y and z axis translation for this node.

Since most nodes are situated relative to (0, 0, 0) when imported as part of a model or constructed programatically, the translation is effectively the position of the model in the scene.

The x, y and z axis translations can also be specified individually as separate properties x, y, and z

Access functions:

QVector3D position () const
void setPosition ( const QVector3D & p )

Notifier signal:

void updated ()

See also x(), y(), and z().

x : qreal

This property holds the amount of x axis translation for this node.

Access functions:

qreal x () const
void setX ( qreal x )

Notifier signal:

void updated ()

See also position().

y : qreal

This property holds the amount of y axis translation for this node.

Access functions:

qreal y () const
void setY ( qreal y )

Notifier signal:

void updated ()

See also position().

z : qreal

This property holds the amount of z axis translation for this node.

Access functions:

qreal z () const
void setZ ( qreal z )

Notifier signal:

void updated ()

See also position().

Member Function Documentation

QGLSceneNode::QGLSceneNode ( QObject * parent = 0 )

Constructs a new scene node and attaches it to parent. If parent is a QGLSceneNode then this node is added to it as a child.

QGLSceneNode::QGLSceneNode ( const QGeometryData & geometry, QObject * parent = 0 )

Constructs a new scene node referencing geometry and attaches it to parent. If parent is a QGLSceneNode then this node is added to it as a child.

QGLSceneNode::~QGLSceneNode () [virtual]

Destroys this scene node.

void QGLSceneNode::addNode ( QGLSceneNode * node )

Adds the node to the list of child nodes for this node.

This function does nothing if node is null or is already a child of this node. If the node is the node itself, a warning about an attempt to add a node to itself is printed, and no add takes place.

If the aim is to have the same geometry displayed several times under a given node, each time with different transformations, use the clone() call to create copies of the node and then apply the transformations to the copies.

Alternatively, create modifier nodes with the transformations and add the geometry bearing node to each with addNode():

 QGLBuilder builder;
 builder << CarWheel(5.0f); // some car wheel geometry
 QGLSceneNode wheel = builder.finalizedSceneNode();
 QGLSceneNode frontLeft = new QGLSceneNode(m_sceneRoot);
 frontLeft->addNode(wheel);
 frontLeft->setPosition(QVector3D(1.0f, 2.0f, 0.0f));
 QGLSceneNode frontRight = new QGLSceneNode(m_sceneRoot);
 frontRight->addNode(wheel);
 frontRight->setPosition(QVector3D(-1.0f, 2.0f, 0.0f));
 QGLSceneNode backLeft = new QGLSceneNode(m_sceneRoot);
 backLeft->addNode(wheel);
 backLeft->setPosition(QVector3D(1.0f, -2.0f, 0.0f));
 QGLSceneNode backRight = new QGLSceneNode(m_sceneRoot);
 backRight->addNode(wheel);
 backRight->setPosition(QVector3D(-1.0f, -2.0f, 0.0f));

Because a child node can be validly added to many different nodes, calling addNode() does not normally affect the QObject::parent() ownership. However, if node does not currently have a QObject::parent(), the parent will be set to this node.

See also removeNode(), clone(), and addNodes().

void QGLSceneNode::addNodes ( const QList<QGLSceneNode *> & nodes )

Adds the members of nodes to the list of child nodes for this node.

See also addNode() and removeNodes().

void QGLSceneNode::addTransform ( QGraphicsTransform3D * transform )

Adds a single transform to this node, to be applied to the node after all current members of transformations() have been applied.

In the mathematical sense, transform is applied to the modelview matrix before the current members of transformations() are applied in reverse order.

See also transforms() and setTransforms().

QList<QGLSceneNode *> QGLSceneNode::allChildren () const

Returns a list including recursively all child nodes under this node. Each child node only appears once, even if it is included multiple times in the scene graph.

See also children().

QGLSceneNode * QGLSceneNode::allExcept ( const QString & name, QObject * parent = 0 ) const

Creates a new QGLSceneNode that is a copy of this scene node, with parent as the parent of the new copy. If parent is NULL then parent is set to this nodes parent.

The copy will reference the same underlying geometry and have all effects, transforms and other properties copied from this node.

The copy returned will have the same child nodes, except all child nodes whose objectName() is equal to name.

See also clone() and only().

QGLSceneNode * QGLSceneNode::allExcept ( const QStringList & names, QObject * parent = 0 ) const

Creates a new QGLSceneNode that is a copy of this scene node, with parent as the parent of the new copy. If parent is NULL then parent is set to this nodes parent.

The copy will reference the same underlying geometry and have all effects, transforms and other properties copied from this node.

The copy returned will have the same child nodes, except all child nodes whose objectName() is in the list of names.

See also clone() and only().

int QGLSceneNode::backMaterialIndex () const

Returns the back material index for this scene node.

See also setBackMaterialIndex().

QBox3D QGLSceneNode::boundingBox () const

Returns a bounding box for the portion of the geometry referenced by this scene node. If the value of start() is 0, and count() is the same as geometry()->size() then the bounding box will be the same as geometry()->boundingBox(). However if the scene node only references some part of the geometry, a bounding box for this section is calculated.

If this scene node has child nodes then the bounding box will be the calculated union of the bounding box for this nodes geometry (if any) and the bounding boxes of the children.

The calculated value is cached and returned on subsequent calls, but could be expensive to calculate initially.

QList<QGLSceneNode *> QGLSceneNode::children () const

Returns a list of the child nodes for this node. This list is not recursively generated, it includes only the nodes which are immediate children of this node.

See also allChildren().

QGLSceneNode * QGLSceneNode::clone ( QObject * parent = 0 ) const

Creates a new QGLSceneNode that is a copy of this scene node, with parent as the parent of the new copy. If parent is NULL then parent is set to this nodes parent.

The copy will reference the same underlying geometry, child nodes, and have all effects, transforms and other properties copied from this node. The only property that is not copied is pickNode().

See also cloneNoChildren().

QGLSceneNode * QGLSceneNode::cloneNoChildren ( QObject * parent = 0 ) const

Creates a new QGLSceneNode that is a copy of this scene node, with parent as the parent of the new copy. If parent is NULL then parent is set to this nodes parent.

The copy will reference the same underlying geometry, and have all effects, transforms and other properties copied from this node. The children() and pickNodes() are not cloned.

See also clone().

int QGLSceneNode::count () const

Returns the count of the vertices to render from geometry() for this scene node. The default is zero, meaning that this node uses all vertices from start() up to the last logical vertex in the underlying geometry().

See also setCount() and start().

void QGLSceneNode::culled () [signal]

Signals that the node was culled due to falling wholly outside the view frustum. This signal can only fire if both QGLSceneNode::CullBoundingBox and QGLSceneNode::ReportCulling options are both set.

void QGLSceneNode::displayed () [signal]

Signals that the node was displayed - or at least its geometry was sent to the GPU for rendering, since the GPU might still clip or occlude the node. This signal can only fire if both QGLSceneNode::CullBoundingBox and QGLSceneNode::ReportCulling options are both set.

void QGLSceneNode::draw ( QGLPainter * painter ) [virtual]

Draws this scene node and its children on the painter.

In detail this function:

  • ensures the effect specified by effect() is current on the painter
  • sets the nodes materials onto the painter, if valid materials are present
  • moves the model-view to the x, y, z position
  • applies any local transforms() that may be set for this node
  • calls draw() for all the child nodes
  • calls draw(start, count) on this nodes geometry object (if any)
  • restores the geometry's original materials if they were changed
  • restores the model-view matrix if any local transform was applied

Note that the draw() method does not restore the effect. If the first step above results in a change to the current QGL::Standard effect then it will remain set to that effect. In general any painting method should ensure the effect it requires is current.

The way draw is implemented ensures that this nodes effects, materials and transformations will apply by default to its child nodes. Transformations are cumulative, but effects and materials override those of any parent node.

Note that if the HideNode option is set for this node, neither it nor its children will be drawn.

void QGLSceneNode::drawGeometry ( QGLPainter * painter ) [virtual protected]

Draws the geometry of the node onto the painter.

This is the function which performs the actual drawing step in the draw function below.

  • calls draw(start, count) on this nodes geometry object (if any)

Override this function to perform special processing on this node, after transformation & culling are applied and before sequencing of materials & effects are done; but just before (or after) the actual draw step.

This default implementation simply draws the nodes geometry onto the painter.

Example:

 void MySpecialNode::geometryDraw(QGLPainter *painter)
 {
     // at this point the node has survived culling, the model-view
     // matrix is transformed into this nodes frame of reference,
     // materials & effects have been applied as this node appears
     // in its place in the render sequence

     doMySpecialProcessing();

     // call parent implementation to do actual draw
     QGLSceneNode::geometryDraw(painter);
 }

QGL::DrawingMode QGLSceneNode::drawingMode () const

Returns the drawing mode to use to render geometry(). The default is QGL::Triangles.

See also setDrawingMode().

qreal QGLSceneNode::drawingWidth () const

Returns the drawing width for this node.

Drawing width is used only when drawing lines or points (ie. when the drawing mode is points, lines, line-strips, etc).

See also setDrawingWidth() and drawingMode().

QGL::StandardEffect QGLSceneNode::effect () const

Returns the local effect associated with this node. The default value is QGL::FlatColor. If the value of hasEffect() is false, then this the value of effect() is ignored.

See also setEffect() and hasEffect().

QGeometryData QGLSceneNode::geometry () const

Returns the geometry associated with this node, or a null QGeometryData if no geometry has been associated with it.

See also setGeometry().

bool QGLSceneNode::hasEffect () const

Returns true if the local effect on this node is enabled, otherwise returns false.

See also setEffectEnabled() and setEffect().

QMatrix4x4 QGLSceneNode::localTransform () const

Returns the local transform associated with this node. If no local transform has been explicitly set, this method returns a QMatrix4x4 set to the identity matrix.

The local transform is typically set during model loading or geometry construction, and is a feature of the geometry.

In general to change the location or orientation of the node use the position() or transforms() properties instead.

See also setLocalTransform(), position(), and transforms().

int QGLSceneNode::materialIndex () const

Returns the material index for this scene node.

See also setMaterialIndex().

QGLSceneNode * QGLSceneNode::only ( const QString & name, QObject * parent = 0 ) const

Creates a new QGLSceneNode that is a copy of this scene node, with parent as the parent of the new copy. If parent is NULL then parent is set to this nodes parent.

The copy will reference the same underlying geometry and have all effects, transforms and other properties copied from this node.

The copy returned will have only one child node. This child node will be the first child node of this one which has its objectName() equal to name.

See also clone() and allExcept().

QGLSceneNode * QGLSceneNode::only ( const QStringList & names, QObject * parent = 0 ) const

Creates a new QGLSceneNode that is a copy of this scene node, with parent as the parent of the new copy. If parent is NULL then parent is set to this nodes parent.

The copy will reference the same underlying geometry and have all effects, transforms and other properties copied from this node.

The copy returned will have only the child nodes from this whose objectName() is in the list of names.

See also clone() and allExcept().

QGLMaterialCollection * QGLSceneNode::palette () const

Returns the palette of materials used by this scene node, or NULL if no palette has been set.

See also setPalette().

QGLPickNode * QGLSceneNode::pickNode () const

Returns the pick node for this scene node, if one was set; otherwise NULL (0) is returned.

See also setPickNode().

void QGLSceneNode::removeNode ( QGLSceneNode * node )

Removes the child node matching node from this node.

If the QObject::parent() ownership of node was set to this node, then its parent will be changed to another parent node if it had multiple parents.

If node had only a single parent, then its parent will be set to null, effectively detaching it from the QObject ownership rules of the scene graph. The caller is then responsible for deleting node.

If the QObject::parent() of node was not a scene node parent, then it will be left unmodified.

See also addNode() and removeNodes().

void QGLSceneNode::removeNodes ( const QList<QGLSceneNode *> & nodes )

Removes the members of nodes from the list of child nodes for this node.

See also removeNode() and addNodes().

void QGLSceneNode::setBackMaterialIndex ( int material )

Sets the back material index for this scene node to material.

See also backMaterialIndex() and materialIndex().

void QGLSceneNode::setCount ( int count )

Sets the count of the vertices to render from geometry() for this scene node.

See also count() and setStart().

void QGLSceneNode::setDrawingMode ( QGL::DrawingMode mode )

Sets the drawing mode to use to render geometry().

Note: this function changes the drawing mode, but the underlying geometry() still consists of the triangles that were added. Thus, this function is only useful for converting the drawing mode into QGL::Points to display the geometry() as a point cloud instead of a triangle mesh. The other enums from QGL::DrawingMode will give unpredictable results.

See also drawingMode().

void QGLSceneNode::setDrawingWidth ( qreal width )

Sets the drawing width to the given value.

Drawing width is used only when drawing lines or points (ie. when the drawing mode is points, lines, line-strips, etc).

See also drawingWidth() and drawingMode().

void QGLSceneNode::setEffect ( QGL::StandardEffect effect )

Sets the local effect associated with this node to be effect. hasEffect() will return true after calling this method.

The QGLSceneNode::draw() function will ensure that effect is applied to the QGLPainter before drawing any geometry.

See also effect() and hasEffect().

void QGLSceneNode::setEffectEnabled ( bool enabled )

Sets whether the current value of effect() or userEffect() will be applied to the QGLPainter prior to drawing. If enabled is true, then the effect is applied, otherwise it is not.

See also setEffect(), effect(), and hasEffect().

void QGLSceneNode::setGeometry ( QGeometryData geometry )

Sets the geometry associated with this node to be geometry. Typically the geometry will be some type of mesh object. The default implementation of the QGLSceneNode::draw() method will call the geometry's draw() method.

See also geometry().

void QGLSceneNode::setLocalTransform ( const QMatrix4x4 & transform )

Sets the local transform associated with this node to be transform. The default implementation of the QGLSceneNode::draw() method will apply this transform to the QGLPainter before drawing any geometry.

See also localTransform().

void QGLSceneNode::setMaterialIndex ( int material )

Sets the material index for this scene node to material.

See also materialIndex().

void QGLSceneNode::setOption ( QGLSceneNode::Option option, bool value )

Enables or disables option according to value.

See also options() and setOptions().

void QGLSceneNode::setPalette ( QGLMaterialCollection * palette )

Sets the palette of materials for this scene node to palette.

See also palette().

void QGLSceneNode::setPickNode ( QGLPickNode * node )

Sets the pick node for this scene node to node.

See also pickNode().

void QGLSceneNode::setStart ( int start )

Sets the start index within geometry() that should be used to render fragments for this scene node.

See also start() and setCount().

void QGLSceneNode::setTransforms ( const QList<QGraphicsTransform3D *> & transforms )

Sets the list of transformations to apply to this node to transforms.

The transformations are applied to the node itself, so a QGraphicsScale3D followed by a QGraphicsTranslation3D will first scale the node in its local co-ordinate system, and then translate the node a new location.

In the mathematical sense, the transformations are applied to the modelview matrix in the reverse order in which they appear in transforms.

The position() is applied after all other transformations have been applied.

See also transforms(), addTransform(), and position().

void QGLSceneNode::setUserEffect ( QGLAbstractEffect * effect )

Sets the local effect associated with this node to be the custom effect. hasEffect() will return true after calling this method.

This custom effect will supersede any standard effect.

The default implementation of QGLSceneNode::apply() will set this effect during initialization of the model.

The default implementation of the QGLSceneNode::draw() method will ensure that effect is applied to the QGLPainter before drawing any geometry.

See also userEffect() and hasEffect().

int QGLSceneNode::start () const

Returns the starting index within geometry() that should be used to render fragments for this scene node. The default value is 0, indicating that the 0'th logical vertex in geometry() is the start.

See also setStart() and count().

QList<QGraphicsTransform3D *> QGLSceneNode::transforms () const

Returns the list of transformations to apply to this node. The default is the empty list.

The transformations are applied to the node itself, so a QGraphicsScale3D followed by a QGraphicsTranslation3D will first scale the node in its local co-ordinate system, and then translate the node a new location.

In the mathematical sense, the transformations are applied to the modelview matrix in the reverse order in which they appear in this list.

The position() is applied after all other transformations have been applied.

See also setTransforms(), addTransform(), and position().

void QGLSceneNode::updated () [signal]

Signals that some property of this scene node, or one of its children, has changed in a manner that will require that the node be redrawn.

QGLAbstractEffect * QGLSceneNode::userEffect () const

Returns the user effect associated with this node, or NULL if one is not set. The default value is NULL. If the value of hasEffect() is false, then this effect is ignored.

See also setUserEffect() and hasEffect().

Related Non-Members

void qDumpScene ( QGLSceneNode * node, bool detailed = true, int indent = 0, const QSet<QGLSceneNode *> & loop = QSet<QGLSceneNode *> () )

Print a description of node, and all its descendants, to the console. This function uses qDebug for its output, so in the case of Windows the output will go to the debug window. If QT_NO_DEBUG_OUTPUT or QT_NO_DEBUG has been defined, (as in release mode) this function will exit without doing anything.

If detailed is true (which it is by default) then all the properties of each node are printed, including materials, geometry and transforms.

If detailed is false, then just one line is printed with the name and some identifying information including a unique id for the node.

The indent and loop parameters are used internally.