17 #ifndef AGXQT_CAMERAVIEWSET_H
18 #define AGXQT_CAMERAVIEWSET_H
26 #define DEFAULT_CAMERADESCRIPTION_FOV 30.0
47 class CameraDescription;
48 class CameraDescriptionSet;
#define AGX_DECLARE_POINTER_TYPES(type)
CameraViewSet is a class that handles and manages a set of cameras that the user should be able to sw...
virtual ~CameraDescriptionSet()
Destructor.
agx::String toString()
Print the set.
agx::UInt m_activeCameraIndex
CameraDescriptionSet()
Constructor.
CameraDescription * getActiveCameraDescription()
Returns the active camera description in the set.
bool removeCameraViewFromName(const agx::String &name)
Remove a loaded camera view given an string identifier. Returns false if not found,...
agx::UInt nextCameraDescription()
Increments the active camera index to the next one. If the active camera index is at max,...
agx::UInt getActiveCameraIndex()
Get the active camera index in the set.
void addCamera(CameraDescription *camera)
Add/Remove a camera to the camera set.
void removeCamera(CameraDescription *camera)
void setActiveCameraViewIndex(agx::UInt index)
Sets the active camera view index. If the index is out of bounds, nothing happens.
agx::Vector< agx::String > getCameraViewNames()
Get the names for all loaded views.
bool containsCameraDescription(const CameraDescription *camera)
Check if the camera is contained in the set.
CameraDescription * getCameraDescriptionFromName(const agx::String &name)
Returns a camera description given a name.
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 ...
agx::UInt getNumberOfCameraDescriptions()
Returns the number of camera descriptions in the active set.
bool getIndexFromCamera(CameraDescription *camera, agx::UInt &index)
agx::UInt previousCameraDescription()
Decrements the active camera index to the previous one. If the active camera index is at 0,...
CameraDescriptionList m_cameraDescriptionContainer
CameraDescription * getCameraDescription(const agx::UInt &index)
Gets the camera description given an index.
bool setActiveViewFromName(const agx::String &name)
Set active view in manager from name. Returns false if not found, true if found and deleted.
Class that describes an abstract camera and it's properties.
const agx::String & getName() const
virtual ~CameraDescription()
Destructor.
const agx::Vec3 & getUp() const
Get up vector.
const agx::Vec3 & getEye() const
Get Eye vector.
const agx::String toString() const
Formats the description to a string.
CameraDescription()
Constructor.
const agx::Real getFov() const
Get Field of view.
agx::String m_name
Name of the camera description.
void setName(const agx::String &name)
Set name of the camera description.
const agx::Vec3 & getCenter() const
Get center.
bool isValid() const
Checks if the camera description is valid.
void setInformation(const agx::Vec3 &eye, const agx::Vec3 ¢er, const agx::Vec3 &up, agx::Real fov)
Set Camera information.
Manager class that acts as a wrapper container for the CameravViewset class for OSG based view system...
CameraDescriptionSet * getCameraDescriptionSet()
Returns the internal structure of the camera view set.
CameraDescriptionSetRef m_cameraSet
bool removeCameraViewFromName(const agx::String &name)
Remove a loaded camera view given an string identifier. Returns false if not found,...
virtual ~OsgCameraViewManager()
Default destructor.
agx::Vector< agx::String > getCameraViewNames()
Get the names for all loaded views.
void setViewOnOSGViewer(CameraDescription *c, osgViewer::Viewer *viewer)
agx::String getActiveCameraViewName() const
Returns the active view name.
void storeCurrentView(osgViewer::Viewer *viewer)
Stores the current view in osg viewer.
void setNextView(osgViewer::Viewer *viewer)
Toggles the next view in stored views and sets it to an osgViewer.
OsgCameraViewManager()
Default constructor.
void setPreviousView(osgViewer::Viewer *viewer)
Toggles a previous view in stored views and sets it to an osgViewer.
bool parseCameraState(agxCFG::ConfigScript *cfg, CameraDescription *c)
Tries to parse a camera state from the current position in the config script.
static CameraDescription * getCameraDescriptionFromOsgViewer(osgViewer::Viewer *viewer)
Utility method for converting osgViewer views to CameraViewDescriptions.
bool storeCameraState(agxCFG::ConfigScript *cfg, CameraDescription *c)
Stores the camera description in the in the current place in the configure script.
bool setActiveViewFromName(const agx::String &name)
Set active view in manager from name. Returns false if not found, true if found and deleted.
void setActiveView(osgViewer::Viewer *viewer)
Sets the active view in the manager an osgViewer.
bool restoreViewsetFromCFGFile(const agx::String &filename)
Restores the a view set from a .cfg file. Will overwrite the current view set in the manager.
bool storeViewsetAsCFGFile(const agx::String &filename)
Store the active configuration to a file.
Base class providing referencing counted objects.
AGXMODEL_EXPORT agx::Vec3 getCenter(const agxCollide::Mesh::Triangle &triangle)
Contains classes/utility functions for connecting AGX to QT with OSG.