covariance_property.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017, Ellon Paiva Mendes @ LAAS-CNRS
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 the Willow Garage, Inc. 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 COVARIANCE_PROPERTY_H
31 #define COVARIANCE_PROPERTY_H
32 
33 #include <deque>
34 
35 #include <QColor>
36 
37 #include <OgreColourValue.h>
38 
40 
41 namespace Ogre
42 {
43 class SceneManager;
44 class SceneNode;
45 } // namespace Ogre
46 
47 namespace rviz
48 {
49 class Property;
50 class ColorProperty;
51 class FloatProperty;
52 class EnumProperty;
53 class CovarianceVisual;
54 
57 {
58  Q_OBJECT
59 public:
61 
62  enum Frame
63  {
66  };
67 
69  {
71  RGB,
72  };
73 
74  CovarianceProperty(const QString& name = "Covariance",
75  bool default_value = false,
76  const QString& description = QString(),
77  rviz::Property* parent = nullptr);
78 
79  template <typename Func, typename R>
80  CovarianceProperty(const QString& name,
81  bool default_value,
82  const QString& description,
83  rviz::Property* parent,
84  Func&& changed_slot,
85  const R* receiver)
87  {
88  connect(receiver, std::forward<Func>(changed_slot));
89  }
90 
91  // this variant is required to allow omitting the receiver argument
92  template <typename Func, typename P>
93  CovarianceProperty(const QString& name,
94  bool default_value,
95  const QString& description,
96  P* parent,
97  Func&& changed_slot)
99  {
100  connect(parent, std::forward<Func>(changed_slot));
101  }
102 
103  ~CovarianceProperty() override;
104 
105  bool getPositionBool();
106  bool getOrientationBool();
107 
108  // Methods to manage the deque of Covariance Visuals
109  CovarianceVisualPtr createAndPushBackVisual(Ogre::SceneManager* scene_manager,
110  Ogre::SceneNode* parent_node);
111  void popFrontVisual();
112  void clearVisual();
113  size_t sizeVisual();
114 
115 public Q_SLOTS:
116  void updateVisibility();
117 
118 private Q_SLOTS:
120  void updateOrientationFrame();
121  void updateColorStyleChoice();
122 
123 private:
125  void updateOrientationFrame(const CovarianceVisualPtr& visual);
126  void updateVisibility(const CovarianceVisualPtr& visual);
127 
128  typedef std::deque<CovarianceVisualPtr> D_Covariance;
130 
142 };
143 
144 } // end namespace rviz
145 
146 #endif // COVARIANCE_PROPERTY_H
rviz::CovarianceProperty::position_alpha_property_
rviz::FloatProperty * position_alpha_property_
Definition: covariance_property.h:133
rviz::CovarianceProperty::position_color_property_
rviz::ColorProperty * position_color_property_
Definition: covariance_property.h:132
Ogre
Definition: axes_display.h:35
rviz::CovarianceProperty::Local
@ Local
Definition: covariance_property.h:64
boost::shared_ptr
rviz::CovarianceProperty::orientation_property_
rviz::BoolProperty * orientation_property_
Definition: covariance_property.h:135
rviz::CovarianceProperty::position_scale_property_
rviz::FloatProperty * position_scale_property_
Definition: covariance_property.h:134
rviz::CovarianceProperty::sizeVisual
size_t sizeVisual()
Definition: covariance_property.cpp:220
rviz::CovarianceProperty::createAndPushBackVisual
CovarianceVisualPtr createAndPushBackVisual(Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node)
Definition: covariance_property.cpp:226
rviz::CovarianceProperty::CovarianceProperty
CovarianceProperty(const QString &name, bool default_value, const QString &description, rviz::Property *parent, Func &&changed_slot, const R *receiver)
Definition: covariance_property.h:80
rviz::CovarianceProperty::ColorStyle
ColorStyle
Definition: covariance_property.h:68
rviz::CovarianceProperty::~CovarianceProperty
~CovarianceProperty() override
Definition: covariance_property.cpp:128
rviz::BoolProperty
Property specialized to provide getter for booleans.
Definition: bool_property.h:38
description
description
rviz::CovarianceProperty::getPositionBool
bool getPositionBool()
Definition: covariance_property.cpp:238
rviz::CovarianceProperty::updateVisibility
void updateVisibility()
Definition: covariance_property.cpp:171
rviz::CovarianceProperty
Property specialized to provide getter for booleans.
Definition: covariance_property.h:56
rviz::CovarianceProperty::CovarianceProperty
CovarianceProperty(const QString &name, bool default_value, const QString &description, P *parent, Func &&changed_slot)
Definition: covariance_property.h:93
rviz::CovarianceProperty::getOrientationBool
bool getOrientationBool()
Definition: covariance_property.cpp:243
rviz::CovarianceProperty::Unique
@ Unique
Definition: covariance_property.h:70
bool_property.h
rviz::ColorProperty
Definition: color_property.h:40
rviz::Property::connect
QMetaObject::Connection connect(const QObject *receiver, const char *slot, Qt::ConnectionType type=Qt::AutoConnection)
Connect changed() signal to given slot of receiver.
Definition: property.cpp:78
rviz::EnumProperty
Enum property.
Definition: enum_property.h:46
rviz::CovarianceProperty::updateColorStyleChoice
void updateColorStyleChoice()
Definition: covariance_property.cpp:132
rviz::FloatProperty
Property specialized to enforce floating point max/min.
Definition: float_property.h:37
rviz::Property
A single element of a property tree, with a name, value, description, and possibly children.
Definition: property.h:100
rviz::CovarianceProperty::clearVisual
void clearVisual()
Definition: covariance_property.cpp:215
rviz::CovarianceProperty::covariances_
D_Covariance covariances_
Definition: covariance_property.h:129
rviz
Definition: add_display_dialog.cpp:54
rviz::CovarianceProperty::orientation_color_property_
rviz::ColorProperty * orientation_color_property_
Definition: covariance_property.h:138
rviz::CovarianceProperty::D_Covariance
std::deque< CovarianceVisualPtr > D_Covariance
Definition: covariance_property.h:128
rviz::CovarianceProperty::orientation_scale_property_
rviz::FloatProperty * orientation_scale_property_
Definition: covariance_property.h:141
rviz::CovarianceProperty::popFrontVisual
void popFrontVisual()
Definition: covariance_property.cpp:210
rviz::CovarianceProperty::updateColorAndAlphaAndScaleAndOffset
void updateColorAndAlphaAndScaleAndOffset()
Definition: covariance_property.cpp:139
rviz::CovarianceProperty::orientation_alpha_property_
rviz::FloatProperty * orientation_alpha_property_
Definition: covariance_property.h:139
rviz::CovarianceProperty::orientation_frame_property_
rviz::EnumProperty * orientation_frame_property_
Definition: covariance_property.h:136
rviz::CovarianceProperty::Frame
Frame
Definition: covariance_property.h:62
default_value
def default_value(type_)
rviz::CovarianceProperty::RGB
@ RGB
Definition: covariance_property.h:71
rviz::CovarianceProperty::CovarianceVisualPtr
boost::shared_ptr< CovarianceVisual > CovarianceVisualPtr
Definition: covariance_property.h:60
rviz::CovarianceProperty::orientation_colorstyle_property_
rviz::EnumProperty * orientation_colorstyle_property_
Definition: covariance_property.h:137
rviz::CovarianceProperty::Fixed
@ Fixed
Definition: covariance_property.h:65
rviz::CovarianceProperty::orientation_offset_property_
rviz::FloatProperty * orientation_offset_property_
Definition: covariance_property.h:140
rviz::CovarianceProperty::position_property_
rviz::BoolProperty * position_property_
Definition: covariance_property.h:131
rviz::CovarianceProperty::updateOrientationFrame
void updateOrientationFrame()
Definition: covariance_property.cpp:196
rviz::CovarianceProperty::CovarianceProperty
CovarianceProperty(const QString &name="Covariance", bool default_value=false, const QString &description=QString(), rviz::Property *parent=nullptr)
Definition: covariance_property.cpp:44


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Aug 2 2024 08:43:09