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

Fix overloaded virtual warnings on noble #1036

Merged
merged 3 commits into from
Aug 15, 2024
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
8 changes: 8 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ release will remove the deprecated code.
+ Removed: `Ogre::OgreItem *OnSelectionClick(const int _x, const int _y)`
+ Replacement: `Ogre::MovableObject *OnSelectionClick(int _x, int _y)`

1. **GpuRays**
+ Made function private: `void Copy(Image &_image)`
+ Use the overloaded function: `void Copy(float *_data)`

1. **RenderPass**
+ Made function private: `void PreRender()`
+ Use the overloaded function: `void PreRender(const CameraPtr &_camera)`

## Gazebo Rendering 7.x to 8.x

### Deprecations
Expand Down
12 changes: 0 additions & 12 deletions include/gz/rendering/Camera.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@
#include "gz/rendering/Sensor.hh"
#include "gz/rendering/Scene.hh"

// overloaded-virtuals warnings appeared on Ubuntu Noble
// GCC-13. it is not easy to fix them without breaking ABI
// ignore them to preserve current ABI.
#if defined(__GNUC__) || defined(__clang__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Woverloaded-virtual"
#endif

namespace gz
{
namespace rendering
Expand Down Expand Up @@ -377,8 +369,4 @@ namespace gz
}
}

#if defined(__GNUC__) || defined(__clang__)
# pragma GCC diagnostic pop
#endif

#endif
4 changes: 4 additions & 0 deletions include/gz/rendering/GpuRays.hh
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ namespace gz
/// \return The vertical resolution.
/// \sa VerticalRayCount()
public: virtual double VerticalResolution() const = 0;

// Disallow use of Camera::Copy by making it private.
// Use the overloaded Copy(float *) function instead.
private: using Camera::Copy;
};
}
}
Expand Down
12 changes: 0 additions & 12 deletions include/gz/rendering/Object.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@
#include "gz/rendering/RenderTypes.hh"
#include "gz/rendering/Export.hh"

// overloaded-virtuals warnings appeared on Ubuntu Noble
// GCC-13. it is not easy to fix them without breaking ABI
// ignore them to preserve current ABI.
#if defined(__GNUC__) || defined(__clang__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Woverloaded-virtual"
#endif

namespace gz
{
namespace rendering
Expand Down Expand Up @@ -78,8 +70,4 @@ namespace gz
}
}

#if defined(__GNUC__) || defined(__clang__)
# pragma GCC diagnostic pop
#endif

#endif
10 changes: 0 additions & 10 deletions include/gz/rendering/ParticleEmitter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,6 @@ namespace gz
/// \sa Lifetime
public: virtual void SetLifetime(double _lifetime) = 0;

/// \brief Get the material which all particles in the emitter will use.
/// \return The material pointer.
/// \sa SetMaterial
public: virtual MaterialPtr Material() const = 0;

/// \brief Sets the material which all particles in the emitter will use.
/// \param[in] _material The material pointer.
/// \sa Material
public: virtual void SetMaterial(const MaterialPtr &_material) = 0;

/// \brief Get the minimum velocity each particle is emitted (m/s).
/// \return Minimum velocity.
/// \sa MaxVelocity
Expand Down
4 changes: 4 additions & 0 deletions include/gz/rendering/RenderPass.hh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ namespace gz
/// \brief See SetWideAngleCameraAfterStitching()
/// \return The current value set by SetWideAngleCameraAfterStitching
public: virtual bool WideAngleCameraAfterStitching() const = 0;

// Documentation inherited
// Use PreRender(const CameraPtr &) instead
private: using Object::PreRender;
};
}
}
Expand Down
3 changes: 3 additions & 0 deletions include/gz/rendering/RenderTarget.hh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ namespace gz
/// \return Render target background color.
public: virtual math::Color BackgroundColor() const = 0;

// Documentation inherited
public: using Object::PreRender;

/// \brief See Object::PreRender. This function will call
/// Object::PreRender but with the added bonus that it has access
/// to the camera that is about to render
Expand Down
12 changes: 0 additions & 12 deletions include/gz/rendering/Visual.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@
#include "gz/rendering/config.hh"
#include "gz/rendering/Node.hh"

// overloaded-virtuals warnings appeared on Ubuntu Noble
// GCC-13. it is not easy to fix them without breaking ABI
// ignore them to preserve current ABI.
#if defined(__GNUC__) || defined(__clang__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Woverloaded-virtual"
#endif

namespace gz
{
namespace rendering
Expand Down Expand Up @@ -215,8 +207,4 @@ namespace gz
}
}

#if defined(__GNUC__) || defined(__clang__)
# pragma GCC diagnostic pop
#endif

#endif
6 changes: 4 additions & 2 deletions include/gz/rendering/base/BaseParticleEmitter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ namespace gz
public: virtual MaterialPtr Material() const override;

