Workspace 6.21.5
|
Creates an instance of a SceneItem in a scene, including all of its children. More...
#include <Rendering/SceneComponents/sceneiteminstance.h>
Public Member Functions | |
SceneItemInstance (const QString &id="") | |
SceneItemInstance (const SceneItemInstance &other) | |
~SceneItemInstance () override | |
SceneItemInstance * | clone () const override |
Mesh::TransformMatrix | getMatrixGlobal () const override |
const QString & | getSceneItemId () const |
const Mesh::TransformMatrix & | getTransformMatrix () const |
SceneItemInstance & | operator= (const SceneItemInstance &rhs) |
void | setSceneItemId (const QString &id) |
void | setTransformMatrix (const Mesh::TransformMatrix &transform) |
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 |
Additional Inherited Members | |
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 &) | |
Often when building a scene for visualisation, it is necessary to duplicate objects which are comprised of many components, transforms and shaders. Take, for example, a model of a car. The car may have a component for its chassis, a component for each of its windows, and wheels, and a component for its interior. Each of the components may also have a shader associated with it in order to ensure that it has the desired appearance when visualised. This can be built up in the Workspace by constructing a Scene with a number of MeshModelInstances (one for each component), and a Shader attached to each component.
If a scene was comprised of multiple cars, it would be wasteful to duplicate this entire hierarchy of components multiple times. The SceneItemInstance class allows the user to avoid copying large sub-branches of their Scene by allowing them to refer to a named sub-branch stored in a SceneItemLibrary.
SceneItemInstances can be added to a Scene just like any other SceneItem. A SceneItemInstance can ever refer to a SceneItem that has SceneItemInstances as other children (though care must be taken to avoid recursive relationships).
SceneItemInstance | ( | const QString & | id = "" | ) |
SceneItemInstance | ( | const SceneItemInstance & | other | ) |
|
override |
|
overridevirtual |
Implements SceneItem.
|
overridevirtual |
Reimplemented from SceneItem.
const QString & getSceneItemId | ( | ) | const |
const Mesh::TransformMatrix & getTransformMatrix | ( | ) | const |
SceneItemInstance & operator= | ( | const SceneItemInstance & | rhs | ) |
rhs |
void setSceneItemId | ( | const QString & | id | ) |
void setTransformMatrix | ( | const Mesh::TransformMatrix & | transform | ) |
|
overridevirtual |
Reimplemented from SceneItem.
|
overridevirtual |
Implements SceneItem.