#include <QGLSceneNode>

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::Optionsoptions )

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

详细说明(Detailed Description)

QGLSceneNode这个类定义(defines)了在一个3D场景(scene)中的一个节点(node)。

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 theaddNode() 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

常量(Constant) 值(Value) 描述(Description)
QGLSceneNode::NoOptions 0x0000 Do not enable any QGLSceneNode options.
QGLSceneNode::CullBoundingBox 0x0001 Perform a cull using boundingBox() before attempting to draw thegeometry().
QGLSceneNode::ViewNormals 0x0002 Enables the display of lighting normals for debugging purposes.
QGLSceneNode::ReportCulling 0x0004 Send a signal when an object is displayed or culled.
QGLSceneNode::HideNode 0x0008 Hide 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 thematerial() 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 aQGLSceneNode 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 toparent. 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 parentas 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 parentas 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 asgeometry()->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 parentas 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 parentas 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 fromstart() 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 andQGLSceneNode::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 andQGLSceneNode::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 isQGL::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 isQGL::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 parentas 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 parentas 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::DrawingModemode )

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 thegeometry() as a point cloud instead of a triangle mesh. The other enums fromQGL::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 theQGLPainter 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 thegeometry 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 ( constQList<QGraphicsTransform3D *> & transforms )

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

The transformations are applied to the node itself, so a QGraphicsScale3Dfollowed 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 QGraphicsScale3Dfollowed 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.

(Qt 翻译) QGLSceneNode的更多相关文章

  1. qt翻译和国际化的探讨。

    这段时间一直都在怼qt的国际化,以前也接触过国际化,但是感觉不是那么的深刻,这次是因为一个项目要做一个国际化的版本,代码里面是不能出现中文的,所以就翻译了一下.qt用的是4.8.6 64位的,IDE( ...

  2. (Qt 翻译) QGLAbstractScene

    QGLAbstractScene Class Reference #include <QGLAbstractScene> This class was introduced in Qt3D ...

  3. Qt翻译---Thread Support in Qt

    Thread Support in Qt QT提供线程支持在平台独立的线程类.一个安全线程的传递事件的方式,一个信号槽的链接在线程之中.这使得开发多线程容易.多线程程序也是一个有用的范例为不冻结用户界 ...

  4. qt翻译--QWaitCondition

    QWaitCondition Class Reference[QtCore module] 该类提供一个情况变量来同步线程. #include <QWaitCondition> 注意:该类 ...

  5. qt 国际化(翻译时会触发changeEvent)

    1. 修改工程文件 .pro ,加入翻译源文件 hello_world.ts: TRANSLATIONS += \        Resource/translations/hello_world.t ...

  6. Qt 本地化(翻译)

    Qt 本地化(翻译) 翻译流程大致是这样的:首先源代码产生 ts 文件,然后送给 Qt Linguist(Qt 语言家)这个 Qt 自带的小工具进行处理产生 qm 翻译文件,最后源代码里加载这个 qm ...

  7. Qt Installer Framework翻译(5-4)

    自定义安装程序 您可以使用脚本通过以下方式来自定义安装程序: > 添加Qt Installer Framework操作,该操作由脚本提供,并由安装程序执行. > 添加新页面,该页面由您在p ...

  8. Qt学习之路(34): 国际化(下)

      原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://devbean.blog.51cto.com/448512/245063 上次 ...

  9. Qt多国语言QT_TR_NOOP和QT_TRANSLATE_NOOP

    文章来源:http://devbean.blog.51cto.com/448512/245063/ 在代码中,我们使用tr()将需要翻译的字符串标记出来.lupdate工具就是提取出tr()函数中的相 ...

随机推荐

  1. 去掉firefox点击按钮时的虚线边框

    去掉火狐里面点击按钮时候的虚线边框 button::-moz-focus-inner, input[type="reset"]::-moz-focus-inner, input[t ...

  2. 《JavaScript 闯关记》之函数

    函数是一段代码,它只定义一次,但可以被执行或调用任意次.在 JavaScript 里,函数即对象,程序可以随意操控它们.比如,可以把函数赋值给变量,或者作为参数传递给其他函数,也可以给它们设置属性,甚 ...

  3. Python 初学

    一. 前言 不怕各位园友笑话,今年年初时,我才知道有一个叫python的编程语言,听说它很大强大,而我只会用c#,正想好好再学一门新语言,还有人分享自己的经验时说,使用python制作的脚本,再做持续 ...

  4. 获取设备、APP的一些信息

    获取设备的一些信息: UIDevice *device = [UIDevice currentDevice]; @property(nonatomic,readonly,strong) NSStrin ...

  5. 天坑 之 Eclipse J2EE Preview 运行正确项目一直显示http 404

    昨天下载了几个新Demo学习,结果不知道改了哪里,导致运行原先自己写的项目(JSP+Servlet+JDBC)(这理论上不会出什么大的问题吧?这么底层),结果莫名其妙的出现Http 404. 搞的我一 ...

  6. CodeForces 698A - Vacations (Codeforces Round #363 (Div. 2))

    要么去体育馆,要么去比赛,要么闲在家里 给出每一天体育馆和比赛的有无情况,要求连续两天不能去同一个地方 问最少闲几天 DP方程很容易看出 dp(第i天能去的地方) = min(dp(第i-1天的三种情 ...

  7. c#接口定义与应用

    public interface IBankAccount //只能加public修饰符,或者什么都不加 { void Playin(decimal money); //函数前不加任何修饰符号 boo ...

  8. Python爬虫实战(4):豆瓣小组话题数据采集—动态网页

    1, 引言 注释:上一篇<Python爬虫实战(3):安居客房产经纪人信息采集>,访问的网页是静态网页,有朋友模仿那个实战来采集动态加载豆瓣小组的网页,结果不成功.本篇是针对动态网页的数据 ...

  9. 【测试Json的多空格问题】

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  10. 2.6. Statistical Models, Supervised Learning and Function Approximation

    Statical model regression $y_i=f_{\theta}(x_i)+\epsilon_i,E(\epsilon)=0$ 1.$\epsilon\sim N(0,\sigma^ ...