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

Error with computeBounds functions in the Cookbook's examples and OSG's current master branch. #13

Closed
AdriCS opened this issue Oct 23, 2014 · 4 comments

Comments

@AdriCS
Copy link
Contributor

AdriCS commented Oct 23, 2014

In NurbsSurface and CloudBlock , the function computeBound is redefined. But with the current OSG's master brach, the build process ends in an error:

error: invalid covariant return type for 'virtual osg::BoundingBox NurbsSurface::computeBound() const'
error: overriding 'virtual osg::BoundingSphere osg::Drawable::computeBound() cost'

It seems that now Drawable has two functions for computing the bounds. The old computeBound now returns a BoundingSphere, whereas the one returning a BoundingBox is now named computeBoundingBox. Even though master isn't a stable release, I think the changes will remain for future releases.

Modifying the source code for NurbsSurface and changing computeBound to computeBoundingBox let me continue with the build.

I can make a pull request with the changes if you want. :)

@xarray
Copy link
Owner

xarray commented Oct 24, 2014

Thanks Ardi. This is because the latest OSG trunk redefines Drawable as a Node type so computeBound() returns a sphere bound by default, as well as a new computeBoundBox() method for precise use. We need to update the recipes to fit this, but had better keep some backward compatibility for older versions, maybe using the OSG_VERSION_GREATER macro.

It would be much appreciated if you could make a pull request, as I'm busy with some client work now. :-)

@AdriCS
Copy link
Contributor Author

AdriCS commented Oct 24, 2014

Hi!

I'll send you the pull request next week! :D

Cheers!

PS: It's Adri, not Ardi ;)

On 24 October 2014 03:39, Rui Wang notifications@github.com wrote:

Thanks Ardi. This is because the latest OSG trunk redefines Drawable as a
Node type so computeBound() returns a sphere bound by default, as well as a
new computeBoundBox() method for precise use. We need to update the recipes
to fit this, but had better keep some backward compatibility for older
versions, maybe using the OSG_VERSION_GREATER macro.

It would be much appreciated if you could make a pull request, as I'm busy
with some client work now. :-)


Reply to this email directly or view it on GitHub
#13 (comment).

AdriCS added a commit to AdriCS/osgRecipes that referenced this issue Oct 27, 2014
…since 3.21 release, due to Drawable inheriting now directly from Node.
xarray added a commit that referenced this issue Oct 27, 2014
@xarray xarray closed this as completed Oct 27, 2014
@1ADZX
Copy link

1ADZX commented Jun 5, 2020

Hi!

I'll send you the pull request next week! :D

Cheers!

PS: It's Adri, not Ardi ;)

On 24 October 2014 03:39, Rui Wang notifications@github.com wrote:

Thanks Ardi. This is because the latest OSG trunk redefines Drawable as a
Node type so computeBound() returns a sphere bound by default, as well as a
new computeBoundBox() method for precise use. We need to update the recipes
to fit this, but had better keep some backward compatibility for older
versions, maybe using the OSG_VERSION_GREATER macro.
It would be much appreciated if you could make a pull request, as I'm busy
with some client work now. :-)

Reply to this email directly or view it on GitHub
#13 (comment).

Hello, I have the same problem as you. Can you tell me how to solve it? I don't know where to use OSG_ VERSION_ Greeter macro, thank you

@1ADZX
Copy link

1ADZX commented Jun 5, 2020

This is my compile error message

In file included from /home/dzx/sonar_simulation/gui/osg_ocean/include/osgOcean/FFTOceanSurfaceVBO:21:0,
from /home/dzx/sonar_simulation/gui/osg_ocean/src/osgOcean/FFTOceanSurfaceVBO.cpp:18:
/home/dzx/sonar_simulation/gui/osg_ocean/include/osgOcean/MipmapGeometryVBO:147:26: error: invalid covariant return type for ‘virtual osg::BoundingBox osgOcean::MipmapGeometryVBO::computeBound() const’
osg::BoundingBox computeBound( void ) const;
^
In file included from /usr/local/include/osg/Geode:18:0,
from /home/dzx/sonar_simulation/gui/osg_ocean/include/osgOcean/OceanTechnique:20,
from /home/dzx/sonar_simulation/gui/osg_ocean/include/osgOcean/FFTOceanTechnique:20,
from /home/dzx/sonar_simulation/gui/osg_ocean/include/osgOcean/FFTOceanSurfaceVBO:20,
from /home/dzx/sonar_simulation/gui/osg_ocean/src/osgOcean/FFTOceanSurfaceVBO.cpp:18:
/usr/local/include/osg/Drawable:155:32: error: overriding ‘virtual osg::BoundingSphere osg::Drawable::computeBound() const’
virtual BoundingSphere computeBound() const;
^
src/osgOcean/CMakeFiles/osgOcean.dir/build.make:158: recipe for target 'src/osgOcean/CMakeFiles/osgOcean.dir/FFTOceanSurfaceVBO.cpp.o' failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants