Go to the documentation of this file.
30 #include <OgreCamera.h>
31 #include <OgreQuaternion.h>
32 #include <OgreSceneManager.h>
33 #include <OgreSceneNode.h>
35 #include <OgreViewport.h>
51 new FloatProperty(
"Scale", 10,
"How much to scale up the size of things in the scene.",
this);
65 camera_->setProjectionType(Ogre::PT_ORTHOGRAPHIC);
66 camera_->setFixedYawAxis(
false);
82 setStatus(
"<b>Left-Click:</b> Move X/Y.");
86 setStatus(
"<b>Left-Click:</b> Rotate. <b>Middle-Click:</b> Move X/Y. <b>Right-Click:</b>: Zoom. "
87 "<b>Shift</b>: More options.");
95 if (event.
type == QEvent::MouseButtonPress)
99 else if (event.
type == QEvent::MouseButtonRelease)
105 diff_x =
event.x -
event.last_x;
106 diff_y =
event.y -
event.last_y;
120 move(-diff_x / scale, diff_y / scale);
122 else if (event.
right())
134 int diff =
event.wheel_delta;
158 qobject_cast<FixedOrientationOrthoViewController*>(source_view))
167 Ogre::Camera* source_camera = source_view->
getCamera();
184 const Ogre::Vector3& old_reference_position,
185 const Ogre::Quaternion& )
195 float width =
camera_->getViewport()->getActualWidth();
196 float height =
camera_->getViewport()->getActualHeight();
201 height / scale / 2,
camera_->getNearClipDistance(),
202 camera_->getFarClipDistance());
203 camera_->setCustomProjectionMatrix(
true, proj);
Ogre::Vector3 reference_position_
virtual void queueRender()=0
Queues a render. Multiple calls before a render happens will only cause a single render.
void onTargetFrameChanged(const Ogre::Vector3 &old_reference_position, const Ogre::Quaternion &old_reference_orientation) override
Override to implement the change in properties which nullifies the change in target frame.
FloatProperty * x_property_
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
void setPosition(const Ogre::Vector3 &pos_rel_target)
void mimic(ViewController *source_view) override
Configure the settings of this view controller to give, as much as possible, a similar view as that g...
bool add(float delta)
Add the given delta to the property value.
FloatProperty * scale_property_
DisplayContext * context_
Property specialized to enforce floating point max/min.
void hide()
Hide this Property in any PropertyTreeWidgets.
void buildScaledOrthoMatrix(Ogre::Matrix4 &proj, float left, float right, float bottom, float top, float near, float far)
void onInitialize() override
Do subclass-specific initialization.
void update(float dt, float ros_dt) override
Called at 30Hz by ViewManager::update() while this view is active. Override with code that needs to r...
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
virtual float getFloat() const
FloatProperty * angle_property_
~FixedOrientationOrthoViewController() override
void mimic(ViewController *source_view) override
Configure the settings of this view controller to give, as much as possible, a similar view as that g...
Ogre::Camera * getCamera() const
void move(float x, float y)
void handleMouseEvent(ViewportMouseEvent &evt) override
bool setFloat(float new_value)
Float-typed "SLOT" version of setValue().
void update(float dt, float ros_dt) override
Called at 30Hz by ViewManager::update() while this view is active. Override with code that needs to r...
void emitConfigChanged()
Subclasses should call this whenever a change is made which would change the results of toString().
void setCursor(CursorType cursor_type)
void setStatus(const QString &message)
void onInitialize() override
Do subclass-specific initialization. Called by ViewController::initialize after context_ and camera_ ...
FloatProperty * y_property_
Ogre::SceneNode * target_scene_node_
bool multiply(float factor)
Multiply the property value by the given factor.
FixedOrientationOrthoViewController()
void lookAt(const Ogre::Vector3 &point_rel_world) override
This should be implemented in each subclass to aim the camera at the given point in space (relative t...
rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Apr 25 2025 02:32:41