osg::ScanParseSkel Class Reference

#include <OSGScanParseSkel.h>

Inheritance diagram for osg::ScanParseSkel:

osg::ScanParseFieldTypeMapper< osg::ScanParseSkel > osg::VRMLNodeFactory< osg::ScanParseFieldTypeMapper< osg::ScanParseSkel > >

List of all members.

Member



bool _bMapTypeIds
Char8_szReferenceHeader
OSGScanParseLexer_pLexer
void reset (void)
void setMapTypeIds (bool bVal)
void setReferenceHeader (const Char8 *szReferenceHeader)

Public Types

enum  BuildInFieldType {
  OSGsfBool = TOK_SFBool, OSGsfColor = TOK_SFColor, OSGsfColorRGBA = TOK_SFColorRGBA, OSGsfDouble = TOK_SFDouble,
  OSGsfFloat = TOK_SFFloat, OSGsfImage = TOK_SFImage, OSGsfInt32 = TOK_SFInt32, OSGsfMatrix3d = TOK_SFMatrix3d,
  OSGsfMatrix3f = TOK_SFMatrix3f, OSGsfMatrix4d = TOK_SFMatrix4d, OSGsfMatrix4f = TOK_SFMatrix4f, OSGsfNode = TOK_SFNode,
  OSGsfRotation = TOK_SFRotation, OSGsfString = TOK_SFString, OSGsfTime = TOK_SFTime, OSGsfVec2d = TOK_SFVec2d,
  OSGsfVec2f = TOK_SFVec2f, OSGsfVec3d = TOK_SFVec3d, OSGsfVec3f = TOK_SFVec3f, OSGsfVec4d = TOK_SFVec4d,
  OSGsfVec4f = TOK_SFVec4f, OSGmfBool = TOK_MFBool, OSGmfColor = TOK_MFColor, OSGmfColorRGBA = TOK_MFColorRGBA,
  OSGmfDouble = TOK_MFDouble, OSGmfFloat = TOK_MFFloat, OSGmfImage = TOK_MFImage, OSGmfInt32 = TOK_MFInt32,
  OSGmfMatrix3d = TOK_MFMatrix3d, OSGmfMatrix3f = TOK_MFMatrix3f, OSGmfMatrix4d = TOK_MFMatrix4d, OSGmfMatrix4f = TOK_MFMatrix4f,
  OSGmfNode = TOK_MFNode, OSGmfRotation = TOK_MFRotation, OSGmfString = TOK_MFString, OSGmfTime = TOK_MFTime,
  OSGmfVec2d = TOK_MFVec2d, OSGmfVec2f = TOK_MFVec2f, OSGmfVec3d = TOK_MFVec3d, OSGmfVec3f = TOK_MFVec3f,
  OSGmfVec4d = TOK_MFVec4d, OSGmfVec4f = TOK_MFVec4f, OSGmfColor4f = TOK_MFColorRGBA, OSGmfColor4i = TOK_MFColor4i,
  OSGmfColor3f = TOK_MFColor, OSGmfMatrix = TOK_MFMatrix4f, OSGmfPnt2f = TOK_MFPnt2f, OSGmfPnt3f = TOK_MFPnt3f,
  OSGmfPnt4f = TOK_MFPnt4f, OSGmfPlane = TOK_MFPlane, OSGsfColor4f = TOK_SFColorRGBA, OSGsfColor4i = TOK_SFColor4i,
  OSGsfColor3f = TOK_SFColor, OSGsfMatrix = TOK_SFMatrix4f, OSGsfPnt2f = TOK_SFPnt2f, OSGsfPnt3f = TOK_SFPnt3f,
  OSGsfPnt4f = TOK_SFPnt4f, OSGsfPlane = TOK_SFPlane, OSGsfVolume = TOK_SFVolume
}
enum  { LastOption = 0x0001 }

Public Member Functions

Constructors


 ScanParseSkel (void)
Destructor


virtual ~ScanParseSkel (void)
Scan


virtual void scanStream (std::istream &is)
virtual void scanFile (const Char8 *szFilename)
virtual Int32 lex (YYSTYPE *lvalp)
virtual const Char8getText (void)
virtual void handleError (const Char8 *szErrorText)
Prototypes


virtual bool verifyHeader (const Char8 *szHeader)
virtual void beginProto (const Char8 *szProtoname)
virtual void endProto (void)
virtual void beginExternProto (const Char8 *szProtoname)
virtual void endExternProtoInterface (void)
virtual void endExternProto (void)
virtual void beginScript (const Char8 *szProtoname)
virtual void endScript (void)
virtual void beginEventInDecl (const Char8 *szEventType, const UInt32 uiFieldTypeId, const Char8 *szEventName)
virtual void beginEventOutDecl (const Char8 *szEventType, const UInt32 uiFieldTypeId, const Char8 *szEventName)
virtual void endEventDecl (void)
virtual void beginFieldDecl (const Char8 *szFieldType, const UInt32 uiFieldTypeId, const Char8 *szFieldName)
virtual void endFieldDecl (void)
virtual void beginExposedFieldDecl (const Char8 *szFieldType, const UInt32 uiFieldTypeId, const Char8 *szFieldName)
virtual void endExposedFieldDecl (void)
virtual void addExternEventInDecl (const Char8 *szEventType, const UInt32 uiFieldTypeId, const Char8 *szEventName)
virtual void addExternEventOutDecl (const Char8 *szEventType, const UInt32 uiFieldTypeId, const Char8 *szEventName)
virtual void addExternFieldDecl (const Char8 *szFieldType, const UInt32 uiFieldTypeId, const Char8 *szFieldName)
virtual void addExternExposedFieldDecl (const Char8 *szFieldType, const UInt32 uiFieldTypeId, const Char8 *szFieldName)
Fields


