proj home

Files   Classes   Functions   Hierarchy  

vrmlshaperaw.cpp

Go to the documentation of this file.
00001 
00002 #include <typedefs.h>
00003 #include <vrmlshaperaw.h>
00004 
00005 vrmlshaperaw::vrmlshaperaw()
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 }
00014 
00015 
00016 
00017 ostream & vrmlshaperaw::print( ostream & os ) const
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 }
00108 
00109 
00110 
00111 

Generated on Fri Mar 4 00:49:32 2011 for Chelton Evans Source by  doxygen 1.5.8