diff --git a/src/osgPlugins/stl/ReaderWriterSTL.cpp b/src/osgPlugins/stl/ReaderWriterSTL.cpp index cce0d7d02..eac5382a5 100644 --- a/src/osgPlugins/stl/ReaderWriterSTL.cpp +++ b/src/osgPlugins/stl/ReaderWriterSTL.cpp @@ -105,22 +105,22 @@ private: osg::Matrix mat = osg::computeLocalToWorld( getNodePath() ); if (m_options && (m_options->getOptionString() == "separateFiles")) { - std::string sepFile = m_fout + i2s(counter); - m_f = new std::ofstream(sepFile.c_str()); - *m_f << "solid " << std::endl; + std::string sepFile = m_fout + i2s(counter); + m_f = new std::ofstream(sepFile.c_str()); + *m_f << "solid " << std::endl; } for ( unsigned int i = 0; i < node.getNumDrawables(); ++i ) { - osg::TriangleFunctor tf; - tf.m_stream = m_f; - tf.m_mat = mat; - node.getDrawable( i )->accept( tf ); + osg::TriangleFunctor tf; + tf.m_stream = m_f; + tf.m_mat = mat; + node.getDrawable( i )->accept( tf ); } if (m_options && (m_options->getOptionString() == "separateFiles")) { - *m_f << "endsolid " << std::endl; - m_f->close(); - delete m_f; + *m_f << "endsolid " << std::endl; + m_f->close(); + delete m_f; } ++counter; @@ -130,11 +130,11 @@ private: // nHandle->SetLocation( Frame( mat ) ); ~CreateStlVisitor() { if (m_options && (m_options->getOptionString() == "separateFiles")) { - osg::notify(osg::INFO) << "ReaderWriterSTL::writeNode: " << counter-1 << "Files were written" << std::endl; + osg::notify(osg::INFO) << "ReaderWriterSTL::writeNode: " << counter-1 << "Files were written" << std::endl; } else { - *m_f << "endsolid " << std::endl; - m_f->close(); - delete m_f; + *m_f << "endsolid " << std::endl; + m_f->close(); + delete m_f; } } private: @@ -148,19 +148,19 @@ private: std::ofstream* m_stream; osg::Matrix m_mat; inline void operator () ( const osg::Vec3& _v1, const osg::Vec3& _v2, const osg::Vec3& _v3, bool treatVertexDataAsTemporary ) { - osg::Vec3 v1 = _v1 * m_mat; - osg::Vec3 v2 = _v2 * m_mat; - osg::Vec3 v3 = _v3 * m_mat; - osg::Vec3 vV1V2 = v2-v1; - osg::Vec3 vV1V3 = v3-v1; - osg::Vec3 vNormal = vV1V2.operator ^(vV1V3); - *m_stream << "facet normal " << vNormal[0] << " " << vNormal[1] << " " << vNormal[2] << std::endl; - *m_stream << "outer loop" << std::endl; - *m_stream << "vertex " << v1[0] << " " << v1[1] << " " << v1[2] << std::endl; - *m_stream << "vertex " << v2[0] << " " << v2[1] << " " << v2[2] << std::endl; - *m_stream << "vertex " << v3[0] << " " << v3[1] << " " << v3[2] << std::endl; - *m_stream << "endloop" << std::endl; - *m_stream << "endfacet " << std::endl; + osg::Vec3 v1 = _v1 * m_mat; + osg::Vec3 v2 = _v2 * m_mat; + osg::Vec3 v3 = _v3 * m_mat; + osg::Vec3 vV1V2 = v2-v1; + osg::Vec3 vV1V3 = v3-v1; + osg::Vec3 vNormal = vV1V2.operator ^(vV1V3); + *m_stream << "facet normal " << vNormal[0] << " " << vNormal[1] << " " << vNormal[2] << std::endl; + *m_stream << "outer loop" << std::endl; + *m_stream << "vertex " << v1[0] << " " << v1[1] << " " << v1[2] << std::endl; + *m_stream << "vertex " << v2[0] << " " << v2[1] << " " << v2[2] << std::endl; + *m_stream << "vertex " << v3[0] << " " << v3[1] << " " << v3[2] << std::endl; + *m_stream << "endloop" << std::endl; + *m_stream << "endfacet " << std::endl; } };