virtual void beginField (const Char8 *szFieldname, const UInt32 uiFieldTypeId)
virtual void endField (void)
Nodes


virtual void beginNode (const Char8 *szNodeTypename, const Char8 *szNodename)
virtual void endNode (void)
virtual void use (const Char8 *szName)
virtual void is (const Char8 *szName)
Misc


virtual void addFieldValue (const Char8 *szFieldVal)
virtual void addBoolValue (bool b)
virtual void addColorValue (const Color3f &c)
virtual void addColorRGBAValue (const Color4f &c)
virtual void addDoubleValue (Real64 d)
virtual void addFloatValue (Real32 f)
virtual void addImageValue (ImagePtr &img)
virtual void addInt32Value (Int32 i)
virtual void addMatrix3dValue (Real64 m00, Real64 m10, Real64 m20, Real64 m01, Real64 m11, Real64 m21, Real64 m02, Real64 m12, Real64 m22)
virtual void addMatrix3fValue (Real32 m00, Real32 m10, Real32 m20, Real32 m01, Real32 m11, Real32 m21, Real32 m02, Real32 m12, Real32 m22)
virtual void addMatrix4dValue (const Matrix4d &m)
virtual void addMatrix4fValue (const Matrix4f &m)
virtual void addRotationValue (const Vec3f &axis, Real32 angle)
virtual void addStringValue (const std::string &s)
virtual void addTimeValue (Time t)
virtual void addVec2dValue (const Vec2d &v)
virtual void addVec2fValue (const Vec2f &v)
virtual void addVec3dValue (const Vec3d &v)
virtual void addVec3fValue (const Vec3f &v)
virtual void addVec4dValue (const Vec4d &v)
virtual void addVec4fValue (const Vec4f &v)
virtual void addColor4iValue (const Color4ub &c)
virtual void addPnt2fValue (const Pnt2f &p)
virtual void addPnt3fValue (const Pnt3f &p)
virtual void addPnt4fValue (const Pnt4f &p)
virtual void addPlaneValue (const Plane &p)
virtual void addVolumeValue (const DynamicVolume &v)
virtual void addRoute (const Char8 *szOutNodename, const Char8 *szOutFieldname, const Char8 *szInNodename, const Char8 *szInFieldname)
virtual void profileElement (const Char8 *szProfileName)
virtual void componentElement (const Char8 *szComponentName)
virtual void metaElement (const Char8 *szMetaKey, const Char8 *szMetaValue)
virtual void importElement (const Char8 *szInlineName, const Char8 *szNodeName, const Char8 *szImportAs)
virtual void exportElement (const Char8 *szNodeName, const Char8 *szExportAs)
Type Information


bool getMapFieldTypes (void)
virtual Int32 mapExtIntFieldType (const Char8 *szFieldname, const Int32 iFieldTypeId)
virtual UInt32 getFieldType (const Char8 *szFieldname)
OSGScanParseLexergetLexer (void)

Private Member Functions

friend int::OSGScanParseSkel_parse (void *)
 ScanParseSkel (const ScanParseSkel &source)
 prohibit default function (move to 'public' if needed)
void operator= (const ScanParseSkel &source)
 prohibit default function (move to 'public' if needed)
void beginValue ()
void appendValue ()
void beginImage (Int32 width, Int32 height, Int32 components)
void addImagePixel (Int32 pixel)
void endImage ()

Private Attributes

std::string _tmpString1
std::string _tmpString2
std::string _tmpString3
Real32 _tmpFloat1
Real32 _tmpFloat2
Real32 _tmpFloat3
Real32 _tmpFloat4
ImagePtr _image
UInt8_imageDataPtr


Detailed Description

Parser / Scanner Skeleton for VRML97 syntax based file formats

Definition at line 74 of file OSGScanParseSkel.h.


Member Enumeration Documentation