// Documentation inherited.
public: virtual void SetMaterial(const MaterialPtr &_material) override;
public: virtual void SetMaterial(MaterialPtr _material,
bool _unique = true) override;

// Documentation inherited.
public: virtual double MinVelocity() const override;
Expand Down Expand Up @@ -341,7 +342,8 @@ namespace gz

/////////////////////////////////////////////////
template <class T>
void BaseParticleEmitter<T>::SetMaterial(const MaterialPtr &_material)
void BaseParticleEmitter<T>::SetMaterial(MaterialPtr _material,
bool /*_unique*/)
{
this->material = _material;
}
Expand Down
2 changes: 1 addition & 1 deletion include/gz/rendering/base/BaseRenderPass.hh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace gz
public: virtual bool IsEnabled() const override;

// Documentation inherited
public: void PreRender(const CameraPtr &_camera) override;
public: virtual void PreRender(const CameraPtr &_camera) override;

// Documentation inherited
public: void SetWideAngleCameraAfterStitching(bool _afterStitching)
Expand Down
12 changes: 0 additions & 12 deletions include/gz/rendering/base/BaseRenderTarget.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@
#include "gz/rendering/Scene.hh"
#include "gz/rendering/base/BaseRenderTypes.hh"

// overloaded-virtuals warnings appeared on Ubuntu Noble
// GCC-13. it is not easy to fix them without breaking ABI
// ignore them to preserve current ABI.
#if defined(__GNUC__) || defined(__clang__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Woverloaded-virtual"
#endif

namespace gz
{
namespace rendering
Expand Down Expand Up @@ -415,8 +407,4 @@ namespace gz
}
}

#if defined(__GNUC__) || defined(__clang__)
# pragma GCC diagnostic pop
#endif

#endif
2 changes: 1 addition & 1 deletion ogre/include/gz/rendering/ogre/OgreRenderTarget.hh
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ namespace gz
public: virtual void PostRender() override;

// Documentation inherited.
public: virtual unsigned int GLId();
public: virtual unsigned int GLId() const override;

public: virtual void Buffer(float *buffer);

Expand Down
2 changes: 1 addition & 1 deletion ogre/src/OgreRenderTarget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void OgreRenderTexture::BuildTarget()
}

//////////////////////////////////////////////////
unsigned int OgreRenderTexture::GLId()
unsigned int OgreRenderTexture::GLId() const
{
if (!this->ogreTexture)
return 0u;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace gz
public: virtual ~Ogre2GaussianNoisePass();

// Documentation inherited
public: void PreRender() override;
public: virtual void PreRender(const CameraPtr &_camera) override;

// Documentation inherited
public: void CreateRenderPass() override;
Expand Down
3 changes: 2 additions & 1 deletion ogre2/include/gz/rendering/ogre2/Ogre2ParticleEmitter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ namespace gz
public: virtual void SetLifetime(double _lifetime) override;

// Documentation inherited.
public: virtual void SetMaterial(const MaterialPtr &_material) override;
public: virtual void SetMaterial(MaterialPtr _material,
bool _unique = true) override;

// Documentation inherited.
public: virtual void SetVelocityRange(double _minVelocity,
Expand Down
4 changes: 2 additions & 2 deletions ogre2/src/Ogre2DepthCamera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Ogre2DepthGaussianNoisePass : public Ogre2GaussianNoisePass
public: virtual ~Ogre2DepthGaussianNoisePass() {}

// Documentation inherited.
public: void PreRender() override;
public: virtual void PreRender(const CameraPtr &_camera) override;

// Documentation inherited.
public: void CreateRenderPass() override;
Expand Down Expand Up @@ -180,7 +180,7 @@ using namespace gz;
using namespace rendering;

//////////////////////////////////////////////////
void Ogre2DepthGaussianNoisePass::PreRender()
void Ogre2DepthGaussianNoisePass::PreRender(const CameraPtr &/*_camera*/)
{
// This function is similar to Ogre2GaussianNoisePass but duplicated here
// for Ogre2DepthCamera
Expand Down
2 changes: 1 addition & 1 deletion ogre2/src/Ogre2GaussianNoisePass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Ogre2GaussianNoisePass::~Ogre2GaussianNoisePass()
}

//////////////////////////////////////////////////
void Ogre2GaussianNoisePass::PreRender()
void Ogre2GaussianNoisePass::PreRender(const CameraPtr &/*_camera*/)
{
if (!this->dataPtr->gaussianNoiseMat)
return;
Expand Down
3 changes: 2 additions & 1 deletion ogre2/src/Ogre2ParticleEmitter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ void Ogre2ParticleEmitter::SetLifetime(double _lifetime)
}

//////////////////////////////////////////////////
void Ogre2ParticleEmitter::SetMaterial(const MaterialPtr &_material)
void Ogre2ParticleEmitter::SetMaterial(MaterialPtr _material,
bool /*_unique*/)
{
// Sanity check: The material cannot be nullptr.
if (!_material)
Expand Down