Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code style only: wrap after open parenthesis if not in one line #504

Merged
merged 1 commit into from
Feb 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion rviz2/test/tools/send_lots_of_points_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ int main(int argc, char ** argv)
}
msg.header.stamp = node->now();

printf("publishing at %d hz, %s, %d x %d points.\n",
printf(
"publishing at %d hz, %s, %d x %d points.\n",
rate, (moving ? "moving" : "static"), width, length);

pub->publish(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ class PluginlibFactory : public ClassIdRecordingFactory<Type>
try {
return class_loader_->createUnmanagedInstance(class_id.toStdString());
} catch (pluginlib::PluginlibException & ex) {
RVIZ_COMMON_LOG_ERROR_STREAM("PluginlibFactory: The plugin for class '" <<
qPrintable(class_id) << "' failed to load. Error: " << ex.what());
RVIZ_COMMON_LOG_ERROR_STREAM(
"PluginlibFactory: The plugin for class '" <<
qPrintable(class_id) << "' failed to load. Error: " << ex.what());
if (error_return) {
*error_return = QString::fromStdString(ex.what());
}
Expand Down
6 changes: 4 additions & 2 deletions rviz_common/include/rviz_common/frame_manager_iface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,10 @@ class RVIZ_COMMON_PUBLIC FrameManagerIface : public QObject
Display * display) override
{
filter->registerCallback(boost::bind(&FrameManager::messageCallback<M>, this, _1, display));
filter->registerFailureCallback(boost::bind(&FrameManager::failureCallback<M>, this, _1, _2,
display));
filter->registerFailureCallback(
boost::bind(
&FrameManager::failureCallback<M>, this, _1, _2,
display));
}
#endif

Expand Down
5 changes: 3 additions & 2 deletions rviz_common/include/rviz_common/message_filter_display.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ class MessageFilterDisplay : public _RosTopicDisplay
fixed_frame_.toStdString(), 10, rviz_ros_node_.lock()->get_raw_node());
tf_filter_->connectInput(*subscription_);
tf_filter_->registerCallback(
std::bind(&MessageFilterDisplay<MessageType>::incomingMessage, this,
std::placeholders::_1));
std::bind(
&MessageFilterDisplay<MessageType>::incomingMessage, this,
std::placeholders::_1));
setStatus(properties::StatusProperty::Ok, "Topic", "OK");
} catch (rclcpp::exceptions::InvalidTopicNameError & e) {
setStatus(
Expand Down
11 changes: 7 additions & 4 deletions rviz_common/include/rviz_common/ros_topic_display.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ class RVIZ_COMMON_PUBLIC _RosTopicDisplay : public Display
: rviz_ros_node_(),
qos_profile(5)
{
topic_property_ = new properties::RosTopicProperty("Topic", "",
"", "", this, SLOT(updateTopic()));
topic_property_ = new properties::RosTopicProperty(
"Topic", "",
"", "", this, SLOT(updateTopic()));

qos_profile_property_ = new properties::QosProfileProperty(topic_property_, qos_profile);
}
Expand Down Expand Up @@ -167,7 +168,8 @@ class RosTopicDisplay : public _RosTopicDisplay
}

if (topic_property_->isEmpty()) {
setStatus(properties::StatusProperty::Error,
setStatus(
properties::StatusProperty::Error,
"Topic",
QString("Error subscribing: Empty topic name"));
return;
Expand All @@ -182,7 +184,8 @@ class RosTopicDisplay : public _RosTopicDisplay
[this](const typename MessageType::ConstSharedPtr message) {incomingMessage(message);});
setStatus(properties::StatusProperty::Ok, "Topic", "OK");
} catch (rclcpp::exceptions::InvalidTopicNameError & e) {
setStatus(properties::StatusProperty::Error, "Topic",
setStatus(
properties::StatusProperty::Error, "Topic",
QString("Error subscribing: ") + e.what());
}
}
Expand Down
10 changes: 6 additions & 4 deletions rviz_common/src/rviz_common/add_display_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@ void getPluginGroups(
QString datatype = QString::fromStdString(map_pair.second[0]);

if (datatype_plugins.contains(datatype)) {
if (groups->empty() ||
!isSubtopic(groups->back().base_topic.toStdString(),
topic.toStdString()))
if (
groups->empty() ||
!isSubtopic(
groups->back().base_topic.toStdString(), topic.toStdString()))
{
PluginGroup pi;
pi.base_topic = topic;
Expand Down Expand Up @@ -478,7 +479,8 @@ TopicDisplayWidget::TopicDisplayWidget(
// *INDENT-ON*

// Connect signal from checkbox
connect(enable_hidden_box_, SIGNAL(stateChanged(int)),
connect(
enable_hidden_box_, SIGNAL(stateChanged(int)),
this, SLOT(stateChanged(int)));

setLayout(layout);
Expand Down
4 changes: 2 additions & 2 deletions rviz_common/src/rviz_common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ bool Config::mapGetInt(const QString & key, int * value_out) const
bool Config::mapGetFloat(const QString & key, float * value_out) const
{
QVariant v;
if (mapGetValue(key,
&v) &&
if (
mapGetValue(key, &v) &&
(static_cast<int>(v.type()) == static_cast<int>(QMetaType::Float) ||
v.type() == QVariant::Double ||
v.type() == QVariant::String))
Expand Down
13 changes: 8 additions & 5 deletions rviz_common/src/rviz_common/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ void Display::setStatus(
const QString & name,
const QString & text)
{
QMetaObject::invokeMethod(this, "setStatusInternal", Qt::QueuedConnection,
QMetaObject::invokeMethod(
this, "setStatusInternal", Qt::QueuedConnection,
Q_ARG(int, level),
Q_ARG(QString, name),
Q_ARG(QString, text));
Expand Down Expand Up @@ -254,8 +255,8 @@ void Display::setStatusInternal(int level, const QString & name, const QString &

void Display::deleteStatus(const QString & name)
{
QMetaObject::invokeMethod(this, "deleteStatusInternal", Qt::QueuedConnection,
Q_ARG(QString, name));
QMetaObject::invokeMethod(
this, "deleteStatusInternal", Qt::QueuedConnection, Q_ARG(QString, name));
}

void Display::deleteStatusInternal(const QString & name)
Expand Down Expand Up @@ -398,7 +399,8 @@ Ogre::SceneNode * Display::getSceneNode() const
void Display::setAssociatedWidget(QWidget * widget)
{
if (associated_widget_panel_) {
disconnect(associated_widget_panel_, SIGNAL(visibilityChanged(bool)), this,
disconnect(
associated_widget_panel_, SIGNAL(visibilityChanged(bool)), this,
SLOT(associatedPanelVisibilityChange(bool)));
disconnect(associated_widget_panel_, SIGNAL(closed()), this, SLOT(disable()));
}
Expand All @@ -408,7 +410,8 @@ void Display::setAssociatedWidget(QWidget * widget)
WindowManagerInterface * wm = context_->getWindowManager();
if (wm) {
associated_widget_panel_ = wm->addPane(getName(), associated_widget_);
connect(associated_widget_panel_, SIGNAL(visibilityChanged(bool)), this,
connect(
associated_widget_panel_, SIGNAL(visibilityChanged(bool)), this,
SLOT(associatedPanelVisibilityChange(bool)));
connect(associated_widget_panel_, SIGNAL(closed()), this, SLOT(disable()));
associated_widget_panel_->setIcon(getIcon());
Expand Down
3 changes: 2 additions & 1 deletion rviz_common/src/rviz_common/failed_tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ void FailedTool::deactivate()

void FailedTool::onInitialize()
{
setDescription("The class required for this tool, '" + getClassId() +
setDescription(
"The class required for this tool, '" + getClassId() +
"', could not be loaded.<br><b>Error:</b><br>" + error_message_);
}

Expand Down
3 changes: 2 additions & 1 deletion rviz_common/src/rviz_common/failed_view_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ void FailedViewController::onActivate()
if (context_->getWindowManager() ) {
parent = context_->getWindowManager()->getParentWindow();
}
QMessageBox::critical(parent, "ViewController '" + getName() + "'unavailable.",
QMessageBox::critical(
parent, "ViewController '" + getName() + "'unavailable.",
getDescription() );
}

Expand Down
13 changes: 7 additions & 6 deletions rviz_common/src/rviz_common/interaction/selection_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ void SelectionManager::initialize()

static const uint32_t texture_data[1] = {0xffff0080};
Ogre::DataStreamPtr pixel_stream;
pixel_stream.reset(new Ogre::MemoryDataStream(
reinterpret_cast<void *>(const_cast<uint32_t *>(&texture_data[0])),
4
pixel_stream.reset(
new Ogre::MemoryDataStream(
reinterpret_cast<void *>(const_cast<uint32_t *>(&texture_data[0])), 4
));

Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton().loadRawData(
Expand Down Expand Up @@ -207,9 +207,10 @@ void SelectionManager::setTextureSize(unsigned size)
}

// create new texture
render_texture = Ogre::TextureManager::getSingleton().createManual(tex_name,
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, size, size, 0,
Ogre::PF_R8G8B8A8, Ogre::TU_STATIC | Ogre::TU_RENDERTARGET);
render_texture = Ogre::TextureManager::getSingleton().createManual(
tex_name,
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, size, size, 0,
Ogre::PF_R8G8B8A8, Ogre::TU_STATIC | Ogre::TU_RENDERTARGET);

render_texture->getBuffer()->getRenderTarget()->setAutoUpdated(false);
}
Expand Down
11 changes: 6 additions & 5 deletions rviz_common/src/rviz_common/interaction/view_picker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,12 @@ void ViewPicker::setDepthTextureSize(unsigned width, unsigned height)
}

depth_render_texture_ =
Ogre::TextureManager::getSingleton().createManual(tex_name,
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
Ogre::TEX_TYPE_2D, depth_texture_width_, depth_texture_height_, 0,
Ogre::PF_R8G8B8,
Ogre::TU_RENDERTARGET);
Ogre::TextureManager::getSingleton().createManual(
tex_name,
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
Ogre::TEX_TYPE_2D, depth_texture_width_, depth_texture_height_, 0,
Ogre::PF_R8G8B8,
Ogre::TU_RENDERTARGET);

depth_render_texture_->getBuffer()->getRenderTarget()->setAutoUpdated(false);
}
Expand Down
5 changes: 3 additions & 2 deletions rviz_common/src/rviz_common/load_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ QCursor makeIconCursor(QString url, bool fill_cache)
{
QPixmap icon = loadPixmap(url, fill_cache);
if (icon.width() == 0 || icon.height() == 0) {
RVIZ_COMMON_LOG_ERROR_STREAM("Could not load pixmap " << url.toStdString() << " -- "
"using default cursor instead.");
RVIZ_COMMON_LOG_ERROR_STREAM(
"Could not load pixmap " << url.toStdString() << " -- "
"using default cursor instead.");
return getDefaultCursor();
}
QString cache_key = url + ".cursor";
Expand Down
4 changes: 2 additions & 2 deletions rviz_common/src/rviz_common/new_object_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ NewObjectDialog::NewObjectDialog(
}

// Buttons
button_box_ = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
Qt::Horizontal);
button_box_ = new QDialogButtonBox(
QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);

auto main_layout = new QVBoxLayout;
main_layout->addWidget(type_box);
Expand Down
18 changes: 12 additions & 6 deletions rviz_common/src/rviz_common/panel_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,28 @@ PanelFactory::PanelFactory(
VisualizationManager * manager)
: PluginlibFactory<Panel>("rviz_common", "rviz_common::Panel")
{
addBuiltInClass("rviz_common", "Displays",
addBuiltInClass(
"rviz_common", "Displays",
"Show and edit the list of Displays",
[rviz_ros_node, manager]() -> Panel * {
return new DisplaysPanel(rviz_ros_node, manager, nullptr);
});
addBuiltInClass("rviz_common", "Help",
addBuiltInClass(
"rviz_common", "Help",
"Show the key and mouse bindings", &newHelpPanel);
addBuiltInClass("rviz_common", "Selection",
addBuiltInClass(
"rviz_common", "Selection",
"Show properties of selected objects", &newSelectionPanel);
// addBuiltInClass("rviz", "Time",
// "Show the current time", &newTimePanel);
addBuiltInClass("rviz_common", "Tool Properties",
addBuiltInClass(
"rviz_common", "Tool Properties",
"Show and edit properties of tools", &newToolPropertiesPanel);
addBuiltInClass("rviz_common", "Transformation",
addBuiltInClass(
"rviz_common", "Transformation",
"Choose the transformation plugin", &newTransformationPanel);
addBuiltInClass("rviz_common", "Views",
addBuiltInClass(
"rviz_common", "Views",
"Show and edit viewpoints", &newViewsPanel);
}

Expand Down
12 changes: 8 additions & 4 deletions rviz_common/src/rviz_common/properties/color_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ ColorEditor::ColorEditor(ColorProperty * property, QWidget * parent)
: LineEditWithButton(parent),
property_(property)
{
connect(this, SIGNAL(textChanged(const QString&)),
connect(
this, SIGNAL(textChanged(const QString&)),
this, SLOT(parseText()));
}

Expand All @@ -66,7 +67,8 @@ void ColorEditor::paintColorBox(QPainter * painter, const QRect & rect, const QC
int size = rect.height() - padding * 2 - 1;
painter->save();
painter->setBrush(color);
painter->drawRoundedRect(rect.x() + padding + 3,
painter->drawRoundedRect(
rect.x() + padding + 3,
rect.y() + padding, size, size, 0, 0, Qt::AbsoluteSize);
painter->restore();
}
Expand Down Expand Up @@ -108,13 +110,15 @@ void ColorEditor::onButtonClick()

QColorDialog * dialog = new QColorDialog(color_, parentWidget() );

connect(dialog, SIGNAL(currentColorChanged(const QColor&)),
connect(
dialog, SIGNAL(currentColorChanged(const QColor&)),
property_, SLOT(setColor(const QColor&)));

// Without this connection the PropertyTreeWidget does not update
// the color info "live" when it changes in the dialog and the 3D
// view.
connect(dialog, SIGNAL(currentColorChanged(const QColor&)),
connect(
dialog, SIGNAL(currentColorChanged(const QColor&)),
parentWidget(), SLOT(update()));

// On the TWM window manager under linux, and on OSX, this
Expand Down
Loading