Public Member Functions | Protected Attributes | List of all members
rviz::CameraBase Class Referenceabstract

Generic interface for a camera. More...

#include <camera_base.h>

Inheritance diagram for rviz::CameraBase:
Inheritance graph
[legend]

Public Member Functions

 CameraBase (Ogre::SceneManager *scene_manager)
 Constructor. More...
 
virtual void fromString (const std::string &str)=0
 Loads the camera's configure from the supplied string (generated through toString()) More...
 
Ogre::Camera * getOgreCamera ()
 Get the Ogre camera associated with this camera object. More...
 
virtual Ogre::Quaternion getOrientation ()=0
 Get the orientation of this camera. More...
 
virtual Ogre::Vector3 getPosition ()=0
 Get the position of this camera. More...
 
virtual void lookAt (const Ogre::Vector3 &point)=0
 Point the camera at the specified point. More...
 
virtual void mouseLeftDown (int, int)
 
virtual void mouseLeftDrag (int diff_x, int diff_y, bool ctrl, bool alt, bool shift)=0
 Handle a left mouse button drag. More...
 
virtual void mouseLeftUp (int, int)
 
virtual void mouseMiddleDown (int, int)
 
virtual void mouseMiddleDrag (int diff_x, int diff_y, bool ctrl, bool alt, bool shift)=0
 Handle a middle mouse button drag. More...
 
virtual void mouseMiddleUp (int, int)
 
virtual void mouseRightDown (int, int)
 
virtual void mouseRightDrag (int diff_x, int diff_y, bool ctrl, bool alt, bool shift)=0
 Handle a right mouse button drag. More...
 
virtual void mouseRightUp (int, int)
 
virtual void move (float x, float y, float z)=0
 Move the camera relative to its orientation. More...
 
virtual void pitch (float angle)=0
 Pitch the camera. More...
 
virtual void relativeNodeChanged ()
 Called when the relative node changes. More...
 
virtual void roll (float angle)=0
 Roll the camera. More...
 
virtual void scrollWheel (int diff, bool ctrl, bool alt, bool shift)=0
 Handle a scrollwheel change. More...
 
virtual void setFrom (CameraBase *camera)=0
 Set the position/orientation of this camera from another camera. More...
 
virtual void setOrientation (const Ogre::Quaternion &orientation)
 Set the orientation of the camera. More...
 
virtual void setOrientation (float x, float y, float z, float w)=0
 Set the orientation of the camera from a quaternion. More...
 
virtual void setPosition (const Ogre::Vector3 &position)
 Set the position of the camera. More...
 
virtual void setPosition (float x, float y, float z)=0
 Set the position of the camera. More...
 
void setRelativeNode (Ogre::SceneNode *node)
 Set a scene node that all camera transformations should be relative to. More...
 
virtual std::string toString ()=0
 Returns a string representation of the camera's configuration. More...
 
virtual void update ()=0
 
virtual void yaw (float angle)=0
 Yaw the camera. More...
 
virtual ~CameraBase ()
 

Protected Attributes

Ogre::Camera * camera_
 Ogre camera associated with this camera object. More...
 
Ogre::SceneNode * relative_node_
 
Ogre::SceneManager * scene_manager_
 Scene manager this camera is part of. More...
 

Detailed Description

Generic interface for a camera.

Provides a interface that a camera can override, providing interchangeability between different camera types. Specific implementation is left to the child class.

Definition at line 53 of file camera_base.h.

Constructor & Destructor Documentation

◆ CameraBase()

rviz::CameraBase::CameraBase ( Ogre::SceneManager *  scene_manager)

Constructor.

Parameters
scene_managerScene manager this camera is displaying

Definition at line 43 of file camera_base.cpp.

◆ ~CameraBase()

rviz::CameraBase::~CameraBase ( )
virtual

Definition at line 52 of file camera_base.cpp.

Member Function Documentation

◆ fromString()

virtual void rviz::CameraBase::fromString ( const std::string &  str)
pure virtual

