Ocean
ClassicScanner.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_SCENEDESCRIPTION_SDX_X3D_CLASSIC_SCANNER_H
9 #define META_OCEAN_SCENEDESCRIPTION_SDX_X3D_CLASSIC_SCANNER_H
10 
12 
13 #include "ocean/io/Scanner.h"
14 
15 namespace Ocean
16 {
17 
18 namespace SceneDescription
19 {
20 
21 namespace SDX
22 {
23 
24 namespace X3D
25 {
26 
27 /**
28  * This class implements a scanner for the classic x3d file format.
29  * @ingroup scenedescriptionsdxx3d
30  */
31 class OCEAN_SCENEDESCRIPTION_SDX_X3D_EXPORT ClassicScanner : public IO::Scanner
32 {
33  public:
34 
35  /**
36  * Definition of x3d symbols.
37  */
38  enum Symbol : uint32_t
39  {
40  /// Dot symbol: '.'.
42  /// Node begin symbol: '{'.
44  /// Node end symbol: '}'.
46  /// Multi field begin symbol: '['.
48  /// Multi field end symbol: ']'.
49  SYMBOL_FIELD_END
50  };
51 
52  /**
53  * Definition of x3d keywords.
54  */
55  enum Keyword : uint32_t
56  {
57  /// DEF keyword.
59  /// FALSE keyword.
61  /// META keyword.
63  /// MFBool keyword.
65  /// MFColor keyword.
67  /// MFFloat keyword.
69  /// MFInt32 keyword.
71  /// MFMatrix3f keyword.
73  /// MFMatrix4f keyword.
75  /// MFNode keyword.
77  /// MFRotation keyword.
79  /// MFString keyword.
81  /// MFTime keywod.
83  /// MFVec2f keyword.
85  /// MFVec3f keyword.
87  /// MFVec4f keyword.
89  /// NULL keyword.
91  /// PROFILE keyword.
93  /// ROUTE keyword.
95  /// SFBool keyword.
97  /// SFColor keyword.
99  /// SFFloat keyword.
101  /// SFInt32 keyword.
103  /// SFMatrix3f keyword.
105  /// SFMatrix4f keyword.
107  /// SFNode keyword.
109  /// SFRotation keyword.
111  /// SFString keyword.
113  /// SFTime keywod.
115  /// SFVec2f keyword.
117  /// SFVec3f keyword.
119  /// SFVec4f keyword.
121  /// TO keyword.
123  /// TRUE keyword.
125  /// USE keyword.
126  KEYWORD_USE
127  };
128 
129  public:
130 
131  /**
132  * Creates a new classic scanner by a given filename.
133  * @param filename The filename of the file to scan
134  * @param progress Optional scanner progress value
135  * @param cancel Optional scanner cancel state
136  * @see Scanner::Scanner().
137  */
138  explicit ClassicScanner(const std::string& filename, float* progress = nullptr, bool* cancel = nullptr);
139 };
140 
141 }
142 
143 }
144 
145 }
146 
147 }
148 
149 #endif // META_OCEAN_SCENEDESCRIPTION_SDX_X3D_CLASSIC_SCANNER_H
This class implements a simple scanner.
Definition: Scanner.h:31
This class implements a scanner for the classic x3d file format.
Definition: ClassicScanner.h:32
Keyword
Definition of x3d keywords.
Definition: ClassicScanner.h:56
@ KEYWORD_META
META keyword.
Definition: ClassicScanner.h:62
@ KEYWORD_SF_VEC_2F
SFVec2f keyword.
Definition: ClassicScanner.h:116
@ KEYWORD_NULL
NULL keyword.
Definition: ClassicScanner.h:90
@ KEYWORD_SF_MATRIX_3F
SFMatrix3f keyword.
Definition: ClassicScanner.h:104
@ KEYWORD_ROUTE
ROUTE keyword.
Definition: ClassicScanner.h:94
@ KEYWORD_MF_VEC_4F
MFVec4f keyword.
Definition: ClassicScanner.h:88
@ KEYWORD_MF_VEC_3F
MFVec3f keyword.
Definition: ClassicScanner.h:86
@ KEYWORD_SF_ROTATION
SFRotation keyword.
Definition: ClassicScanner.h:110
@ KEYWORD_SF_VEC_3F
SFVec3f keyword.
Definition: ClassicScanner.h:118
@ KEYWORD_MF_VEC_2F
MFVec2f keyword.
Definition: ClassicScanner.h:84
@ KEYWORD_SF_TIME
SFTime keywod.
Definition: ClassicScanner.h:114
@ KEYWORD_MF_MATRIX_4F
MFMatrix4f keyword.
Definition: ClassicScanner.h:74
@ KEYWORD_MF_MATRIX_3F
MFMatrix3f keyword.
Definition: ClassicScanner.h:72
@ KEYWORD_SF_NODE
SFNode keyword.
Definition: ClassicScanner.h:108
@ KEYWORD_MF_INT32
MFInt32 keyword.
Definition: ClassicScanner.h:70
@ KEYWORD_SF_VEC_4F
SFVec4f keyword.
Definition: ClassicScanner.h:120
@ KEYWORD_MF_BOOL
MFBool keyword.
Definition: ClassicScanner.h:64
@ KEYWORD_SF_FLOAT
SFFloat keyword.
Definition: ClassicScanner.h:100
@ KEYWORD_TO
TO keyword.
Definition: ClassicScanner.h:122
@ KEYWORD_MF_TIME
MFTime keywod.
Definition: ClassicScanner.h:82
@ KEYWORD_SF_INT32
SFInt32 keyword.
Definition: ClassicScanner.h:102
@ KEYWORD_MF_COLOR
MFColor keyword.
Definition: ClassicScanner.h:66
@ KEYWORD_SF_MATRIX_4F
SFMatrix4f keyword.
Definition: ClassicScanner.h:106
@ KEYWORD_MF_STRING
MFString keyword.
Definition: ClassicScanner.h:80
@ KEYWORD_MF_ROTATION
MFRotation keyword.
Definition: ClassicScanner.h:78
@ KEYWORD_DEF
DEF keyword.
Definition: ClassicScanner.h:58
@ KEYWORD_SF_BOOL
SFBool keyword.
Definition: ClassicScanner.h:96
@ KEYWORD_MF_FLOAT
MFFloat keyword.
Definition: ClassicScanner.h:68
@ KEYWORD_SF_COLOR
SFColor keyword.
Definition: ClassicScanner.h:98
@ KEYWORD_PROFILE
PROFILE keyword.
Definition: ClassicScanner.h:92
@ KEYWORD_FALSE
FALSE keyword.
Definition: ClassicScanner.h:60
@ KEYWORD_MF_NODE
MFNode keyword.
Definition: ClassicScanner.h:76
@ KEYWORD_SF_STRING
SFString keyword.
Definition: ClassicScanner.h:112
@ KEYWORD_TRUE
TRUE keyword.
Definition: ClassicScanner.h:124
ClassicScanner(const std::string &filename, float *progress=nullptr, bool *cancel=nullptr)
Creates a new classic scanner by a given filename.
Symbol
Definition of x3d symbols.
Definition: ClassicScanner.h:39
@ SYMBOL_NODE_END
Node end symbol: '}'.
Definition: ClassicScanner.h:45
@ SYMBOL_FIELD_BEGIN
Multi field begin symbol: '['.
Definition: ClassicScanner.h:47
@ SYMBOL_NODE_BEGIN
Node begin symbol: '{'.
Definition: ClassicScanner.h:43
@ SYMBOL_DOT
Dot symbol: '.'.
Definition: ClassicScanner.h:41
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15