Skip to content

Commit

Permalink
Consolidate namespaces: plugins
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Oct 30, 2023
1 parent 6b2a501 commit ccdef74
Show file tree
Hide file tree
Showing 48 changed files with 172 additions and 385 deletions.
9 changes: 4 additions & 5 deletions src/plugins/camera_fps/CameraFps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@

#include "CameraFps.hh"

namespace gz::gui::plugins
{
/// \brief Private data class for CameraFps
class gz::gui::plugins::CameraFpsPrivate
class CameraFpsPrivate
{
/// \brief Previous camera update time
public: std::optional<std::chrono::steady_clock::time_point>
Expand All @@ -50,10 +52,6 @@ class gz::gui::plugins::CameraFpsPrivate
public: QString cameraFPSValue;
};

using namespace gz;
using namespace gui;
using namespace plugins;

/////////////////////////////////////////////////
void CameraFps::OnRender()
{
Expand Down Expand Up @@ -125,6 +123,7 @@ void CameraFps::SetCameraFpsValue(const QString &_value)
this->dataPtr->cameraFPSValue = _value;
this->CameraFpsValueChanged();
}
} // namespace gz::gui::plugins

// Register this plugin
GZ_ADD_PLUGIN(gz::gui::plugins::CameraFps,
Expand Down
13 changes: 4 additions & 9 deletions src/plugins/camera_fps/CameraFps.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@

#include "gz/gui/Plugin.hh"

namespace gz
{
namespace gui
{
namespace plugins
namespace gz::gui::plugins
{
class CameraFpsPrivate;

Expand Down Expand Up @@ -74,7 +70,6 @@ namespace plugins
/// \brief Pointer to private data.
private: std::unique_ptr<CameraFpsPrivate> dataPtr;
};
}
}
}
#endif
} // namespace gz::gui::plugins

#endif // GZ_GUI_PLUGINS_CAMERAFPS_HH_
9 changes: 4 additions & 5 deletions src/plugins/camera_tracking/CameraTracking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@

#include "CameraTracking.hh"

namespace gz::gui::plugins
{
/// \brief Private data class for CameraTracking
class gz::gui::plugins::CameraTrackingPrivate
class CameraTrackingPrivate
{
/// \brief Perform rendering calls in the rendering thread.
public: void OnRender();
Expand Down Expand Up @@ -153,10 +155,6 @@ class gz::gui::plugins::CameraTrackingPrivate
public: QTimer *timer{nullptr};
};

using namespace gz;
using namespace gui;
using namespace plugins;

/////////////////////////////////////////////////
void CameraTrackingPrivate::Initialize()
{
Expand Down Expand Up @@ -494,6 +492,7 @@ bool CameraTracking::eventFilter(QObject *_obj, QEvent *_event)
// Standard event processing
return QObject::eventFilter(_obj, _event);
}
} // namespace gz::gui::plugins

// Register this plugin
GZ_ADD_PLUGIN(gz::gui::plugins::CameraTracking,
Expand Down
13 changes: 4 additions & 9 deletions src/plugins/camera_tracking/CameraTracking.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@

#include "gz/gui/Plugin.hh"

namespace gz
{
namespace gui
{
namespace plugins
namespace gz::gui::plugins
{
class CameraTrackingPrivate;

Expand Down Expand Up @@ -64,7 +60,6 @@ namespace plugins
/// \brief Pointer to private data.
private: std::unique_ptr<CameraTrackingPrivate> dataPtr;
};
}
}
}
#endif
} // namespace gz::gui::plugins

#endif // GZ_GUI_PLUGINS_CAMERATRACKING_HH_
9 changes: 3 additions & 6 deletions src/plugins/grid_config/GridConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ namespace gz::gui
/// \brief Visible state
bool visible{true};
};
}

using namespace gz;
using namespace gui;