Loads the camera's configure from the supplied string (generated through toString())

Parameters
strThe string to load from

Implemented in rviz::OrbitCamera.

◆ getOgreCamera()

Ogre::Camera* rviz::CameraBase::getOgreCamera ( )
inline

Get the Ogre camera associated with this camera object.

Returns
The Ogre camera associated with this camera object

Definition at line 67 of file camera_base.h.

◆ getOrientation()

virtual Ogre::Quaternion rviz::CameraBase::getOrientation ( )
pure virtual

Get the orientation of this camera.

Returns
The orientation of this camera

Implemented in rviz::OrbitCamera.

◆ getPosition()

virtual Ogre::Vector3 rviz::CameraBase::getPosition ( )
pure virtual

Get the position of this camera.

Returns
The position of this camera

Implemented in rviz::OrbitCamera.

◆ lookAt()

virtual void rviz::CameraBase::lookAt ( const Ogre::Vector3 &  point)
pure virtual

Point the camera at the specified point.

Parameters
pointThe point to look at

Implemented in rviz::OrbitCamera.

◆ mouseLeftDown()

virtual void rviz::CameraBase::mouseLeftDown ( int  ,
int   
)
inlinevirtual

Reimplemented in rviz::OrbitCamera.

Definition at line 177 of file camera_base.h.

◆ mouseLeftDrag()

virtual void rviz::CameraBase::mouseLeftDrag ( int  diff_x,
int  diff_y,
bool  ctrl,
bool  alt,
bool  shift 
)
pure virtual

Handle a left mouse button drag.

Parameters
diff_xPixels the mouse has moved in the (window space) x direction
diff_yPixels the mouse has moved in the (window space) y direction

Implemented in rviz::OrbitCamera.

◆ mouseLeftUp()

virtual void rviz::CameraBase::mouseLeftUp ( int  ,
int   
)
inlinevirtual

Reimplemented in rviz::OrbitCamera.

Definition at line 186 of file camera_base.h.

◆ mouseMiddleDown()

virtual void rviz::CameraBase::mouseMiddleDown ( int  ,
int   
)
inlinevirtual

Reimplemented in rviz::OrbitCamera.

Definition at line 180 of file camera_base.h.

◆ mouseMiddleDrag()

virtual void rviz::CameraBase::mouseMiddleDrag ( int  diff_x,
int  diff_y,
bool  ctrl,
bool  alt,
bool  shift 
)
pure virtual

Handle a middle mouse button drag.

Parameters
diff_xPixels the mouse has moved in the (window space) x direction
diff_yPixels the mouse has moved in the (window space) y direction

Implemented in rviz::OrbitCamera.

◆ mouseMiddleUp()

virtual void rviz::CameraBase::mouseMiddleUp ( int  ,
int   
)
inlinevirtual

Reimplemented in rviz::OrbitCamera.

Definition at line 189 of file camera_base.h.

◆ mouseRightDown()

virtual void rviz::CameraBase::mouseRightDown ( int  ,
int   
)
inlinevirtual

Reimplemented in rviz::OrbitCamera.

Definition at line 183 of file camera_base.h.

◆ mouseRightDrag()

virtual void rviz::CameraBase::mouseRightDrag ( int  diff_x,
int  diff_y,
bool  ctrl,
bool  alt,
bool  shift 
)
pure virtual

Handle a right mouse button drag.

Parameters
diff_xPixels the mouse has moved in the (window space) x direction
diff_yPixels the mouse has moved in the (window space) y direction

Implemented in rviz::OrbitCamera.

◆ mouseRightUp()

virtual void rviz::CameraBase::mouseRightUp ( int  ,
int   
)
inlinevirtual

Reimplemented in rviz::OrbitCamera.

Definition at line 192 of file camera_base.h.

◆ move()

virtual void rviz::CameraBase::move ( float  x,
float  y,
float  z 
)
pure virtual

Move the camera relative to its orientation.

