Robert Osfield <[email protected]> wrote: > Hi Jan, > > I resorted to getting OpenVRML 0.18.3 to build under a Kubuntu 9.10 > install, using this I came across a build issue with your changes - > you missed sending your changes to ReaderWriterVRML2.h for the change > in method signature of the convertFromVRML method. I was able to work > out what this change should have been - simple use what you used in > the .cpp, and got things to build cleanly.
That's actually weird, because the only change I have made was removal of a header file that is not in 0.18.3 anymore. Odd ... I guess something had to fall through the cracks somewhere. > I also fixed an unused > variable warning : > > home/robert/OpenSceneGraph/src/osgPlugins/vrml/IndexedFaceSet.cpp:21: > warning: unused variable ‘osg_stateset’ > > Which... was getOrCreateStateSet(), but I presume isn't required. Yes, I think I remember seeing this one, it was a leftover. > > All these changes are now checked into svn/trunk. Could you test out > svn/trunk to make sure that my changes are all appropriate. It works for me (32bit Linux), except for one missed function declaration in the header that causes undefined symbol crash at runtime. I have just commented it out, the file is attached. I am not sure where did the declaration with the istream as input argument come from. Regards, Jan
// -*-c++-*- /* * * VRML2 file converter for OpenSceneGraph. * * authors : Jan Ciger ([email protected]), * Tolga Abaci ([email protected]), * Bruno Herbelin ([email protected]) * * (c) VRlab EPFL, Switzerland, 2004-2006 * * Gino van den Bergen, DTECTA ([email protected]) * Xiangxian Wang ([email protected]) * */ #include <string> #include <map> #include <osg/Node> #include <osg/Geometry> #include <osgDB/Registry> #include <osgDB/ReadFile> #include <osgDB/FileNameUtils> #include <osgDB/FileUtils> namespace openvrml { class node; } class QuadricKey { public: QuadricKey(float height, float radius, unsigned bottom, unsigned side, unsigned top) : m_height(height) , m_radius(radius) , m_flags(bottom | (side << 1) | (top << 2)) {} bool operator<(const QuadricKey& rhs) const { return m_height < rhs.m_height || (m_height == rhs.m_height && (m_radius < rhs.m_radius || (m_radius == rhs.m_radius && m_flags < rhs.m_flags))); } private: float m_height; float m_radius; unsigned m_flags; }; /** * OpenSceneGraph plugin wrapper/converter. */ class ReaderWriterVRML2 : public osgDB::ReaderWriter { public: ReaderWriterVRML2() { supportsExtension("wrl","VRML format"); } virtual const char* className() const { return "VRML2 Reader/Writer"; } virtual ReadResult readNode(const std::string&, const osgDB::Options *options) const; // virtual ReadResult readNode(std::istream& fin, const osgDB::Options* options) const; private: typedef std::map<float, osg::ref_ptr<osg::Geometry> > SphereLibrary; typedef std::map<osg::Vec3, osg::ref_ptr<osg::Geometry> > BoxLibrary; typedef std::map<QuadricKey, osg::ref_ptr<osg::Geometry> > ConeLibrary; typedef std::map<QuadricKey, osg::ref_ptr<osg::Geometry> > CylinderLibrary; osg::ref_ptr<osg::Node> convertFromVRML(openvrml::node *obj) const; osg::ref_ptr<osg::Geometry> convertVRML97IndexedFaceSet(openvrml::node *vrml_ifs) const; osg::ref_ptr<osg::Geometry> convertVRML97Box(openvrml::node* vrml_box) const; osg::ref_ptr<osg::Geometry> convertVRML97Sphere(openvrml::node* vrml_sphere) const; osg::ref_ptr<osg::Geometry> convertVRML97Cone(openvrml::node* vrml_cone) const; osg::ref_ptr<osg::Geometry> convertVRML97Cylinder(openvrml::node* vrml_cylinder) const; mutable BoxLibrary m_boxLibrary; mutable SphereLibrary m_sphereLibrary; mutable ConeLibrary m_coneLibrary; mutable CylinderLibrary m_cylinderLibrary; };
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
