frame_view_controller.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019, Bielefeld University
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of Bielefeld University nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef RVIZ_FRAME_VIEW_CONTROLLER_H
31 #define RVIZ_FRAME_VIEW_CONTROLLER_H
32 
33 #include "fps_view_controller.h"
34 
35 namespace rviz
36 {
37 class FloatProperty;
38 class VectorProperty;
39 class EnumProperty;
40 
43 {
44  Q_OBJECT
45 
46 public:
48  ~FrameViewController() override = default;
49  void onInitialize() override;
50 
51  void reset() override;
52  void handleMouseEvent(ViewportMouseEvent& event) override;
53 
54 protected:
55  void onTargetFrameChanged(const Ogre::Vector3& old_reference_position,
56  const Ogre::Quaternion& old_reference_orientation) override;
57  void updateTargetSceneNode() override;
58 
60  void setAxisFromCamera();
62  int actualCameraAxisOption(double precision = 0.001) const;
63 
66 
67 protected Q_SLOTS:
68  void changedOrientation() override;
69  void changedAxis();
70 
71 private:
72  void rememberAxis(int current);
74 };
75 
76 } // end namespace rviz
77 
78 #endif // RVIZ_FRAME_VIEW_CONTROLLER_H
rviz::FrameViewController::updateTargetSceneNode
void updateTargetSceneNode() override
Update the position of the target_scene_node_ from the TF frame specified in the Target Frame propert...
Definition: frame_view_controller.cpp:151
rviz::FrameViewController::setAxisFromCamera
void setAxisFromCamera()
set axis_property_ from camera
Definition: frame_view_controller.cpp:116
rviz::FrameViewController::locked_property_
BoolProperty * locked_property_
Lock camera, i.e. disable mouse interaction?
Definition: frame_view_controller.h:65
rviz::FrameViewController::handleMouseEvent
void handleMouseEvent(ViewportMouseEvent &event) override
Definition: frame_view_controller.cpp:90
rviz::FrameViewController::FrameViewController
FrameViewController()
Definition: frame_view_controller.cpp:54
rviz::BoolProperty
Property specialized to provide getter for booleans.
Definition: bool_property.h:38
rviz::ViewportMouseEvent
Definition: viewport_mouse_event.h:45
rviz::FPSViewController
A first-person camera, controlled by yaw, pitch, roll, and position.
Definition: fps_view_controller.h:41
rviz::FrameViewController::~FrameViewController
~FrameViewController() override=default
rviz::EnumProperty
Enum property.
Definition: enum_property.h:46
rviz::FrameViewController::axis_property_
EnumProperty * axis_property_
The axis that the camera aligns to.
Definition: frame_view_controller.h:64
rviz
Definition: add_display_dialog.cpp:54
rviz::FrameViewController::onTargetFrameChanged
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.
Definition: frame_view_controller.cpp:145
rviz::FrameViewController::rememberAxis
void rememberAxis(int current)
Definition: frame_view_controller.cpp:139
rviz::FrameViewController::onInitialize
void onInitialize() override
Do subclass-specific initialization. Called by ViewController::initialize after context_ and camera_ ...
Definition: frame_view_controller.cpp:70
rviz::FrameViewController::changedOrientation
void changedOrientation() override
Definition: frame_view_controller.cpp:127
fps_view_controller.h
rviz::FrameViewController::changedAxis
void changedAxis()
Definition: frame_view_controller.cpp:133
rviz::FrameViewController::previous_axis_
int previous_axis_
Definition: frame_view_controller.h:73
rviz::FrameViewController::actualCameraAxisOption
int actualCameraAxisOption(double precision=0.001) const
find enum ID from camera's current pose
Definition: frame_view_controller.cpp:100
rviz::FrameViewController::reset
void reset() override
Definition: frame_view_controller.cpp:76
rviz::FrameViewController
A camera tied to a given frame.
Definition: frame_view_controller.h:42


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Dec 13 2024 03:31:02