#include <view_controller.h>
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_ |
DisplayContext * | context_ |
QCursor | cursor_ |
bool | is_active_ |
FloatProperty * | near_clip_property_ |
BoolProperty * | stereo_enable_ |
FloatProperty * | stereo_eye_separation_ |
BoolProperty * | stereo_eye_swap_ |
FloatProperty * | stereo_focal_distance_ |
Private Slots | |
void | updateNearClipDistance () |
void | updateStereoProperties () |
Private Attributes | |
QString | class_id_ |
QMap< CursorType, QCursor > | standard_cursors_ |
EnumProperty * | type_property_ |
Definition at line 58 of file view_controller.h.
enum rviz::ViewController::CursorType [protected] |
Definition at line 173 of file view_controller.h.
Definition at line 56 of file view_controller.cpp.
rviz::ViewController::~ViewController | ( | ) | [virtual] |
Definition at line 120 of file view_controller.cpp.
void rviz::ViewController::activate | ( | ) |
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.
void rviz::ViewController::configChanged | ( | ) | [signal] |
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] |
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] |
Reimplemented in rviz::OrbitViewController, rviz::FPSViewController, rviz::XYOrbitViewController, and rviz::FixedOrientationOrthoViewController.
Definition at line 91 of file view_controller.h.
void rviz::ViewController::initialize | ( | DisplayContext * | context | ) |
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::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::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::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.
previous_view | is 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.
void rviz::ViewController::updateNearClipDistance | ( | ) | [private, slot] |
Definition at line 251 of file view_controller.cpp.
void rviz::ViewController::updateStereoProperties | ( | ) | [private, slot] |
Definition at line 257 of file view_controller.cpp.
Ogre::Camera* rviz::ViewController::camera_ [protected] |
Definition at line 180 of file view_controller.h.
QString rviz::ViewController::class_id_ [private] |
Definition at line 200 of file view_controller.h.
DisplayContext* rviz::ViewController::context_ [protected] |
Definition at line 179 of file view_controller.h.
QCursor rviz::ViewController::cursor_ [protected] |
Definition at line 187 of file view_controller.h.
bool rviz::ViewController::is_active_ [protected] |
Definition at line 182 of file view_controller.h.
FloatProperty* rviz::ViewController::near_clip_property_ [protected] |
Definition at line 189 of file view_controller.h.
QMap<CursorType,QCursor> rviz::ViewController::standard_cursors_ [private] |
Definition at line 203 of file view_controller.h.
BoolProperty* rviz::ViewController::stereo_enable_ [protected] |
Definition at line 190 of file view_controller.h.
Definition at line 192 of file view_controller.h.
BoolProperty* rviz::ViewController::stereo_eye_swap_ [protected] |
Definition at line 191 of file view_controller.h.
Definition at line 193 of file view_controller.h.
EnumProperty* rviz::ViewController::type_property_ [private] |
Definition at line 199 of file view_controller.h.