/src/assimp/code/AssetLib/glTFCommon/glTFCommon.h
Line | Count | Source |
1 | | /* |
2 | | Open Asset Import Library (assimp) |
3 | | ---------------------------------------------------------------------- |
4 | | |
5 | | Copyright (c) 2006-2025, assimp team |
6 | | |
7 | | All rights reserved. |
8 | | |
9 | | Redistribution and use of this software in source and binary forms, |
10 | | with or without modification, are permitted provided that the |
11 | | following conditions are met: |
12 | | |
13 | | * Redistributions of source code must retain the above |
14 | | copyright notice, this list of conditions and the |
15 | | following disclaimer. |
16 | | |
17 | | * Redistributions in binary form must reproduce the above |
18 | | copyright notice, this list of conditions and the |
19 | | following disclaimer in the documentation and/or other |
20 | | materials provided with the distribution. |
21 | | |
22 | | * Neither the name of the assimp team, nor the names of its |
23 | | contributors may be used to endorse or promote products |
24 | | derived from this software without specific prior |
25 | | written permission of the assimp team. |
26 | | |
27 | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
28 | | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
29 | | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
30 | | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
31 | | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
32 | | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
33 | | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
34 | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
35 | | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
36 | | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
37 | | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
38 | | |
39 | | ---------------------------------------------------------------------- |
40 | | */ |
41 | | #ifndef AI_GLFTCOMMON_H_INC |
42 | | #define AI_GLFTCOMMON_H_INC |
43 | | |
44 | | #include <assimp/Exceptional.h> |
45 | | #include <assimp/DefaultLogger.hpp> |
46 | | |
47 | | #include <algorithm> |
48 | | #include <list> |
49 | | #include <map> |
50 | | #include <stdexcept> |
51 | | #include <string> |
52 | | #include <vector> |
53 | | |
54 | | #include <rapidjson/document.h> |
55 | | #include <rapidjson/error/en.h> |
56 | | #include <rapidjson/rapidjson.h> |
57 | | |
58 | | // clang-format off |
59 | | |
60 | | #ifdef ASSIMP_API |
61 | | # include <assimp/ByteSwapper.h> |
62 | | # include <assimp/DefaultIOSystem.h> |
63 | | # include <memory> |
64 | | #else |
65 | | # include <memory> |
66 | | # define AI_SWAP4(p) |
67 | | # define ai_assert |
68 | | #endif |
69 | | |
70 | | #if _MSC_VER > 1500 || (defined __GNUC__) |
71 | | # define ASSIMP_GLTF_USE_UNORDERED_MULTIMAP |
72 | | #else |
73 | | # define gltf_unordered_map map |
74 | | #endif |
75 | | |
76 | | #ifdef ASSIMP_GLTF_USE_UNORDERED_MULTIMAP |
77 | | # include <unordered_map> |
78 | | # if defined(_MSC_VER) && _MSC_VER <= 1600 |
79 | | # define gltf_unordered_map tr1::unordered_map |
80 | | # else |
81 | | # define gltf_unordered_map unordered_map |
82 | | # endif |
83 | | #endif |
84 | | // clang-format on |
85 | | |
86 | | |
87 | | namespace glTFCommon { |
88 | | |
89 | | using rapidjson::Document; |
90 | | using rapidjson::Value; |
91 | | |
92 | | #ifdef ASSIMP_API |
93 | | using Assimp::IOStream; |
94 | | using Assimp::IOSystem; |
95 | | using std::shared_ptr; |
96 | | #else |
97 | | using std::shared_ptr; |
98 | | |
99 | | typedef std::runtime_error DeadlyImportError; |
100 | | typedef std::runtime_error DeadlyExportError; |
101 | | |
102 | | enum aiOrigin { |
103 | | aiOrigin_SET = 0, |
104 | | aiOrigin_CUR = 1, |
105 | | aiOrigin_END = 2 |
106 | | }; |
107 | | |
108 | | class IOSystem; |
109 | | |
110 | | class IOStream { |
111 | | public: |
112 | | IOStream(FILE *file) : |
113 | | f(file) {} |
114 | | ~IOStream() { |
115 | | fclose(f); |
116 | | } |
117 | | |
118 | | size_t Read(void *b, size_t sz, size_t n) { return fread(b, sz, n, f); } |
119 | | size_t Write(const void *b, size_t sz, size_t n) { return fwrite(b, sz, n, f); } |
120 | | int Seek(size_t off, aiOrigin orig) { return fseek(f, off, int(orig)); } |
121 | | size_t Tell() const { return ftell(f); } |
122 | | |
123 | | size_t FileSize() { |
124 | | long p = Tell(), len = (Seek(0, aiOrigin_END), Tell()); |
125 | | return size_t((Seek(p, aiOrigin_SET), len)); |
126 | | } |
127 | | |
128 | | private: |
129 | | FILE *f; |
130 | | }; |
131 | | #endif |
132 | | |
133 | | // Vec/matrix types, as raw float arrays |
134 | | typedef float(vec3)[3]; |
135 | | typedef float(vec4)[4]; |
136 | | typedef float(mat4)[16]; |
137 | | |
138 | 0 | inline void CopyValue(const glTFCommon::vec3 &v, aiColor4D &out) { |
139 | 0 | out.r = v[0]; |
140 | 0 | out.g = v[1]; |
141 | 0 | out.b = v[2]; |
142 | 0 | out.a = 1.0; |
143 | 0 | } |
144 | | |
145 | 0 | inline void CopyValue(const glTFCommon::vec4 &v, aiColor4D &out) { |
146 | 0 | out.r = v[0]; |
147 | 0 | out.g = v[1]; |
148 | 0 | out.b = v[2]; |
149 | 0 | out.a = v[3]; |
150 | 0 | } |
151 | | |
152 | 0 | inline void CopyValue(const glTFCommon::vec4 &v, aiColor3D &out) { |
153 | 0 | out.r = v[0]; |
154 | 0 | out.g = v[1]; |
155 | 0 | out.b = v[2]; |
156 | 0 | } |
157 | | |
158 | 0 | inline void CopyValue(const glTFCommon::vec3 &v, aiColor3D &out) { |
159 | 0 | out.r = v[0]; |
160 | 0 | out.g = v[1]; |
161 | 0 | out.b = v[2]; |
162 | 0 | } |
163 | | |
164 | 0 | inline void CopyValue(const glTFCommon::vec3 &v, aiVector3D &out) { |
165 | 0 | out.x = v[0]; |
166 | 0 | out.y = v[1]; |
167 | 0 | out.z = v[2]; |
168 | 0 | } |
169 | | |
170 | 0 | inline void CopyValue(const glTFCommon::vec4 &v, aiQuaternion &out) { |
171 | 0 | out.x = v[0]; |
172 | 0 | out.y = v[1]; |
173 | 0 | out.z = v[2]; |
174 | 0 | out.w = v[3]; |
175 | 0 | } |
176 | | |
177 | 0 | inline void CopyValue(const glTFCommon::mat4 &v, aiMatrix4x4 &o) { |
178 | 0 | o.a1 = v[0]; |
179 | 0 | o.b1 = v[1]; |
180 | 0 | o.c1 = v[2]; |
181 | 0 | o.d1 = v[3]; |
182 | 0 | o.a2 = v[4]; |
183 | 0 | o.b2 = v[5]; |
184 | 0 | o.c2 = v[6]; |
185 | 0 | o.d2 = v[7]; |
186 | 0 | o.a3 = v[8]; |
187 | 0 | o.b3 = v[9]; |
188 | 0 | o.c3 = v[10]; |
189 | 0 | o.d3 = v[11]; |
190 | 0 | o.a4 = v[12]; |
191 | 0 | o.b4 = v[13]; |
192 | 0 | o.c4 = v[14]; |
193 | 0 | o.d4 = v[15]; |
194 | 0 | } |
195 | | |
196 | | #if _MSC_VER |
197 | | # pragma warning(push) |
198 | | # pragma warning(disable : 4310) |
199 | | #endif // _MSC_VER |
200 | | |
201 | 0 | inline std::string getCurrentAssetDir(const std::string &pFile) { |
202 | 0 | int pos = std::max(int(pFile.rfind('/')), int(pFile.rfind('\\'))); |
203 | 0 | if (pos == int(std::string::npos)) { |
204 | 0 | return std::string(); |
205 | 0 | } |
206 | | |
207 | 0 | return pFile.substr(0, pos + 1); |
208 | 0 | } |
209 | | #if _MSC_VER |
210 | | # pragma warning(pop) |
211 | | #endif // _MSC_VER |
212 | | |
213 | | namespace Util { |
214 | | |
215 | | void EncodeBase64(const uint8_t *in, size_t inLength, std::string &out); |
216 | | |
217 | | size_t DecodeBase64(const char *in, size_t inLength, uint8_t *&out); |
218 | | |
219 | 0 | inline size_t DecodeBase64(const char *in, uint8_t *&out) { |
220 | 0 | return DecodeBase64(in, strlen(in), out); |
221 | 0 | } |
222 | | |
223 | | struct DataURI { |
224 | | const char *mediaType; |
225 | | const char *charset; |
226 | | bool base64; |
227 | | const char *data; |
228 | | size_t dataLength; |
229 | | }; |
230 | | |
231 | | //! Check if a uri is a data URI |
232 | | bool ParseDataURI(const char *const_uri, size_t uriLen, DataURI &out); |
233 | | |
234 | | } // namespace Util |
235 | | |
236 | | #define CHECK_EXT(EXT) \ |
237 | 0 | if (exts.find(#EXT) != exts.end()) extensionsUsed.EXT = true; |
238 | | |
239 | | //! Helper struct to represent values that might not be present |
240 | | template <class T> |
241 | | struct Nullable { |
242 | | T value; |
243 | | bool isPresent; |
244 | | |
245 | | Nullable() : |
246 | 0 | isPresent(false) {}Unexecuted instantiation: glTFCommon::Nullable<float [16]>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<float [3]>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<float [4]>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::Nullable() Unexecuted instantiation: glTFCommon::Nullable<double>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<unsigned long>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<long>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<bool>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<std::__1::vector<glTF2::CustomExtension, std::__1::allocator<glTF2::CustomExtension> > >::Nullable() Unexecuted instantiation: glTFCommon::Nullable<glTF2::PbrSpecularGlossiness>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialSpecular>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialSheen>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialClearcoat>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialTransmission>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialVolume>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialIOR>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialEmissiveStrength>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialAnisotropy>::Nullable() Unexecuted instantiation: glTFCommon::Nullable<float>::Nullable() |
247 | | Nullable(T &val) : |
248 | 0 | value(val), |
249 | 0 | isPresent(true) {}Unexecuted instantiation: glTFCommon::Nullable<glTF2::PbrSpecularGlossiness>::Nullable(glTF2::PbrSpecularGlossiness&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialSpecular>::Nullable(glTF2::MaterialSpecular&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialSheen>::Nullable(glTF2::MaterialSheen&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialClearcoat>::Nullable(glTF2::MaterialClearcoat&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialTransmission>::Nullable(glTF2::MaterialTransmission&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialVolume>::Nullable(glTF2::MaterialVolume&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialIOR>::Nullable(glTF2::MaterialIOR&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialEmissiveStrength>::Nullable(glTF2::MaterialEmissiveStrength&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialAnisotropy>::Nullable(glTF2::MaterialAnisotropy&) |
250 | | }; |
251 | | |
252 | | //! A reference to one top-level object, which is valid |
253 | | //! until the Asset instance is destroyed |
254 | | template <class T> |
255 | | class Ref { |
256 | | std::vector<T *> *vector; |
257 | | unsigned int index; |
258 | | |
259 | | public: |
260 | | Ref() : |
261 | 108 | vector(nullptr), |
262 | 108 | index(0) {}glTFCommon::Ref<glTF::Buffer>::Ref() Line | Count | Source | 261 | 27 | vector(nullptr), | 262 | 27 | index(0) {} |
Unexecuted instantiation: glTFCommon::Ref<glTF::Accessor>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF::BufferView>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF::Material>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF::Camera>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF::Light>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF::Texture>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF::Sampler>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF::Image>::Ref() glTFCommon::Ref<glTF::Scene>::Ref() Line | Count | Source | 261 | 27 | vector(nullptr), | 262 | 27 | index(0) {} |
Unexecuted instantiation: glTFCommon::Ref<glTF::Node>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF::Skin>::Ref() glTFCommon::Ref<glTF2::Scene>::Ref() Line | Count | Source | 261 | 27 | vector(nullptr), | 262 | 27 | index(0) {} |
glTFCommon::Ref<glTF2::Buffer>::Ref() Line | Count | Source | 261 | 27 | vector(nullptr), | 262 | 27 | index(0) {} |
Unexecuted instantiation: glTFCommon::Ref<glTF2::Texture>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF2::BufferView>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF2::Accessor>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF2::Material>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF2::Node>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF2::Sampler>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF2::Image>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF2::Skin>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF2::Camera>::Ref() Unexecuted instantiation: glTFCommon::Ref<glTF2::Light>::Ref() |
263 | | Ref(std::vector<T *> &vec, unsigned int idx) : |
264 | 0 | vector(&vec), |
265 | 0 | index(idx) {}Unexecuted instantiation: glTFCommon::Ref<glTF::Buffer>::Ref(std::__1::vector<glTF::Buffer*, std::__1::allocator<glTF::Buffer*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::BufferView>::Ref(std::__1::vector<glTF::BufferView*, std::__1::allocator<glTF::BufferView*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::Accessor>::Ref(std::__1::vector<glTF::Accessor*, std::__1::allocator<glTF::Accessor*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::Node>::Ref(std::__1::vector<glTF::Node*, std::__1::allocator<glTF::Node*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::Mesh>::Ref(std::__1::vector<glTF::Mesh*, std::__1::allocator<glTF::Mesh*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::Material>::Ref(std::__1::vector<glTF::Material*, std::__1::allocator<glTF::Material*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::Texture>::Ref(std::__1::vector<glTF::Texture*, std::__1::allocator<glTF::Texture*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::Image>::Ref(std::__1::vector<glTF::Image*, std::__1::allocator<glTF::Image*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::Sampler>::Ref(std::__1::vector<glTF::Sampler*, std::__1::allocator<glTF::Sampler*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::Camera>::Ref(std::__1::vector<glTF::Camera*, std::__1::allocator<glTF::Camera*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::Light>::Ref(std::__1::vector<glTF::Light*, std::__1::allocator<glTF::Light*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::Skin>::Ref(std::__1::vector<glTF::Skin*, std::__1::allocator<glTF::Skin*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::Scene>::Ref(std::__1::vector<glTF::Scene*, std::__1::allocator<glTF::Scene*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::Animation>::Ref(std::__1::vector<glTF::Animation*, std::__1::allocator<glTF::Animation*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF2::Buffer>::Ref(std::__1::vector<glTF2::Buffer*, std::__1::allocator<glTF2::Buffer*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF2::BufferView>::Ref(std::__1::vector<glTF2::BufferView*, std::__1::allocator<glTF2::BufferView*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF2::Accessor>::Ref(std::__1::vector<glTF2::Accessor*, std::__1::allocator<glTF2::Accessor*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF2::Sampler>::Ref(std::__1::vector<glTF2::Sampler*, std::__1::allocator<glTF2::Sampler*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF2::Texture>::Ref(std::__1::vector<glTF2::Texture*, std::__1::allocator<glTF2::Texture*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF2::Image>::Ref(std::__1::vector<glTF2::Image*, std::__1::allocator<glTF2::Image*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF2::Material>::Ref(std::__1::vector<glTF2::Material*, std::__1::allocator<glTF2::Material*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF2::Node>::Ref(std::__1::vector<glTF2::Node*, std::__1::allocator<glTF2::Node*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF2::Skin>::Ref(std::__1::vector<glTF2::Skin*, std::__1::allocator<glTF2::Skin*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF2::Mesh>::Ref(std::__1::vector<glTF2::Mesh*, std::__1::allocator<glTF2::Mesh*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF2::Scene>::Ref(std::__1::vector<glTF2::Scene*, std::__1::allocator<glTF2::Scene*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF2::Animation>::Ref(std::__1::vector<glTF2::Animation*, std::__1::allocator<glTF2::Animation*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF2::Camera>::Ref(std::__1::vector<glTF2::Camera*, std::__1::allocator<glTF2::Camera*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF2::Light>::Ref(std::__1::vector<glTF2::Light*, std::__1::allocator<glTF2::Light*> >&, unsigned int) |
266 | | |
267 | 0 | inline unsigned int GetIndex() const { return index; }Unexecuted instantiation: glTFCommon::Ref<glTF::Texture>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF::Node>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Texture>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Mesh>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Node>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF::Image>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF::Material>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF::Mesh>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF::Camera>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF::Light>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Image>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Material>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Camera>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Light>::GetIndex() const |
268 | | |
269 | 0 | operator bool() const { return vector != nullptr && index < vector->size(); }Unexecuted instantiation: glTFCommon::Ref<glTF::Scene>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF::Buffer>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF::Node>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF::BufferView>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF::Mesh>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF::Camera>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF::Accessor>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF::Texture>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF::Material>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF::Skin>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF::Image>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF::Sampler>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF2::BufferView>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Material>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Skin>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Image>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Scene>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Buffer>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Node>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Texture>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Accessor>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Sampler>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Mesh>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Camera>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Light>::operator bool() const Unexecuted instantiation: glTFCommon::Ref<glTF::Light>::operator bool() const |
270 | | |
271 | 0 | T *operator->() { return (*vector)[index]; }Unexecuted instantiation: glTFCommon::Ref<glTF::BufferView>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Accessor>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Buffer>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Camera>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Node>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Texture>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Material>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Skin>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Image>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Sampler>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Scene>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Mesh>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Animation>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::Buffer>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::BufferView>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::Scene>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::Node>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::Accessor>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::Texture>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::Material>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::Mesh>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::Skin>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::Image>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::Sampler>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::Animation>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::Camera>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::Light>::operator->() |
272 | | |
273 | 0 | T &operator*() { return *((*vector)[index]); }Unexecuted instantiation: glTFCommon::Ref<glTF::Node>::operator*() Unexecuted instantiation: glTFCommon::Ref<glTF2::Node>::operator*() |
274 | | }; |
275 | | |
276 | | // |
277 | | // JSON Value reading helpers |
278 | | // |
279 | | |
280 | | template <class T> |
281 | | struct ReadHelper { |
282 | 0 | static bool Read(Value &val, T &out) { |
283 | 0 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; |
284 | 0 | } Unexecuted instantiation: glTFCommon::ReadHelper<glTF::PrimitiveMode>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::PrimitiveMode&) Unexecuted instantiation: glTFCommon::ReadHelper<unsigned int>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, unsigned int&) Unexecuted instantiation: glTFCommon::ReadHelper<int>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, int&) Unexecuted instantiation: glTFCommon::ReadHelper<glTF::SamplerMagFilter>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::SamplerMagFilter&) Unexecuted instantiation: glTFCommon::ReadHelper<glTF::SamplerMinFilter>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::SamplerMinFilter&) Unexecuted instantiation: glTFCommon::ReadHelper<glTF::SamplerWrap>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::SamplerWrap&) Unexecuted instantiation: glTFCommon::ReadHelper<glTF::ComponentType>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::ComponentType&) Unexecuted instantiation: glTFCommon::ReadHelper<glTF::Camera::Type>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::Camera::Type&) Unexecuted instantiation: glTFCommon::ReadHelper<glTF2::ComponentType>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::ComponentType&) Unexecuted instantiation: glTFCommon::ReadHelper<glTF2::SamplerMagFilter>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::SamplerMagFilter&) Unexecuted instantiation: glTFCommon::ReadHelper<glTF2::SamplerMinFilter>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::SamplerMinFilter&) Unexecuted instantiation: glTFCommon::ReadHelper<glTF2::SamplerWrap>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::SamplerWrap&) Unexecuted instantiation: glTFCommon::ReadHelper<glTF2::PrimitiveMode>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::PrimitiveMode&) |
285 | | }; |
286 | | |
287 | | template <> |
288 | | struct ReadHelper<bool> { |
289 | 0 | static bool Read(Value &val, bool &out) { |
290 | 0 | return val.IsBool() ? out = val.GetBool(), true : false; |
291 | 0 | } |
292 | | }; |
293 | | |
294 | | template <> |
295 | | struct ReadHelper<float> { |
296 | 0 | static bool Read(Value &val, float &out) { |
297 | 0 | return val.IsNumber() ? out = static_cast<float>(val.GetDouble()), true : false; |
298 | 0 | } |
299 | | }; |
300 | | |
301 | | template <unsigned int N> |
302 | | struct ReadHelper<float[N]> { |
303 | 0 | static bool Read(Value &val, float (&out)[N]) { |
304 | 0 | if (!val.IsArray() || val.Size() != N) return false; |
305 | 0 | for (unsigned int i = 0; i < N; ++i) { |
306 | 0 | if (val[i].IsNumber()) |
307 | 0 | out[i] = static_cast<float>(val[i].GetDouble()); |
308 | 0 | } |
309 | 0 | return true; |
310 | 0 | } Unexecuted instantiation: glTFCommon::ReadHelper<float [16]>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [16]) Unexecuted instantiation: glTFCommon::ReadHelper<float [3]>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [3]) Unexecuted instantiation: glTFCommon::ReadHelper<float [4]>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [4]) |
311 | | }; |
312 | | |
313 | | template <> |
314 | | struct ReadHelper<const char *> { |
315 | 0 | static bool Read(Value &val, const char *&out) { |
316 | 0 | return val.IsString() ? (out = val.GetString(), true) : false; |
317 | 0 | } |
318 | | }; |
319 | | |
320 | | template <> |
321 | | struct ReadHelper<std::string> { |
322 | 0 | static bool Read(Value &val, std::string &out) { |
323 | 0 | return val.IsString() ? (out = std::string(val.GetString(), val.GetStringLength()), true) : false; |
324 | 0 | } |
325 | | }; |
326 | | |
327 | | template <class T> |
328 | | struct ReadHelper<Nullable<T>> { |
329 | 0 | static bool Read(Value &val, Nullable<T> &out) { |
330 | 0 | return out.isPresent = ReadHelper<T>::Read(val, out.value); |
331 | 0 | } Unexecuted instantiation: glTFCommon::ReadHelper<glTFCommon::Nullable<float [16]> >::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [16]>&) Unexecuted instantiation: glTFCommon::ReadHelper<glTFCommon::Nullable<float [3]> >::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [3]>&) Unexecuted instantiation: glTFCommon::ReadHelper<glTFCommon::Nullable<float [4]> >::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [4]>&) Unexecuted instantiation: glTFCommon::ReadHelper<glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&) Unexecuted instantiation: glTFCommon::ReadHelper<glTFCommon::Nullable<float> >::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float>&) |
332 | | }; |
333 | | |
334 | | template <> |
335 | | struct ReadHelper<uint64_t> { |
336 | 0 | static bool Read(Value &val, uint64_t &out) { |
337 | 0 | return val.IsUint64() ? out = val.GetUint64(), true : false; |
338 | 0 | } |
339 | | }; |
340 | | |
341 | | template <> |
342 | | struct ReadHelper<int64_t> { |
343 | 0 | static bool Read(Value &val, int64_t &out) { |
344 | 0 | return val.IsInt64() ? out = val.GetInt64(), true : false; |
345 | 0 | } |
346 | | }; |
347 | | |
348 | | #ifdef __APPLE__ |
349 | | |
350 | | // On Mac size_t and uint64_t are not the same, so we need a specialized version |
351 | | // here to properly parse byteOffset and other parameters > 2^31 |
352 | | // On Windows and Linux the types match andno additional specialization is required |
353 | | |
354 | | template <> |
355 | | struct ReadHelper<size_t> { |
356 | | static bool Read(Value &val, size_t &out) { |
357 | | return val.IsInt64() ? out = val.GetInt64(), true : false; |
358 | | } |
359 | | }; |
360 | | |
361 | | #endif |
362 | | |
363 | | template <class T> |
364 | 0 | inline static bool ReadValue(Value &val, T &out) { |
365 | 0 | return ReadHelper<T>::Read(val, out); |
366 | 0 | } Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<float [16]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [16]>&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadValue<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [4]) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<float [16]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [16]>&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<float [16]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [16]>&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<float [16]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [16]>&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadValue<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [4]) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<float [16]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [16]>&) |
367 | | |
368 | | template <class T> |
369 | 0 | inline static bool ReadMember(Value &obj, const char *id, T &out) { |
370 | 0 | if (!obj.IsObject()) { |
371 | 0 | return false; |
372 | 0 | } |
373 | 0 | Value::MemberIterator it = obj.FindMember(id); |
374 | 0 | if (it != obj.MemberEnd()) { |
375 | 0 | return ReadHelper<T>::Read(it->value, out); |
376 | 0 | } |
377 | 0 | return false; |
378 | 0 | } Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [3]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [3]>&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [4]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [4]>&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::PrimitiveMode&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, int&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerMagFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerMagFilter&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerMinFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerMinFilter&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerWrap>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerWrap&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::ComponentType&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::Camera::Type>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::Camera::Type&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [4]) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTF2::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::ComponentType&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTF2::SamplerMagFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerMagFilter&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTF2::SamplerMinFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerMinFilter&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTF2::SamplerWrap>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerWrap&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [4]) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<float [3]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [3]) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTF2::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::PrimitiveMode&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float>&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [3]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [3]>&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [4]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [4]>&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTF2::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::ComponentType&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTF2::SamplerMagFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerMagFilter&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTF2::SamplerMinFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerMinFilter&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTF2::SamplerWrap>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerWrap&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [4]) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<float [3]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [3]) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTF2::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::PrimitiveMode&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float>&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [3]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [3]>&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [4]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [4]>&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [3]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [3]>&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [4]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [4]>&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::PrimitiveMode&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, int&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerMagFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerMagFilter&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerMinFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerMinFilter&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerWrap>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerWrap&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::ComponentType&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::Camera::Type>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::Camera::Type&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [4]) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [3]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [3]>&) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [4]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [4]>&) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::PrimitiveMode&) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int&) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::ComponentType&) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*&) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long&) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [4]) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::SamplerMagFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerMagFilter&) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::SamplerMinFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerMinFilter&) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::SamplerWrap>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerWrap&) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float&) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<float [3]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [3]) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool&) Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float>&) |
379 | | |
380 | | template <class T> |
381 | 0 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { |
382 | 0 | T out; |
383 | 0 | return ReadMember(obj, id, out) ? out : defaultValue; |
384 | 0 | } Unexecuted instantiation: glTFExporter.cpp:glTF::PrimitiveMode glTFCommon::MemberOrDefault<glTF::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::PrimitiveMode) Unexecuted instantiation: glTFExporter.cpp:char const* glTFCommon::MemberOrDefault<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*) Unexecuted instantiation: glTFExporter.cpp:unsigned long glTFCommon::MemberOrDefault<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long) Unexecuted instantiation: glTFExporter.cpp:unsigned int glTFCommon::MemberOrDefault<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int) Unexecuted instantiation: glTFExporter.cpp:glTF::ComponentType glTFCommon::MemberOrDefault<glTF::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::ComponentType) Unexecuted instantiation: glTFExporter.cpp:int glTFCommon::MemberOrDefault<int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, int) Unexecuted instantiation: glTFExporter.cpp:glTF::Camera::Type glTFCommon::MemberOrDefault<glTF::Camera::Type>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::Camera::Type) Unexecuted instantiation: glTFExporter.cpp:float glTFCommon::MemberOrDefault<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::MemberOrDefault<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool) Unexecuted instantiation: glTF2Exporter.cpp:unsigned long glTFCommon::MemberOrDefault<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long) Unexecuted instantiation: glTF2Exporter.cpp:unsigned int glTFCommon::MemberOrDefault<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int) Unexecuted instantiation: glTF2Exporter.cpp:glTF2::ComponentType glTFCommon::MemberOrDefault<glTF2::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::ComponentType) Unexecuted instantiation: glTF2Exporter.cpp:glTF2::PrimitiveMode glTFCommon::MemberOrDefault<glTF2::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::PrimitiveMode) Unexecuted instantiation: glTF2Exporter.cpp:char const* glTFCommon::MemberOrDefault<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*) Unexecuted instantiation: glTF2Exporter.cpp:float glTFCommon::MemberOrDefault<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float) Unexecuted instantiation: ImporterRegistry.cpp:unsigned long glTFCommon::MemberOrDefault<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long) Unexecuted instantiation: ImporterRegistry.cpp:unsigned int glTFCommon::MemberOrDefault<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int) Unexecuted instantiation: ImporterRegistry.cpp:glTF2::ComponentType glTFCommon::MemberOrDefault<glTF2::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::ComponentType) Unexecuted instantiation: ImporterRegistry.cpp:glTF2::PrimitiveMode glTFCommon::MemberOrDefault<glTF2::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::PrimitiveMode) Unexecuted instantiation: ImporterRegistry.cpp:char const* glTFCommon::MemberOrDefault<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*) Unexecuted instantiation: ImporterRegistry.cpp:float glTFCommon::MemberOrDefault<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::MemberOrDefault<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool) Unexecuted instantiation: glTFImporter.cpp:glTF::PrimitiveMode glTFCommon::MemberOrDefault<glTF::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::PrimitiveMode) Unexecuted instantiation: glTFImporter.cpp:char const* glTFCommon::MemberOrDefault<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*) Unexecuted instantiation: glTFImporter.cpp:unsigned long glTFCommon::MemberOrDefault<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long) Unexecuted instantiation: glTFImporter.cpp:unsigned int glTFCommon::MemberOrDefault<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int) Unexecuted instantiation: glTFImporter.cpp:glTF::ComponentType glTFCommon::MemberOrDefault<glTF::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::ComponentType) Unexecuted instantiation: glTFImporter.cpp:int glTFCommon::MemberOrDefault<int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, int) Unexecuted instantiation: glTFImporter.cpp:glTF::Camera::Type glTFCommon::MemberOrDefault<glTF::Camera::Type>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::Camera::Type) Unexecuted instantiation: glTFImporter.cpp:float glTFCommon::MemberOrDefault<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float) Unexecuted instantiation: glTF2Importer.cpp:glTF2::PrimitiveMode glTFCommon::MemberOrDefault<glTF2::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::PrimitiveMode) Unexecuted instantiation: glTF2Importer.cpp:unsigned int glTFCommon::MemberOrDefault<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int) Unexecuted instantiation: glTF2Importer.cpp:unsigned long glTFCommon::MemberOrDefault<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long) Unexecuted instantiation: glTF2Importer.cpp:glTF2::ComponentType glTFCommon::MemberOrDefault<glTF2::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::ComponentType) Unexecuted instantiation: glTF2Importer.cpp:char const* glTFCommon::MemberOrDefault<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*) Unexecuted instantiation: glTF2Importer.cpp:float glTFCommon::MemberOrDefault<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float) |
385 | | |
386 | 0 | inline Value *FindMember(Value &val, const char *id) { |
387 | 0 | if (!val.IsObject()) { |
388 | 0 | return nullptr; |
389 | 0 | } |
390 | 0 | Value::MemberIterator it = val.FindMember(id); |
391 | 0 | return (it != val.MemberEnd()) ? &it->value : nullptr; |
392 | 0 | } |
393 | | |
394 | | template <int N> |
395 | 0 | inline void throwUnexpectedTypeError(const char (&expectedTypeName)[N], const char *memberId, const char *context, const char *extraContext) { |
396 | 0 | std::string fullContext = context; |
397 | 0 | if (extraContext && (strlen(extraContext) > 0)) { |
398 | 0 | fullContext = fullContext + " (" + extraContext + ")"; |
399 | 0 | } |
400 | 0 | throw DeadlyImportError("Member \"", memberId, "\" was not of type \"", expectedTypeName, "\" when reading ", fullContext); |
401 | 0 | } Unexecuted instantiation: void glTFCommon::throwUnexpectedTypeError<7>(char const (&) [7], char const*, char const*, char const*) Unexecuted instantiation: void glTFCommon::throwUnexpectedTypeError<5>(char const (&) [5], char const*, char const*, char const*) Unexecuted instantiation: void glTFCommon::throwUnexpectedTypeError<6>(char const (&) [6], char const*, char const*, char const*) |
402 | | |
403 | | // Look-up functions with type checks. Context and extra context help the user identify the problem if there's an error. |
404 | | |
405 | 0 | inline Value *FindStringInContext(Value &val, const char *memberId, const char *context, const char *extraContext = nullptr) { |
406 | 0 | if (!val.IsObject()) { |
407 | 0 | return nullptr; |
408 | 0 | } |
409 | 0 | Value::MemberIterator it = val.FindMember(memberId); |
410 | 0 | if (it == val.MemberEnd()) { |
411 | 0 | return nullptr; |
412 | 0 | } |
413 | 0 | if (!it->value.IsString()) { |
414 | 0 | throwUnexpectedTypeError("string", memberId, context, extraContext); |
415 | 0 | } |
416 | 0 | return &it->value; |
417 | 0 | } |
418 | | |
419 | 0 | inline Value *FindNumberInContext(Value &val, const char *memberId, const char *context, const char *extraContext = nullptr) { |
420 | 0 | if (!val.IsObject()) { |
421 | 0 | return nullptr; |
422 | 0 | } |
423 | 0 | Value::MemberIterator it = val.FindMember(memberId); |
424 | 0 | if (it == val.MemberEnd()) { |
425 | 0 | return nullptr; |
426 | 0 | } |
427 | 0 | if (!it->value.IsNumber()) { |
428 | 0 | throwUnexpectedTypeError("number", memberId, context, extraContext); |
429 | 0 | } |
430 | 0 | return &it->value; |
431 | 0 | } |
432 | | |
433 | 0 | inline Value *FindUIntInContext(Value &val, const char *memberId, const char *context, const char *extraContext = nullptr) { |
434 | 0 | if (!val.IsObject()) { |
435 | 0 | return nullptr; |
436 | 0 | } |
437 | 0 | Value::MemberIterator it = val.FindMember(memberId); |
438 | 0 | if (it == val.MemberEnd()) { |
439 | 0 | return nullptr; |
440 | 0 | } |
441 | 0 | if (!it->value.IsUint()) { |
442 | 0 | throwUnexpectedTypeError("uint", memberId, context, extraContext); |
443 | 0 | } |
444 | 0 | return &it->value; |
445 | 0 | } |
446 | | |
447 | 0 | inline Value *FindArrayInContext(Value &val, const char *memberId, const char *context, const char *extraContext = nullptr) { |
448 | 0 | if (!val.IsObject()) { |
449 | 0 | return nullptr; |
450 | 0 | } |
451 | 0 | Value::MemberIterator it = val.FindMember(memberId); |
452 | 0 | if (it == val.MemberEnd()) { |
453 | 0 | return nullptr; |
454 | 0 | } |
455 | 0 | if (!it->value.IsArray()) { |
456 | 0 | throwUnexpectedTypeError("array", memberId, context, extraContext); |
457 | 0 | } |
458 | 0 | return &it->value; |
459 | 0 | } |
460 | | |
461 | 0 | inline Value *FindObjectInContext(Value &val, const char * memberId, const char *context, const char *extraContext = nullptr) { |
462 | 0 | if (!val.IsObject()) { |
463 | 0 | return nullptr; |
464 | 0 | } |
465 | 0 | Value::MemberIterator it = val.FindMember(memberId); |
466 | 0 | if (it == val.MemberEnd()) { |
467 | 0 | return nullptr; |
468 | 0 | } |
469 | 0 | if (!it->value.IsObject()) { |
470 | 0 | ASSIMP_LOG_ERROR("Member \"", memberId, "\" was not of type \"", context, "\" when reading ", extraContext); |
471 | 0 | return nullptr; |
472 | 0 | } |
473 | 0 | return &it->value; |
474 | 0 | } |
475 | | |
476 | 0 | inline Value *FindExtensionInContext(Value &val, const char *extensionId, const char *context, const char *extraContext = nullptr) { |
477 | 0 | if (Value *extensionList = FindObjectInContext(val, "extensions", context, extraContext)) { |
478 | 0 | if (Value *extension = FindObjectInContext(*extensionList, extensionId, context, extraContext)) { |
479 | 0 | return extension; |
480 | 0 | } |
481 | 0 | } |
482 | 0 | return nullptr; |
483 | 0 | } |
484 | | |
485 | | // Overloads when the value is the document. |
486 | | |
487 | 0 | inline Value *FindString(Document &doc, const char *memberId) { |
488 | 0 | return FindStringInContext(doc, memberId, "the document"); |
489 | 0 | } |
490 | | |
491 | 0 | inline Value *FindNumber(Document &doc, const char *memberId) { |
492 | 0 | return FindNumberInContext(doc, memberId, "the document"); |
493 | 0 | } |
494 | | |
495 | 0 | inline Value *FindUInt(Document &doc, const char *memberId) { |
496 | 0 | return FindUIntInContext(doc, memberId, "the document"); |
497 | 0 | } |
498 | | |
499 | 0 | inline Value *FindArray(Document &val, const char *memberId) { |
500 | 0 | return FindArrayInContext(val, memberId, "the document"); |
501 | 0 | } |
502 | | |
503 | 0 | inline Value *FindObject(Document &doc, const char *memberId) { |
504 | 0 | return FindObjectInContext(doc, memberId, "the document"); |
505 | 0 | } |
506 | | |
507 | 0 | inline Value *FindExtension(Value &val, const char *extensionId) { |
508 | 0 | return FindExtensionInContext(val, extensionId, "the document"); |
509 | 0 | } |
510 | | |
511 | 0 | inline Value *FindString(Value &val, const char *id) { |
512 | 0 | Value::MemberIterator it = val.FindMember(id); |
513 | 0 | return (it != val.MemberEnd() && it->value.IsString()) ? &it->value : nullptr; |
514 | 0 | } |
515 | | |
516 | 0 | inline Value *FindObject(Value &val, const char *id) { |
517 | 0 | Value::MemberIterator it = val.FindMember(id); |
518 | 0 | return (it != val.MemberEnd() && it->value.IsObject()) ? &it->value : nullptr; |
519 | 0 | } |
520 | | |
521 | 0 | inline Value *FindArray(Value &val, const char *id) { |
522 | 0 | Value::MemberIterator it = val.FindMember(id); |
523 | 0 | return (it != val.MemberEnd() && it->value.IsArray()) ? &it->value : nullptr; |
524 | 0 | } |
525 | | |
526 | 0 | inline Value *FindNumber(Value &val, const char *id) { |
527 | 0 | Value::MemberIterator it = val.FindMember(id); |
528 | 0 | return (it != val.MemberEnd() && it->value.IsNumber()) ? &it->value : nullptr; |
529 | 0 | } |
530 | | |
531 | | } // namespace glTFCommon |
532 | | |
533 | | #endif // AI_GLFTCOMMON_H_INC |