proj home

Files   Classes   Functions   Hierarchy  

vrmlshapeNormal Class Reference

Identify VRML Normal. More...

#include <vrmlshapeparse.h>

Inheritance diagram for vrmlshapeNormal:
Collaboration diagram for vrmlshapeNormal:

List of all members.

Public Member Functions

 vrmlshapeNormal ()
 A normal token.
void eval (vrmlshapeparse &p) const
 Expecting { vector [ 1.5915e-015 1 -3.1849e-015, .


Detailed Description

Identify VRML Normal.

Definition at line 282 of file vrmlshapeparse.h.


Constructor & Destructor Documentation

vrmlshapeNormal::vrmlshapeNormal (  )  [inline]

A normal token.

Definition at line 288 of file vrmlshapeparse.h.

00289     : vrmlshapetoken("Normal") {}


Member Function Documentation

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 }


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:50:24 2011 for Chelton Evans Source by  doxygen 1.5.8