Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QSGNode Class

The QSGNode class is the base class for all nodes in the scene graph. More...

 #include <QSGNode>

Inherited by: QSGBasicGeometryNode, QSGOpacityNode, and QSGTransformNode.

Public Types

flags DirtyState
enum DirtyStateBit { DirtyUsePreprocess, DirtyChildrenDoNotOverlap, DirtyStaticSubtreeGeometry, DirtyMatrix, ..., DirtyPropagationMask }
enum Flag { OwnedByParent, UsePreprocess, ChildrenDoNotOverlap, StaticSubtreeGeometry, ..., OwnsOpaqueMaterial }
flags Flags
enum NodeType { BasicNodeType, RootNodeType, GeometryNodeType, TransformNodeType, ..., UserNodeType }

Public Functions

QSGNode()
virtual ~QSGNode()
void appendChildNode(QSGNode * node)
QSGNode * childAtIndex(int i) const
int childCount() const
void clearDirty()
DirtyState dirtyState() const
QSGNode * firstChild() const
Flags flags() const
void insertChildNodeAfter(QSGNode * node, QSGNode * after)
void insertChildNodeBefore(QSGNode * node, QSGNode * before)
virtual bool isSubtreeBlocked() const
QSGNode * lastChild() const
void markDirty(DirtyState bits)
QSGNode * nextSibling() const
QSGNode * parent() const
void prependChildNode(QSGNode * node)
virtual void preprocess()
QSGNode * previousSibling() const
void removeAllChildNodes()
void removeChildNode(QSGNode * node)
void setFlag(Flag f, bool enabled = true)
void setFlags(Flags f, bool enabled = true)
NodeType type() const

Protected Functions

QSGNode(NodeType type)

Detailed Description

The QSGNode class is the base class for all nodes in the scene graph.

The QSGNode class can be used as a child container. Children are added with the appendChildNode(), prependChildNode(), insertChildNodeBefore() and insertChildNodeAfter(). Ordering of nodes is important as geometry nodes will be rendered in the order they are added to the scene graph. Actually, the scene may reorder nodes freely, but the resulting visual order is still guaranteed.

The scene graph nodes contains a mechanism to describe which parts of the scene has changed. This includes the combined matrices, accumulated opacity, changes to the node hierarchy, etc. This information can be used for optimizations inside the scene graph renderer. For the renderer to properly render the nodes, it is important that users call QSGNode::markDirty() with the correct flags when nodes are changed. Most of the functions on the node classes will implicitly call markDirty(), e.g. QSGNode::appendChildNode() will call markDirty() passing in QSGNode::DirtyNodeAdded.

If nodes change every frame, the preprocess() function can be used to apply changes to a node for every frame its rendered. The use of preprocess() must be explicitly enabled by setting the QSGNode::UsePreprocess flag on the node.

The virtual isSubtreeBlocked() function can be used to disable a subtree all together. Nodes in a blocked subtree will not be preprocessed() and not rendered.

Warning: Anything related to QSGNode should happen on the scene graph rendering thread.

Member Type Documentation

enum QSGNode::DirtyStateBit
flags QSGNode::DirtyState

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

enum QSGNode::Flag
flags QSGNode::Flags

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

enum QSGNode::NodeType

Member Function Documentation

QSGNode::QSGNode()

QSGNode::QSGNode(NodeType type) [protected]

QSGNode::~QSGNode() [virtual]

void QSGNode::appendChildNode(QSGNode * node)

Appends node to this node's list of children.

Ordering of nodes is important as geometry nodes will be rendered in the order they are added to the scene graph.

QSGNode * QSGNode::childAtIndex(int i) const

int QSGNode::childCount() const

void QSGNode::clearDirty()

DirtyState QSGNode::dirtyState() const

QSGNode * QSGNode::firstChild() const

Flags QSGNode::flags() const

See also setFlags().

void QSGNode::insertChildNodeAfter(QSGNode * node, QSGNode * after)

Inserts node to this node's list of children after the node specified with after.

Ordering of nodes is important as geometry nodes will be rendered in the order they are added to the scene graph.

void QSGNode::insertChildNodeBefore(QSGNode * node, QSGNode * before)

Inserts node to this node's list of children before the node specified with before.

Ordering of nodes is important as geometry nodes will be rendered in the order they are added to the scene graph.

bool QSGNode::isSubtreeBlocked() const [virtual]

Returns whether this node and its subtree is available for use.

Blocked subtrees will not get their dirty states updated and they will not be rendered.

The QSGOpacityNode will return a blocked subtree when accumulated opacity is 0, for instance.

QSGNode * QSGNode::lastChild() const

void QSGNode::markDirty(DirtyState bits)

Marks this node with the states in flags as dirty.

When a node is marked dirty, it recursively mark the parent chain as dirty and notify all connected renderers that the has dirty states.

QSGNode * QSGNode::nextSibling() const

QSGNode * QSGNode::parent() const

void QSGNode::prependChildNode(QSGNode * node)

Prepends node to this node's the list of children.

Ordering of nodes is important as geometry nodes will be rendered in the order they are added to the scene graph.

void QSGNode::preprocess() [virtual]

Override this function to do processing on the node before it is rendered.

Preprocessing needs to be explicitly enabled by setting the flag QSGNode::UsePreprocess. The flag needs to be set before the node is added to the scene graph and will cause the preprocess() function to be called for every frame the node is rendered.

The preprocess function is called before the update pass that propegates opacity and transformations through the scene graph. That means that functions like QSGOpacityNode::combinedOpacity() and QSGTransformNode::combinedMatrix() will not contain up-to-date values. If such values are changed during the preprocess, these changes will be propegated through the scene graph before it is rendered.

Warning: Beware of deleting nodes while they are being preprocessed. It is possible, with a small performance hit, to delete a single node during its own preprocess call. Deleting a subtree which has nodes that also use preprocessing may result in a segmentation fault. This is done for performance reasons.

QSGNode * QSGNode::previousSibling() const

void QSGNode::removeAllChildNodes()

Removes all child nodes from this node's list of children.

void QSGNode::removeChildNode(QSGNode * node)

Removes node from this node's list of children.

void QSGNode::setFlag(Flag f, bool enabled = true)

Sets the flag f on this node if enabled is true; otherwise clears the flag.

See also flags().

void QSGNode::setFlags(Flags f, bool enabled = true)

Sets the flags f on this node if enabled is true; otherwise clears the flags.

See also flags().

NodeType QSGNode::type() const

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web