GraphicsAPI_2020C
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 #pragma once
46 #ifndef AI_EXPORT_H_INC
47 #define AI_EXPORT_H_INC
48 
49 #ifndef ASSIMP_BUILD_NO_EXPORT
50 
51 // Public ASSIMP data structures
52 #include <assimp/types.h>
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 struct aiScene; // aiScene.h
59 struct aiFileIO; // aiFileIO.h
60 
61 // --------------------------------------------------------------------------------
67 {
71  const char* id;
72 
75  const char* description;
76 
78  const char* fileExtension;
79 };
80 
81 
82 // --------------------------------------------------------------------------------
86 ASSIMP_API size_t aiGetExportFormatCount(void);
87 
88 
89 // --------------------------------------------------------------------------------
97 ASSIMP_API const C_STRUCT aiExportFormatDesc* aiGetExportFormatDescription( size_t pIndex);
98 
99 // --------------------------------------------------------------------------------
104 ASSIMP_API void aiReleaseExportFormatDescription( const C_STRUCT aiExportFormatDesc *desc );
105 
106 // --------------------------------------------------------------------------------
115 ASSIMP_API void aiCopyScene(const C_STRUCT aiScene* pIn,
116  C_STRUCT aiScene** pOut);
117 
118 
119 // --------------------------------------------------------------------------------
121 ASSIMP_API void aiFreeScene(const C_STRUCT aiScene* pIn);
122 
123 // --------------------------------------------------------------------------------
162 ASSIMP_API aiReturn aiExportScene( const C_STRUCT aiScene* pScene,
163  const char* pFormatId,
164  const char* pFileName,
165  unsigned int pPreprocessing);
166 
167 
168 // --------------------------------------------------------------------------------
183 ASSIMP_API aiReturn aiExportSceneEx( const C_STRUCT aiScene* pScene,
184  const char* pFormatId,
185  const char* pFileName,
186  C_STRUCT aiFileIO* pIO,
187  unsigned int pPreprocessing );
188 
189 
190 // --------------------------------------------------------------------------------
201 {
203  size_t size;
204 
206  void* data;
207 
220  C_STRUCT aiString name;
221 
223  C_STRUCT aiExportDataBlob * next;
224 
225 #ifdef __cplusplus
226  aiExportDataBlob() { size = 0; data = next = NULL; }
229  ~aiExportDataBlob() { delete [] static_cast<unsigned char*>( data ); delete next; }
230 
231 private:
232  // no copying
234  aiExportDataBlob& operator= (const aiExportDataBlob& );
235 #endif // __cplusplus
236 };
237 
238 // --------------------------------------------------------------------------------
248 ASSIMP_API const C_STRUCT aiExportDataBlob* aiExportSceneToBlob( const C_STRUCT aiScene* pScene, const char* pFormatId, unsigned int pPreprocessing );
249 
250 
251 // --------------------------------------------------------------------------------
256 ASSIMP_API void aiReleaseExportBlob( const C_STRUCT aiExportDataBlob* pData );
257 
258 #ifdef __cplusplus
259 }
260 #endif
261 
262 #endif // ASSIMP_BUILD_NO_EXPORT
263 #endif // AI_EXPORT_H_INC
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:203
Basic data types and primitives, such as vectors or colors.
C-API: File system callbacks.
Definition: cfileio.h:78
ASSIMP_API void aiReleaseExportFormatDescription(const C_STRUCT aiExportFormatDesc *desc)
Release a description of the nth export file format.
const char * fileExtension
Recommended file extension for the exported file in lower case.
Definition: cexport.h:78
ASSIMP_API size_t aiGetExportFormatCount(void)
Returns the number of export file formats available in the current Assimp build.
aiReturn
Standard return type for some library functions.
Definition: types.h:375
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:206
Represents an UTF-8 string, zero byte terminated.
Definition: types.h:252
The root structure of the imported data.
Definition: scene.h:240
Describes a blob of exported scene data.
Definition: cexport.h:200
const char * id
a short string ID to uniquely identify the export format.
Definition: cexport.h:71
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:75
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.
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:66