Skip to content

Commit ef95ae8

Browse files
committed
code style
1 parent fcdf022 commit ef95ae8

File tree

5 files changed

+107
-153
lines changed

5 files changed

+107
-153
lines changed

rviz_common/include/rviz_common/properties/ros_topic_multi_property.hpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,33 +46,32 @@ namespace properties
4646
class RVIZ_COMMON_PUBLIC RosTopicMultiProperty : public RosTopicProperty
4747
{
4848
Q_OBJECT
49+
4950
public:
5051
explicit RosTopicMultiProperty(
51-
const QString & name = QString(),
52-
const QString & default_value = QString(),
52+
const QString & name = QString(), const QString & default_value = QString(),
5353
const std::vector<QString> & message_types = std::vector<QString>(),
54-
const QString & description = QString(),
55-
Property * parent = nullptr,
56-
const char * changed_slot = nullptr,
57-
QObject * receiver = nullptr):
58-
RosTopicProperty(name, default_value, "", description, parent, changed_slot, receiver),
59-
message_types_(message_types)
60-
{}
54+
const QString & description = QString(), Property * parent = nullptr,
55+
const char * changed_slot = nullptr, QObject * receiver = nullptr)
56+
: RosTopicProperty(name, default_value, "", description, parent, changed_slot, receiver),
57+
message_types_(message_types)
58+
{
59+
}
6160

6261
void setMessageTypes(const std::vector<QString> & message_types)
63-
{message_types_ = message_types;}
64-
62+
{
63+
message_types_ = message_types;
64+
}
6565

66-
std::vector<QString> getMessageTypes() const
67-
{return message_types_;}
66+
std::vector<QString> getMessageTypes() const {return message_types_;}
6867

6968
protected Q_SLOTS:
70-
virtual void fillTopicList() override;
69+
void fillTopicList() override;
7170

7271
private:
7372
// Hide the parent class methods which only take a single type
74-
using RosTopicProperty::setMessageType;
7573
using RosTopicProperty::getMessageType;
74+
using RosTopicProperty::setMessageType;
7675

7776
// Instead of one message type, store a list of allowed types
7877
std::vector<QString> message_types_;

rviz_common/include/rviz_common/properties/ros_topic_property.hpp

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,29 +49,21 @@ class RVIZ_COMMON_PUBLIC RosTopicProperty : public EditableEnumProperty
4949

5050
public:
5151
explicit RosTopicProperty(
52-
const QString & name = QString(),
53-
const QString & default_value = QString(),
54-
const QString & message_type = QString(),
55-
const QString & description = QString(),
56-
Property * parent = nullptr,
57-
const char * changed_slot = nullptr,
58-
QObject * receiver = nullptr);
52+
const QString & name = QString(), const QString & default_value = QString(),
53+
const QString & message_type = QString(), const QString & description = QString(),
54+
Property * parent = nullptr, const char * changed_slot = nullptr, QObject * receiver = nullptr);
5955

6056
void initialize(ros_integration::RosNodeAbstractionIface::WeakPtr rviz_ros_node);
6157

6258
void setMessageType(const QString & message_type);
6359

64-
QString getMessageType() const
65-
{return message_type_;}
60+
QString getMessageType() const {return message_type_;}
6661

67-
QString getTopic() const
68-
{return getValue().toString();}
62+
QString getTopic() const {return getValue().toString();}
6963

70-
std::string getTopicStd() const
71-
{return getValue().toString().toStdString();}
64+
std::string getTopicStd() const {return getValue().toString().toStdString();}
7265

73-
bool isEmpty() const
74-
{return getTopicStd().empty();}
66+
bool isEmpty() const {return getTopicStd().empty();}
7567

7668
protected Q_SLOTS:
7769
virtual void fillTopicList();
@@ -81,20 +73,15 @@ protected Q_SLOTS:
8173
QString message_type_;
8274
};
8375

