Workspace 6.21.5
Public Member Functions | Protected Member Functions | List of all members
SceneBoundingBoxCalculator Class Reference

Utility class for calculating the bounding box of a scene.

#include <Rendering/SceneComponents/calculatesceneboundingbox.h>

Inheritance diagram for SceneBoundingBoxCalculator:
[legend]

Public Member Functions

 SceneBoundingBoxCalculator (const QString &locationInformationForLogging="")
 
 ~SceneBoundingBoxCalculator () override
 
const Mesh::BoundingBoxMinimalgetBoundingBox () const
 
bool isEmpty () const
 
- Public Member Functions inherited from SceneProcessor
 ~SceneProcessor () override
 
bool process (Scene &scene)
 
bool process (Transform &transform)
 
bool visit (Annotation &annotation)
 
bool visit (Camera &camera)
 
bool visit (ClipRegion &clipRegion)
 
bool visit (Light &light)
 
bool visit (MeshModelInstance &model)
 
bool visit (SceneItemInstance &sceneItemInstance)
 
bool visit (Transform &transform)
 
- Public Member Functions inherited from Observable
virtual ~Observable ()
 
void attachObserver (Observer &observer)
 
void destroy ()
 
void detachObserver (Observer &observer)
 
void notifyEvent (const ObservableEvent &event)
 

Protected Member Functions

bool preVisits (Scene &scene) override
 
bool visitImpl (MeshModelInstance &modelInstance) override
 
- Protected Member Functions inherited from SceneProcessor
 SceneProcessor ()
 
 SceneProcessor (const SceneProcessor &p)
 
SceneProcessoroperator= (const SceneProcessor &p)
 
virtual bool postVisits (Scene &scene)
 
virtual bool preVisits (Scene &scene)
 
virtual bool traverseScene (Scene &scene)
 
virtual bool visitImpl (Annotation &annotation)
 
virtual bool visitImpl (Camera &camera)
 
virtual bool visitImpl (ClipRegion &clipRegion)
 
virtual bool visitImpl (Light &light)
 
virtual bool visitImpl (MeshModelInstance &modelInstance)
 
virtual bool visitImpl (SceneItemInstance &sceneItemInstance)
 
virtual bool visitImpl (Transform &transform)
 
- Protected Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 

Additional Inherited Members

- Static Public Attributes inherited from SceneProcessor
static const Application::LogManager::MessageCategory LOG_SCENEPROCESSOR
 

Constructor & Destructor Documentation

◆ SceneBoundingBoxCalculator()

SceneBoundingBoxCalculator ( const QString &  locationInformationForLogging = "")

◆ ~SceneBoundingBoxCalculator()

~SceneBoundingBoxCalculator ( )
overridedefault

Member Function Documentation

◆ getBoundingBox()

const BoundingBoxMinimal & getBoundingBox ( ) const
Returns
The bounding box that has been calculated from the supplied scene during the last call to process().
Precondition
The process() function must have been invoked.

◆ isEmpty()

bool isEmpty ( ) const
Returns
true of the bounding box is empty, false otherwise.

◆ preVisits()

bool preVisits ( Scene scene)
overrideprotectedvirtual
Parameters
sceneThe scene being visited.

This function should only ever be called by process(). Client code should not call it directly. The default implementation performs a check on this condition and returns true if the function is being called within a call to process(), or false otherwise. The default implementation performs no other action.

Subclasses may wish to provide their own implementation for preVisits() in order to set up their own internal data structures. They are not required to call this base class implementation if they do so.

Reimplemented from SceneProcessor.

◆ visitImpl()

bool visitImpl ( MeshModelInstance modelInstance)
overrideprotectedvirtual
Parameters
modelInstanceThe model to visit.
Note
This function will only be called if modelInstance is enabled (this is controlled by the visit(MeshModelInstance&) function which is the only place visitImpl(MeshModelInstance&) should be called from).

The default implementation does nothing. Most subclasses will override this function.

Reimplemented from SceneProcessor.