From 8c13c8a558f2451383755cc895b0da4bf0874e7a Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 14 Jan 2016 20:44:09 +0100 Subject: [PATCH] PLYExporter: forbit copying + add empty destructor. --- code/PlyExporter.cpp | 13 +++++++++---- code/PlyExporter.h | 22 +++++++++++----------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/code/PlyExporter.cpp b/code/PlyExporter.cpp index d884c887c..607f332c2 100644 --- a/code/PlyExporter.cpp +++ b/code/PlyExporter.cpp @@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "qnan.h" -using namespace Assimp; +//using namespace Assimp; namespace Assimp { // ------------------------------------------------------------------------------------------------ @@ -86,8 +86,6 @@ void ExportScenePlyBinary(const char* pFile, IOSystem* pIOSystem, const aiScene* outfile->Write(exporter.mOutput.str().c_str(), static_cast(exporter.mOutput.tellp()), 1); } -} // end of namespace Assimp - #define PLY_EXPORT_HAS_NORMALS 0x1 #define PLY_EXPORT_HAS_TANGENTS_BITANGENTS 0x2 #define PLY_EXPORT_HAS_TEXCOORDS 0x4 @@ -216,6 +214,11 @@ PlyExporter::PlyExporter(const char* _filename, const aiScene* pScene, bool bina } } +// ------------------------------------------------------------------------------------------------ +PlyExporter::~PlyExporter() { + // empty +} + // ------------------------------------------------------------------------------------------------ void PlyExporter::WriteMeshVerts(const aiMesh* m, unsigned int components) { @@ -367,4 +370,6 @@ void PlyExporter::WriteMeshIndicesBinary(const aiMesh* m, unsigned int offset) WriteMeshIndicesBinary_Generic(m, offset, mOutput); } -#endif +} // end of namespace Assimp + +#endif // !defined(ASSIMP_BUILD_NO_EXPORT) && !defined(ASSIMP_BUILD_NO_PLY_EXPORTER) diff --git a/code/PlyExporter.h b/code/PlyExporter.h index 1bd48815d..be4fa466f 100644 --- a/code/PlyExporter.h +++ b/code/PlyExporter.h @@ -59,30 +59,30 @@ namespace Assimp class PlyExporter { public: - /// Constructor for a specific scene to export + /// The class constructor for a specific scene to export PlyExporter(const char* filename, const aiScene* pScene, bool binary = false); + /// The class destructor, empty. + ~PlyExporter(); public: - - /// public stringstreams to write all output into + /// public string-streams to write all output into: std::ostringstream mOutput; private: - void WriteMeshVerts(const aiMesh* m, unsigned int components); void WriteMeshIndices(const aiMesh* m, unsigned int ofs); - void WriteMeshVertsBinary(const aiMesh* m, unsigned int components); void WriteMeshIndicesBinary(const aiMesh* m, unsigned int offset); private: + const std::string filename; // tHE FILENAME + const std::string endl; // obviously, this endl() doesn't flush() the stream - const std::string filename; - - // obviously, this endl() doesn't flush() the stream - const std::string endl; +private: + PlyExporter( const PlyExporter & ); + PlyExporter &operator = ( const PlyExporter & ); }; -} +} // Namespace Assimp -#endif +#endif // AI_PLYEXPORTER_H_INC