BRE12
cexport.h
Go to the documentation of this file.
1 /*
2 ---------------------------------------------------------------------------
3 Open Asset Import Library (assimp)
4 ---------------------------------------------------------------------------
5 
6 Copyright (c) 2006-2011, assimp team
7 
8 All rights reserved.
9 
10 Redistribution and use of this software in source and binary forms,
11 with or without modification, are permitted provided that the following
12 conditions are met:
13 
14 * Redistributions of source code must retain the above
15 copyright notice, this list of conditions and the
16 following disclaimer.
17 
18 * Redistributions in binary form must reproduce the above
19 copyright notice, this list of conditions and the
20 following disclaimer in the documentation and/or other
21 materials provided with the distribution.
22 
23 * Neither the name of the assimp team, nor the names of its
24 contributors may be used to endorse or promote products
25 derived from this software without specific prior
26 written permission of the assimp team.
27 
28 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 ---------------------------------------------------------------------------
40 */
41 
45 #ifndef AI_EXPORT_H_INC
46 #define AI_EXPORT_H_INC
47 
48 #ifndef ASSIMP_BUILD_NO_EXPORT
49 
50 #include "types.h"
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 struct aiScene; // aiScene.h
57 struct aiFileIO; // aiFileIO.h
58 
59 // --------------------------------------------------------------------------------
65 {
69  const char* id;
70 
73  const char* description;
74 
76  const char* fileExtension;
77 };
78 
79 
80 // --------------------------------------------------------------------------------
84 ASSIMP_API size_t aiGetExportFormatCount(void);
85 
86 
87 // --------------------------------------------------------------------------------
94 ASSIMP_API const C_STRUCT aiExportFormatDesc* aiGetExportFormatDescription( size_t pIndex);
95 
96 
97 // --------------------------------------------------------------------------------
106 ASSIMP_API void aiCopyScene(const C_STRUCT aiScene* pIn,
107  C_STRUCT aiScene** pOut);
108 
109 
110 // --------------------------------------------------------------------------------
112 ASSIMP_API void aiFreeScene(const C_STRUCT aiScene* pIn);
113 
114 // --------------------------------------------------------------------------------
156 ASSIMP_API aiReturn aiExportScene( const C_STRUCT aiScene* pScene,
157  const char* pFormatId,
158  const char* pFileName,
159  unsigned int pPreprocessing);
160 
161 
162 // --------------------------------------------------------------------------------
177 ASSIMP_API aiReturn aiExportSceneEx( const C_STRUCT aiScene* pScene,
178  const char* pFormatId,
179  const char* pFileName,
180  C_STRUCT aiFileIO* pIO,
181  unsigned int pPreprocessing );
182 
183 
184 // --------------------------------------------------------------------------------
195 {
197  size_t size;
198 
200  void* data;
201 
214  C_STRUCT aiString name;
215 
217  C_STRUCT aiExportDataBlob * next;
218 
219 #ifdef __cplusplus
220  aiExportDataBlob() { size = 0; data = next = NULL; }
223  ~aiExportDataBlob() { delete [] static_cast<unsigned char*>( data ); delete next; }
224 
225 private:
226  // no copying
228  aiExportDataBlob& operator= (const aiExportDataBlob& );
229 #endif // __cplusplus
230 };
231 
232 // --------------------------------------------------------------------------------
242 ASSIMP_API const C_STRUCT aiExportDataBlob* aiExportSceneToBlob( const C_STRUCT aiScene* pScene, const char* pFormatId, unsigned int pPreprocessing );
243 
244 
245 // --------------------------------------------------------------------------------
250 ASSIMP_API void aiReleaseExportBlob( const C_STRUCT aiExportDataBlob* pData );
251 
252 #ifdef __cplusplus
253 }
254 #endif
255 
256 #endif // ASSIMP_BUILD_NO_EXPORT
257 #endif // AI_EXPORT_H_INC
258 
ASSIMP_API const C_STRUCT aiExportFormatDesc * aiGetExportFormatDescription(size_t pIndex)
Returns a description of the nth export file format.
ASSIMP_API aiReturn aiExportScene(const C_STRUCT aiScene *pScene, const char *pFormatId, const char *pFileName, unsigned int pPreprocessing)
Exports the given scene to a chosen file format and writes the result file(s) to disk.
size_t size
Size of the data in bytes.
Definition: cexport.h:197
Basic data types and primitives, such as vectors or colors.
C-API: File system callbacks.
Definition: cfileio.h:76
const char * fileExtension
Recommended file extension for the exported file in lower case.
Definition: cexport.h:76
C_STRUCT aiString name
Name of the blob.
Definition: cexport.h:214
ASSIMP_API size_t aiGetExportFormatCount(void)
Returns the number of export file formats available in the current Assimp build.
ASSIMP_API aiReturn aiExportSceneEx(const C_STRUCT aiScene *pScene, const char *pFormatId, const char *pFileName, C_STRUCT aiFileIO *pIO, unsigned int pPreprocessing)
Exports the given scene to a chosen file format using custom IO logic supplied by you...
ASSIMP_API void aiCopyScene(const C_STRUCT aiScene *pIn, C_STRUCT aiScene **pOut)
Create a modifiable copy of a scene.
void * data
The data.
Definition: cexport.h:200
Represents an UTF-8 string, zero byte terminated.
Definition: types.h:251
Describes a blob of exported scene data.
Definition: cexport.h:194
const char * id
a short string ID to uniquely identify the export format.
Definition: cexport.h:69
ASSIMP_API void aiFreeScene(const C_STRUCT aiScene *pIn)
Frees a scene copy created using aiCopyScene()
const char * description
A short description of the file format to present to users.
Definition: cexport.h:73
ASSIMP_API const C_STRUCT aiExportDataBlob * aiExportSceneToBlob(const C_STRUCT aiScene *pScene, const char *pFormatId, unsigned int pPreprocessing)
Exports the given scene to a chosen file format.
C_STRUCT aiExportDataBlob * next
Pointer to the next blob in the chain or NULL if there is none.
Definition: cexport.h:217
ASSIMP_API void aiReleaseExportBlob(const C_STRUCT aiExportDataBlob *pData)
Releases the memory associated with the given exported data.
Describes an file format which Assimp can export to.
Definition: cexport.h:64