1 | /* |
2 | --------------------------------------------------------------------------- |
3 | Open Asset Import Library (assimp) |
4 | --------------------------------------------------------------------------- |
5 | |
6 | Copyright (c) 2006-2017, assimp team |
7 | |
8 | |
9 | All rights reserved. |
10 | |
11 | Redistribution and use of this software in source and binary forms, |
12 | with or without modification, are permitted provided that the following |
13 | conditions are met: |
14 | |
15 | * Redistributions of source code must retain the above |
16 | copyright notice, this list of conditions and the |
17 | following disclaimer. |
18 | |
19 | * Redistributions in binary form must reproduce the above |
20 | copyright notice, this list of conditions and the |
21 | following disclaimer in the documentation and/or other |
22 | materials provided with the distribution. |
23 | |
24 | * Neither the name of the assimp team, nor the names of its |
25 | contributors may be used to endorse or promote products |
26 | derived from this software without specific prior |
27 | written permission of the assimp team. |
28 | |
29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
40 | --------------------------------------------------------------------------- |
41 | */ |
42 | |
43 | /** @file importerdesc.h |
44 | * @brief #aiImporterFlags, aiImporterDesc implementation. |
45 | */ |
46 | #pragma once |
47 | #ifndef AI_IMPORTER_DESC_H_INC |
48 | #define AI_IMPORTER_DESC_H_INC |
49 | |
50 | |
51 | /** Mixed set of flags for #aiImporterDesc, indicating some features |
52 | * common to many importers*/ |
53 | enum aiImporterFlags |
54 | { |
55 | /** Indicates that there is a textual encoding of the |
56 | * file format; and that it is supported.*/ |
57 | aiImporterFlags_SupportTextFlavour = 0x1, |
58 | |
59 | /** Indicates that there is a binary encoding of the |
60 | * file format; and that it is supported.*/ |
61 | aiImporterFlags_SupportBinaryFlavour = 0x2, |
62 | |
63 | /** Indicates that there is a compressed encoding of the |
64 | * file format; and that it is supported.*/ |
65 | aiImporterFlags_SupportCompressedFlavour = 0x4, |
66 | |
67 | /** Indicates that the importer reads only a very particular |
68 | * subset of the file format. This happens commonly for |
69 | * declarative or procedural formats which cannot easily |
70 | * be mapped to #aiScene */ |
71 | aiImporterFlags_LimitedSupport = 0x8, |
72 | |
73 | /** Indicates that the importer is highly experimental and |
74 | * should be used with care. This only happens for trunk |
75 | * (i.e. SVN) versions, experimental code is not included |
76 | * in releases. */ |
77 | aiImporterFlags_Experimental = 0x10 |
78 | }; |
79 | |
80 | |
81 | /** Meta information about a particular importer. Importers need to fill |
82 | * this structure, but they can freely decide how talkative they are. |
83 | * A common use case for loader meta info is a user interface |
84 | * in which the user can choose between various import/export file |
85 | * formats. Building such an UI by hand means a lot of maintenance |
86 | * as importers/exporters are added to Assimp, so it might be useful |
87 | * to have a common mechanism to query some rough importer |
88 | * characteristics. */ |
89 | struct aiImporterDesc |
90 | { |
91 | /** Full name of the importer (i.e. Blender3D importer)*/ |
92 | const char* mName; |
93 | |
94 | /** Original author (left blank if unknown or whole assimp team) */ |
95 | const char* mAuthor; |
96 | |
97 | /** Current maintainer, left blank if the author maintains */ |
98 | const char* mMaintainer; |
99 | |
100 | /** Implementation comments, i.e. unimplemented features*/ |
101 | const char* ; |
102 | |
103 | /** These flags indicate some characteristics common to many |
104 | importers. */ |
105 | unsigned int mFlags; |
106 | |
107 | /** Minimum format version that can be loaded im major.minor format, |
108 | both are set to 0 if there is either no version scheme |
109 | or if the loader doesn't care. */ |
110 | unsigned int mMinMajor; |
111 | unsigned int mMinMinor; |
112 | |
113 | /** Maximum format version that can be loaded im major.minor format, |
114 | both are set to 0 if there is either no version scheme |
115 | or if the loader doesn't care. Loaders that expect to be |
116 | forward-compatible to potential future format versions should |
117 | indicate zero, otherwise they should specify the current |
118 | maximum version.*/ |
119 | unsigned int mMaxMajor; |
120 | unsigned int mMaxMinor; |
121 | |
122 | /** List of file extensions this importer can handle. |
123 | List entries are separated by space characters. |
124 | All entries are lower case without a leading dot (i.e. |
125 | "xml dae" would be a valid value. Note that multiple |
126 | importers may respond to the same file extension - |
127 | assimp calls all importers in the order in which they |
128 | are registered and each importer gets the opportunity |
129 | to load the file until one importer "claims" the file. Apart |
130 | from file extension checks, importers typically use |
131 | other methods to quickly reject files (i.e. magic |
132 | words) so this does not mean that common or generic |
133 | file extensions such as XML would be tediously slow. */ |
134 | const char* mFileExtensions; |
135 | }; |
136 | |
137 | /** \brief Returns the Importer description for a given extension. |
138 | |
139 | Will return a NULL-pointer if no assigned importer desc. was found for the given extension |
140 | \param extension [in] The extension to look for |
141 | \return A pointer showing to the ImporterDesc, \see aiImporterDesc. |
142 | */ |
143 | ASSIMP_API const C_STRUCT aiImporterDesc* aiGetImporterDesc( const char *extension ); |
144 | |
145 | #endif // AI_IMPORTER_DESC_H_INC |
146 | |