0031332: Data Exchange - RWGltf_CafReader ignores bufferView.byteStride within glTF 2.0
[occt.git] / src / RWGltf / RWGltf_GltfArrayType.hxx
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_GltfArrayType_HeaderFile
16 #define _RWGltf_GltfArrayType_HeaderFile
17
18 #include <Standard_CString.hxx>
19
20 //! Low-level glTF enumeration defining Array type.
21 enum RWGltf_GltfArrayType
22 {
23   RWGltf_GltfArrayType_UNKNOWN,  //!< unknown or invalid type
24   RWGltf_GltfArrayType_Indices,  //!< "indices"    within "primitive"  element
25   RWGltf_GltfArrayType_Position, //!< "POSITION"   within "attributes" element
26   RWGltf_GltfArrayType_Normal,   //!< "NORMAL"     within "attributes" element
27   RWGltf_GltfArrayType_Color,    //!< "COLOR"      within "attributes" element
28   RWGltf_GltfArrayType_TCoord0,  //!< "TEXCOORD_0" within "attributes" element
29   RWGltf_GltfArrayType_TCoord1,  //!< "TEXCOORD_1" within "attributes" element
30   RWGltf_GltfArrayType_Joint,    //!< "JOINT"      within "attributes" element
31   RWGltf_GltfArrayType_Weight,   //!< "WEIGHT"     within "attributes" element
32 };
33
34 //! Parse GltfArrayType from string.
35 inline RWGltf_GltfArrayType RWGltf_GltfParseAttribType (const char* theType)
36 {
37   if (IsEqual ("POSITION", theType))
38   {
39     return RWGltf_GltfArrayType_Position;
40   }
41   else if (IsEqual ("NORMAL", theType))
42   {
43     return RWGltf_GltfArrayType_Normal;
44   }
45   else if (IsEqual ("COLOR", theType))
46   {
47     return RWGltf_GltfArrayType_Color;
48   }
49   else if (IsEqual ("TEXCOORD_0", theType))
50   {
51     return RWGltf_GltfArrayType_TCoord0;
52   }
53   else if (IsEqual ("TEXCOORD_1", theType))
54   {
55     return RWGltf_GltfArrayType_TCoord1;
56   }
57   else if (IsEqual ("JOINT", theType))
58   {
59     return RWGltf_GltfArrayType_Joint;
60   }
61   else if (IsEqual ("WEIGHT", theType))
62   {
63     return RWGltf_GltfArrayType_Weight;
64   }
65   return RWGltf_GltfArrayType_UNKNOWN;
66 }
67
68 #endif // _RWGltf_GltfArrayType_HeaderFile