Base class for all types that can be added as a child of a Transform.
#include <Rendering/SceneComponents/sceneitem.h>
◆ SceneItem() [1/2]
◆ SceneItem() [2/2]
- Parameters
-
item | The scene item to be copied. |
The parent transform of item is not copied to this object. The parent of the new item must be explicitly set by calling the parent's Transform::addChild() function if it should have the same parent as item.
◆ ~SceneItem()
◆ addToScene()
void addToScene |
( |
Scene & |
scene, |
|
|
const QString & |
opIdPath = "" |
|
) |
| |
|
protectedvirtual |
◆ clone()
- Returns
- A clone of this object.
- Note
- Subclasses would normally return their own type rather than the Clonable type. The C++ language rules allow a more derived type to be returned from a virtual function and the compiler will still treat it as a valid override.
Implements Clonable.
Implemented in Annotation, Camera, AmbientLight, DirectionalLight, PointLight, SpotLight, ClipRegion, MeshModelInstance, SceneItemInstance, Transform, and Light.
◆ getEnabled()
bool getEnabled |
( |
| ) |
const |
- Returns
- True if this scene item is enabled, meaning that it should be processed by scene processors.
When a scene item is not enabled, all scene processors must ignore it as though it was not even present.
- See also
- setEnabled()
◆ getId()
const QString & getId |
( |
| ) |
const |
- Returns
- itemId A unique ID for each SceneItem in a scene, typically the opIdPath that matches the Operation that generated it (so that it stays consistent after save and re-load of a workflow) but may have an additional suffix for ops that return a hierarchy of SceneItems.
◆ getLocalBoundingBox()
- Returns
- The bounding box which encapsulates the model instance's geometry (in local (to the source) coordinates).
◆ getMatrixGlobal()
- Returns
- The global transformation matrix for the object itself. This is equivalent to multiplying together all of the parent transforms' matrices, and this item's own local matrix. Since most SceneItems don't have their own local transform matrices, the result of this function is usually the same as the result of getParentMatrixGlobal().
- See also
- getParentMatrixGlobal
Reimplemented in Camera, ClipRegion, SceneItemInstance, and Transform.
◆ getMatrixLocal()
- Returns
- If the scene item has its own local transform matrix, this will function will return it. If not, it will return the identity matrix.
Reimplemented in Camera, and Transform.
◆ getName()
const QString & getName |
( |
| ) |
const |
- Returns
- The name of the item. It is up to clients how they use this name and what meaning they assign to it.
◆ getParentMatrixGlobal()
- Returns
- The global transformation matrix for the parent of this object. This is equivalent to multiplying together all of the parent transforms' matrices.
- Note
- If this scene item is itself a transform, the global transform returned will not include the local transform too. Thus, if F is a transform in the scene and M is the return value of this function, the global transform matrix that will be applied to all children of F is (MF), not just M. To get the world transform of the item itself, call getMatrixGlobal()
- See also
- getMatrixGlobal
◆ getParentTransform()
- Returns
- The parent transform for this scene item. If it has no parent then a null pointer will be returned.
◆ isTransformModified()
bool isTransformModified |
( |
| ) |
const |
|
protected |
- Returns
- Whether or not the transform information has been modified or not. This is generally used to detect whether an update of the global transform information is required.
◆ operator=()
- Parameters
-
item | The scene item to be copied. |
The parent transform of item is not copied to this object. The parent of this item must be explicitly set by calling the parent's Transform::addChild() function if it should have the same parent as item.
◆ setEnabled()
void setEnabled |
( |
bool |
b | ) |
|
- Parameters
-
b | Specifies whether or not this particular scene item should be processed by scene processors. |
When a scene item is not enabled, all scene processors must ignore it as though it was not even present. For Transform scene items, this implies that all children of the transform must also be ignored. For lights, it implies that the light is off.
Scene items are enabled by default.
- See also
- getEnabled()
◆ setId()
void setId |
( |
const QString & |
itemId | ) |
|
- Parameters
-
itemId | A unique ID for each SceneItem in a scene, typically the opIdPath that matches the Operation that generated it (so that it stays consistent after save and re-load of a workflow) but may have an additional suffix for ops that return a hierarchy of SceneItems. |
◆ setLocalBoundingBox()
- Parameters
-
bb | The bounding box we are assigning to this model instance (in local (to the source) coordinates). |
Reimplemented in MeshModelInstance.
◆ setName()
void setName |
( |
const QString & |
name | ) |
|
- Parameters
-
name | The name to give this item. Any previous name is discarded. |
◆ setTransformModified()
void setTransformModified |
( |
bool |
b | ) |
|
|
protected |
- Parameters
-
b | Whether or not the local transform has been modified. |
Protected function for indicating that the transform information of this scene item has been modified. Only derived classes may set this, as not all derived classes posess transform information.
- See also
- isTransformModified
◆ toTransform() [1/2]
◆ toTransform() [2/2]
◆ updateGlobalMatrix()
void updateGlobalMatrix |
( |
| ) |
|
|
virtual |
◆ visit()