Signals | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Slots | Private Attributes
rviz::ViewController Class Reference

#include <view_controller.h>

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

List of all members.

Signals

void configChanged ()

Public Member Functions

void activate ()
 Called by RenderPanel when this view controller is about to be used.
void emitConfigChanged ()
 Subclasses should call this whenever a change is made which would change the results of toString().
Ogre::Camera * getCamera () const
virtual QString getClassId () const
 Return the class identifier which was used to create this instance. This version just returns whatever was set with setClassId().
virtual QCursor getCursor ()
virtual QVariant getViewData (int column, int role) const
 Overridden from Property to give a different background color and bold font if this view is active.
virtual Qt::ItemFlags getViewFlags (int column) const
 Overridden from Property to make this draggable if it is not active.
virtual void handleKeyEvent (QKeyEvent *event, RenderPanel *panel)
 Called by MoveTool and InteractionTool when keyboard events are passed to them.
virtual void handleMouseEvent (ViewportMouseEvent &evt)
void initialize (DisplayContext *context)
 Do all setup that can't be done in the constructor.
bool isActive () const
virtual void load (const Config &config)
 Load the value of this property and/or its children from the given Config reference.
void lookAt (float x, float y, float z)
 Convenience function which calls lookAt(Ogre::Vector3).
virtual void lookAt (const Ogre::Vector3 &point)
 This should be implemented in each subclass to aim the camera at the given point in space (relative to the fixed frame).
virtual void mimic (ViewController *source_view)
 Configure the settings of this view controller to give, as much as possible, a similar view as that given by the source_view.
virtual void reset ()=0
virtual void save (Config config) const
 Write the value of this property and/or its children into the given Config reference.
virtual void setClassId (const QString &class_id)
 Set the class identifier used to create this instance. Typically this will be set by the factory object which created it.
virtual void transitionFrom (ViewController *previous_view)
 Called by ViewManager when this ViewController is being made current.
virtual void update (float dt, float ros_dt)
 Called at 30Hz by ViewManager::update() while this view is active. Override with code that needs to run repeatedly.
 ViewController ()
virtual ~ViewController ()

Static Public Member Functions

static QString formatClassId (const QString &class_id)

Protected Types

enum  CursorType {
  Default, Rotate2D, Rotate3D, MoveXY,
  MoveZ, Zoom, Crosshair
}

Protected Member Functions

virtual void onActivate ()
 called by activate().
virtual void onInitialize ()
 Do subclass-specific initialization. Called by ViewController::initialize after context_ and camera_ are set. Default implementation does nothing.
void setCursor (CursorType cursor_type)
void setCursor (QCursor cursor)
void setStatus (const QString &message)

Protected Attributes

Ogre::Camera * camera_
DisplayContextcontext_
QCursor cursor_
bool is_active_
FloatPropertynear_clip_property_
BoolPropertystereo_enable_
FloatPropertystereo_eye_separation_
BoolPropertystereo_eye_swap_
FloatPropertystereo_focal_distance_

Private Slots

void updateNearClipDistance ()
void updateStereoProperties ()

Private Attributes

QString class_id_
QMap< CursorType, QCursor > standard_cursors_
EnumPropertytype_property_

Detailed Description

Definition at line 58 of file view_controller.h.


Member Enumeration Documentation

Enumerator:
Default 
Rotate2D 
Rotate3D 
MoveXY 
MoveZ 
Zoom 
Crosshair 

Definition at line 173 of file view_controller.h.


Constructor & Destructor Documentation

Definition at line 56 of file view_controller.cpp.

Definition at line 120 of file view_controller.cpp.


Member Function Documentation

Called by RenderPanel when this view controller is about to be used.

There is no deactivate() because ViewControllers leaving "current" are destroyed. Put any cleanup in the destructor.

Definition at line 179 of file view_controller.cpp.

Subclasses should call this whenever a change is made which would change the results of toString().

Definition at line 185 of file view_controller.cpp.

QString rviz::ViewController::formatClassId ( const QString &  class_id) [static]

Definition at line 125 of file view_controller.cpp.

Ogre::Camera* rviz::ViewController::getCamera ( ) const [inline]

Definition at line 133 of file view_controller.h.

virtual QString rviz::ViewController::getClassId ( ) const [inline, virtual]

Return the class identifier which was used to create this instance. This version just returns whatever was set with setClassId().

Definition at line 138 of file view_controller.h.

virtual QCursor rviz::ViewController::getCursor ( ) [inline, virtual]
Returns:
A mouse cursor representing the current state

Definition at line 150 of file view_controller.h.

QVariant rviz::ViewController::getViewData ( int  column,
int  role 
) const [virtual]

Overridden from Property to give a different background color and bold font if this view is active.

Reimplemented from rviz::Property.

Definition at line 141 of file view_controller.cpp.

Qt::ItemFlags rviz::ViewController::getViewFlags ( int  column) const [virtual]

Overridden from Property to make this draggable if it is not active.

Reimplemented from rviz::Property.

Definition at line 167 of file view_controller.cpp.

void rviz::ViewController::handleKeyEvent ( QKeyEvent *  event,
RenderPanel panel 
) [virtual]

Called by MoveTool and InteractionTool when keyboard events are passed to them.

The default implementation here handles the "F" (focus on object) and "Z" (zero - reset) keys.

Definition at line 210 of file view_controller.cpp.

virtual void rviz::ViewController::handleMouseEvent ( ViewportMouseEvent evt) [inline, virtual]

