Skip to content

Commit

Permalink
Merge branch 'main' into mjcarroll/qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcarroll committed Feb 5, 2024
2 parents 2ec0c07 + 32773d6 commit b1dcc50
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 17 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ add_compile_definitions(QT_DISABLE_DEPRECATED_UP_TO=0x050F00)
set(CMAKE_AUTOMOC TRUE)
set(CMAKE_AUTOUIC TRUE)
set(CMAKE_AUTORCC TRUE)
cmake_policy(SET CMP0100 NEW)

if(POLICY CMP0100)
cmake_policy(SET CMP0100 NEW)
endif()
Expand Down
16 changes: 15 additions & 1 deletion src/plugins/CameraTracking/CameraTracking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ class CameraTracking::Implementation
/// \brief The pose set from the move to pose service.
public: std::optional<math::Pose3d> moveToPoseValue;

/// \brief The motion duration set from the move to pose service.
public: std::optional<double> moveToPoseDuration;

/// \brief Follow service
public: std::string followService;

Expand Down Expand Up @@ -250,6 +253,7 @@ void CameraTracking::Implementation::OnMoveToComplete()
void CameraTracking::Implementation::OnMoveToPoseComplete()
{
this->moveToPoseValue.reset();
this->moveToPoseDuration.reset();
}

/////////////////////////////////////////////////
Expand Down Expand Up @@ -290,6 +294,15 @@ bool CameraTracking::Implementation::OnMoveToPose(const msgs::GUICamera &_msg,

this->moveToPoseValue = pose;

if (_msg.duration() > 0)
{
this->moveToPoseDuration = _msg.duration();
}
else
{
this->moveToPoseDuration = 0.5;
}

_res.set_data(true);
return true;
}
Expand Down Expand Up @@ -352,7 +365,8 @@ void CameraTracking::Implementation::OnRender()
{
this->moveToHelper.MoveTo(this->camera,
*(this->moveToPoseValue),
0.5, std::bind(&Implementation::OnMoveToPoseComplete, this));
*(this->moveToPoseDuration),
std::bind(&Implementation::OnMoveToPoseComplete, this));
this->prevMoveToTime = std::chrono::system_clock::now();
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/ImageDisplay/ImageDisplay.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <gz/msgs/image.pb.h>

#ifndef _WIN32
# define ImageDisplay_EXPORTS_API
# define ImageDisplay_EXPORTS_API __attribute__ ((visibility ("default")))
#else
# if (defined(ImageDisplay_EXPORTS))
# define ImageDisplay_EXPORTS_API __declspec(dllexport)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/KeyPublisher/KeyPublisher.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define GZ_GUI_PLUGINS_KEYPUBLISHER_HH_

#ifndef _WIN32
# define KeyPublisher_EXPORTS_API
# define KeyPublisher_EXPORTS_API __attribute__ ((visibility ("default")))
#else
# if (defined(KeyPublisher_EXPORTS))
# define KeyPublisher_EXPORTS_API __declspec(dllexport)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/Publisher/Publisher.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <gz/utils/ImplPtr.hh>

#ifndef _WIN32
# define Publisher_EXPORTS_API
# define Publisher_EXPORTS_API __attribute__ ((visibility ("default")))
#else
# if (defined(Publisher_EXPORTS))
# define Publisher_EXPORTS_API __declspec(dllexport)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/ShutdownButton/ShutdownButton.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "gz/gui/Plugin.hh"

#ifndef _WIN32
# define ShutdownButton_EXPORTS_API
# define ShutdownButton_EXPORTS_API __attribute__ ((visibility ("default")))
#else
# if (defined(ShutdownButton_EXPORTS))
# define ShutdownButton_EXPORTS_API __declspec(dllexport)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/Teleop/Teleop.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <gz/utils/ImplPtr.hh>

#ifndef _WIN32
# define Teleop_EXPORTS_API
# define Teleop_EXPORTS_API __attribute__ ((visibility ("default")))
#else
# if (defined(Teleop_EXPORTS))
# define Teleop_EXPORTS_API __declspec(dllexport)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/TopicEcho/TopicEcho.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#endif

#ifndef _WIN32
# define TopicEcho_EXPORTS_API
# define TopicEcho_EXPORTS_API __attribute__ ((visibility ("default")))
#else
# if (defined(TopicEcho_EXPORTS))
# define TopicEcho_EXPORTS_API __declspec(dllexport)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/TopicViewer/TopicViewer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <gz/utils/ImplPtr.hh>

#ifndef _WIN32
# define TopicViewer_EXPORTS_API
# define TopicViewer_EXPORTS_API __attribute__ ((visibility ("default")))
#else
# if (defined(TopicViewer_EXPORTS))
# define TopicViewer_EXPORTS_API __declspec(dllexport)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/WorldControl/WorldControl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <gz/utils/ImplPtr.hh>

#ifndef _WIN32
# define WorldControl_EXPORTS_API
# define WorldControl_EXPORTS_API __attribute__ ((visibility ("default")))
#else
# if (defined(WorldControl_EXPORTS))
# define WorldControl_EXPORTS_API __declspec(dllexport)
Expand Down
14 changes: 12 additions & 2 deletions src/plugins/WorldControl/WorldControlEventListener.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,27 @@
#define GZ_GUI_WORLDCONTROLEVENTLISTENER_HH_

#include "gz/gui/Application.hh"
#include "gz/gui/Export.hh"
#include "gz/gui/GuiEvents.hh"
#include "gz/gui/MainWindow.hh"
#include "gz/gui/qt.h"

#ifndef _WIN32
# define WorldControl_EXPORTS_API __attribute__ ((visibility ("default")))
#else
# if (defined(WorldControl_EXPORTS))
# define WorldControl_EXPORTS_API __declspec(dllexport)
# else
# define WorldControl_EXPORTS_API __declspec(dllimport)
# endif
#endif


namespace gz::gui
{
/// \brief Helper class for testing listening to events emitted by the
/// WorldControl plugin. This is used for testing the event behavior of
/// the WorldControl plugin.
class WorldControlEventListener : public QObject
class WorldControl_EXPORTS_API WorldControlEventListener : public QObject
{
Q_OBJECT

Expand Down
3 changes: 1 addition & 2 deletions src/plugins/WorldStats/WorldStats.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@

#include <gz/msgs/world_stats.pb.h>

#include "gz/gui/Export.hh"
#include "gz/gui/Plugin.hh"

#include <gz/utils/ImplPtr.hh>

#ifndef _WIN32
# define WorldStats_EXPORTS_API
# define WorldStats_EXPORTS_API __attribute__ ((visibility ("default")))
#else
# if (defined(WorldStats_EXPORTS))
# define WorldStats_EXPORTS_API __declspec(dllexport)
Expand Down
3 changes: 1 addition & 2 deletions test/helpers/TestHelper.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
#define GZ_GUI_TESTHELPER_HH_

#include <gz/gui/Application.hh>
#include <gz/gui/Export.hh>
#include <gz/gui/MainWindow.hh>

#ifndef _WIN32
# define TestHelper_EXPORTS_API
# define TestHelper_EXPORTS_API __attribute__ ((visibility ("default")))
#else
# if (defined(TestHelper_EXPORTS))
# define TestHelper_EXPORTS_API __declspec(dllexport)
Expand Down

0 comments on commit b1dcc50

Please sign in to comment.