Enumerator:
OSGsfBool 
OSGsfColor 
OSGsfColorRGBA 
OSGsfDouble 
OSGsfFloat 
OSGsfImage 
OSGsfInt32 
OSGsfMatrix3d 
OSGsfMatrix3f 
OSGsfMatrix4d 
OSGsfMatrix4f 
OSGsfNode 
OSGsfRotation 
OSGsfString 
OSGsfTime 
OSGsfVec2d 
OSGsfVec2f 
OSGsfVec3d 
OSGsfVec3f 
OSGsfVec4d 
OSGsfVec4f 
OSGmfBool 
OSGmfColor 
OSGmfColorRGBA 
OSGmfDouble 
OSGmfFloat 
OSGmfImage 
OSGmfInt32 
OSGmfMatrix3d 
OSGmfMatrix3f 
OSGmfMatrix4d 
OSGmfMatrix4f 
OSGmfNode 
OSGmfRotation 
OSGmfString 
OSGmfTime 
OSGmfVec2d 
OSGmfVec2f 
OSGmfVec3d 
OSGmfVec3f 
OSGmfVec4d 
OSGmfVec4f 
OSGmfColor4f 
OSGmfColor4i 
OSGmfColor3f 
OSGmfMatrix 
OSGmfPnt2f 
OSGmfPnt3f 
OSGmfPnt4f 
OSGmfPlane 
OSGsfColor4f 
OSGsfColor4i 
OSGsfColor3f 
OSGsfMatrix 
OSGsfPnt2f 
OSGsfPnt3f 
OSGsfPnt4f 
OSGsfPlane 
OSGsfVolume 

Definition at line 81 of file OSGScanParseSkel.h.

00082     {
00083         OSGsfBool      = TOK_SFBool,
00084         OSGsfColor     = TOK_SFColor,
00085         OSGsfColorRGBA = TOK_SFColorRGBA,
00086         OSGsfDouble    = TOK_SFDouble,
00087         OSGsfFloat     = TOK_SFFloat,
00088         OSGsfImage     = TOK_SFImage,
00089         OSGsfInt32     = TOK_SFInt32,
00090         OSGsfMatrix3d  = TOK_SFMatrix3d,
00091         OSGsfMatrix3f  = TOK_SFMatrix3f,
00092         OSGsfMatrix4d  = TOK_SFMatrix4d,
00093         OSGsfMatrix4f  = TOK_SFMatrix4f,
00094         OSGsfNode      = TOK_SFNode,
00095         OSGsfRotation  = TOK_SFRotation,
00096         OSGsfString    = TOK_SFString,
00097         OSGsfTime      = TOK_SFTime,
00098         OSGsfVec2d     = TOK_SFVec2d,
00099         OSGsfVec2f     = TOK_SFVec2f,
00100         OSGsfVec3d     = TOK_SFVec3d,
00101         OSGsfVec3f     = TOK_SFVec3f,
00102         OSGsfVec4d     = TOK_SFVec4d,
00103         OSGsfVec4f     = TOK_SFVec4f,
00104         OSGmfBool      = TOK_MFBool,
00105         OSGmfColor     = TOK_MFColor,
00106         OSGmfColorRGBA = TOK_MFColorRGBA,
00107         OSGmfDouble    = TOK_MFDouble,
00108         OSGmfFloat     = TOK_MFFloat,
00109         OSGmfImage     = TOK_MFImage,
00110         OSGmfInt32     = TOK_MFInt32,
00111         OSGmfMatrix3d  = TOK_MFMatrix3d,
00112         OSGmfMatrix3f  = TOK_MFMatrix3f,
00113         OSGmfMatrix4d  = TOK_MFMatrix4d,
00114         OSGmfMatrix4f  = TOK_MFMatrix4f,
00115         OSGmfNode      = TOK_MFNode,
00116         OSGmfRotation  = TOK_MFRotation,
00117         OSGmfString    = TOK_MFString,
00118         OSGmfTime      = TOK_MFTime,
00119         OSGmfVec2d     = TOK_MFVec2d,
00120         OSGmfVec2f     = TOK_MFVec2f,
00121         OSGmfVec3d     = TOK_MFVec3d,
00122         OSGmfVec3f     = TOK_MFVec3f,
00123         OSGmfVec4d     = TOK_MFVec4d,
00124         OSGmfVec4f     = TOK_MFVec4f,
00125 
00126         OSGmfColor4f   = TOK_MFColorRGBA,
00127         OSGmfColor4i   = TOK_MFColor4i,
00128         OSGmfColor3f   = TOK_MFColor,
00129         OSGmfMatrix    = TOK_MFMatrix4f,
00130         OSGmfPnt2f     = TOK_MFPnt2f,
00131         OSGmfPnt3f     = TOK_MFPnt3f,
00132         OSGmfPnt4f     = TOK_MFPnt4f,
00133         OSGmfPlane     = TOK_MFPlane,
00134         OSGsfColor4f   = TOK_SFColorRGBA,
00135         OSGsfColor4i   = TOK_SFColor4i,
00136         OSGsfColor3f   = TOK_SFColor,
00137         OSGsfMatrix    = TOK_SFMatrix4f,
00138         OSGsfPnt2f     = TOK_SFPnt2f,
00139         OSGsfPnt3f     = TOK_SFPnt3f,
00140         OSGsfPnt4f     = TOK_SFPnt4f,
00141         OSGsfPlane     = TOK_SFPlane,
00142         OSGsfVolume    = TOK_SFVolume
00143     };

anonymous enum

Enumerator:
LastOption 

Definition at line 145 of file OSGScanParseSkel.h.

