proj home

Files   Classes   Functions   Hierarchy  

vrmlshaperaw Class Reference

A limited subset of the VRML Shape node is representated. More...

#include <vrmlshaperaw.h>

Collaboration diagram for vrmlshaperaw:

List of all members.

Public Member Functions

 vrmlshaperaw ()
 The default initializes memory to not being used.
ostreamprint (ostream &os) const
 For debugging purposes the VRML node interpretation can be printed.

Public Attributes

bool isline
 Is this a line?
bool istriangles
 Is this shape a triangle mesh?
vector< double > point
 The point[] vector data.
vector< double > normal
 The normal[] vector data.
vector< double > color
 The color vector data.
vector< int > coordIndex
 The indexes that define the shapses.
double diffuseColor [3]
 The diffuse color.
double emissiveColor [3]
 The emissive color.
double ambientIntensity
 The ambient/background light.


Detailed Description

A limited subset of the VRML Shape node is representated.

This is an expensive data structure because all the supported VRML attributes are allocated for. However because of the flat structure it is easy to use.

The parser simply writes in the values which it wants to and leaves the others unchanged.

The real numbers are set to negative values to indicate that the data was not set. Booleans are set to false.

Definition at line 24 of file vrmlshaperaw.h.


Constructor & Destructor Documentation

vrmlshaperaw::vrmlshaperaw (  ) 

The default initializes memory to not being used.

Definition at line 5 of file vrmlshaperaw.cpp.

References ambientIntensity, diffuseColor, and emissiveColor.

00006   : 
00007   isline(false),
00008   istriangles(false)
00009 {
00010   diffuseColor[0] = diffuseColor[1] = diffuseColor[2] = -1.0;
00011   emissiveColor[0] = emissiveColor[1] = emissiveColor[2] = -1.0;
00012   ambientIntensity = -1.0;
00013 }


Member Function Documentation

ostream & vrmlshaperaw::print ( ostream os  )  const

For debugging purposes the VRML node interpretation can be printed.

Definition at line 17 of file vrmlshaperaw.cpp.

References ambientIntensity, color, coordIndex, diffuseColor, emissiveColor, isline, istriangles, normal, and point.

00018 {
00019   if (isline)
00020     os << "isline" << endl;
00021 
00022   if (istriangles)
00023     os << "istriangles" << endl;
00024 
00025   
00026   if (diffuseColor[0]>=0.0)
00027   {
00028     os << "diffuseColor: ";
00029     os << diffuseColor[0] << " ";
00030     os << diffuseColor[1] << " ";
00031     os << diffuseColor[2] << " ";
00032     os << endl;
00033   }
00034   
00035   if (emissiveColor[0]>=0.0)
00036   {
00037     os << "emissiveColor: ";
00038     os << emissiveColor[0] << " ";
00039     os << emissiveColor[1] << " ";
00040     os << emissiveColor[2] << " ";
00041     os << endl;
00042   }
00043   
00044   if (ambientIntensity>=0.0)
00045   {
00046     os << "ambientIntensity: ";
00047     os << ambientIntensity;
00048     os << endl;
00049   }
00050 
00051   if (! point.empty() )
00052   {
00053     os << "point:" << endl;
00054 
00055     for (uint i=0; i<point.size(); ++i)
00056     {
00057       os << point[i] << " ";
00058       if ((i+1)%3==0)
00059         os << endl;
00060     }
00061     os << endl;
00062   }
00063 
00064   if (! normal.empty() )
00065   {
00066     os << "normal:" << endl;
00067 
00068     for (uint i=0; i<normal.size(); ++i)
00069     {
00070       os << normal[i] << " ";
00071 
00072       if ((i+1)%3==0)
00073         os << endl;
00074     }
00075     os << endl;
00076   }
00077 
00078   if (! color.empty() )
00079   {
00080     os << "color:" << endl;
00081 
00082     for (uint i=0; i<color.size(); ++i)
00083     {
00084       os << color[i] << " ";
00085       if ((i+1)%3==0)
00086         os << endl;
00087     }
00088     os << endl;
00089   }
00090 
00091   if (! coordIndex.empty() )
00092   {
00093     os << "coordIndex:" << endl;
00094     for (uint i=0; i<coordIndex.size(); ++i)
00095     {
00096       if (coordIndex[i]==-1)
00097         os << endl;
00098       else
00099         os << coordIndex[i] << " ";
00100     }
00101     os << endl;
00102   }
00103 
00104   os << endl;
00105 
00106   return os;
00107 }


Member Data Documentation

The ambient/background light.

Definition at line 49 of file vrmlshaperaw.h.

Referenced by print(), and vrmlshaperaw().

vector<double> vrmlshaperaw::color

The color vector data.

Definition at line 40 of file vrmlshaperaw.h.

Referenced by print().

The indexes that define the shapses.

Definition at line 42 of file vrmlshaperaw.h.

Referenced by print().

The diffuse color.

Definition at line 45 of file vrmlshaperaw.h.

Referenced by print(), and vrmlshaperaw().

The emissive color.

Definition at line 47 of file vrmlshaperaw.h.

Referenced by print(), and vrmlshaperaw().

Is this a line?

Definition at line 30 of file vrmlshaperaw.h.

Referenced by print().

Is this shape a triangle mesh?

Definition at line 32 of file vrmlshaperaw.h.

Referenced by print().

vector<double> vrmlshaperaw::normal

The normal[] vector data.

Definition at line 38 of file vrmlshaperaw.h.

Referenced by print().

vector<double> vrmlshaperaw::point

The point[] vector data.

Definition at line 36 of file vrmlshaperaw.h.

Referenced by print().


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