|
AGXDynamics
2.31.1.0
|
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... | |
| 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 |
| 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... | |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. 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 | 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 | 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... | |
| 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... | |
Static Public Member Functions | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Protected Member Functions | |
| virtual | ~CameraDescriptionSet () |
| Destructor. More... | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
| bool | getIndexFromCamera (CameraDescription *camera, agx::UInt &index) |
Static Protected Member Functions | |
| 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... | |
Protected Attributes | |
| agx::UInt | m_activeCameraIndex |
| CameraDescriptionList | m_cameraDescriptionContainer |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
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.
| agxQt::CameraDescriptionSet::CameraDescriptionSet | ( | ) |
Constructor.
|
protectedvirtual |
Destructor.
| void agxQt::CameraDescriptionSet::addCamera | ( | CameraDescription * | camera | ) |
Add/Remove a camera to the camera set.
|
protectedinherited |
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), agx::InternalData::getOrCreate(), and agx::InternalData::hasData().
|
inherited |
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
| bool agxQt::CameraDescriptionSet::containsCameraDescription | ( | const CameraDescription * | camera | ) |
Check if the camera is contained in the set.
|
protectedinherited |
| CameraDescription* agxQt::CameraDescriptionSet::getActiveCameraDescription | ( | ) |
Returns the active camera description in the set.
| agx::UInt agxQt::CameraDescriptionSet::getActiveCameraIndex | ( | ) |
Get the active camera index in the set.
| CameraDescription* agxQt::CameraDescriptionSet::getCameraDescription | ( | const agx::UInt & | index | ) |
Gets the camera description given an index.
| CameraDescription* agxQt::CameraDescriptionSet::getCameraDescriptionFromName | ( | const agx::String & | name | ) |
Returns a camera description given a name.
| agx::Vector<agx::String> agxQt::CameraDescriptionSet::getCameraViewNames | ( | ) |
Get the names for all loaded views.
|
staticprotectedinherited |
|
protected |
| agx::UInt agxQt::CameraDescriptionSet::getNumberOfCameraDescriptions | ( | ) |
Returns the number of camera descriptions in the active set.
|
inherited |
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::EntityStorage::getInstances(), and agx::Object::getResource().
| 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.
| 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.
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
This method should be used with care, always balanced with the same number of calls to unreference.
| void agxQt::CameraDescriptionSet::removeCamera | ( | CameraDescription * | camera | ) |
| 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.
| 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.
Sets the active camera view index. If the index is out of bounds, nothing happens.
| 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.
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
| agx::String agxQt::CameraDescriptionSet::toString | ( | ) |
Print the set.
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
This method should be used with care, always balanced with the same number of calls to reference.
Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
|
staticinherited |
|
protected |
Definition at line 125 of file CameraViewSet.h.
|
protected |
Definition at line 124 of file CameraViewSet.h.
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.