Merge branch 'master' into debian-fixes
commit
36c937cc19
|
@ -101,9 +101,11 @@ private:
|
||||||
std::vector<OpcPackageRelationship*> mRelations;
|
std::vector<OpcPackageRelationship*> mRelations;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ASSIMP_BUILD_NO_3MF_EXPORTER
|
|
||||||
#endif // ASSIMP_BUILD_NO_EXPORT
|
|
||||||
|
|
||||||
} // Namespace D3MF
|
} // Namespace D3MF
|
||||||
} // Namespace Assimp
|
} // Namespace Assimp
|
||||||
|
|
||||||
|
#endif // ASSIMP_BUILD_NO_3MF_EXPORTER
|
||||||
|
#endif // ASSIMP_BUILD_NO_EXPORT
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,11 +48,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <assimp/defs.h>
|
#include <assimp/defs.h>
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||||
|
|
||||||
// nothing really needed here - reserved for future use like properties
|
// nothing really needed here - reserved for future use like properties
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
void ASSIMP_API ExportSceneAssbin(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* /*pProperties*/);
|
void ASSIMP_API ExportSceneAssbin(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* /*pProperties*/);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif // AI_ASSBINEXPORTER_H_INC
|
#endif // AI_ASSBINEXPORTER_H_INC
|
||||||
|
|
|
@ -43,13 +43,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssbinFileWriter.h"
|
#include "AssbinFileWriter.h"
|
||||||
|
|
||||||
#include "Common/assbin_chunks.h"
|
#include "Common/assbin_chunks.h"
|
||||||
#include "PostProcessing/ProcessHelper.h"
|
#include "PostProcessing/ProcessHelper.h"
|
||||||
|
|
||||||
#include <assimp/Exceptional.h>
|
#include <assimp/Exceptional.h>
|
||||||
#include <assimp/version.h>
|
#include <assimp/version.h>
|
||||||
#include <assimp/Exporter.hpp>
|
|
||||||
#include <assimp/IOStream.hpp>
|
#include <assimp/IOStream.hpp>
|
||||||
|
|
||||||
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
||||||
|
@ -58,7 +56,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "../contrib/zlib/zlib.h"
|
#include "../contrib/zlib/zlib.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <ctime>
|
||||||
|
|
||||||
#if _MSC_VER
|
#if _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
|
@ -277,7 +275,7 @@ public:
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~AssbinChunkWriter() {
|
~AssbinChunkWriter() override {
|
||||||
if (container) {
|
if (container) {
|
||||||
container->Write(&magic, sizeof(uint32_t), 1);
|
container->Write(&magic, sizeof(uint32_t), 1);
|
||||||
container->Write(&cursor, sizeof(uint32_t), 1);
|
container->Write(&cursor, sizeof(uint32_t), 1);
|
||||||
|
@ -288,26 +286,27 @@ public:
|
||||||
|
|
||||||
void *GetBufferPointer() { return buffer; }
|
void *GetBufferPointer() { return buffer; }
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
size_t Read(void * /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/) override {
|
||||||
virtual size_t Read(void * /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
virtual aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/) {
|
|
||||||
|
aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/) override {
|
||||||
return aiReturn_FAILURE;
|
return aiReturn_FAILURE;
|
||||||
}
|
}
|
||||||
virtual size_t Tell() const {
|
|
||||||
|
size_t Tell() const override {
|
||||||
return cursor;
|
return cursor;
|
||||||
}
|
}
|
||||||
virtual void Flush() {
|
|
||||||
|
void Flush() override {
|
||||||
// not implemented
|
// not implemented
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual size_t FileSize() const {
|
size_t FileSize() const override {
|
||||||
return cursor;
|
return cursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
size_t Write(const void *pvBuffer, size_t pSize, size_t pCount) override {
|
||||||
virtual size_t Write(const void *pvBuffer, size_t pSize, size_t pCount) {
|
|
||||||
pSize *= pCount;
|
pSize *= pCount;
|
||||||
if (cursor + pSize > cur_size) {
|
if (cursor + pSize > cur_size) {
|
||||||
Grow(cursor + pSize);
|
Grow(cursor + pSize);
|
||||||
|
|
|
@ -46,6 +46,7 @@ directly (unless you are adding new loaders), instead use the
|
||||||
corresponding preprocessor flag to selectively disable formats.
|
corresponding preprocessor flag to selectively disable formats.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <assimp/anim.h>
|
||||||
#include <assimp/BaseImporter.h>
|
#include <assimp/BaseImporter.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
|
@ -1,139 +0,0 @@
|
||||||
// Copyright (C) 2002-2005 Nikolaus Gebhardt
|
|
||||||
// This file is part of the "Irrlicht Engine" and the "irrXML" project.
|
|
||||||
// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h
|
|
||||||
|
|
||||||
#ifndef __FAST_A_TO_F_H_INCLUDED__
|
|
||||||
#define __FAST_A_TO_F_H_INCLUDED__
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
namespace irr
|
|
||||||
{
|
|
||||||
namespace core
|
|
||||||
{
|
|
||||||
|
|
||||||
const float fast_atof_table[] = {
|
|
||||||
0.f,
|
|
||||||
0.1f,
|
|
||||||
0.01f,
|
|
||||||
0.001f,
|
|
||||||
0.0001f,
|
|
||||||
0.00001f,
|
|
||||||
0.000001f,
|
|
||||||
0.0000001f,
|
|
||||||
0.00000001f,
|
|
||||||
0.000000001f,
|
|
||||||
0.0000000001f,
|
|
||||||
0.00000000001f,
|
|
||||||
0.000000000001f,
|
|
||||||
0.0000000000001f,
|
|
||||||
0.00000000000001f,
|
|
||||||
0.000000000000001f
|
|
||||||
};
|
|
||||||
|
|
||||||
//! Provides a fast function for converting a string into a float,
|
|
||||||
//! about 6 times faster than atof in win32.
|
|
||||||
// If you find any bugs, please send them to me, niko (at) irrlicht3d.org.
|
|
||||||
inline char* fast_atof_move(char* c, float& out)
|
|
||||||
{
|
|
||||||
bool inv = false;
|
|
||||||
char *t;
|
|
||||||
float f;
|
|
||||||
|
|
||||||
if (*c=='-')
|
|
||||||
{
|
|
||||||
c++;
|
|
||||||
inv = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
f = (float)strtol(c, &t, 10);
|
|
||||||
|
|
||||||
c = t;
|
|
||||||
|
|
||||||
if (*c == '.')
|
|
||||||
{
|
|
||||||
c++;
|
|
||||||
|
|
||||||
float pl = (float)strtol(c, &t, 10);
|
|
||||||
pl *= fast_atof_table[t-c];
|
|
||||||
|
|
||||||
f += pl;
|
|
||||||
|
|
||||||
c = t;
|
|
||||||
|
|
||||||
if (*c == 'e')
|
|
||||||
{
|
|
||||||
++c;
|
|
||||||
float exp = (float)strtol(c, &t, 10);
|
|
||||||
f *= (float)pow(10.0f, exp);
|
|
||||||
c = t;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (inv)
|
|
||||||
f *= -1.0f;
|
|
||||||
|
|
||||||
out = f;
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Provides a fast function for converting a string into a float,
|
|
||||||
//! about 6 times faster than atof in win32.
|
|
||||||
// If you find any bugs, please send them to me, niko (at) irrlicht3d.org.
|
|
||||||
inline const char* fast_atof_move_const(const char* c, float& out)
|
|
||||||
{
|
|
||||||
bool inv = false;
|
|
||||||
char *t;
|
|
||||||
float f;
|
|
||||||
|
|
||||||
if (*c=='-')
|
|
||||||
{
|
|
||||||
c++;
|
|
||||||
inv = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
f = (float)strtol(c, &t, 10);
|
|
||||||
|
|
||||||
c = t;
|
|
||||||
|
|
||||||
if (*c == '.')
|
|
||||||
{
|
|
||||||
c++;
|
|
||||||
|
|
||||||
float pl = (float)strtol(c, &t, 10);
|
|
||||||
pl *= fast_atof_table[t-c];
|
|
||||||
|
|
||||||
f += pl;
|
|
||||||
|
|
||||||
c = t;
|
|
||||||
|
|
||||||
if (*c == 'e')
|
|
||||||
{
|
|
||||||
++c;
|
|
||||||
f32 exp = (f32)strtol(c, &t, 10);
|
|
||||||
f *= (f32)powf(10.0f, exp);
|
|
||||||
c = t;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (inv)
|
|
||||||
f *= -1.0f;
|
|
||||||
|
|
||||||
out = f;
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline float fast_atof(const char* c)
|
|
||||||
{
|
|
||||||
float ret;
|
|
||||||
fast_atof_move_const(c, ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // end namespace core
|
|
||||||
}// end namespace irr
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -45,6 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||||
|
|
||||||
class TestProgressHandler : public ProgressHandler {
|
class TestProgressHandler : public ProgressHandler {
|
||||||
public:
|
public:
|
||||||
TestProgressHandler() :
|
TestProgressHandler() :
|
||||||
|
@ -101,3 +103,5 @@ TEST_F(ExporterTest, ExporterIdTest) {
|
||||||
const aiExportFormatDesc *desc = exporter.GetExportFormatDescription(exportFormatCount);
|
const aiExportFormatDesc *desc = exporter.GetExportFormatDescription(exportFormatCount);
|
||||||
EXPECT_EQ(nullptr, desc) << "More exporters than claimed";
|
EXPECT_EQ(nullptr, desc) << "More exporters than claimed";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -233,6 +233,8 @@ unsigned int GetMeshUseCount(const aiNode *rootNode) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||||
|
|
||||||
TEST_F(utColladaImportExport, exportRootNodeMeshTest) {
|
TEST_F(utColladaImportExport, exportRootNodeMeshTest) {
|
||||||
Assimp::Importer importer;
|
Assimp::Importer importer;
|
||||||
Assimp::Exporter exporter;
|
Assimp::Exporter exporter;
|
||||||
|
@ -342,6 +344,8 @@ TEST_F(utColladaImportExport, exporterUniqueIdsTest) {
|
||||||
ImportAsNames(outFileNamed, scene);
|
ImportAsNames(outFileNamed, scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
class utColladaZaeImportExport : public AbstractImportExportBase {
|
class utColladaZaeImportExport : public AbstractImportExportBase {
|
||||||
public:
|
public:
|
||||||
virtual bool importerTest() final {
|
virtual bool importerTest() final {
|
||||||
|
|
|
@ -66,6 +66,8 @@ const char *AICMD_MSG_DUMP_HELP =
|
||||||
FILE *out = nullptr;
|
FILE *out = nullptr;
|
||||||
bool shortened = false;
|
bool shortened = false;
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------
|
||||||
int Assimp_Dump(const char *const *params, unsigned int num) {
|
int Assimp_Dump(const char *const *params, unsigned int num) {
|
||||||
const char *fail = "assimp dump: Invalid number of arguments. "
|
const char *fail = "assimp dump: Invalid number of arguments. "
|
||||||
|
@ -162,3 +164,9 @@ int Assimp_Dump(const char *const *params, unsigned int num) {
|
||||||
printf("assimp dump: Wrote output dump %s\n", cur_out.c_str());
|
printf("assimp dump: Wrote output dump %s\n", cur_out.c_str());
|
||||||
return AssimpCmdError::Success;
|
return AssimpCmdError::Success;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
int Assimp_Dump(const char *const *, unsigned int ) {
|
||||||
|
printf("assimp dump: Export disabled.\n");
|
||||||
|
return AssimpCmdError::UnrecognizedCommand;
|
||||||
|
}
|
||||||
|
#endif
|
Loading…
Reference in New Issue