Workspace 6.21.5
|
Provides a transformable item to be placed in a Scene. More...
#include <Rendering/SceneComponents/transform.h>
Public Member Functions | |
Transform (const QString &id="") | |
~Transform () override | |
bool | addChild (SceneItem &item) |
void | clearChildren () |
Transform * | clone () const override |
SceneItem & | getChild (unsigned i) |
const SceneItem & | getChild (unsigned i) const |
Mesh::TransformMatrix & | getMatrix () |
const Mesh::TransformMatrix & | getMatrix () const |
Mesh::TransformMatrix | getMatrixGlobal () const override |
Mesh::TransformMatrix | getMatrixLocal () const override |
virtual Scene * | getScene () |
Shader * | getSymbolShader () const |
bool | isSymbolVisible () const |
unsigned | numChildren () const |
void | removeChild (SceneItem &item) |
void | setMatrix (const Mesh::TransformMatrix &matrix) |
void | setSymbolShader (Shader *shader) |
void | setSymbolVisible (bool b) |
const Transform * | toTransform () const override |
Transform * | toTransform () override |
void | updateGlobalMatrix () override |
bool | visit (SceneProcessor &processor) override |
Public Member Functions inherited from SceneItem | |
~SceneItem () override | |
SceneItem * | clone () const override=0 |
bool | getEnabled () const |
const QString & | getId () const |
const Mesh::BoundingBoxMinimal & | getLocalBoundingBox () const |
virtual Mesh::TransformMatrix | getMatrixGlobal () const |
virtual Mesh::TransformMatrix | getMatrixLocal () const |
const QString & | getName () const |
Mesh::TransformMatrix | getParentMatrixGlobal () const |
Transform * | getParentTransform () |
void | setEnabled (bool b) |
void | setId (const QString &itemId) |
virtual void | setLocalBoundingBox (const Mesh::BoundingBoxMinimal &bb) |
void | setName (const QString &name) |
virtual Transform * | toTransform () |
virtual const Transform * | toTransform () const |
virtual void | updateGlobalMatrix () |
virtual bool | visit (SceneProcessor &processor)=0 |
Public Member Functions inherited from Observable | |
virtual | ~Observable () |
void | attachObserver (Observer &observer) |
void | destroy () |
void | detachObserver (Observer &observer) |
void | notifyEvent (const ObservableEvent &event) |
Public Member Functions inherited from Clonable | |
virtual | ~Clonable ()=default |
virtual Clonable * | clone () const =0 |
Protected Member Functions | |
Transform (const Transform &t) | |
Protected Member Functions inherited from SceneItem | |
SceneItem (const QString &id) | |
SceneItem (const SceneItem &item) | |
virtual void | addToScene (Scene &scene, const QString &opIdPath="") |
bool | isTransformModified () const |
SceneItem & | operator= (const SceneItem &item) |
void | setTransformModified (bool b) |
Protected Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
Transform objects are a fundamental part of any Scene. They can be used to position and orientate objects, including other transforms, so that any SceneItem can be added to a Scene and moved relative to other objects in the scene. Transforms provide a heirarchical tree structure for organizing parent-child relationships between objects.
Some items can only be added to a scene as a child of a Transform. The MeshModelInstance class is a prime example. Other objects might not normally be added as a child of a transform (such as lights or cameras), but doing so can allow interesting effects such as a light or camera which follows the movement of some object. A car headlight would be a perfect application for adding a light as a child of a transform to ensure that the light stays with a MeshModelInstance of the car body.
Transform | ( | const QString & | id = "" | ) |
|
override |
bool addChild | ( | SceneItem & | item | ) |
item | The item we wish to add to the transform as a child. |
void clearChildren | ( | ) |
All children will be removed from the transform. No children will be deleted, they are simply removed from this transform and made parentless.
|
overridevirtual |
SceneItem & getChild | ( | unsigned | i | ) |
i |
const SceneItem & getChild | ( | unsigned | i | ) | const |
i |
Mesh::TransformMatrix & getMatrix | ( | ) |
const Mesh::TransformMatrix & getMatrix | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
overridevirtual |
Reimplemented from SceneItem.
|
overridevirtual |
Reimplemented from SceneItem.
|
virtual |
If this transform is added as a child to another transform, the getScene() function will automatically return the scene of the parent by querying the parent for its scene. This sequence continues until the top level transform is reached. If the top level transform is part of a scene, it will know the scene to which it belongs and return that.
Shader * getSymbolShader | ( | ) | const |
bool isSymbolVisible | ( | ) | const |
unsigned numChildren | ( | ) | const |
void removeChild | ( | SceneItem & | item | ) |
item | The item to remove. It will not be deleted. |
void setMatrix | ( | const Mesh::TransformMatrix & | matrix | ) |
matrix | The new matrix to assign to this transform. |
void setSymbolShader | ( | Shader * | shader | ) |
shader | Sets the shader for the transform. |
void setSymbolVisible | ( | bool | b | ) |
b | Controls the visibility of the transform (whether to display it). |
|
overridevirtual |
|
overridevirtual |
Reimplemented from SceneItem.
|
overridevirtual |