diff --git a/src/osgPlugins/3ds/ReaderWriter3DS.cpp b/src/osgPlugins/3ds/ReaderWriter3DS.cpp index db754bdf3..cffe3cf5f 100644 --- a/src/osgPlugins/3ds/ReaderWriter3DS.cpp +++ b/src/osgPlugins/3ds/ReaderWriter3DS.cpp @@ -1196,7 +1196,7 @@ osgDB::ReaderWriter::WriteResult ReaderWriter3DS::doWriteNode(const osg::Node& n bool ReaderWriter3DS::createFileObject(const osg::Node& node, Lib3dsFile * file3ds,const std::string& fileName, const osgDB::ReaderWriter::Options* options) const { - WriterNodeVisitor w(file3ds, fileName, options, osgDB::getFilePath(node.getName())); + plugin3ds::WriterNodeVisitor w(file3ds, fileName, options, osgDB::getFilePath(node.getName())); const_cast(node).accept(w); // Ugly const_cast<> for visitor... if (!w.succeeded()) return false; w.writeMaterials(); diff --git a/src/osgPlugins/3ds/WriterNodeVisitor.cpp b/src/osgPlugins/3ds/WriterNodeVisitor.cpp index 68e3aa936..604925eac 100644 --- a/src/osgPlugins/3ds/WriterNodeVisitor.cpp +++ b/src/osgPlugins/3ds/WriterNodeVisitor.cpp @@ -126,6 +126,11 @@ bool is3DSpath(const std::string & s, bool extendedFilePaths) } +// Use namespace qualification to avoid static-link symbol collitions +// from multiply defined symbols. +namespace plugin3ds +{ + /** writes all primitives of a primitive-set out to a stream, decomposes quads to triangles, line-strips to lines etc */ class PrimitiveIndexWriter : public osg::PrimitiveIndexFunctor @@ -1055,3 +1060,6 @@ void WriterNodeVisitor::apply3DSMatrixNode(osg::Node &node, const osg::Matrix * lib3ds_file_append_node(file3ds, reinterpret_cast(node3ds), reinterpret_cast(parent)); _cur3dsNode = node3ds; } + +// end namespace plugin3ds +} diff --git a/src/osgPlugins/3ds/WriterNodeVisitor.h b/src/osgPlugins/3ds/WriterNodeVisitor.h index f11a77536..76743f8b6 100644 --- a/src/osgPlugins/3ds/WriterNodeVisitor.h +++ b/src/osgPlugins/3ds/WriterNodeVisitor.h @@ -48,6 +48,9 @@ void copyOsgMatrixToLib3dsMatrix(Lib3dsMatrix lib3ds_matrix, const osg::Matrix& typedef std::map, unsigned int> MapIndices; typedef std::vector > ListTriangle; //the int is the drawable of the triangle +namespace plugin3ds +{ + class WriterNodeVisitor: public osg::NodeVisitor { public: @@ -213,4 +216,7 @@ class WriterNodeVisitor: public osg::NodeVisitor std::set _imageSet; }; +// end namespace plugin3ds +} + #endif diff --git a/src/osgPlugins/fbx/ReaderWriterFBX.cpp b/src/osgPlugins/fbx/ReaderWriterFBX.cpp index 9c816fd9c..4dcfc88e2 100644 --- a/src/osgPlugins/fbx/ReaderWriterFBX.cpp +++ b/src/osgPlugins/fbx/ReaderWriterFBX.cpp @@ -424,7 +424,7 @@ osgDB::ReaderWriter::WriteResult ReaderWriterFBX::writeNode( } KFbxScene* pScene = KFbxScene::Create(pSdkManager, ""); - WriterNodeVisitor writerNodeVisitor(pScene, pSdkManager, filename, + pluginfbx::WriterNodeVisitor writerNodeVisitor(pScene, pSdkManager, filename, options, osgDB::getFilePath(node.getName().empty() ? filename : node.getName())); if (useFbxRoot && isBasicRootNode(node)) { diff --git a/src/osgPlugins/fbx/WriterNodeVisitor.cpp b/src/osgPlugins/fbx/WriterNodeVisitor.cpp index 8eb99632d..203b6fc2f 100644 --- a/src/osgPlugins/fbx/WriterNodeVisitor.cpp +++ b/src/osgPlugins/fbx/WriterNodeVisitor.cpp @@ -25,6 +25,13 @@ #include "WriterNodeVisitor.h" #include + +// Use namespace qualification to avoid static-link symbol collitions +// from multiply defined symbols. +namespace pluginfbx +{ + + /** writes all primitives of a primitive-set out to a stream, decomposes quads to triangles, line-strips to lines etc */ class PrimitiveIndexWriter : public osg::PrimitiveIndexFunctor { @@ -782,3 +789,6 @@ void WriterNodeVisitor::apply(osg::MatrixTransform& node) traverse(node); _curFbxNode = parent; } + +// end namespace pluginfbx +} diff --git a/src/osgPlugins/fbx/WriterNodeVisitor.h b/src/osgPlugins/fbx/WriterNodeVisitor.h index ef4240a32..97e714322 100644 --- a/src/osgPlugins/fbx/WriterNodeVisitor.h +++ b/src/osgPlugins/fbx/WriterNodeVisitor.h @@ -59,6 +59,8 @@ struct VertexIndex typedef std::vector > ListTriangle; //the int is the drawable of the triangle typedef std::map MapIndices; ///< Map OSG indices to FBX mesh indices +namespace pluginfbx +{ ///\author Capo (Thibault Caporal), Sukender (Benoit Neil) class WriterNodeVisitor: public osg::NodeVisitor @@ -261,4 +263,7 @@ class WriterNodeVisitor: public osg::NodeVisitor const std::string _srcDirectory; }; +// end namespace pluginfbx +} + #endif // _FBX_WRITER_NODE_VISITOR_HEADER__