84-
class RVIZ_COMMON_PUBLIC RosFilteredTopicProperty
85-
: public rviz_common::properties::RosTopicProperty
76+
class RVIZ_COMMON_PUBLIC RosFilteredTopicProperty : public rviz_common::properties::RosTopicProperty
8677
{
8778
Q_OBJECT
8879

8980
public:
9081
RosFilteredTopicProperty(
91-
const QString & name = QString(),
92-
const QString & default_value = QString(),
93-
const QString & message_type = QString(),
94-
const QString & description = QString(),
95-
const QRegExp & filter = QRegExp(),
96-
Property * parent = 0,
97-
const char * changed_slot = 0,
82+
const QString & name = QString(), const QString & default_value = QString(),
83+
const QString & message_type = QString(), const QString & description = QString(),
84+
const QRegExp & filter = QRegExp(), Property * parent = 0, const char * changed_slot = 0,
9885
QObject * receiver = 0);
9986

10087
void enableFilter(bool enabled);

rviz_common/src/rviz_common/properties/ros_topic_multi_property.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@
2727
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2828
// POSSIBILITY OF SUCH DAMAGE.
2929

30+
#include "rviz_common/properties/ros_topic_multi_property.hpp"
3031

32+
#include <QApplication> // NOLINT: cpplint can't handle Qt imports
33+
#include <algorithm>
3134
#include <map>
3235
#include <string>
33-
#include <algorithm>
3436

35-
#include <QApplication> // NOLINT: cpplint can't handle Qt imports
36-
37-
#include "rviz_common/properties/ros_topic_multi_property.hpp"
3837
#include "rviz_common/ros_integration/ros_node_abstraction_iface.hpp"
3938

4039
namespace rviz_common
@@ -53,9 +52,12 @@ void RosTopicMultiProperty::fillTopicList()
5352
for (const auto & topic : published_topics) {
5453
// Only add topics whose type matches.
5554
for (const auto & type : topic.second) {
56-
if (std::find(message_types_.begin(), message_types_.end(), QString::fromStdString(type))
57-
!= message_types_.end())
55+
if (
56+
std::find(message_types_.begin(), message_types_.end(), QString::fromStdString(type)) !=
57+
message_types_.end())
58+
{
5859
addOptionStd(topic.first);
60+
}
5961
}
6062
}
6163
sortOptions();

rviz_default_plugins/include/rviz_default_plugins/displays/image/image_display.hpp

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,40 +29,37 @@
2929
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3030
// POSSIBILITY OF SUCH DAMAGE.
3131

32-
3332
#ifndef RVIZ_DEFAULT_PLUGINS__DISPLAYS__IMAGE__IMAGE_DISPLAY_HPP_
3433
#define RVIZ_DEFAULT_PLUGINS__DISPLAYS__IMAGE__IMAGE_DISPLAY_HPP_
3534

3635
#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
37-
# include <memory>
38-
# include <string>
39-
40-
# include <QObject> // NOLINT cpplint cannot handle include order here
41-
42-
# include <OgreMaterial.h>
43-
# include <OgreRenderTargetListener.h>
44-
# include <OgreSharedPtr.h>
45-
46-
# include "rviz_common/message_filter_display.hpp"
47-
# include "rviz_common/render_panel.hpp"
48-
# include "rviz_common/properties/bool_property.hpp"
49-
# include "rviz_common/properties/float_property.hpp"
50-
# include "rviz_common/properties/int_property.hpp"
51-
# include "rviz_common/properties/enum_property.hpp"
52-
53-
# include "rviz_default_plugins/displays/image/ros_image_texture_iface.hpp"
54-
# include "rviz_default_plugins/visibility_control.hpp"
55-
# include "rviz_default_plugins/displays/image/image_transport_display.hpp"
56-
57-
# include <sensor_msgs/msg/image.hpp>
36+
#include <OgreMaterial.h>
37+
#include <OgreRenderTargetListener.h>
38+
#include <OgreSharedPtr.h>
39+
40+
#include <QObject> // NOLINT cpplint cannot handle include order here
41+
42+
#include <memory>
43+
#include <string>
44+
45+
#include <sensor_msgs/msg/image.hpp>
46+
47+
#include "rviz_common/message_filter_display.hpp"
48+
#include "rviz_common/properties/bool_property.hpp"
49+
#include "rviz_common/properties/enum_property.hpp"
50+
#include "rviz_common/properties/float_property.hpp"
51+
#include "rviz_common/properties/int_property.hpp"
52+
#include "rviz_common/render_panel.hpp"
53+
#include "rviz_default_plugins/displays/image/image_transport_display.hpp"
54+
#include "rviz_default_plugins/displays/image/ros_image_texture_iface.hpp"
55+
#include "rviz_default_plugins/visibility_control.hpp"
5856
#endif
5957

60-
6158
namespace Ogre
6259
{
6360
class SceneNode;
6461
class Rectangle2D;
65-
}
62+
} // namespace Ogre
6663

6764
namespace rviz_default_plugins
6865
{
@@ -73,8 +70,8 @@ namespace displays
7370
* \class ImageDisplay
7471
*
7572
*/
76-
class RVIZ_DEFAULT_PLUGINS_PUBLIC ImageDisplay : public
77-
rviz_default_plugins::displays::ImageTransportDisplay<sensor_msgs::msg::Image>
73+
class RVIZ_DEFAULT_PLUGINS_PUBLIC ImageDisplay
74+
: public rviz_default_plugins::displays::ImageTransportDisplay<sensor_msgs::msg::Image>
7875
{
7976
Q_OBJECT
8077

0 commit comments

Comments
 (0)