00146     {
00147         LastOption = 0x0001
00148     };


Constructor & Destructor Documentation

ScanParseSkel::ScanParseSkel ( void   ) 

Definition at line 66 of file OSGScanParseSkel.cpp.

00066                                  :
00067     _bMapTypeIds      (false ),
00068     _szReferenceHeader(NULL  ),
00069     _pLexer           (new OSGScanParseLexer),
00070     _image            (NullFC),
00071     _imageDataPtr     (0     )
00072 {
00073 }

ScanParseSkel::~ScanParseSkel ( void   )  [virtual]

Definition at line 78 of file OSGScanParseSkel.cpp.

References _image, _pLexer, osg::NullFC, and osg::subRefCP().

00079 {
00080     if (_image != NullFC)
00081         subRefCP(_image);
00082     if(_pLexer != NULL)
00083         delete _pLexer;
00084 }

osg::ScanParseSkel::ScanParseSkel ( const ScanParseSkel source  )  [private]


Member Function Documentation

osg::ScanParseSkel::int::OSGScanParseSkel_parse ( void *   )  [private]

void ScanParseSkel::scanStream ( std::istream &  is  )  [virtual]

Definition at line 92 of file OSGScanParseSkel.cpp.

References _pLexer, and OSGScanParseSkel_parse().

Referenced by scanFile().

00093 {
00094     if(is.good())
00095     {
00096         _pLexer->switch_streams(&is, 0);
00097         OSGScanParseSkel_parse(this);
00098     }
00099 }

void ScanParseSkel::scanFile ( const Char8 szFilename  )  [virtual]

Definition at line 102 of file OSGScanParseSkel.cpp.

References is(), OSGScanParseSkel_parse(), PNOTICE, and scanStream().

00103 {
00104     if(szFilename == NULL)
00105         return;
00106 
00107 #ifdef OSG_FLEX_USE_IOSTREAM_INPUT
00108     std::ifstream is(szFilename);
00109 
00110     if(is.good())
00111     {
00112         PNOTICE << "Loading Stream: " << szFilename << std::endl;
00113 
00114         scanStream(is);
00115 
00116         is.close();
00117     }
00118 #else
00119     FILE *pInFile = fopen(szFilename, "r");
00120 
00121     if(pInFile != NULL)
00122     {
00123         PNOTICE << "Loading File : " << szFilename << std::endl;
00124 
00125         OSGScanParseSkel_in = pInFile;
00126 
00127         OSGScanParseSkel_parse(this);
00128 
00129         fclose(pInFile);
00130     }
00131 #endif
00132 }

Int32 ScanParseSkel::lex ( YYSTYPE *  lvalp  )  [virtual]

Definition at line 134 of file OSGScanParseSkel.cpp.

References _pLexer, and OSGScanParseLexer::yylex().

00135 {
00136     return _pLexer->yylex(lvalp);
00137 }

const Char8 * ScanParseSkel::getText ( void   )  [virtual]

Definition at line 139 of file OSGScanParseSkel.cpp.

References _pLexer.

00140 {
00141     return _pLexer->YYText();
00142 }

void ScanParseSkel::handleError ( const Char8 szErrorText  )  [virtual]

Definition at line 144 of file OSGScanParseSkel.cpp.

References _pLexer, and FWARNING.

00145 {
00146     FWARNING(("-----> %s in Line %d, read '%s'\n",
00147               szErrorText,
00148               _pLexer->lineno(),
00149               _pLexer->YYText()));
00150 }

bool ScanParseSkel::verifyHeader ( const Char8 szHeader  )  [virtual]

Definition at line 155 of file OSGScanParseSkel.cpp.

References _szReferenceHeader, SLOG, and osg::stringlen().

00156 {
00157     bool returnValue = true;
00158 
00159     if(szHeader == NULL)
00160     {
00161         SLOG << "Error Null Header String Read" << std::endl;
00162         return false;
00163     }
00164 
00165     if(_szReferenceHeader != NULL)
00166     {
00167         if(strncmp(szHeader,
00168                    _szReferenceHeader,
00169                    stringlen(_szReferenceHeader)) != 0)
00170         {
00171             SLOG << "Error : Header [" << szHeader << "] does not "
00172                     << "match reference [" << _szReferenceHeader << "]"
00173                     << std::endl;
00174 
00175             returnValue = false;
00176         }
00177     }
00178     else
00179     {
00180         SLOG << "Error Null Reference Header, Check disabled " << std::endl;
00181         return true;
00182     }
00183 
00184     return returnValue;
00185 }

void ScanParseSkel::beginProto ( const Char8 szProtoname  )  [virtual]

Reimplemented in osg::VRMLNodeFactory< osg::ScanParseFieldTypeMapper< osg::ScanParseSkel > >.

Definition at line 187 of file OSGScanParseSkel.cpp.

00188 {
00189 }

void ScanParseSkel::endProto ( void   )  [virtual]

Reimplemented in osg::VRMLNodeFactory< osg::ScanParseFieldTypeMapper< osg::ScanParseSkel > >.

Definition at line 191 of file OSGScanParseSkel.cpp.

