Files Classes Functions Hierarchy
#include <vrmlshapeparse.h>
Public Member Functions | |
| vrmlshapeNormal () | |
| A normal token. | |
| void | eval (vrmlshapeparse &p) const |
| Expecting { vector [ 1.5915e-015 1 -3.1849e-015, . | |
Definition at line 282 of file vrmlshapeparse.h.
| vrmlshapeNormal::vrmlshapeNormal | ( | ) | [inline] |
A normal token.
Definition at line 288 of file vrmlshapeparse.h.
00289 : vrmlshapetoken("Normal") {}
| void vrmlshapeNormal::eval | ( | vrmlshapeparse & | p | ) | const [virtual] |
Expecting { vector [ 1.5915e-015 1 -3.1849e-015, .
. ] } in parser scope.
Implements vrmlshapetoken.
Definition at line 255 of file vrmlshapeparse.cpp.
References dbg, vrmlshapeparse::tokenstream, and vrmlshapeparse::vshp.
00256 { 00257 assert(p.vshp.empty()==false); 00258 ++p.tokenstream; 00259 assert(p.tokenstream()=="{"); 00260 ++p.tokenstream; 00261 assert(p.tokenstream()=="vector"); 00262 ++p.tokenstream; 00263 00264 assert(p.tokenstream()=="["); 00265 ++p.tokenstream; 00266 double d; 00267 while((p.tokenstream()!="]") && !p.tokenstream) 00268 { 00269 stringstream s(p.tokenstream()); 00270 s >> d; 00271 p.vshp.back().normal.push_back(d); 00272 00273 ++p.tokenstream; 00274 } 00275 ++p.tokenstream; 00276 00277 assert(p.tokenstream()=="}"); 00278 ++p.tokenstream; 00279 00280 assert((p.vshp.back().normal.size()%3)==0); 00281 00282 #ifdef DEBUG_VRMLSHAPEPARSE 00283 dbg() << id << endl; 00284 #endif 00285 }
1.5.8