/////////////////////////////////////////////////
GridConfig::GridConfig()
Expand Down Expand Up @@ -409,7 +405,8 @@ void GridConfig::RefreshList()
this->OnName(this->dataPtr->nameList.at(0));
this->NameListChanged();
}
} // namespace gz::gui

// Register this plugin
GZ_ADD_PLUGIN(GridConfig,
gui::Plugin)
GZ_ADD_PLUGIN(gz::gui::GridConfig,
gz::gui::Plugin)
9 changes: 3 additions & 6 deletions src/plugins/grid_config/GridConfig.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@

#include <gz/gui/Plugin.hh>

namespace gz
{
namespace gui
namespace gz::gui
{
class GridConfigPrivate;

Expand Down Expand Up @@ -143,7 +141,6 @@ namespace gui
/// \brief Pointer to private data.
private: std::unique_ptr<GridConfigPrivate> dataPtr;
};
}
}
} // namespace gz::gui

#endif
#endif // GZ_GUI_GRIDCONFIG_HH_
18 changes: 4 additions & 14 deletions src/plugins/image_display/ImageDisplay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@
#include "gz/gui/Application.hh"
#include "gz/gui/MainWindow.hh"

namespace gz
{
namespace gui
{
namespace plugins
namespace gz::gui::plugins
{
class ImageDisplayPrivate
{
Expand All @@ -56,13 +52,6 @@ namespace plugins
/// \brief To provide images for QML.
public: ImageProvider *provider{nullptr};
};
}
}
}

using namespace gz;
using namespace gui;
using namespace plugins;

/////////////////////////////////////////////////
ImageDisplay::ImageDisplay()
Expand Down Expand Up @@ -273,7 +262,8 @@ void ImageDisplay::SetTopicList(const QStringList &_topicList)
this->dataPtr->topicList = _topicList;
this->TopicListChanged();
}
} // namespace gz::gui::plugins

// Register this plugin
GZ_ADD_PLUGIN(ImageDisplay,
gui::Plugin)
GZ_ADD_PLUGIN(gz::gui::plugins::ImageDisplay,
gz::gui::Plugin)
12 changes: 3 additions & 9 deletions src/plugins/image_display/ImageDisplay.hh
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@

#include "gz/gui/Plugin.hh"

namespace gz
{
namespace gui
{
namespace plugins
namespace gz::gui::plugins
{
class ImageDisplayPrivate;

Expand Down Expand Up @@ -136,8 +132,6 @@ namespace plugins
/// \brief Pointer to private data.
private: std::unique_ptr<ImageDisplayPrivate> dataPtr;
};
}
}
}
} // namespace gz::gui::plugins

#endif
#endif // GZ_GUI_PLUGINS_IMAGEDISPLAY_HH_
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@

#include "InteractiveViewControl.hh"

namespace gz::gui::plugins
{
/// \brief Private data class for InteractiveViewControl
class gz::gui::plugins::InteractiveViewControlPrivate
class InteractiveViewControlPrivate
{
/// \brief Perform rendering calls in the rendering thread.
public: void OnRender();
Expand Down Expand Up @@ -144,10 +146,6 @@ class gz::gui::plugins::InteractiveViewControlPrivate
public: double viewControlSensitivity = 1.0;
};

using namespace gz;
using namespace gui;
using namespace plugins;

/////////////////////////////////////////////////
void InteractiveViewControlPrivate::OnRender()
{
Expand Down Expand Up @@ -502,6 +500,7 @@ bool InteractiveViewControl::eventFilter(QObject *_obj, QEvent *_event)
// Standard event processing
return QObject::eventFilter(_obj, _event);
}
} // namespace gz::gui::plugins