00192 {
00193 }

void ScanParseSkel::beginExternProto ( const Char8 szProtoname  )  [virtual]

Definition at line 195 of file OSGScanParseSkel.cpp.

00196 {
00197 }

void ScanParseSkel::endExternProtoInterface ( void   )  [virtual]

Definition at line 199 of file OSGScanParseSkel.cpp.

00200 {
00201 }

void ScanParseSkel::endExternProto ( void   )  [virtual]

Definition at line 203 of file OSGScanParseSkel.cpp.

00204 {
00205 }

void ScanParseSkel::beginScript ( const Char8 szProtoname  )  [virtual]

Definition at line 207 of file OSGScanParseSkel.cpp.

00208 {
00209 }

void ScanParseSkel::endScript ( void   )  [virtual]

Definition at line 211 of file OSGScanParseSkel.cpp.

00212 {
00213 }

void ScanParseSkel::beginEventInDecl ( const Char8 szEventType,
const UInt32  uiFieldTypeId,
const Char8 szEventName 
) [virtual]

Reimplemented in osg::VRMLNodeFactory< osg::ScanParseFieldTypeMapper< osg::ScanParseSkel > >.

Definition at line 215 of file OSGScanParseSkel.cpp.

00218 {
00219 }

void ScanParseSkel::beginEventOutDecl ( const Char8 szEventType,
const UInt32  uiFieldTypeId,
const Char8 szEventName 
) [virtual]

Reimplemented in osg::VRMLNodeFactory< osg::ScanParseFieldTypeMapper< osg::ScanParseSkel > >.

Definition at line 221 of file OSGScanParseSkel.cpp.

00224 {
00225 }

void ScanParseSkel::endEventDecl ( void   )  [virtual]

Definition at line 227 of file OSGScanParseSkel.cpp.

00228 {
00229 }

void ScanParseSkel::beginFieldDecl ( const Char8 szFieldType,
const UInt32  uiFieldTypeId,
const Char8 szFieldName 
) [virtual]

Reimplemented in osg::VRMLNodeFactory< osg::ScanParseFieldTypeMapper< osg::ScanParseSkel > >.

Definition at line 231 of file OSGScanParseSkel.cpp.

00234 {
00235 }

void ScanParseSkel::endFieldDecl ( void   )  [virtual]

Reimplemented in osg::VRMLNodeFactory< osg::ScanParseFieldTypeMapper< osg::ScanParseSkel > >.

Definition at line 237 of file OSGScanParseSkel.cpp.

00238 {
00239 }

void ScanParseSkel::beginExposedFieldDecl ( const Char8 szFieldType,
const UInt32  uiFieldTypeId,
const Char8 szFieldName 
) [virtual]

Reimplemented in osg::VRMLNodeFactory< osg::ScanParseFieldTypeMapper< osg::ScanParseSkel > >.

Definition at line 241 of file OSGScanParseSkel.cpp.

00244 {
00245 }

void ScanParseSkel::endExposedFieldDecl ( void   )  [virtual]

Reimplemented in osg::VRMLNodeFactory< osg::ScanParseFieldTypeMapper< osg::ScanParseSkel > >.

Definition at line 247 of file OSGScanParseSkel.cpp.

00248 {
00249 }

void ScanParseSkel::addExternEventInDecl ( const Char8 szEventType,
const UInt32  uiFieldTypeId,
const Char8 szEventName 
) [virtual]

Definition at line 252 of file OSGScanParseSkel.cpp.

00255 {
00256 }

void ScanParseSkel::addExternEventOutDecl ( const Char8 szEventType,
const UInt32  uiFieldTypeId,
const Char8 szEventName 
) [virtual]

Definition at line 258 of file OSGScanParseSkel.cpp.

00261 {
00262 }

void ScanParseSkel::addExternFieldDecl ( const Char8 szFieldType,
const UInt32  uiFieldTypeId,
const Char8 szFieldName 
) [virtual]

Definition at line 264 of file OSGScanParseSkel.cpp.

00267 {
00268 }

void ScanParseSkel::addExternExposedFieldDecl ( const Char8 szFieldType,
const UInt32  uiFieldTypeId,
const Char8 szFieldName 
) [virtual]

Definition at line 270 of file OSGScanParseSkel.cpp.

00273 {
00274 }

void ScanParseSkel::beginField ( const Char8 szFieldname,
const UInt32  uiFieldTypeId 
) [virtual]

Definition at line 279 of file OSGScanParseSkel.cpp.

00281 {
00282 }

void ScanParseSkel::endField ( void   )  [virtual]

Definition at line 284 of file OSGScanParseSkel.cpp.

00285 {
00286 }

void ScanParseSkel::beginNode ( const Char8 szNodeTypename,
const Char8 szNodename 
) [virtual]

Definition at line 291 of file OSGScanParseSkel.cpp.

00293 {
00294     fprintf(stderr, "Calling default begin node %s %s\n",
00295             szNodeTypename,
00296             szNodename);
00297 }

void ScanParseSkel::endNode ( void   )  [virtual]

Definition at line 299 of file OSGScanParseSkel.cpp.

