0a419c51 |
1 | // Author: Kirill Gavrilov |
2 | // Copyright (c) 2016-2019 OPEN CASCADE SAS |
3 | // |
4 | // This file is part of Open CASCADE Technology software library. |
5 | // |
6 | // This library is free software; you can redistribute it and/or modify it under |
7 | // the terms of the GNU Lesser General Public License version 2.1 as published |
8 | // by the Free Software Foundation, with special exception defined in the file |
9 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
10 | // distribution for complete text of the license and disclaimer of any warranty. |
11 | // |
12 | // Alternatively, this file may be used under the terms of Open CASCADE |
13 | // commercial license or contractual agreement. |
14 | |
15 | #ifndef _RWGltf_GltfAccessorLayout_HeaderFile |
16 | #define _RWGltf_GltfAccessorLayout_HeaderFile |
17 | |
18 | #include <Standard_CString.hxx> |
19 | |
20 | //! Low-level glTF enumeration defining Accessor layout. |
21 | //! Similar to Graphic3d_TypeOfData but does not define actual type and includes matrices. |
22 | enum RWGltf_GltfAccessorLayout |
23 | { |
24 | RWGltf_GltfAccessorLayout_UNKNOWN, //!< unknown or invalid type |
25 | RWGltf_GltfAccessorLayout_Scalar, //!< "SCALAR" |
26 | RWGltf_GltfAccessorLayout_Vec2, //!< "VEC2" |
27 | RWGltf_GltfAccessorLayout_Vec3, //!< "VEC3" |
28 | RWGltf_GltfAccessorLayout_Vec4, //!< "VEC4" |
29 | RWGltf_GltfAccessorLayout_Mat2, //!< "MAT2" |
30 | RWGltf_GltfAccessorLayout_Mat3, //!< "MAT3" |
31 | RWGltf_GltfAccessorLayout_Mat4, //!< "MAT4" |
32 | }; |
33 | |
34 | //! Parse GltfAccessorLayout from string. |
35 | inline RWGltf_GltfAccessorLayout RWGltf_GltfParseAccessorType (const char* theType) |
36 | { |
37 | if (IsEqual ("SCALAR", theType)) |
38 | { |
39 | return RWGltf_GltfAccessorLayout_Scalar; |
40 | } |
41 | else if (IsEqual ("VEC2", theType)) |
42 | { |
43 | return RWGltf_GltfAccessorLayout_Vec2; |
44 | } |
45 | else if (IsEqual ("VEC3", theType)) |
46 | { |
47 | return RWGltf_GltfAccessorLayout_Vec3; |
48 | } |
49 | else if (IsEqual ("VEC4", theType)) |
50 | { |
51 | return RWGltf_GltfAccessorLayout_Vec4; |
52 | } |
53 | else if (IsEqual ("MAT2", theType)) |
54 | { |
55 | return RWGltf_GltfAccessorLayout_Mat2; |
56 | } |
57 | else if (IsEqual ("MAT3", theType)) |
58 | { |
59 | return RWGltf_GltfAccessorLayout_Mat3; |
60 | } |
61 | else if (IsEqual ("MAT4", theType)) |
62 | { |
63 | return RWGltf_GltfAccessorLayout_Mat4; |
64 | } |
65 | return RWGltf_GltfAccessorLayout_UNKNOWN; |
66 | } |
67 | |
68 | #endif // _RWGltf_GltfAccessorLayout_HeaderFile |