Files Classes Functions Hierarchy
00001 #ifndef VRMLSHAPEPARSE_H 00002 #define VRMLSHAPEPARSE_H 00003 00004 #include <cassert> 00005 #include <vector> 00006 using namespace std; 00007 00008 #include <tokenizer.h> 00009 00010 #include <vrmlshaperaw.h> 00011 00012 00013 class vrmlshapeparse; 00014 00035 class vrmlshapetoken 00036 { 00037 public: 00038 00040 stringc id; 00041 00043 vrmlshapetoken(stringc & id_) 00044 : id(id_) {} 00045 00047 virtual ~vrmlshapetoken() {} 00048 00051 void eval 00052 ( 00053 bool & handled, 00054 vrmlshapeparse & p 00055 ) const; 00056 00058 virtual void eval( vrmlshapeparse& p) const=0; 00059 00064 void consumescope 00065 ( 00066 vrmlshapeparse & p, 00067 stringc & left, 00068 stringc & right 00069 ) const; 00070 00074 virtual void depth( vrmlshapeparse & p ) const; 00075 00076 }; 00077 00085 class vrmlshapetokengroup 00086 { 00087 public: 00088 00090 vector< vrmlshapetoken * > tokens; 00091 00094 void eval( vrmlshapeparse & p ) const; 00095 00097 ~vrmlshapetokengroup(); 00098 }; 00099 00106 class vrmlshapeparse 00107 { 00109 vrmlshapetokengroup tg; 00110 public: 00111 00113 tokenizer tokenstream; 00114 00117 vector< vrmlshaperaw > vshp; 00118 00121 boolc readfile(stringc & filename); 00122 }; 00123 00127 class vrmlshapeShape 00128 : public vrmlshapetoken 00129 { 00130 vrmlshapetokengroup tg; 00131 public: 00132 00134 vrmlshapeShape(); 00135 00138 void depth( vrmlshapeparse & p ) const 00139 { tg.eval(p); } 00140 00142 void eval( vrmlshapeparse & p ) const; 00143 00144 }; 00145 00149 class vrmlshapeIndexedLineSet 00150 : public vrmlshapetoken 00151 { 00152 vrmlshapetokengroup tg; 00153 public: 00154 00156 vrmlshapeIndexedLineSet(); 00157 00160 void depth( vrmlshapeparse & p ) const 00161 { tg.eval(p); } 00162 00164 void eval( vrmlshapeparse & p ) const; 00165 00166 }; 00167 00171 class vrmlshapeIndexedFaceSet 00172 : public vrmlshapetoken 00173 { 00174 vrmlshapetokengroup tg; 00175 public: 00176 00178 vrmlshapeIndexedFaceSet(); 00179 00182 void depth( vrmlshapeparse & p ) const 00183 { tg.eval(p); } 00184 00186 void eval( vrmlshapeparse & p ) const; 00187 }; 00188 00192 class vrmlshapeMaterial 00193 : public vrmlshapetoken 00194 { 00195 vrmlshapetokengroup tg; 00196 public: 00197 00199 vrmlshapeMaterial(); 00200 00203 void depth( vrmlshapeparse & p ) const 00204 { tg.eval(p); } 00205 00207 void eval( vrmlshapeparse & p ) const; 00208 }; 00209 00213 class vrmlshapediffuseColor 00214 : public vrmlshapetoken 00215 { 00216 public: 00217 00219 vrmlshapediffuseColor() 00220 : vrmlshapetoken("diffuseColor") {} 00221 00223 void eval( vrmlshapeparse & p ) const; 00224 00225 }; 00226 00230 class vrmlshapeemissiveColor 00231 : public vrmlshapetoken 00232 { 00233 public: 00234 00236 vrmlshapeemissiveColor() 00237 : vrmlshapetoken("emissiveColor") {} 00238 00240 void eval( vrmlshapeparse & p ) const; 00241 00242 }; 00243 00247 class vrmlshapeambientIntensity 00248 : public vrmlshapetoken 00249 { 00250 public: 00251 00253 vrmlshapeambientIntensity() 00254 : vrmlshapetoken("ambientIntensity") {} 00255 00257 void eval( vrmlshapeparse & p ) const; 00258 00259 }; 00260 00264 class vrmlshapepoint 00265 : public vrmlshapetoken 00266 { 00267 public: 00268 00270 vrmlshapepoint() 00271 : vrmlshapetoken("point") {} 00272 00275 void eval( vrmlshapeparse & p ) const; 00276 00277 }; 00278 00282 class vrmlshapeNormal 00283 : public vrmlshapetoken 00284 { 00285 public: 00286 00288 vrmlshapeNormal() 00289 : vrmlshapetoken("Normal") {} 00290 00293 void eval( vrmlshapeparse & p ) const; 00294 00295 }; 00296 00300 class vrmlshapecoordIndex 00301 : public vrmlshapetoken 00302 { 00303 public: 00304 00306 vrmlshapecoordIndex() 00307 : vrmlshapetoken("coordIndex") {} 00308 00310 void eval( vrmlshapeparse & p ) const; 00311 00312 }; 00313 00314 00315 #endif 00316 00317
1.5.8