Skip to content

Instantly share code, notes, and snippets.

@hgaiser
Created January 22, 2015 10:49
Show Gist options
  • Save hgaiser/ebc83769f2315a730359 to your computer and use it in GitHub Desktop.
Save hgaiser/ebc83769f2315a730359 to your computer and use it in GitHub Desktop.
rviz moc
diff --git a/src/image_view/image_view.h b/src/image_view/image_view.h
index 36a621f..411b2e1 100644
--- a/src/image_view/image_view.h
+++ b/src/image_view/image_view.h
@@ -27,27 +27,26 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
+# include "rviz/ogre_helpers/qt_ogre_render_window.h"
+# include "rviz/ogre_helpers/initialization.h"
+# include "rviz/image/ros_image_texture.h"
-#include "rviz/ogre_helpers/qt_ogre_render_window.h"
-#include "rviz/ogre_helpers/initialization.h"
-#include "rviz/image/ros_image_texture.h"
+# include "ros/ros.h"
+# include <ros/package.h>
-#include "ros/ros.h"
-#include <ros/package.h>
+# include <OGRE/OgreRoot.h>
+# include <OGRE/OgreSceneManager.h>
+# include <OGRE/OgreViewport.h>
+# include <OGRE/OgreRectangle2D.h>
+# include <OGRE/OgreMaterial.h>
+# include <OGRE/OgreMaterialManager.h>
+# include <OGRE/OgreTextureUnitState.h>
-#include <OGRE/OgreRoot.h>
-#include <OGRE/OgreSceneManager.h>
-#include <OGRE/OgreViewport.h>
-#include <OGRE/OgreRectangle2D.h>
-#include <OGRE/OgreMaterial.h>
-#include <OGRE/OgreMaterialManager.h>
-#include <OGRE/OgreTextureUnitState.h>
+# include <image_transport/image_transport.h>
+# include <image_transport/subscriber_filter.h>
-#include <image_transport/image_transport.h>
-#include <image_transport/subscriber_filter.h>
-
-#ifdef Q_OS_MAC
-#include <ApplicationServices/ApplicationServices.h>
+# include <ApplicationServices/ApplicationServices.h>
#endif
using namespace rviz;
diff --git a/src/rviz/default_plugin/camera_display.h b/src/rviz/default_plugin/camera_display.h
index 9bfb57c..ce90b72 100644
--- a/src/rviz/default_plugin/camera_display.h
+++ b/src/rviz/default_plugin/camera_display.h
@@ -35,16 +35,16 @@
#include <OGRE/OgreMaterial.h>
#include <OGRE/OgreRenderTargetListener.h>
-#include <sensor_msgs/CameraInfo.h>
-
#ifndef Q_MOC_RUN
-#include <message_filters/subscriber.h>
-#include <tf/message_filter.h>
-#endif
+# include <sensor_msgs/CameraInfo.h>
-#include "rviz/image/image_display_base.h"
-#include "rviz/image/ros_image_texture.h"
-#include "rviz/render_panel.h"
+# include <message_filters/subscriber.h>
+# include <tf/message_filter.h>
+
+# include "rviz/image/image_display_base.h"
+# include "rviz/image/ros_image_texture.h"
+# include "rviz/render_panel.h"
+#endif
namespace Ogre
{
diff --git a/src/rviz/default_plugin/depth_cloud_display.h b/src/rviz/default_plugin/depth_cloud_display.h
index 5983837..e5463df 100644
--- a/src/rviz/default_plugin/depth_cloud_display.h
+++ b/src/rviz/default_plugin/depth_cloud_display.h
@@ -30,29 +30,29 @@
#ifndef RVIZ_DEPTH_CLOUD_DISPLAY_H
#define RVIZ_DEPTH_CLOUD_DISPLAY_H
-#include <boost/shared_ptr.hpp>
-#include <boost/thread/mutex.hpp>
-
-#include <ros/ros.h>
-#include <image_transport/image_transport.h>
-#include <image_transport/subscriber_filter.h>
#ifndef Q_MOC_RUN
-#include <message_filters/subscriber.h>
-#include <message_filters/synchronizer.h>
-#include <message_filters/sync_policies/approximate_time.h>
-#include <tf/message_filter.h>
+# include <boost/shared_ptr.hpp>
+# include <boost/thread/mutex.hpp>
+
+# include <ros/ros.h>
+# include <image_transport/image_transport.h>
+# include <image_transport/subscriber_filter.h>
+# include <message_filters/subscriber.h>
+# include <message_filters/synchronizer.h>
+# include <message_filters/sync_policies/approximate_time.h>
+# include <tf/message_filter.h>
+
+# include "rviz/properties/enum_property.h"
+# include "rviz/properties/float_property.h"
+# include "rviz/properties/bool_property.h"
+# include "rviz/properties/int_property.h"
+# include "rviz/properties/ros_topic_property.h"
+
+# include <rviz/display.h>
+
+# include <rviz/default_plugin/point_cloud_common.h>
#endif
-#include "rviz/properties/enum_property.h"
-#include "rviz/properties/float_property.h"
-#include "rviz/properties/bool_property.h"
-#include "rviz/properties/int_property.h"
-#include "rviz/properties/ros_topic_property.h"
-
-#include <rviz/display.h>
-
-#include <rviz/default_plugin/point_cloud_common.h>
-
#include <QMap>
using namespace rviz;
diff --git a/src/rviz/default_plugin/image_display.h b/src/rviz/default_plugin/image_display.h
index 2cfa140..84b0225 100644
--- a/src/rviz/default_plugin/image_display.h
+++ b/src/rviz/default_plugin/image_display.h
@@ -30,18 +30,20 @@
#ifndef RVIZ_IMAGE_DISPLAY_H
#define RVIZ_IMAGE_DISPLAY_H
-#include <QObject>
+#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
+# include <QObject>
-#include <OGRE/OgreMaterial.h>
-#include <OGRE/OgreRenderTargetListener.h>
+# include <OGRE/OgreMaterial.h>
+# include <OGRE/OgreRenderTargetListener.h>
-#include "rviz/image/image_display_base.h"
-#include "rviz/image/ros_image_texture.h"
-#include "rviz/render_panel.h"
+# include "rviz/image/image_display_base.h"
+# include "rviz/image/ros_image_texture.h"
+# include "rviz/render_panel.h"
-#include "rviz/properties/bool_property.h"
-#include "rviz/properties/float_property.h"
-#include "rviz/properties/int_property.h"
+# include "rviz/properties/bool_property.h"
+# include "rviz/properties/float_property.h"
+# include "rviz/properties/int_property.h"
+#endif
namespace Ogre
diff --git a/src/rviz/default_plugin/point_cloud_common.h b/src/rviz/default_plugin/point_cloud_common.h
index b713e9c..c2a0cfe 100644
--- a/src/rviz/default_plugin/point_cloud_common.h
+++ b/src/rviz/default_plugin/point_cloud_common.h
@@ -30,32 +30,34 @@
#ifndef RVIZ_POINT_CLOUD_COMMON_H
#define RVIZ_POINT_CLOUD_COMMON_H
-#include <deque>
-#include <queue>
-#include <vector>
+#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
+# include <deque>
+# include <queue>
+# include <vector>
-#include <QObject>
-#include <QList>
+# include <QObject>
+# include <QList>
-#include <boost/shared_ptr.hpp>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/recursive_mutex.hpp>
+# include <boost/shared_ptr.hpp>
+# include <boost/thread/mutex.hpp>
+# include <boost/thread/recursive_mutex.hpp>
-#include <ros/spinner.h>
-#include <ros/callback_queue.h>
+# include <ros/spinner.h>
+# include <ros/callback_queue.h>
-#include <message_filters/time_sequencer.h>
+# include <message_filters/time_sequencer.h>
-#include <pluginlib/class_loader.h>
+# include <pluginlib/class_loader.h>
-#include <sensor_msgs/PointCloud.h>
-#include <sensor_msgs/PointCloud2.h>
+# include <sensor_msgs/PointCloud.h>
+# include <sensor_msgs/PointCloud2.h>
-#include "rviz/selection/selection_manager.h"
-#include "rviz/default_plugin/point_cloud_transformer.h"
-#include "rviz/properties/color_property.h"
-#include "rviz/ogre_helpers/point_cloud.h"
-#include "rviz/selection/forwards.h"
+# include "rviz/selection/selection_manager.h"
+# include "rviz/default_plugin/point_cloud_transformer.h"
+# include "rviz/properties/color_property.h"
+# include "rviz/ogre_helpers/point_cloud.h"
+# include "rviz/selection/forwards.h"
+#endif
namespace rviz
{
diff --git a/src/rviz/default_plugin/tools/goal_tool.h b/src/rviz/default_plugin/tools/goal_tool.h
index 4f731fc..7e4a7ef 100644
--- a/src/rviz/default_plugin/tools/goal_tool.h
+++ b/src/rviz/default_plugin/tools/goal_tool.h
@@ -30,11 +30,13 @@
#ifndef RVIZ_GOAL_TOOL_H
#define RVIZ_GOAL_TOOL_H
-#include <QObject>
+#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
+# include <QObject>
-#include <ros/ros.h>
+# include <ros/ros.h>
-#include "rviz/default_plugin/tools/pose_tool.h"
+# include "rviz/default_plugin/tools/pose_tool.h"
+#endif
namespace rviz
{
diff --git a/src/rviz/default_plugin/tools/initial_pose_tool.h b/src/rviz/default_plugin/tools/initial_pose_tool.h
index 22f3dbb..aa472bc 100644
--- a/src/rviz/default_plugin/tools/initial_pose_tool.h
+++ b/src/rviz/default_plugin/tools/initial_pose_tool.h
@@ -30,11 +30,13 @@
#ifndef RVIZ_INITIAL_POSE_TOOL_H
#define RVIZ_INITIAL_POSE_TOOL_H
-#include <QObject>
+#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
+# include <QObject>
-#include <ros/ros.h>
+# include <ros/ros.h>
-#include "rviz/default_plugin/tools/pose_tool.h"
+# include "rviz/default_plugin/tools/pose_tool.h"
+#endif
namespace rviz
{
diff --git a/src/rviz/default_plugin/tools/point_tool.h b/src/rviz/default_plugin/tools/point_tool.h
index bc88d6c..30d7531 100644
--- a/src/rviz/default_plugin/tools/point_tool.h
+++ b/src/rviz/default_plugin/tools/point_tool.h
@@ -30,13 +30,15 @@
#ifndef RVIZ_POINT_TOOL_H
#define RVIZ_POINT_TOOL_H
-#include <ros/node_handle.h>
-#include <ros/publisher.h>
+#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
+# include <ros/node_handle.h>
+# include <ros/publisher.h>
-#include "rviz/tool.h"
+# include "rviz/tool.h"
-#include <QCursor>
-#include <QObject>
+# include <QCursor>
+# include <QObject>
+#endif
namespace rviz
{
diff --git a/src/rviz/display.h b/src/rviz/display.h
index b05dba5..ff6bd28 100644
--- a/src/rviz/display.h
+++ b/src/rviz/display.h
@@ -31,7 +31,9 @@
#include <string>
-#include <ros/ros.h>
+#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
+# include <ros/ros.h>
+#endif
#include "rviz/properties/status_property.h"
#include "rviz/properties/bool_property.h"
diff --git a/src/rviz/image/image_display_base.h b/src/rviz/image/image_display_base.h
index 2c05c8c..042d876 100644
--- a/src/rviz/image/image_display_base.h
+++ b/src/rviz/image/image_display_base.h
@@ -31,22 +31,22 @@
#include <QObject>
-#ifndef Q_MOC_RUN
-#include <message_filters/subscriber.h>
-#include <tf/message_filter.h>
-#endif
-#include <sensor_msgs/Image.h>
+#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
+# include <message_filters/subscriber.h>
+# include <tf/message_filter.h>
+# include <sensor_msgs/Image.h>
-#include <image_transport/image_transport.h>
-#include <image_transport/subscriber_filter.h>
+# include <image_transport/image_transport.h>
+# include <image_transport/subscriber_filter.h>
-#include "rviz/display_context.h"
-#include "rviz/frame_manager.h"
-#include "rviz/properties/ros_topic_property.h"
-#include "rviz/properties/enum_property.h"
-#include "rviz/properties/int_property.h"
+# include "rviz/display_context.h"
+# include "rviz/frame_manager.h"
+# include "rviz/properties/ros_topic_property.h"
+# include "rviz/properties/enum_property.h"
+# include "rviz/properties/int_property.h"
-#include "rviz/display.h"
+# include "rviz/display.h"
+#endif
namespace rviz
{
diff --git a/src/rviz/visualizer_app.h b/src/rviz/visualizer_app.h
index 578c4ea..d642b0d 100644
--- a/src/rviz/visualizer_app.h
+++ b/src/rviz/visualizer_app.h
@@ -31,7 +31,9 @@
#include <QObject>
-#include <ros/ros.h>
+#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
+# include <ros/ros.h>
+#endif
class QTimer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment