AGX Dynamics  2.37.2.0
agxQt::CameraDescriptionSet Class Reference

CameraViewSet is a class that handles and manages a set of cameras that the user should be able to switch between in the active scene Different Cameras can be stored to the active set while looking at the scene for future references. More...

#include <CameraViewSet.h>

+ Inheritance diagram for agxQt::CameraDescriptionSet:

Public Member Functions

 CameraDescriptionSet ()
 Constructor. More...
 
void addCamera (CameraDescription *camera)
 Add/Remove a camera to the camera set. More...
 
bool containsCameraDescription (const CameraDescription *camera)
 Check if the camera is contained in the set. More...
 
CameraDescription * getActiveCameraDescription ()
 Returns the active camera description in the set. More...
 
agx::UInt getActiveCameraIndex ()
 Get the active camera index in the set. More...
 
CameraDescription * getCameraDescription (const agx::UInt &index)
 Gets the camera description given an index. More...
 
CameraDescription * getCameraDescriptionFromName (const agx::String &name)
 Returns a camera description given a name. More...
 
agx::Vector< agx::String > getCameraViewNames ()
 Get the names for all loaded views. More...
 
agx::UInt getNumberOfCameraDescriptions ()
 Returns the number of camera descriptions in the active set. More...
 
agx::UInt nextCameraDescription ()
 Increments the active camera index to the next one. If the active camera index is at max, it cycles back to the first index. Returns the active index after increment. More...
 
agx::UInt previousCameraDescription ()
 Decrements the active camera index to the previous one. If the active camera index is at 0, it cycles forward to the last index. Returns the active index after increment. More...
 
void removeCamera (CameraDescription *camera)
 
bool removeCameraViewFromName (const agx::String &name)
 Remove a loaded camera view given an string identifier. Returns false if not found, true if found and deleted. More...
 
bool renameCameraDescription (const agx::String &oldname, const agx::String &newName)
 Tries to rename a camera description given a name identifier. Returns false if no camera description of that name exists in the set. More...
 
void setActiveCameraViewIndex (agx::UInt index)
 Sets the active camera view index. If the index is out of bounds, nothing happens. More...
 
bool setActiveViewFromName (const agx::String &name)
 Set active view in manager from name. Returns false if not found, true if found and deleted. More...
 
agx::String toString ()
 Print the set. More...
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor. More...
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object. More...
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Protected Member Functions

virtual ~CameraDescriptionSet ()
 Destructor. More...
 
bool getIndexFromCamera (CameraDescription *camera, agx::UInt &index)
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Protected Attributes

agx::UInt m_activeCameraIndex
 
CameraDescriptionList m_cameraDescriptionContainer
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Detailed Description

CameraViewSet is a class that handles and manages a set of cameras that the user should be able to switch between in the active scene Different Cameras can be stored to the active set while looking at the scene for future references.

This class serves as a container and manager for the different types of views that the user want to store

TODO - nextCam.., prevCam.. should reutrn a descirption instead of index. Should only expose index at getCameraDescription().

Definition at line 59 of file CameraViewSet.h.

Constructor & Destructor Documentation

◆ CameraDescriptionSet()

agxQt::CameraDescriptionSet::CameraDescriptionSet ( )

Constructor.

◆ ~CameraDescriptionSet()

virtual agxQt::CameraDescriptionSet::~CameraDescriptionSet ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ addCamera()

void agxQt::CameraDescriptionSet::addCamera ( CameraDescription *  camera)

Add/Remove a camera to the camera set.

◆ containsCameraDescription()

bool agxQt::CameraDescriptionSet::containsCameraDescription ( const CameraDescription *  camera)

Check if the camera is contained in the set.

◆ getActiveCameraDescription()

CameraDescription* agxQt::CameraDescriptionSet::getActiveCameraDescription ( )

Returns the active camera description in the set.

◆ getActiveCameraIndex()

agx::UInt agxQt::CameraDescriptionSet::getActiveCameraIndex ( )

Get the active camera index in the set.

◆ getCameraDescription()

CameraDescription* agxQt::CameraDescriptionSet::getCameraDescription ( const agx::UInt &  index)

Gets the camera description given an index.

◆ getCameraDescriptionFromName()

CameraDescription* agxQt::CameraDescriptionSet::getCameraDescriptionFromName ( const agx::String &  name)

Returns a camera description given a name.

◆ getCameraViewNames()

agx::Vector<agx::String> agxQt::CameraDescriptionSet::getCameraViewNames ( )

Get the names for all loaded views.

◆ getIndexFromCamera()

bool agxQt::CameraDescriptionSet::getIndexFromCamera ( CameraDescription *  camera,
agx::UInt &  index 
)
protected

◆ getNumberOfCameraDescriptions()

agx::UInt agxQt::CameraDescriptionSet::getNumberOfCameraDescriptions ( )

Returns the number of camera descriptions in the active set.

◆ nextCameraDescription()

agx::UInt agxQt::CameraDescriptionSet::nextCameraDescription ( )

Increments the active camera index to the next one. If the active camera index is at max, it cycles back to the first index. Returns the active index after increment.

◆ previousCameraDescription()

agx::UInt agxQt::CameraDescriptionSet::previousCameraDescription ( )

Decrements the active camera index to the previous one. If the active camera index is at 0, it cycles forward to the last index. Returns the active index after increment.

◆ removeCamera()

void agxQt::CameraDescriptionSet::removeCamera ( CameraDescription *  camera)

◆ removeCameraViewFromName()

bool agxQt::CameraDescriptionSet::removeCameraViewFromName ( const agx::String &  name)

Remove a loaded camera view given an string identifier. Returns false if not found, true if found and deleted.

◆ renameCameraDescription()

bool agxQt::CameraDescriptionSet::renameCameraDescription ( const agx::String &  oldname,
const agx::String &  newName 
)

Tries to rename a camera description given a name identifier. Returns false if no camera description of that name exists in the set.

◆ setActiveCameraViewIndex()

void agxQt::CameraDescriptionSet::setActiveCameraViewIndex ( agx::UInt  index)

Sets the active camera view index. If the index is out of bounds, nothing happens.

◆ setActiveViewFromName()

bool agxQt::CameraDescriptionSet::setActiveViewFromName ( const agx::String &  name)

Set active view in manager from name. Returns false if not found, true if found and deleted.

◆ toString()

agx::String agxQt::CameraDescriptionSet::toString ( )

Print the set.

Member Data Documentation

◆ m_activeCameraIndex

agx::UInt agxQt::CameraDescriptionSet::m_activeCameraIndex
protected

Definition at line 125 of file CameraViewSet.h.

◆ m_cameraDescriptionContainer

CameraDescriptionList agxQt::CameraDescriptionSet::m_cameraDescriptionContainer
protected

Definition at line 124 of file CameraViewSet.h.


The documentation for this class was generated from the following file: