RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
CameraController Class Referenceabstract

an interface for controlling the camera using a mouse. More...

#include <CameraController.hpp>

Inherited by ArcBallController, and FixedAxisController.

Public Types

typedef rw::core::Ptr< CameraControllerPtr
 smart pointer type of this class
 

Public Member Functions

virtual ~CameraController ()
 destructor
 
virtual void setBounds (double NewWidth, double NewHeight)=0
 set the bounds that define the area where the 2d point is valid. The bound is defined in a plane with [0,width] and [0,height]. Where (0,0) is the upper left corner of the plane. More...
 
virtual void setCenter (const rw::math::Vector3D<> &center, const rw::math::Vector2D<> &screenCenter)=0
 update the center of rotation and screen center More...
 
virtual void handleEvent (QEvent *event)=0
 event handler, typically mouse and keyboard More...
 
virtual void setTransform (const rw::math::Transform3D<> &t3d)=0
 set world to camera transformation More...
 
virtual rw::math::Transform3D getTransform () const =0
 get the current world to camera transformation More...
 
virtual rw::math::Vector3D getCenter ()=0
 get the current pivot point in world coordinates More...
 
virtual void draw ()=0
 draw the camera control.
 
virtual void zoom (double amount)=0
 Zoom by amount specified by amount. More...
 
virtual void autoZoom (rw::core::Ptr< rw::models::WorkCell > workcell, rw::core::Ptr< const rw::kinematics::State > state, double fovy, double aspectRatio)=0
 Zooms the camera to fit all devices into the camera view. More...
 
virtual void setZoomTarget (rw::math::Vector3D< double > target, bool enable=true)
 set the 3D coordinate that should be zoomed towards. More...
 
virtual void setPanTarget (rw::math::Vector3D< double > target, bool enable=true)
 set the 3D coordinate that should be moved. More...
 
virtual rw::math::Vector3D getPanTarget ()
 get the 3D coordinate that should be moved. More...
 
virtual void setDrawable (rw::graphics::DrawableNode::Ptr obj)
 add a drawable to the camera controller More...
 

Detailed Description

an interface for controlling the camera using a mouse.

Member Function Documentation

◆ autoZoom()

virtual void autoZoom ( rw::core::Ptr< rw::models::WorkCell workcell,
rw::core::Ptr< const rw::kinematics::State state,
double  fovy,
double  aspectRatio 
)
pure virtual

Zooms the camera to fit all devices into the camera view.

Useful when working with robots smaller or larger than standard. Calling this method moves the camera along its Z-axis.

Parameters
workcell[in] The autozoom functions fits all frames of workcell in the viewport
state[in] state with the current positions of the frames. If NULL, the default workcell state is used.
fovy[in] the field of view in the vertical direction (in radians).
aspectRatio[in] the aspect ratio of (width divided by height).

Implemented in ArcBallController.

◆ getCenter()

virtual rw::math::Vector3D getCenter ( )
pure virtual

get the current pivot point in world coordinates

Returns
current pivot point

Implemented in FixedAxisController, and ArcBallController.

◆ getPanTarget()

virtual rw::math::Vector3D getPanTarget ( )
inlinevirtual

get the 3D coordinate that should be moved.

Returns
the target position to move.

Reimplemented in ArcBallController.

◆ getTransform()

virtual rw::math::Transform3D getTransform ( ) const
pure virtual

get the current world to camera transformation

Returns
world to camera transformation

Implemented in FixedAxisController, and ArcBallController.

◆ handleEvent()

virtual void handleEvent ( QEvent *  event)
pure virtual

event handler, typically mouse and keyboard

Parameters
event[in] the specific event

Implemented in FixedAxisController, and ArcBallController.

◆ setBounds()

virtual void setBounds ( double  NewWidth,
double  NewHeight 
)
pure virtual

set the bounds that define the area where the 2d point is valid. The bound is defined in a plane with [0,width] and [0,height]. Where (0,0) is the upper left corner of the plane.

Parameters
NewWidth[in] width
NewHeight[in] height

Implemented in ArcBallController.

◆ setCenter()

virtual void setCenter ( const rw::math::Vector3D<> &  center,
const rw::math::Vector2D<> &  screenCenter 
)
pure virtual

update the center of rotation and screen center

Parameters
center[in] center of rotation in world coordinates
screenCenter[in] center of rotation in screen coordinates

Implemented in FixedAxisController, and ArcBallController.

◆ setDrawable()

virtual void setDrawable ( rw::graphics::DrawableNode::Ptr  obj)
inlinevirtual

add a drawable to the camera controller

Parameters
obj[in] a drawable to be controled by the camera controller

Reimplemented in ArcBallController.

◆ setPanTarget()

virtual void setPanTarget ( rw::math::Vector3D< double >  target,
bool  enable = true 
)
inlinevirtual

set the 3D coordinate that should be moved.

Parameters
target[in] the target position to move.
enable[in] enable or disable pan with pantarget.

Reimplemented in ArcBallController.

◆ setTransform()

virtual void setTransform ( const rw::math::Transform3D<> &  t3d)
pure virtual

set world to camera transformation

Parameters
t3d[in] world to camera transformation

Implemented in FixedAxisController, and ArcBallController.

◆ setZoomTarget()

virtual void setZoomTarget ( rw::math::Vector3D< double >  target,
bool  enable = true 
)
inlinevirtual

set the 3D coordinate that should be zoomed towards.

Parameters
target[in] the target position to zoom towards.
enable[in] enable or disable zoom with zoomtarget.

Reimplemented in ArcBallController.

◆ zoom()

virtual void zoom ( double  amount)
pure virtual

Zoom by amount specified by amount.

Calling this method moves the camera along its Z-axis.

Parameters
amount[in] Meters to zoom the camera

Implemented in ArcBallController.


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