Merge branch 'master' into const-tokens

This commit is contained in:
krishty
2021-09-15 23:31:00 +02:00
committed by GitHub
130 changed files with 2977 additions and 3522 deletions

View File

@@ -43,6 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file STLExporter.h
* Declares the exporter class to write a scene to a Stereolithography (STL) file
*/
#pragma once
#ifndef AI_STLEXPORTER_H_INC
#define AI_STLEXPORTER_H_INC
@@ -57,28 +58,24 @@ namespace Assimp {
// ------------------------------------------------------------------------------------------------
/** Helper class to export a given scene to a STL file. */
// ------------------------------------------------------------------------------------------------
class STLExporter
{
class STLExporter {
public:
/// Constructor for a specific scene to export
STLExporter(const char* filename, const aiScene* pScene, bool exportPOintClouds, bool binary = false);
STLExporter(const char *filename, const aiScene *pScene, bool exportPOintClouds, bool binary = false);
/// public stringstreams to write all output into
/// public string-streams to write all output into
std::ostringstream mOutput;
private:
void WritePointCloud(const std::string &name, const aiScene* pScene);
void WriteMesh(const aiMesh* m);
void WriteMeshBinary(const aiMesh* m);
void WritePointCloud(const std::string &name, const aiScene *pScene);
void WriteMesh(const aiMesh *m);
void WriteMeshBinary(const aiMesh *m);
private:
const std::string filename;
// this endl() doesn't flush() the stream
const std::string endl;
};
}
} // namespace Assimp
#endif

View File

@@ -43,7 +43,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef ASSIMP_BUILD_NO_STL_IMPORTER
// internal headers
#include "STLLoader.h"
#include <assimp/ParsingUtils.h>
#include <assimp/fast_atof.h>
@@ -146,7 +145,9 @@ bool STLImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool c
if (extension == "stl") {
return true;
} else if (!extension.length() || checkSig) {
}
if (!extension.length() || checkSig) {
if (!pIOHandler) {
return true;
}

View File

@@ -53,7 +53,6 @@ struct aiNode;
namespace Assimp {
// ---------------------------------------------------------------------------
/**
* @brief Importer class for the sterolithography STL file format.
@@ -68,13 +67,13 @@ public:
/**
* @brief The class destructor.
*/
~STLImporter();
~STLImporter() override;
/**
* @brief Returns whether the class can handle the format of the given file.
* See BaseImporter::CanRead() for details.
*/
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const override;
protected:
@@ -82,14 +81,14 @@ protected:
* @brief Return importer meta information.
* See #BaseImporter::GetInfo for the details
*/
const aiImporterDesc* GetInfo () const;
const aiImporterDesc* GetInfo () const override;
/**
* @brief Imports the given file into the given scene structure.
* See BaseImporter::InternReadFile() for details
*/
void InternReadFile( const std::string& pFile, aiScene* pScene,
IOSystem* pIOHandler);
IOSystem* pIOHandler) override;
/**
* @brief Loads a binary .stl file