Blue Brain BioExplorer
core::Camera Class Reference

The Camera class is an abstract interface for a camera in a 3D graphics application. It is defined by a position and a quaternion and inherits from the PropertyObject class. More...

#include <Camera.h>

Inheritance diagram for core::Camera:
Collaboration diagram for core::Camera:

Public Member Functions

PLATFORM_API Camera ()=default
 Default constructor. More...
 
virtual PLATFORM_API ~Camera ()=default
 Default destructor. More...
 
virtual PLATFORM_API void commit ()
 Commits any changes made to the camera object so that attributes become available to the rendering engine. More...
 
PLATFORM_API Cameraoperator= (const Camera &rhs)
 Copy constructor. More...
 
PLATFORM_API void set (const Vector3d &position, const Quaterniond &orientation, const Vector3d &target=Vector3d(0.0, 0.0, 0.0))
 Sets the position, orientation quaternion, and target of the camera. More...
 
PLATFORM_API void setInitialState (const Vector3d &position, const Quaterniond &orientation, const Vector3d &target=Vector3d(0.0, 0.0, 0.0))
 Sets the initial state of the camera. More...
 
PLATFORM_API void reset ()
 Resets the camera to its initial values. More...
 
PLATFORM_API void setPosition (const Vector3d &position)
 Sets the camera position. More...
 
PLATFORM_API void setTarget (const Vector3d &target)
 Sets the camera target. More...
 
PLATFORM_API const Vector3dgetPosition () const
 Gets the camera position. More...
 
PLATFORM_API const Vector3dgetTarget () const
 Gets the camera target. More...
 
PLATFORM_API void setOrientation (Quaterniond orientation)
 Sets the camera orientation quaternion. More...
 
PLATFORM_API const QuaterniondgetOrientation () const
 Gets the camera orientation quaternion. More...
 
PLATFORM_API void setBufferTarget (const std::string &target)
 Sets the name of the current rendered frame buffer. More...
 
PLATFORM_API const std::string & getBufferTarget () const
 Gets the name of the current rendered frame buffer. More...
 
PLATFORM_API void setEngine (Engine *engine)
 Set the Engine object. More...
 
- Public Member Functions inherited from core::PropertyObject
void setCurrentType (const std::string &type)
 
const std::string & getCurrentType () const
 
template<typename T >
void updateProperty (const std::string &name, const T &value, const bool triggerCallback=true)
 
bool hasProperty (const std::string &name) const
 
template<typename T >
getProperty (const std::string &name) const
 
template<typename T >
getPropertyOrValue (const std::string &name, T val) const
 
void setProperties (const PropertyMap &properties)
 
void setProperties (const std::string &type, const PropertyMap &properties)
 
void updateProperties (const PropertyMap &properties)
 
const auto & getPropertyMap () const
 
const auto & getPropertyMap (const std::string &type) const
 
strings getTypes () const
 
void clonePropertiesFrom (const PropertyObject &obj)
 
- Public Member Functions inherited from core::BaseObject
 BaseObject ()=default
 
virtual ~BaseObject ()=default
 
 BaseObject (const BaseObject &)
 
BaseObjectoperator= (const BaseObject &rhs)
 
bool isModified () const
 
void resetModified ()
 
void markModified (const bool triggerCallback=true)
 
void onModified (const ModifiedCallback &callback)
 
void clearModifiedCallback ()
 

Protected Attributes

Engine_engine {nullptr}
 
- Protected Attributes inherited from core::PropertyObject
std::string _currentType
 
std::map< std::string, PropertyMap_properties
 

Additional Inherited Members

- Public Types inherited from core::BaseObject
using ModifiedCallback = std::function< void(const BaseObject &)>
 
- Protected Member Functions inherited from core::BaseObject
template<typename T >
void _updateValue (T &member, const T &newValue, const bool triggerCallback=true)
 
template<class T >
bool _isEqual (const T &a, const T &b, typename std::enable_if< std::is_floating_point< T >::value >::type *=0)
 
template<class T >
bool _isEqual (const T &a, const T &b, typename std::enable_if<!std::is_floating_point< T >::value >::type *=0)
 

Detailed Description

