Skip to content

Commit

Permalink
Fix virtual overload warnings on noble
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 committed Aug 13, 2024
1 parent c3f3e2c commit 83758af
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 69 deletions.
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
2 changes: 1 addition & 1 deletion ogre2/include/gz/rendering/ogre2/Ogre2GaussianNoisePass.hh
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

0 comments on commit 83758af

Please sign in to comment.