Workspace 6.21.5
|
Scene class which can hold lights, cameras and transforms. More...
#include <Rendering/SceneComponents/scene.h>
Additional Inherited Members | |
Protected Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
A Scene does not hold models directly, but rather models must be added as children of a transform to place them in the scene.
Scene | ( | ) |
|
override |
void add | ( | SceneOverlay & | overlay | ) |
overlay | The image overlay being added to the scene. |
Image overlays are not really part of the scene itself, but rather they are intended to be overlaid in front of the rendered image when the scene is being rendered. They will be overlaid in the order in which they are added to the scene, so clients should be careful about how they add and remove image overlays.
void added | ( | Camera & | camera | ) |
camera | The camera being added to the scene. |
void added | ( | Light & | light | ) |
light | The light being added to the scene. |
void addInternalSource | ( | Mesh::MeshModelSource & | source | ) |
source | A model source to be added to the scene's internal list of sources. |
This function should only be called by MeshModelInstance. It will be called when the private model source for the proxy is set or changed or when the proxy is added to the scene.
void clear | ( | ) |
Clears all SceneItem objects and image overlays from the scene. Nothing is deleted - this function merely clears the list of scene items and image overlays. It is up to the caller to look after ownership of the items and overlays themselves.
void deregisterSceneItem | ( | const SceneItem & | item | ) |
Camera * getCamera | ( | const QString & | name = "Default" , |
bool | enabledOnly = false |
||
) |
name | The name of the camera to try to find |
enabledOnly | Retrieve only cameras that are enabled. |
Camera * getCamera | ( | unsigned | i | ) |
i | The index of the camera to retrieve. No check is performed on whether this index is valid (that is the caller's responsibility). |
const RenderSettings & getDefaultRenderSettings | ( | ) | const |
Light & getLight | ( | unsigned | i | ) |
i | The index of the light to retrieve. It is the caller's responsibility to ensure that this is strictly less than the number of lights in the scene as returned from numLights(). |
Mesh::MeshModelLibrary & getMeshModelLibrary | ( | ) |
It should be noted that this will never be the same library as any library passed to setMeshModelLibrary(). This is because the scene has its own internal model library which it uses to hold model sources it manages for itself. Any library passed to setMeshModelLibrary() will be included as a sub-library of the return value of getMeshModelLibrary().
unsigned getNumSceneOverlays | ( | ) | const |
Transform & getRootTransform | ( | ) |
const Transform & getRootTransform | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
SceneItemLibrary & getSceneItemLibrary | ( | ) |
const QString & getSceneItemOpIdPath | ( | const SceneItem & | item | ) | const |
item | The SceneItem we wish to retrieve its OpIdPath |
const SceneItem * getSceneItemWithOpIdPath | ( | const QString & | opIdPath | ) | const |
opIdPath | The operation Id path to use to find the specified scene item. |
const SceneOverlay & getSceneOverlay | ( | unsigned | index | ) | const |
index | The index of the image overlay to retrieve. It must be less than the number of image overlays as returned by getNumImageOverlays(). |
ShaderLibrary & getShaderLibrary | ( | ) |
bool hasSceneOverlays | ( | ) | const |
Included because it is generally faster to determine whether a container is empty than to count all of the items it contains in the case it is non-empty.
unsigned numCameras | ( | ) | const |
unsigned numLights | ( | ) | const |
void registerSceneItem | ( | const SceneItem & | item, |
const QString & | opIdPath | ||
) |
void remove | ( | SceneOverlay & | overlay | ) |
overlay | The image overlay being removed from the scene. |
void removed | ( | Camera & | camera | ) |
camera | The camera being removed from the scene. |
void removed | ( | Light & | light | ) |
light | The light being removed from the scene. |
void removeInternalSource | ( | Mesh::MeshModelSource & | source | ) |
source | A model source to be removed from the scene's internal list of sources. |
This function should only be called by MeshModelInstance. It will be called when the private model source for the proxy is cleared or changed, or when the proxy is removed from the scene.
void setDefaultRenderSettings | ( | const RenderSettings & | settings | ) |
settings | The settings to use by default when the scene is rendered, assuming there are no overrides from the rendering widget. |
void setMeshModelLibrary | ( | Mesh::MeshModelLibrary * | library | ) |
library | The new library to use with the scene. The old library is no longer used, but it is not deleted. |
The scene does not take ownership of the library. Rather, it simply keeps a reference to it so that SceneProcessor implementations can access the library when needed. If there was already a library assigned to the scene, it will no longer be used. If library is a null pointer, only those model sources managed internally by the scene will be available.
Note also that the library passed in will not be the same as the one returned by getMeshModelLibrary(). See the documentation for that function for the reasons why.
void setSceneItemLibrary | ( | SceneItemLibrary * | library | ) |
library | The new SceneItemLibrary to use with the scene. The old library is no longer used but is not deleted. |
A scene can have a scene item library associated with it. This scene item library will be used by renderers to retrieve scene items associated with a sceneiteminstance.
void setShaderLibrary | ( | ShaderLibrary * | library | ) |
library | The new ShaderLibrary to use with the scene. The old library is no longer used but is not deleted. |
A scene can have a shader library associated with it. This shader library will be used by renderers to retrieve shaders associated with meshmodelinstances.