00300 {
00301 }

void ScanParseSkel::use ( const Char8 szName  )  [virtual]

Definition at line 303 of file OSGScanParseSkel.cpp.

References PINFO.

00304 {
00305     PINFO << "Use : " << szName << std::endl;
00306 }

void ScanParseSkel::is ( const Char8 szName  )  [virtual]

Definition at line 308 of file OSGScanParseSkel.cpp.

Referenced by scanFile().

00309 {
00310 }

void ScanParseSkel::addFieldValue ( const Char8 szFieldVal  )  [virtual]

void ScanParseSkel::addBoolValue ( bool  b  )  [virtual]

Definition at line 349 of file OSGScanParseSkel.cpp.

References _pLexer, and addFieldValue().

00350 {
00351     addFieldValue(_pLexer->YYText());
00352 }

void ScanParseSkel::addColorValue ( const Color3f c  )  [virtual]

Definition at line 354 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00355 {
00356     addFieldValue(_tmpString1.c_str());
00357 }

void ScanParseSkel::addColorRGBAValue ( const Color4f c  )  [virtual]

Definition at line 359 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00360 {
00361     addFieldValue(_tmpString1.c_str());
00362 }

void ScanParseSkel::addDoubleValue ( Real64  d  )  [virtual]

Definition at line 364 of file OSGScanParseSkel.cpp.

References _pLexer, and addFieldValue().

00365 {
00366     addFieldValue(_pLexer->YYText());
00367 }

void ScanParseSkel::addFloatValue ( Real32  f  )  [virtual]

Definition at line 369 of file OSGScanParseSkel.cpp.

References _pLexer, and addFieldValue().

00370 {
00371     addFieldValue(_pLexer->YYText());
00372 }

void ScanParseSkel::addImageValue ( ImagePtr img  )  [virtual]

Definition at line 374 of file OSGScanParseSkel.cpp.

References addFieldValue().

Referenced by endImage().

00375 {
00376     UInt32 numComponents = img->getComponents();
00377     std::ostringstream os;
00378     os << img->getWidth() << ' ' << img->getHeight() << ' ' << numComponents;
00379     addFieldValue(os.str().c_str());
00380     UInt32 numPixels = img->getWidth() * img->getHeight();
00381     UInt32 pixel;
00382     UInt8 *data = img->getData();
00383     for (UInt32 i = 0; i < numPixels; ++i)
00384     {
00385         pixel = 0;
00386         for (UInt32 j = 0; j < numComponents; ++j)
00387             pixel = (pixel << 8) | *data++;
00388         os.str(std::string());
00389         os << pixel;
00390         addFieldValue(os.str().c_str());
00391     }
00392 }

void ScanParseSkel::addInt32Value ( Int32  i  )  [virtual]

Definition at line 394 of file OSGScanParseSkel.cpp.

References _pLexer, and addFieldValue().

00395 {
00396     addFieldValue(_pLexer->YYText());
00397 }

void ScanParseSkel::addMatrix3dValue ( Real64  m00,
Real64  m10,
Real64  m20,
Real64  m01,
Real64  m11,
Real64  m21,
Real64  m02,
Real64  m12,
Real64  m22 
) [virtual]

Definition at line 399 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00402 {
00403     addFieldValue(_tmpString1.c_str());
00404 }

void ScanParseSkel::addMatrix3fValue ( Real32  m00,
Real32  m10,
Real32  m20,
Real32  m01,
Real32  m11,
Real32  m21,
Real32  m02,
Real32  m12,
Real32  m22 
) [virtual]

Definition at line 406 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00409 {
00410     addFieldValue(_tmpString1.c_str());
00411 }

void ScanParseSkel::addMatrix4dValue ( const Matrix4d m  )  [virtual]

Definition at line 413 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00414 {
00415     addFieldValue(_tmpString1.c_str());
00416 }

void ScanParseSkel::addMatrix4fValue ( const Matrix4f m  )  [virtual]

Definition at line 418 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00419 {
00420     addFieldValue(_tmpString1.c_str());
00421 }

void ScanParseSkel::addRotationValue ( const Vec3f axis,
Real32  angle 
) [virtual]

Definition at line 423 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00424 {
00425     addFieldValue(_tmpString1.c_str());
00426 }

void ScanParseSkel::addStringValue ( const std::string &  s  )  [virtual]

Definition at line 428 of file OSGScanParseSkel.cpp.

References addFieldValue().

00429 {
00430     addFieldValue(s.c_str());
00431 }

void ScanParseSkel::addTimeValue ( Time  t  )  [virtual]

Definition at line 433 of file OSGScanParseSkel.cpp.

References _pLexer, and addFieldValue().

00434 {
00435     addFieldValue(_pLexer->YYText());
00436 }

void ScanParseSkel::addVec2dValue ( const Vec2d v  )  [virtual]

Definition at line 438 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00439 {
00440     addFieldValue(_tmpString1.c_str());
00441 }

void ScanParseSkel::addVec2fValue ( const Vec2f v  )  [virtual]

Definition at line 443 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00444 {
00445     addFieldValue(_tmpString1.c_str());
00446 }