// Register this plugin
GZ_ADD_PLUGIN(gz::gui::plugins::InteractiveViewControl,
Expand Down
12 changes: 3 additions & 9 deletions src/plugins/interactive_view_control/InteractiveViewControl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@

#include "gz/gui/Plugin.hh"

namespace gz
{
namespace gui
{
namespace plugins
namespace gz::gui::plugins
{
class InteractiveViewControlPrivate;

Expand Down Expand Up @@ -70,8 +66,6 @@ namespace plugins
/// \brief Pointer to private data.
private: std::unique_ptr<InteractiveViewControlPrivate> dataPtr;
};
}
}
}
} // namespace gz::gui::plugins

#endif
#endif // GZ_GUI_PLUGINS_INTERACTIVEVIEWCONTROL_HH_
14 changes: 4 additions & 10 deletions src/plugins/key_publisher/KeyPublisher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@

#include "KeyPublisher.hh"

namespace gz
{
namespace gui
namespace gz::gui
{
class KeyPublisherPrivate
{
Expand All @@ -49,11 +47,6 @@ namespace gui
pub.Publish(Msg);
}
};
}
}

using namespace gz;
using namespace gui;

/////////////////////////////////////////////////
KeyPublisher::KeyPublisher(): Plugin(), dataPtr(new KeyPublisherPrivate)
Expand Down Expand Up @@ -88,7 +81,8 @@ bool KeyPublisher::eventFilter(QObject *_obj, QEvent *_event)
}
return QObject::eventFilter(_obj, _event);
}
} // namespace gz::gui

// Register this plugin
GZ_ADD_PLUGIN(KeyPublisher,
gui::Plugin)
GZ_ADD_PLUGIN(gz::gui::KeyPublisher,
gz::gui::Plugin)
9 changes: 3 additions & 6 deletions src/plugins/key_publisher/KeyPublisher.hh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
#include <gz/gui/Plugin.hh>
#include <gz/transport/Node.hh>

namespace gz
{
namespace gui
namespace gz::gui
{
class KeyPublisherPrivate;

Expand Down Expand Up @@ -68,7 +66,6 @@ namespace gui
/// \brief Pointer to private data.
private: std::unique_ptr<KeyPublisherPrivate> dataPtr;
};
}
}
} // namespace gz::gui

#endif
#endif // GZ_GUI_PLUGINS_KEYPUBLISHER_HH_
9 changes: 4 additions & 5 deletions src/plugins/marker_manager/MarkerManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@

#include "MarkerManager.hh"

namespace gz::gui::plugins
{
/// \brief Private data class for MarkerManager
class gz::gui::plugins::MarkerManagerPrivate
class MarkerManagerPrivate
{
/// \brief Update markers based on msgs received
public: void OnRender();
Expand Down Expand Up @@ -140,10 +142,6 @@ class gz::gui::plugins::MarkerManagerPrivate
public: bool warnOnActionFailure{true};
};

using namespace gz;
using namespace gui;
using namespace plugins;

/////////////////////////////////////////////////
void MarkerManagerPrivate::Initialize()
{
Expand Down Expand Up @@ -777,6 +775,7 @@ bool MarkerManager::eventFilter(QObject *_obj, QEvent *_event)
// Standard event processing
return QObject::eventFilter(_obj, _event);
}
} // namespace gz::gui::plugins

// Register this plugin
GZ_ADD_PLUGIN(gz::gui::plugins::MarkerManager,
Expand Down
13 changes: 4 additions & 9 deletions src/plugins/marker_manager/MarkerManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@

#include "gz/gui/Plugin.hh"

namespace gz
{
namespace gui
{
namespace plugins
namespace gz::gui::plugins
{
class MarkerManagerPrivate;

Expand Down Expand Up @@ -62,7 +58,6 @@ namespace plugins
/// \brief Pointer to private data.
private: std::unique_ptr<MarkerManagerPrivate> dataPtr;
};
}
}
}
#endif
} // namespace gz::gui::plugins

#endif // GZ_GUI_PLUGINS_MARKERMANAGER_HH_
Loading

0 comments on commit ccdef74

Please sign in to comment.