tf_frame_property.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, Willow Garage, Inc.
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 #ifndef TF_FRAME_PROPERTY_H
30 #define TF_FRAME_PROPERTY_H
31 
32 #include <string>
33 
35 #include <rviz/rviz_export.h>
36 
37 namespace rviz
38 {
39 class FrameManager;
40 
41 class RVIZ_EXPORT TfFrameProperty : public EditableEnumProperty
42 {
43  Q_OBJECT
44 public:
45  TfFrameProperty(const QString& name = QString(),
46  const QString& default_value = QString(),
47  const QString& description = QString(),
48  Property* parent = nullptr,
49  FrameManager* frame_manager = nullptr,
50  bool include_fixed_frame_string = false);
51 
52  template <typename Func, typename R>
53  TfFrameProperty(const QString& name,
54  const QString& default_value,
55  const QString& description,
56  Property* parent,
57  FrameManager* frame_manager,
58  bool include_fixed_frame_string,
59  Func&& changed_slot,
60  const R* receiver)
61  : TfFrameProperty(name, default_value, description, parent, frame_manager, include_fixed_frame_string)
62  {
63  connect(receiver, std::forward<Func>(changed_slot));
64  }
65 
66  // this variant is required to allow omitting the receiver argument
67  template <typename Func, typename P>
68  TfFrameProperty(const QString& name,
69  const QString& default_value,
70  const QString& description,
71  P* parent,
72  FrameManager* frame_manager,
73  bool include_fixed_frame_string,
74  Func&& changed_slot)
75  : TfFrameProperty(name, default_value, description, parent, frame_manager, include_fixed_frame_string)
76  {
77  connect(parent, std::forward<Func>(changed_slot));
78  }
79 
81  bool setValue(const QVariant& new_value) override;
82 
83  QString getFrame() const;
84  std::string getFrameStd() const;
85 
86  void setFrameManager(FrameManager* frame_manager);
88  {
89  return frame_manager_;
90  }
91 
92  static const QString FIXED_FRAME_STRING;
93 
94 private Q_SLOTS:
95  void fillFrameList();
96 
100  void handleFixedFrameChange();
101 
102 private:
105 };
106 
107 } // end namespace rviz
108 
109 #endif // TF_FRAME_PROPERTY_H
rviz::FrameManager
Helper class for transforming data into Ogre's world frame (the fixed frame).
Definition: frame_manager.h:64
rviz::EditableEnumProperty
Editable Enum property.
Definition: editable_enum_property.h:43
description
description
rviz::TfFrameProperty::include_fixed_frame_string_
bool include_fixed_frame_string_
Definition: tf_frame_property.h:104
rviz::TfFrameProperty::getFrameManager
FrameManager * getFrameManager() const
Definition: tf_frame_property.h:87
rviz::Property
A single element of a property tree, with a name, value, description, and possibly children.
Definition: property.h:100
rviz::TfFrameProperty::TfFrameProperty
TfFrameProperty(const QString &name, const QString &default_value, const QString &description, Property *parent, FrameManager *frame_manager, bool include_fixed_frame_string, Func &&changed_slot, const R *receiver)
Definition: tf_frame_property.h:53
rviz::TfFrameProperty::TfFrameProperty
TfFrameProperty(const QString &name, const QString &default_value, const QString &description, P *parent, FrameManager *frame_manager, bool include_fixed_frame_string, Func &&changed_slot)
Definition: tf_frame_property.h:68
rviz
Definition: add_display_dialog.cpp:54
rviz::TfFrameProperty
Definition: tf_frame_property.h:41
rviz::TfFrameProperty::FIXED_FRAME_STRING
static const QString FIXED_FRAME_STRING
Definition: tf_frame_property.h:92
rviz::TfFrameProperty::frame_manager_
FrameManager * frame_manager_
Definition: tf_frame_property.h:103
default_value
def default_value(type_)
editable_enum_property.h


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