void ScanParseSkel::addVec3dValue ( const Vec3d v  )  [virtual]

Definition at line 448 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00449 {
00450     addFieldValue(_tmpString1.c_str());
00451 }

void ScanParseSkel::addVec3fValue ( const Vec3f v  )  [virtual]

Definition at line 453 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00454 {
00455     addFieldValue(_tmpString1.c_str());
00456 }

void ScanParseSkel::addVec4dValue ( const Vec4d v  )  [virtual]

Definition at line 458 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00459 {
00460     addFieldValue(_tmpString1.c_str());
00461 }

void ScanParseSkel::addVec4fValue ( const Vec4f v  )  [virtual]

Definition at line 463 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00464 {
00465     addFieldValue(_tmpString1.c_str());
00466 }

void ScanParseSkel::addColor4iValue ( const Color4ub c  )  [virtual]

Definition at line 468 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00469 {
00470     addFieldValue(_tmpString1.c_str());
00471 }

void ScanParseSkel::addPnt2fValue ( const Pnt2f p  )  [virtual]

Definition at line 473 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00474 {
00475     addFieldValue(_tmpString1.c_str());
00476 }

void ScanParseSkel::addPnt3fValue ( const Pnt3f p  )  [virtual]

Definition at line 478 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00479 {
00480     addFieldValue(_tmpString1.c_str());
00481 }

void ScanParseSkel::addPnt4fValue ( const Pnt4f p  )  [virtual]

Definition at line 483 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00484 {
00485     addFieldValue(_tmpString1.c_str());
00486 }

void ScanParseSkel::addPlaneValue ( const Plane p  )  [virtual]

Definition at line 488 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00489 {
00490     addFieldValue(_tmpString1.c_str());
00491 }

void ScanParseSkel::addVolumeValue ( const DynamicVolume v  )  [virtual]

Definition at line 493 of file OSGScanParseSkel.cpp.

References _tmpString1, and addFieldValue().

00494 {
00495     addFieldValue(_tmpString1.c_str());
00496 }

void ScanParseSkel::addRoute ( const Char8 szOutNodename,
const Char8 szOutFieldname,
const Char8 szInNodename,
const Char8 szInFieldname 
) [virtual]

Definition at line 498 of file OSGScanParseSkel.cpp.

00502 {
00503 }

void ScanParseSkel::profileElement ( const Char8 szProfileName  )  [virtual]

Definition at line 312 of file OSGScanParseSkel.cpp.

00313 {
00314     fprintf(stderr, "PROFILE %s\n", szProfileName);
00315 }

void ScanParseSkel::componentElement ( const Char8 szComponentName  )  [virtual]

Definition at line 317 of file OSGScanParseSkel.cpp.

00318 {
00319     fprintf(stderr, "COMPONENT %s\n", szComponentName);
00320 }

void ScanParseSkel::metaElement ( const Char8 szMetaKey,
const Char8 szMetaValue 
) [virtual]

Definition at line 322 of file OSGScanParseSkel.cpp.

00324 {
00325     fprintf(stderr, "META %s %s\n", szMetaKey, szMetaValue);
00326 }

void ScanParseSkel::importElement ( const Char8 szInlineName,
const Char8 szNodeName,
const Char8 szImportAs 
) [virtual]

Definition at line 328 of file OSGScanParseSkel.cpp.

00331 {
00332     fprintf(stderr, "IMPORT %s.%s AS %s\n", 
00333                     szInlineName, szNodeName, szImportAs);
00334 }

void ScanParseSkel::exportElement ( const Char8 szNodeName,
const Char8 szExportAs 
) [virtual]

Definition at line 336 of file OSGScanParseSkel.cpp.

00338 {
00339     fprintf(stderr, "EXPORT %s AS %s\n", szNodeName, szExportAs);
00340 }

bool ScanParseSkel::getMapFieldTypes ( void   ) 

Definition at line 508 of file OSGScanParseSkel.cpp.

References _bMapTypeIds.

00509 {
00510     return _bMapTypeIds;
00511 }

Int32 ScanParseSkel::mapExtIntFieldType ( const Char8 szFieldname,
const Int32  iFieldTypeId 
) [virtual]

Reimplemented in osg::ScanParseFieldTypeMapper< osg::ScanParseSkel >.

Definition at line 513 of file OSGScanParseSkel.cpp.

00514 {
00515     return iFieldType;
00516 }

UInt32 ScanParseSkel::getFieldType ( const Char8 szFieldname  )  [virtual]

Definition at line 518 of file OSGScanParseSkel.cpp.

00519 {
00520     return 0;
00521 }

OSGScanParseLexer * ScanParseSkel::getLexer ( void   ) 

Definition at line 523 of file OSGScanParseSkel.cpp.

References _pLexer.

00524 {
00525     return _pLexer;
00526 }

void ScanParseSkel::reset ( void   )  [protected]

Definition at line 531 of file OSGScanParseSkel.cpp.

00532 {
00533 }

void ScanParseSkel::setMapTypeIds ( bool  bVal  )  [protected]