Parameters
xDistance to move along the X-axis
yDistance to move along the Y-axis
zDistance to move along the Z-axis

Implemented in rviz::OrbitCamera.

◆ pitch()

virtual void rviz::CameraBase::pitch ( float  angle)
pure virtual

Pitch the camera.

Calls to pitch are cumulative, so: pitch(PI); pitch(PI);

is equivalent to pitch(2*PI);

Parameters
angleAngle to pitch, in radians

Implemented in rviz::OrbitCamera.

◆ relativeNodeChanged()

virtual void rviz::CameraBase::relativeNodeChanged ( )
inlinevirtual

Called when the relative node changes.

Definition at line 80 of file camera_base.h.

◆ roll()

virtual void rviz::CameraBase::roll ( float  angle)
pure virtual

Roll the camera.

Calls to roll are cumulative, so: roll(PI); roll(PI);

is equivalent to roll(2*PI);

Parameters
angleAngle to roll, in radians

Implemented in rviz::OrbitCamera.

◆ scrollWheel()

virtual void rviz::CameraBase::scrollWheel ( int  diff,
bool  ctrl,
bool  alt,
bool  shift 
)
pure virtual

Handle a scrollwheel change.

Parameters
diffNumber of "units" the scrollwheel has moved
Todo:
Probably need to pass in how many units there are in a "click" of the wheel

Implemented in rviz::OrbitCamera.

◆ setFrom()

virtual void rviz::CameraBase::setFrom ( CameraBase camera)
pure virtual

Set the position/orientation of this camera from another camera.

Parameters
cameraThe camera to set from

Implemented in rviz::OrbitCamera.

◆ setOrientation() [1/2]

void rviz::CameraBase::setOrientation ( const Ogre::Quaternion &  orientation)
virtual

Set the orientation of the camera.

Definition at line 71 of file camera_base.cpp.

◆ setOrientation() [2/2]

virtual void rviz::CameraBase::setOrientation ( float  x,
float  y,
float  z,
float  w 
)
pure virtual

Set the orientation of the camera from a quaternion.

Implemented in rviz::OrbitCamera.

◆ setPosition() [1/2]

void rviz::CameraBase::setPosition ( const Ogre::Vector3 &  position)
virtual

Set the position of the camera.

Definition at line 66 of file camera_base.cpp.

◆ setPosition() [2/2]

virtual void rviz::CameraBase::setPosition ( float  x,
float  y,
float  z 
)
pure virtual

Set the position of the camera.

Implemented in rviz::OrbitCamera.

◆ setRelativeNode()

void rviz::CameraBase::setRelativeNode ( Ogre::SceneNode *  node)

Set a scene node that all camera transformations should be relative to.

Parameters
nodeThe node

Definition at line 57 of file camera_base.cpp.

◆ toString()

virtual std::string rviz::CameraBase::toString ( )
pure virtual

Returns a string representation of the camera's configuration.

Implemented in rviz::OrbitCamera.

◆ update()

virtual void rviz::CameraBase::update ( )
pure virtual

Implemented in rviz::OrbitCamera.

◆ yaw()

virtual void rviz::CameraBase::yaw ( float  angle)
pure virtual

Yaw the camera.

Calls to yaw are cumulative, so: yaw(PI); yaw(PI);

is equivalent to yaw(2*PI);

Parameters
angleAngle to yaw, in radians

Implemented in rviz::OrbitCamera.

Member Data Documentation

◆ camera_

Ogre::Camera* rviz::CameraBase::camera_
protected

Ogre camera associated with this camera object.

Definition at line 236 of file camera_base.h.

◆ relative_node_

Ogre::SceneNode* rviz::CameraBase::relative_node_
protected

Definition at line 239 of file camera_base.h.

◆ scene_manager_

Ogre::SceneManager* rviz::CameraBase::scene_manager_
protected

Scene manager this camera is part of.

Definition at line 237 of file camera_base.h.


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


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Sat May 27 2023 02:06:25