Do all setup that can't be done in the constructor.

Creates camera_ and attaches it to the root scene node.

Calls onInitialize() just before returning.

Definition at line 84 of file view_controller.cpp.

bool rviz::ViewController::isActive ( ) const [inline]

Definition at line 147 of file view_controller.h.

void rviz::ViewController::load ( const Config config) [virtual]

Load the value of this property and/or its children from the given Config reference.

Reimplemented from rviz::Property.

Reimplemented in rviz::FailedViewController.

Definition at line 190 of file view_controller.cpp.

void rviz::ViewController::lookAt ( float  x,
float  y,
float  z 
)

Convenience function which calls lookAt(Ogre::Vector3).

Definition at line 237 of file view_controller.cpp.

virtual void rviz::ViewController::lookAt ( const Ogre::Vector3 point) [inline, virtual]

This should be implemented in each subclass to aim the camera at the given point in space (relative to the fixed frame).

Reimplemented in rviz::OrbitViewController, rviz::FailedViewController, rviz::FPSViewController, rviz::ThirdPersonFollowerViewController, rviz::XYOrbitViewController, and rviz::FixedOrientationOrthoViewController.

Definition at line 105 of file view_controller.h.

virtual void rviz::ViewController::mimic ( ViewController source_view) [inline, virtual]

Configure the settings of this view controller to give, as much as possible, a similar view as that given by the source_view.

source_view must return a valid Ogre::Camera* from getCamera().

This base class implementation does nothing.

Reimplemented in rviz::OrbitViewController, rviz::FramePositionTrackingViewController, rviz::FPSViewController, rviz::ThirdPersonFollowerViewController, rviz::FixedOrientationOrthoViewController, and rviz::XYOrbitViewController.

Definition at line 118 of file view_controller.h.

virtual void rviz::ViewController::onActivate ( ) [inline, protected, virtual]

called by activate().

Override to implement view-specific activation. This base implementation does nothing.

Reimplemented in rviz::FramePositionTrackingViewController, and rviz::FailedViewController.

Definition at line 170 of file view_controller.h.

virtual void rviz::ViewController::onInitialize ( ) [inline, protected, virtual]

Do subclass-specific initialization. Called by ViewController::initialize after context_ and camera_ are set. Default implementation does nothing.

Reimplemented in rviz::OrbitViewController, rviz::FramePositionTrackingViewController, rviz::ThirdPersonFollowerViewController, rviz::FPSViewController, rviz::XYOrbitViewController, and rviz::FixedOrientationOrthoViewController.

Definition at line 164 of file view_controller.h.

virtual void rviz::ViewController::reset ( ) [pure virtual]

Reset the view controller to some sane initial state, like looking at 0,0,0 from a few meters away.

Implemented in rviz::OrbitViewController, rviz::FailedViewController, rviz::FPSViewController, and rviz::FixedOrientationOrthoViewController.

void rviz::ViewController::save ( Config  config) const [virtual]

Write the value of this property and/or its children into the given Config reference.

Reimplemented from rviz::Property.

Reimplemented in rviz::FailedViewController.

Definition at line 202 of file view_controller.cpp.

virtual void rviz::ViewController::setClassId ( const QString &  class_id) [inline, virtual]

Set the class identifier used to create this instance. Typically this will be set by the factory object which created it.

Definition at line 142 of file view_controller.h.

void rviz::ViewController::setCursor ( CursorType  cursor_type) [protected]

Definition at line 232 of file view_controller.cpp.

void rviz::ViewController::setCursor ( QCursor  cursor) [inline, protected]

Definition at line 177 of file view_controller.h.

void rviz::ViewController::setStatus ( const QString &  message) [protected]

Definition at line 243 of file view_controller.cpp.

virtual void rviz::ViewController::transitionFrom ( ViewController previous_view) [inline, virtual]

Called by ViewManager when this ViewController is being made current.

Parameters:
previous_viewis the previous "current" view, and will not be NULL.

This gives ViewController subclasses an opportunity to implement a smooth transition from a previous viewpoint to the new viewpoint.

This base class implementation does nothing.

Definition at line 128 of file view_controller.h.

virtual void rviz::ViewController::update ( float  dt,
float  ros_dt 
) [inline, virtual]

Called at 30Hz by ViewManager::update() while this view is active. Override with code that needs to run repeatedly.

Reimplemented in rviz::OrbitViewController, rviz::FPSViewController, rviz::FixedOrientationOrthoViewController, and rviz::FramePositionTrackingViewController.

Definition at line 89 of file view_controller.h.

Definition at line 251 of file view_controller.cpp.

Definition at line 257 of file view_controller.cpp.


Member Data Documentation

Ogre::Camera* rviz::ViewController::camera_ [protected]

Definition at line 180 of file view_controller.h.

Definition at line 200 of file view_controller.h.

Definition at line 179 of file view_controller.h.

QCursor rviz::ViewController::cursor_ [protected]

Definition at line 187 of file view_controller.h.

Definition at line 182 of file view_controller.h.

Definition at line 189 of file view_controller.h.

Definition at line 203 of file view_controller.h.

Definition at line 190 of file view_controller.h.

Definition at line 192 of file view_controller.h.

Definition at line 191 of file view_controller.h.

Definition at line 193 of file view_controller.h.

Definition at line 199 of file view_controller.h.


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


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Thu Jun 6 2019 18:02:17