Definition at line 535 of file OSGScanParseSkel.cpp.

References _bMapTypeIds.

00536 {
00537     _bMapTypeIds = bVal;
00538 }

void ScanParseSkel::setReferenceHeader ( const Char8 szReferenceHeader  )  [protected]

Definition at line 540 of file OSGScanParseSkel.cpp.

References _szReferenceHeader, and osg::stringDup().

00541 {
00542     stringDup(szReferenceHeader, _szReferenceHeader);
00543 }

void osg::ScanParseSkel::operator= ( const ScanParseSkel source  )  [private]

void ScanParseSkel::beginValue (  )  [private]

Definition at line 547 of file OSGScanParseSkel.cpp.

References _pLexer, and _tmpString1.

00548 {
00549     _tmpString1.assign(_pLexer->YYText(), _pLexer->YYLeng());
00550 }

void ScanParseSkel::appendValue (  )  [private]

Definition at line 552 of file OSGScanParseSkel.cpp.

References _pLexer, and _tmpString1.

00553 {
00554     _tmpString1.push_back(' ');
00555     _tmpString1.append(_pLexer->YYText(), _pLexer->YYLeng());
00556 }

void ScanParseSkel::beginImage ( Int32  width,
Int32  height,
Int32  components 
) [private]

Definition at line 558 of file OSGScanParseSkel.cpp.

References _image, _imageDataPtr, _pLexer, osg::addRefCP(), osg::ImageBase::create(), OSGScanParseLexer::expectImageInts(), osg::NullFC, osg::Image::OSG_INVALID_PF, osg::Image::OSG_L_PF, osg::Image::OSG_LA_PF, osg::Image::OSG_RGB_PF, and osg::Image::OSG_RGBA_PF.

00559 {
00560     if (_image == NullFC)
00561     {
00562         _image = Image::create();
00563         addRefCP(_image);
00564     }
00565     UInt32 pixelFormat;
00566     switch (components)
00567     {
00568     case 1:  pixelFormat = Image::OSG_L_PF;       break;
00569     case 2:  pixelFormat = Image::OSG_LA_PF;      break;
00570     case 3:  pixelFormat = Image::OSG_RGB_PF;     break;
00571     case 4:  pixelFormat = Image::OSG_RGBA_PF;    break;
00572     default: pixelFormat = Image::OSG_INVALID_PF; break;
00573     }
00574     _image->set(pixelFormat, width, height);
00575     _imageDataPtr = _image->getData();
00576     _pLexer->expectImageInts(width * height);
00577 }

void ScanParseSkel::addImagePixel ( Int32  pixel  )  [private]

Definition at line 579 of file OSGScanParseSkel.cpp.

References _image, _imageDataPtr, osg::Image::OSG_L_PF, osg::Image::OSG_LA_PF, osg::Image::OSG_RGB_PF, and osg::Image::OSG_RGBA_PF.

00580 {
00581     switch (_image->getPixelFormat())
00582     {
00583     case Image::OSG_RGBA_PF:
00584         *_imageDataPtr++ = pixel >> 24;
00585         // Fall through
00586     case Image::OSG_RGB_PF:
00587         *_imageDataPtr++ = pixel >> 16;
00588         // Fall through
00589     case Image::OSG_LA_PF:
00590         *_imageDataPtr++ = pixel >> 8;
00591         // Fall through
00592     case Image::OSG_L_PF:
00593         *_imageDataPtr++ = pixel;
00594         // Fall through
00595     default:
00596         break;
00597     }
00598 }

void ScanParseSkel::endImage (  )  [private]

Definition at line 600 of file OSGScanParseSkel.cpp.

References _image, _imageDataPtr, addImageValue(), osg::NullFC, and osg::subRefCP().

00601 {
00602     _imageDataPtr = 0;
00603     addImageValue(_image);
00604     subRefCP(_image);
00605     _image = NullFC;
00606 }


Member Data Documentation

Definition at line 362 of file OSGScanParseSkel.h.

Referenced by getMapFieldTypes(), and setMapTypeIds().

Definition at line 363 of file OSGScanParseSkel.h.

Referenced by setReferenceHeader(), and verifyHeader().

std::string osg::ScanParseSkel::_tmpString1 [private]

std::string osg::ScanParseSkel::_tmpString2 [private]

Definition at line 381 of file OSGScanParseSkel.h.

std::string osg::ScanParseSkel::_tmpString3 [private]

Definition at line 381 of file OSGScanParseSkel.h.

Definition at line 382 of file OSGScanParseSkel.h.

Definition at line 382 of file OSGScanParseSkel.h.

Definition at line 382 of file OSGScanParseSkel.h.

Definition at line 382 of file OSGScanParseSkel.h.

Definition at line 394 of file OSGScanParseSkel.h.

Referenced by addImagePixel(), beginImage(), endImage(), and ~ScanParseSkel().

Definition at line 396 of file OSGScanParseSkel.h.

Referenced by addImagePixel(), beginImage(), and endImage().


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

Generated on Mon Mar 17 11:12:27 2008 for OpenSG by  doxygen 1.5.5