Skip to content

Commit

Permalink
Merge branch 'master' into static
Browse files Browse the repository at this point in the history
  • Loading branch information
mahiuchun authored Sep 17, 2021
2 parents 93edbe8 + 71a87b6 commit 79f3368
Show file tree
Hide file tree
Showing 130 changed files with 2,927 additions and 3,472 deletions.
2 changes: 1 addition & 1 deletion code/AssetLib/3DS/3DSExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <memory>

using namespace Assimp;
namespace Assimp {

using namespace D3DS;

namespace {
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/3DS/3DSHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/light.h>
#include <assimp/material.h>
#include <assimp/qnan.h>
#include <stdio.h> //sprintf
#include <cstdio> //sprintf

namespace Assimp {
namespace D3DS {
Expand Down
10 changes: 5 additions & 5 deletions code/AssetLib/3DS/3DSLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef AI_3DSIMPORTER_H_INC
#define AI_3DSIMPORTER_H_INC
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER

#include <assimp/BaseImporter.h>
#include <assimp/types.h>

#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER

#include "3DSHelper.h"
#include <assimp/StreamReader.h>
Expand All @@ -75,29 +75,29 @@ class Discreet3DSImporter : public BaseImporter {
* See BaseImporter::CanRead() for details.
*/
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
bool checkSig) const;
bool checkSig) const override;

// -------------------------------------------------------------------
/** Called prior to ReadFile().
* The function is a request to the importer to update its configuration
* basing on the Importer's configuration property list.
*/
void SetupProperties(const Importer* pImp);
void SetupProperties(const Importer* pImp) override;

protected:

// -------------------------------------------------------------------
/** Return importer meta information.
* See #BaseImporter::GetInfo for the details
*/
const aiImporterDesc* GetInfo () const;
const aiImporterDesc* GetInfo () const override;

// -------------------------------------------------------------------
/** 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;

// -------------------------------------------------------------------
/** Converts a temporary material to the outer representation
Expand Down
5 changes: 3 additions & 2 deletions code/AssetLib/3MF/D3MFExporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once

#ifndef ASSIMP_BUILD_NO_EXPORT
#ifndef ASSIMP_BUILD_NO_3MF_EXPORTER

#include <memory>
#include <sstream>
#include <vector>
Expand All @@ -58,8 +61,6 @@ class IOStream;

namespace D3MF {

#ifndef ASSIMP_BUILD_NO_EXPORT
#ifndef ASSIMP_BUILD_NO_3MF_EXPORTER

struct OpcPackageRelationship;

Expand Down
4 changes: 4 additions & 0 deletions code/AssetLib/3MF/D3MFImporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_D3MFLOADER_H_INCLUDED
#define AI_D3MFLOADER_H_INCLUDED

#ifndef ASSIMP_BUILD_NO_3MF_IMPORTER

#include <assimp/BaseImporter.h>

namespace Assimp {
Expand Down Expand Up @@ -84,4 +86,6 @@ class D3MFImporter : public BaseImporter {

} // Namespace Assimp

#endif // #ifndef ASSIMP_BUILD_NO_3MF_IMPORTER

#endif // AI_D3MFLOADER_H_INCLUDED
3 changes: 1 addition & 2 deletions code/AssetLib/3MF/D3MFOpcPackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/IOSystem.hpp>
#include <assimp/texture.h>
#include "3MFXmlTags.h"

#include <algorithm>
#include <cassert>
#include <cstdlib>
#include <map>
#include <memory>
#include <vector>

namespace Assimp {
Expand Down Expand Up @@ -186,7 +186,6 @@ D3MFOpcPackage::D3MFOpcPackage(IOSystem *pIOHandler, const std::string &rFile) :
D3MFOpcPackage::~D3MFOpcPackage() {
mZipArchive->Close(mRootStream);
delete mZipArchive;
mZipArchive = nullptr;
}

IOStream *D3MFOpcPackage::RootStream() const {
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/3MF/D3MFOpcPackage.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef D3MFOPCPACKAGE_H
#define D3MFOPCPACKAGE_H

#include <assimp/IOSystem.hpp>
#include <memory>
#include <string>
#include <assimp/IOSystem.hpp>

struct aiTexture;

Expand Down
10 changes: 5 additions & 5 deletions code/AssetLib/AC/ACLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace Assimp {
class AC3DImporter : public BaseImporter {
public:
AC3DImporter();
~AC3DImporter();
~AC3DImporter() override;

// Represents an AC3D material
struct Material {
Expand Down Expand Up @@ -185,25 +185,25 @@ class AC3DImporter : public BaseImporter {
* See BaseImporter::CanRead() for details.
*/
bool CanRead(const std::string &pFile, IOSystem *pIOHandler,
bool checkSig) const;
bool checkSig) const override;

protected:
// -------------------------------------------------------------------
/** Return importer meta information.
* See #BaseImporter::GetInfo for the details */
const aiImporterDesc *GetInfo() const;
const aiImporterDesc *GetInfo() const override;

// -------------------------------------------------------------------
/** 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;

// -------------------------------------------------------------------
/** Called prior to ReadFile().
* The function is a request to the importer to update its configuration
* basing on the Importer's configuration property list.*/
void SetupProperties(const Importer *pImp);
void SetupProperties(const Importer *pImp) override;

private:
// -------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions code/AssetLib/AMF/AMFImporter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class AMFImporter : public BaseImporter {
AMFImporter() AI_NO_EXCEPT;

/// Default destructor.
~AMFImporter();
~AMFImporter() override;

/// Parse AMF file and fill scene graph. The function has no return value. Result can be found by analyzing the generated graph.
/// Also exception can be thrown if trouble will found.
Expand All @@ -276,9 +276,9 @@ class AMFImporter : public BaseImporter {
void ParseFile(const std::string &pFile, IOSystem *pIOHandler);
void ParseHelper_Node_Enter(AMFNodeElementBase *child);
void ParseHelper_Node_Exit();
bool CanRead(const std::string &pFile, IOSystem *pIOHandler, bool pCheckSig) const;
void InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler);
const aiImporterDesc *GetInfo() const;
bool CanRead(const std::string &pFile, IOSystem *pIOHandler, bool pCheckSig) const override;
void InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) override;
const aiImporterDesc *GetInfo() const override;
bool Find_NodeElement(const std::string &pID, const AMFNodeElementBase::EType pType, AMFNodeElementBase **pNodeElement) const;
bool Find_ConvertedNode(const std::string &pID, NodeArray &nodeArray, aiNode **pNode) const;
bool Find_ConvertedMaterial(const std::string &pID, const SPP_Material **pConvertedMaterial) const;
Expand Down
9 changes: 4 additions & 5 deletions code/AssetLib/AMF/AMFImporter_Node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef INCLUDED_AI_AMF_IMPORTER_NODE_H
#define INCLUDED_AI_AMF_IMPORTER_NODE_H

// Header files, stdlib.
// Header files, Assimp.
#include <assimp/scene.h>
#include <assimp/types.h>

#include <list>
#include <string>
#include <vector>

// Header files, Assimp.
#include "assimp/scene.h"
#include "assimp/types.h"

/// \class CAMFImporter_NodeElement
/// Base class for elements of nodes.
class AMFNodeElementBase {
Expand Down
2 changes: 0 additions & 2 deletions code/AssetLib/ASE/ASELoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2021, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
Expand Down
25 changes: 5 additions & 20 deletions code/AssetLib/ASE/ASELoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,42 +62,37 @@ namespace Assimp {
class ASEImporter : public BaseImporter {
public:
ASEImporter();
~ASEImporter();
~ASEImporter() override;

// -------------------------------------------------------------------
/** 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 checkSig) const override;

protected:

// -------------------------------------------------------------------
/** Return importer meta information.
* See #BaseImporter::GetInfo for the details
*/
const aiImporterDesc* GetInfo () const;

const aiImporterDesc* GetInfo () const override;

// -------------------------------------------------------------------
/** 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;

// -------------------------------------------------------------------
/** Called prior to ReadFile().
* The function is a request to the importer to update its configuration
* basing on the Importer's configuration property list.
*/
void SetupProperties(const Importer* pImp);

void SetupProperties(const Importer* pImp) override;

private:

// -------------------------------------------------------------------
/** Generate normal vectors basing on smoothing groups
* (in some cases the normal are already contained in the file)
Expand All @@ -106,7 +101,6 @@ class ASEImporter : public BaseImporter {
*/
bool GenerateNormals(ASE::Mesh& mesh);


// -------------------------------------------------------------------
/** Create valid vertex/normal/UV/color/face lists.
* All elements are unique, faces have only one set of indices
Expand All @@ -115,51 +109,43 @@ class ASEImporter : public BaseImporter {
*/
void BuildUniqueRepresentation(ASE::Mesh& mesh);


/** Create one-material-per-mesh meshes ;-)
* \param mesh Mesh to work with
* \param Receives the list of all created meshes
*/
void ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOut);


// -------------------------------------------------------------------
/** Convert a material to a aiMaterial object
* \param mat Input material
*/
void ConvertMaterial(ASE::Material& mat);


// -------------------------------------------------------------------
/** Setup the final material indices for each mesh
*/
void BuildMaterialIndices();


// -------------------------------------------------------------------
/** Build the node graph
*/
void BuildNodes(std::vector<ASE::BaseNode*>& nodes);


// -------------------------------------------------------------------
/** Build output cameras
*/
void BuildCameras();


// -------------------------------------------------------------------
/** Build output lights
*/
void BuildLights();


// -------------------------------------------------------------------
/** Build output animations
*/
void BuildAnimations(const std::vector<ASE::BaseNode*>& nodes);


// -------------------------------------------------------------------
/** Add sub nodes to a node
* \param pcParent parent node to be filled
Expand All @@ -183,7 +169,6 @@ class ASEImporter : public BaseImporter {
void GenerateDefaultMaterial();

protected:

/** Parser instance */
ASE::Parser* mParser;

Expand Down
2 changes: 0 additions & 2 deletions code/AssetLib/ASE/ASEParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2021, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/Assbin/AssbinExporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2021, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
Expand Down Expand Up @@ -43,6 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file AssbinExporter.h
* ASSBIN Exporter Main Header
*/
#pragma once
#ifndef AI_ASSBINEXPORTER_H_INC
#define AI_ASSBINEXPORTER_H_INC

Expand Down
17 changes: 5 additions & 12 deletions code/AssetLib/Assbin/AssbinLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2021, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
Expand Down Expand Up @@ -74,17 +73,11 @@ class AssbinImporter : public BaseImporter
bool compressed;

public:
virtual bool CanRead(
const std::string& pFile,
IOSystem* pIOHandler,
bool checkSig
) const;
virtual const aiImporterDesc* GetInfo() const;
virtual void InternReadFile(
const std::string& pFile,
aiScene* pScene,
IOSystem* pIOHandler
);
bool CanRead(const std::string& pFile,
IOSystem* pIOHandler, bool checkSig) const override;
const aiImporterDesc* GetInfo() const override;
void InternReadFile(
const std::string& pFile,aiScene* pScene,IOSystem* pIOHandler) override;
void ReadHeader();
void ReadBinaryScene( IOStream * stream, aiScene* pScene );
void ReadBinaryNode( IOStream * stream, aiNode** mRootNode, aiNode* parent );
Expand Down
Loading

0 comments on commit 79f3368

Please sign in to comment.