1
2 // Actually just a dummy, used by the compiler to build the precompiled header.
3
4 #include "./../include/assimp/version.h"
5 #include "./../include/assimp/scene.h"
6 #include "ScenePrivate.h"
7
8 static const unsigned int MajorVersion = 3;
9 static const unsigned int MinorVersion = 3;
10
11 // --------------------------------------------------------------------------------
12 // Legal information string - dont't remove this.
13 static const char* LEGAL_INFORMATION =
14
15 "Open Asset Import Library (Assimp).\n"
16 "A free C/C++ library to import various 3D file formats into applications\n\n"
17
18 "(c) 2008-2010, assimp team\n"
19 "License under the terms and conditions of the 3-clause BSD license\n"
20 "http://assimp.sourceforge.net\n"
21 ;
22
23 // ------------------------------------------------------------------------------------------------
24 // Get legal string
aiGetLegalString()25 ASSIMP_API const char* aiGetLegalString () {
26 return LEGAL_INFORMATION;
27 }
28
29 // ------------------------------------------------------------------------------------------------
30 // Get Assimp minor version
aiGetVersionMinor()31 ASSIMP_API unsigned int aiGetVersionMinor () {
32 return MinorVersion;
33 }
34
35 // ------------------------------------------------------------------------------------------------
36 // Get Assimp major version
aiGetVersionMajor()37 ASSIMP_API unsigned int aiGetVersionMajor () {
38 return MajorVersion;
39 }
40
41 // ------------------------------------------------------------------------------------------------
42 // Get flags used for compilation
aiGetCompileFlags()43 ASSIMP_API unsigned int aiGetCompileFlags () {
44
45 unsigned int flags = 0;
46
47 #ifdef ASSIMP_BUILD_BOOST_WORKAROUND
48 flags |= ASSIMP_CFLAGS_NOBOOST;
49 #endif
50 #ifdef ASSIMP_BUILD_SINGLETHREADED
51 flags |= ASSIMP_CFLAGS_SINGLETHREADED;
52 #endif
53 #ifdef ASSIMP_BUILD_DEBUG
54 flags |= ASSIMP_CFLAGS_DEBUG;
55 #endif
56 #ifdef ASSIMP_BUILD_DLL_EXPORT
57 flags |= ASSIMP_CFLAGS_SHARED;
58 #endif
59 #ifdef _STLPORT_VERSION
60 flags |= ASSIMP_CFLAGS_STLPORT;
61 #endif
62
63 return flags;
64 }
65
66 // include current build revision, which is even updated from time to time -- :-)
67 #include "revision.h"
68
69 // ------------------------------------------------------------------------------------------------
aiGetVersionRevision()70 ASSIMP_API unsigned int aiGetVersionRevision ()
71 {
72 return GitVersion;
73 }
74
75 // ------------------------------------------------------------------------------------------------
aiScene()76 ASSIMP_API aiScene::aiScene()
77 : mFlags(0)
78 , mRootNode(NULL)
79 , mNumMeshes(0)
80 , mMeshes(NULL)
81 , mNumMaterials(0)
82 , mMaterials(NULL)
83 , mNumAnimations(0)
84 , mAnimations(NULL)
85 , mNumTextures(0)
86 , mTextures(NULL)
87 , mNumLights(0)
88 , mLights(NULL)
89 , mNumCameras(0)
90 , mCameras(NULL)
91 , mPrivate(new Assimp::ScenePrivateData())
92 {
93 }
94
95 // ------------------------------------------------------------------------------------------------
~aiScene()96 ASSIMP_API aiScene::~aiScene()
97 {
98 // delete all sub-objects recursively
99 delete mRootNode;
100
101 // To make sure we won't crash if the data is invalid it's
102 // much better to check whether both mNumXXX and mXXX are
103 // valid instead of relying on just one of them.
104 if (mNumMeshes && mMeshes)
105 for( unsigned int a = 0; a < mNumMeshes; a++)
106 delete mMeshes[a];
107 delete [] mMeshes;
108
109 if (mNumMaterials && mMaterials)
110 for( unsigned int a = 0; a < mNumMaterials; a++)
111 delete mMaterials[a];
112 delete [] mMaterials;
113
114 if (mNumAnimations && mAnimations)
115 for( unsigned int a = 0; a < mNumAnimations; a++)
116 delete mAnimations[a];
117 delete [] mAnimations;
118
119 if (mNumTextures && mTextures)
120 for( unsigned int a = 0; a < mNumTextures; a++)
121 delete mTextures[a];
122 delete [] mTextures;
123
124 if (mNumLights && mLights)
125 for( unsigned int a = 0; a < mNumLights; a++)
126 delete mLights[a];
127 delete [] mLights;
128
129 if (mNumCameras && mCameras)
130 for( unsigned int a = 0; a < mNumCameras; a++)
131 delete mCameras[a];
132 delete [] mCameras;
133
134 delete static_cast<Assimp::ScenePrivateData*>( mPrivate );
135 }
136
137