The Camera class is an abstract interface for a camera in a 3D graphics application. It is defined by a position and a quaternion and inherits from the PropertyObject class.

Definition at line 40 of file Camera.h.

Constructor & Destructor Documentation

◆ Camera()

PLATFORM_API core::Camera::Camera ( )
default

Default constructor.

◆ ~Camera()

virtual PLATFORM_API core::Camera::~Camera ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ commit()

virtual PLATFORM_API void core::Camera::commit ( )
inlinevirtual

Commits any changes made to the camera object so that attributes become available to the rendering engine.

Reimplemented in core::engine::ospray::OSPRayCamera, and core::engine::optix::OptiXCamera.

Definition at line 57 of file Camera.h.

◆ getBufferTarget()

PLATFORM_API const std::string& core::Camera::getBufferTarget ( ) const
inline

Gets the name of the current rendered frame buffer.

Returns
The name of the frame buffer.

Definition at line 147 of file Camera.h.

◆ getOrientation()

PLATFORM_API const Quaterniond& core::Camera::getOrientation ( ) const
inline

Gets the camera orientation quaternion.

Returns
The orientation quaternion.

Definition at line 133 of file Camera.h.

◆ getPosition()

PLATFORM_API const Vector3d& core::Camera::getPosition ( ) const
inline

Gets the camera position.

Returns
The x, y, z coordinates of the camera position.

Definition at line 108 of file Camera.h.

◆ getTarget()

PLATFORM_API const Vector3d& core::Camera::getTarget ( ) const
inline

Gets the camera target.

Returns
The x, y, z coordinates of the camera target.

Definition at line 115 of file Camera.h.

◆ operator=()

Camera & core::Camera::operator= ( const Camera rhs)

Copy constructor.

Definition at line 28 of file Camera.cpp.

◆ reset()

void core::Camera::reset ( )

Resets the camera to its initial values.

Definition at line 60 of file Camera.cpp.

◆ set()

void core::Camera::set ( const Vector3d position,
const Quaterniond orientation,
const Vector3d target = Vector3d(0.0, 0.0, 0.0) 
)

Sets the position, orientation quaternion, and target of the camera.

Parameters
positionThe x, y, z coordinates of the camera position.
orientationThe x, y, z, w values of the quaternion describing the camera orientation.
targetThe x, y, z coordinates of the camera target.

Definition at line 44 of file Camera.cpp.

◆ setBufferTarget()

PLATFORM_API void core::Camera::setBufferTarget ( const std::string &  target)
inline

Sets the name of the current rendered frame buffer.

Parameters
targetThe name of the frame buffer.

Definition at line 140 of file Camera.h.

◆ setEngine()

PLATFORM_API void core::Camera::setEngine ( Engine engine)
inline

Set the Engine object.

Parameters
enginePointer to the engine object

Definition at line 154 of file Camera.h.

◆ setInitialState()

void core::Camera::setInitialState ( const Vector3d position,
const Quaterniond orientation,
const Vector3d target = Vector3d(0.0, 0.0, 0.0) 
)

Sets the initial state of the camera.

Parameters
positionThe x, y, z coordinates of the camera position.
orientationThe x, y, z, w values of the quaternion describing the camera orientation.
targetThe x, y, z coordinates of the camera target.

Definition at line 51 of file Camera.cpp.

◆ setOrientation()

PLATFORM_API void core::Camera::setOrientation ( Quaterniond  orientation)
inline

Sets the camera orientation quaternion.

Parameters
orientationThe orientation quaternion.

Definition at line 122 of file Camera.h.

◆ setPosition()

PLATFORM_API void core::Camera::setPosition ( const Vector3d position)
inline

Sets the camera position.

Parameters
positionThe x, y, z coordinates of the camera position.

Definition at line 94 of file Camera.h.

◆ setTarget()

PLATFORM_API void core::Camera::setTarget ( const Vector3d target)
inline

Sets the camera target.

Parameters
targetThe x, y, z coordinates of the camera target.

Definition at line 101 of file Camera.h.

Member Data Documentation

◆ _engine

Engine* core::Camera::_engine {nullptr}
protected

Definition at line 157 of file Camera.h.


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