osg::VRMLGeometryPartDesc Class Reference
[VRML-specific File Input/Output]

VRML Gemetry Part Desc. More...

#include <OSGVRMLNodeDescs.h>

Inheritance diagram for osg::VRMLGeometryPartDesc:

osg::VRMLNodeDesc

List of all members.

Member



FieldNameTypeHash _mFieldTypes
GenericAttPtr _pGenAtt
FieldContainerPtr _pNodeProto
FieldContainerPtr _pNodeCoreProto
Field_pCurrField
std::string _szCurrentName
bool _bSaveOnEnd
static UInt32 _uiIndent = 0
FieldgetField (FieldContainerPtr pFC1, FieldContainerPtr pFC2, GenericAttPtr pGenAtt, const Char8 *szFieldname)

Public Member Functions

Constructors


 VRMLGeometryPartDesc (Char8 *szVRMLPartname, Char8 *szOSGPartname, Char8 *szOSGProtoname)
Destructor


virtual ~VRMLGeometryPartDesc (void)
Helper


virtual void init (const Char8 *szName)
Field


virtual bool prototypeAddField (const Char8 *szFieldType, const UInt32 uiFieldTypeId, const Char8 *szFieldName)
virtual void getFieldAndDesc (FieldContainerPtr pFC, const Char8 *szFieldname, Field *&pField, const FieldDescription *&pDesc)
Node


virtual FieldContainerPtr beginNode (const Char8 *szTypename, const Char8 *szName, FieldContainerPtr pCurrentFC)
Dump


virtual void dump (const Char8 *szNodeName)
Helper


virtual void reset (void)
virtual void setOnEndSave (const Char8 *szName)
virtual void clearOnEndSave (void)
virtual bool getOnEndSave (void)
virtual const Char8getSavename (void)
virtual FieldContainerPtr getSaveFieldContainer (void)
Field


virtual FieldgetField (const Char8 *szFieldname)
Prototypes


virtual void prototypeAddFieldValue (const Char8 *szFieldVal)
virtual void endProtoInterface (void)
Node


virtual void endNode (FieldContainerPtr)
FieldValue


virtual void addFieldValue (Field *pField, const Char8 *szFieldVal)
virtual bool use (FieldContainerPtr)

Static Public Member Functions

Class Get


static UInt32 getIndent (void)
static void incIndent (void)
static void decIndent (void)
static void resetIndent (void)

Protected Types

typedef std::map< const Char8
*, UInt32, LTString
FieldNameTypeHash

Protected Attributes

Member


Char8_szVRMLPartname
Char8_szOSGPartname
Char8_szOSGProtoname

Private Types

typedef VRMLNodeDesc Inherited

Private Member Functions

 VRMLGeometryPartDesc (const VRMLGeometryPartDesc &source)
 prohibit default function (move to 'public' if needed)
void operator= (const VRMLGeometryPartDesc &source)
 prohibit default function (move to 'public' if needed)


Detailed Description

VRML Geometry Part Set description

Definition at line 634 of file OSGVRMLNodeDescs.h.


Member Typedef Documentation

Definition at line 707 of file OSGVRMLNodeDescs.h.

typedef std::map< const Char8 *, UInt32, LTString> osg::VRMLNodeDesc::FieldNameTypeHash [protected, inherited]

Definition at line 298 of file OSGVRMLNodeDescs.h.


Constructor & Destructor Documentation

VRMLGeometryPartDesc::VRMLGeometryPartDesc ( Char8 szVRMLPartname,
Char8 szOSGPartname,
Char8 szOSGProtoname 
)

Definition at line 2045 of file OSGVRMLNodeDescs.cpp.

References _szOSGPartname, _szOSGProtoname, _szVRMLPartname, and osg::stringDup().

02047                                                                   :
02048      Inherited(),
02049 
02050     _szVRMLPartname(NULL),
02051     _szOSGPartname (NULL),
02052     _szOSGProtoname(NULL)
02053 {
02054     stringDup(szVRMLPartname, _szVRMLPartname);
02055     stringDup(szOSGPartname,  _szOSGPartname );
02056     stringDup(szOSGProtoname, _szOSGProtoname);
02057 }

VRMLGeometryPartDesc::~VRMLGeometryPartDesc ( void   )  [virtual]

Definition at line 2062 of file OSGVRMLNodeDescs.cpp.

02063 {
02064 }

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


Member Function Documentation

void VRMLGeometryPartDesc::init ( const Char8 szName  )  [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 2069 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_pGenAtt, osg::VRMLNodeDesc::_pNodeProto, _szOSGPartname, _szOSGProtoname, _szVRMLPartname, osg::DynFieldAttachment< AttachmentDescT >::create(), osg::FieldContainerFactory::createFieldContainer(), osg::VRMLNodeDesc::getIndent(), osg::indentLog(), osg::NullFC, PINFO, PWARNING, and osg::FieldContainerFactory::the().

02070 {
02071 #ifdef OSG_DEBUG_VRML
02072     indentLog(getIndent(), PINFO);
02073     PINFO << "GeoPartDesc::init : "
02074           << szName << " "
02075           << _szVRMLPartname << " "
02076           << _szOSGPartname << " "
02077           << _szOSGProtoname << " "
02078           << std::endl;
02079 #endif
02080 
02081     _pNodeProto =
02082        FieldContainerFactory::the()->createFieldContainer(_szOSGProtoname);
02083 
02084     if(_pNodeProto == NullFC)
02085     {
02086         PWARNING << "ERROR no prototype available for "
02087                  << _szOSGProtoname
02088                  << std::endl;
02089     }
02090 
02091     _pGenAtt = GenericAtt::create();
02092     _pGenAtt->setInternal(true);
02093 }

bool VRMLGeometryPartDesc::prototypeAddField ( const Char8 szFieldType,
const UInt32  uiFieldTypeId,
const Char8 szFieldName 
) [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 2098 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_pCurrField, _szVRMLPartname, osg::VRMLNodeDesc::getIndent(), osg::indentLog(), PINFO, osg::VRMLNodeDesc::prototypeAddField(), and osg::stringcasecmp().

02101 {
02102     bool bFound = false;
02103 
02104     _pCurrField = NULL;
02105 
02106     if(stringcasecmp(_szVRMLPartname, szFieldname) == 0)
02107     {
02108 #ifdef OSG_DEBUG_VRML
02109         indentLog(getIndent(), PINFO);
02110         PINFO << "GeoPartDesc::prototypeAddField : add part "
02111               << szFieldname
02112               << std::endl;
02113 #endif
02114 
02115         bFound = true;
02116     }
02117 
02118 
02119     if(bFound == true)
02120     {
02121         return true;
02122     }
02123     else
02124     {
02125         return VRMLNodeDesc::prototypeAddField(szFieldType,
02126                                                uiFieldTypeId,
02127                                                szFieldname);
02128     }
02129 }

void VRMLGeometryPartDesc::getFieldAndDesc ( FieldContainerPtr  pFC,
const Char8 szFieldname,
Field *&  pField,
const FieldDescription *&  pDesc 
) [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 2131 of file OSGVRMLNodeDescs.cpp.

References _szOSGPartname, _szVRMLPartname, osg::VRMLNodeDesc::decIndent(), osg::VRMLNodeDesc::getFieldAndDesc(), osg::VRMLNodeDesc::getIndent(), osg::VRMLNodeDesc::incIndent(), osg::indentLog(), osg::NullFC, PINFO, PWARNING, and osg::stringcasecmp().

02136 {
02137 #ifdef OSG_DEBUG_VRML
02138     indentLog(getIndent(), PINFO);
02139     PINFO << "VRMLGeometryPartDesc::getFieldAndDesc : looking for "
02140           << szFieldname
02141           << std::endl;
02142 #endif
02143 
02144     if(szFieldname == NULL)
02145         return;
02146 
02147     if(pFC == NullFC)
02148         return;
02149 
02150     incIndent();
02151 
02152     if(stringcasecmp(_szVRMLPartname, szFieldname) == 0)
02153     {
02154 #ifdef OSG_DEBUG_VRML
02155         indentLog(getIndent(), PINFO);
02156         PINFO << "VRMLGeometryPartDesc::getFieldAndDesc : request internal "
02157               << szFieldname
02158               << " return "
02159               << _szOSGPartname
02160               << std::endl;
02161 #endif
02162 
02163         pField = pFC->getField(_szOSGPartname);
02164 
02165         if(pField != NULL)
02166             pDesc = pFC->getType().findFieldDescription(_szOSGPartname);
02167 
02168         if(pField == NULL)
02169         {
02170             PWARNING << "VRMLGeometryPartDesc::getFieldAndDesc : could not"
02171                      << " map : "
02172                      << szFieldname
02173                      << " to "
02174                      << _szOSGPartname
02175                      << std::endl;
02176         }
02177     }
02178     else
02179     {
02180         Inherited::getFieldAndDesc(pFC,
02181                                    szFieldname,
02182                                    pField,
02183                                    pDesc);
02184     }
02185 
02186 #ifdef OSG_DEBUG_VRML
02187     decIndent();
02188 #endif
02189 }

FieldContainerPtr VRMLGeometryPartDesc::beginNode ( const Char8 szTypename,
const Char8 szName,
FieldContainerPtr  pCurrentFC 
) [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 2194 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_pNodeProto, and osg::NullFC.

02198 {
02199     FieldContainerPtr returnValue = NullFC;
02200 
02201     if(_pNodeProto != NullFC)
02202         returnValue = _pNodeProto->shallowCopy();
02203 
02204     return returnValue;
02205 }

void VRMLGeometryPartDesc::dump ( const Char8 szNodeName  )  [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 2210 of file OSGVRMLNodeDescs.cpp.

02211 {
02212 }

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

UInt32 VRMLNodeDesc::getIndent ( void   )  [static, inherited]

Definition at line 128 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_uiIndent.

Referenced by osg::VRMLNodeFactory< BaseT >::addFieldValue(), osg::VRMLNodeFactory< BaseT >::beginEventInDecl(), osg::VRMLNodeFactory< BaseT >::beginEventOutDecl(), osg::VRMLViewpointDesc::beginNode(), osg::VRMLInlineDesc::beginNode(), osg::VRMLGroupDesc::beginNode(), osg::VRMLSwitchDesc::beginNode(), osg::VRMLLODDesc::beginNode(), osg::VRMLPixelTextureDesc::beginNode(), osg::VRMLImageTextureDesc::beginNode(), osg::VRMLTextureTransformDesc::beginNode(), osg::VRMLAppearanceDesc::beginNode(), osg::VRMLGeometryPointSetDesc::beginNode(), osg::VRMLGeometryDesc::beginNode(), osg::VRMLShapeDesc::beginNode(), osg::VRMLFile::beginNode(), osg::VRMLNodeFactory< BaseT >::beginProto(), osg::VRMLFile::endField(), osg::VRMLViewpointDesc::endNode(), osg::VRMLInlineDesc::endNode(), osg::VRMLExtrusionDesc::endNode(), osg::VRMLGroupDesc::endNode(), osg::VRMLSwitchDesc::endNode(), osg::VRMLLODDesc::endNode(), osg::VRMLPixelTextureDesc::endNode(), osg::VRMLImageTextureDesc::endNode(), osg::VRMLTextureTransformDesc::endNode(), osg::VRMLAppearanceDesc::endNode(), osg::VRMLGeometryObjectDesc::endNode(), osg::VRMLGeometryPointSetDesc::endNode(), osg::VRMLGeometryDesc::endNode(), osg::VRMLShapeDesc::endNode(), osg::VRMLFile::endNode(), osg::VRMLNodeFactory< BaseT >::findNodeDesc(), osg::VRMLNodeDesc::getField(), osg::VRMLViewpointDesc::getFieldAndDesc(), osg::VRMLInlineDesc::getFieldAndDesc(), osg::VRMLExtrusionDesc::getFieldAndDesc(), osg::VRMLGroupDesc::getFieldAndDesc(), osg::VRMLSwitchDesc::getFieldAndDesc(), osg::VRMLLODDesc::getFieldAndDesc(), osg::VRMLAppearanceDesc::getFieldAndDesc(), osg::VRMLGeometryObjectDesc::getFieldAndDesc(), getFieldAndDesc(), osg::VRMLGeometryPointSetDesc::getFieldAndDesc(), osg::VRMLGeometryDesc::getFieldAndDesc(), osg::VRMLShapeDesc::getFieldAndDesc(), osg::VRMLNodeDesc::getFieldAndDesc(), osg::VRMLFile::getFieldType(), osg::VRMLInlineDesc::init(), osg::VRMLExtrusionDesc::init(), osg::VRMLGroupDesc::init(), osg::VRMLSwitchDesc::init(), osg::VRMLLODDesc::init(), osg::VRMLPixelTextureDesc::init(), osg::VRMLImageTextureDesc::init(), osg::VRMLTextureTransformDesc::init(), osg::VRMLMaterialDesc::init(), osg::VRMLAppearanceDesc::init(), osg::VRMLGeometryObjectDesc::init(), init(), osg::VRMLGeometryPointSetDesc::init(), osg::VRMLGeometryDesc::init(), osg::VRMLShapeDesc::init(), osg::VRMLPixelTextureDesc::prototypeAddField(), osg::VRMLImageTextureDesc::prototypeAddField(), osg::VRMLTextureTransformDesc::prototypeAddField(), osg::VRMLMaterialDesc::prototypeAddField(), prototypeAddField(), osg::VRMLGeometryPointSetDesc::prototypeAddField(), osg::VRMLGeometryDesc::prototypeAddField(), osg::VRMLShapeDesc::prototypeAddField(), osg::VRMLNodeDesc::prototypeAddField(), osg::VRMLFile::setContainerFieldValue(), and osg::VRMLFile::use().

00129 {
00130     return _uiIndent;
00131 }

void VRMLNodeDesc::incIndent ( void   )  [static, inherited]

void VRMLNodeDesc::decIndent ( void   )  [static, inherited]

void VRMLNodeDesc::resetIndent ( void   )  [static, inherited]

void VRMLNodeDesc::reset ( void   )  [virtual, inherited]

void VRMLNodeDesc::setOnEndSave ( const Char8 szName  )  [virtual, inherited]

Definition at line 209 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_bSaveOnEnd, and osg::VRMLNodeDesc::_szCurrentName.

Referenced by osg::VRMLFile::beginNode().

00210 {
00211     _szCurrentName = szName; // does that make a copy? I expect it to...
00212     _bSaveOnEnd = true;
00213 }

void VRMLNodeDesc::clearOnEndSave ( void   )  [virtual, inherited]

Definition at line 215 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_bSaveOnEnd.

Referenced by osg::VRMLFile::endNode().

00216 {
00217     _bSaveOnEnd = false;
00218 }

bool VRMLNodeDesc::getOnEndSave ( void   )  [virtual, inherited]

Definition at line 220 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_bSaveOnEnd.

Referenced by osg::VRMLFile::endNode().

00221 {
00222     return _bSaveOnEnd;
00223 }

const Char8 * VRMLNodeDesc::getSavename ( void   )  [virtual, inherited]

Definition at line 225 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_szCurrentName.

Referenced by osg::VRMLFile::endNode().

00226 {
00227     return _szCurrentName.c_str();
00228 }

FieldContainerPtr VRMLNodeDesc::getSaveFieldContainer ( void   )  [virtual, inherited]

Reimplemented in osg::VRMLAppearanceDesc.

Definition at line 230 of file OSGVRMLNodeDescs.cpp.

References osg::NullFC.

Referenced by osg::VRMLFile::endNode().

00231 {
00232     return NullFC;
00233 }

Field * VRMLNodeDesc::getField ( const Char8 szFieldname  )  [virtual, inherited]

Field * VRMLNodeDesc::getField ( FieldContainerPtr  pFC1,
FieldContainerPtr  pFC2,
GenericAttPtr  pGenAtt,
const Char8 szFieldname 
) [protected, inherited]

Definition at line 607 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::decIndent(), osg::VRMLNodeDesc::getIndent(), osg::VRMLNodeDesc::incIndent(), osg::indentLog(), osg::NullFC, and PINFO.

00611 {
00612     Field *returnValue = NULL;
00613 
00614     if(szFieldname == NULL)
00615     {
00616         return returnValue;
00617     }
00618 
00619 #ifdef OSG_DEBUG_VRML
00620     indentLog(getIndent(), PINFO);
00621     PINFO << "VRMLNodeDesc::getField " << std::endl;
00622 
00623     incIndent();
00624 
00625     indentLog(getIndent(), PINFO);
00626     PINFO << "Trying to find field : " << szFieldname << std::endl;
00627 #endif
00628 
00629     if(pFC1 != NullFC)
00630     {
00631         returnValue = pFC1->getField(szFieldname);
00632     }
00633 
00634 #ifdef OSG_DEBUG_VRML
00635     incIndent();
00636 
00637     indentLog(getIndent(), PINFO);
00638     PINFO << "Got this from node : " << returnValue << std::endl;
00639 #endif
00640 
00641     if(returnValue != NULL)
00642         return returnValue;
00643 
00644     if(pFC2 != NullFC)
00645     {
00646         returnValue = pFC2->getField(szFieldname);
00647 
00648 #ifdef OSG_DEBUG_VRML
00649         indentLog(getIndent(), PINFO);
00650         PINFO << "Got this from nodecore : " << returnValue << std::endl;
00651 #endif
00652     }
00653     else
00654     {
00655 #ifdef OSG_DEBUG_VRML
00656         indentLog(getIndent(), PINFO);
00657         PINFO << "No core to check" << std::endl;
00658 #endif
00659     }
00660 
00661 
00662     if(returnValue != NULL)
00663         return returnValue;
00664 
00665     if(pGenAtt != NullFC)
00666     {
00667         returnValue = pGenAtt->getField(szFieldname);
00668     }
00669 
00670 #ifdef OSG_DEBUG_VRML
00671     indentLog(getIndent(), PINFO);
00672     PINFO << "Got this from attachment : " << returnValue << std::endl;
00673 
00674     decIndent();
00675     decIndent();
00676 #endif
00677 
00678     return returnValue;
00679 }

void VRMLNodeDesc::prototypeAddFieldValue ( const Char8 szFieldVal  )  [virtual, inherited]

Definition at line 477 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_pCurrField, and osg::Field::pushValueByStr().

Referenced by osg::VRMLNodeFactory< BaseT >::addFieldValue().

00478 {
00479     if(_pCurrField       != NULL)
00480     {
00481         _pCurrField->pushValueByStr(szFieldVal);
00482     }
00483 }

void VRMLNodeDesc::endProtoInterface ( void   )  [virtual, inherited]

void VRMLNodeDesc::endNode ( FieldContainerPtr   )  [virtual, inherited]

void VRMLNodeDesc::addFieldValue ( Field pField,
const Char8 szFieldVal 
) [virtual, inherited]

Reimplemented in osg::VRMLGeometryDesc, osg::VRMLGeometryPointSetDesc, and osg::VRMLPixelTextureDesc.

Definition at line 551 of file OSGVRMLNodeDescs.cpp.

References osg::Field::pushValueByStr().

Referenced by osg::VRMLFile::addFieldValue().

00553 {
00554     if(pField != NULL)
00555     {
00556         pField->pushValueByStr(szFieldVal);
00557     }
00558 }

bool VRMLNodeDesc::use ( FieldContainerPtr   )  [virtual, inherited]

Reimplemented in osg::VRMLAppearanceDesc.

Definition at line 560 of file OSGVRMLNodeDescs.cpp.

Referenced by osg::VRMLFile::use().

00561 {
00562     return false;
00563 }


Member Data Documentation

Definition at line 699 of file OSGVRMLNodeDescs.h.

Referenced by getFieldAndDesc(), init(), prototypeAddField(), and VRMLGeometryPartDesc().

Definition at line 700 of file OSGVRMLNodeDescs.h.

Referenced by getFieldAndDesc(), init(), and VRMLGeometryPartDesc().

Definition at line 701 of file OSGVRMLNodeDescs.h.

Referenced by init(), and VRMLGeometryPartDesc().

UInt32 VRMLNodeDesc::_uiIndent = 0 [static, protected, inherited]

Definition at line 307 of file OSGVRMLNodeDescs.h.

Field* osg::VRMLNodeDesc::_pCurrField [protected, inherited]

std::string osg::VRMLNodeDesc::_szCurrentName [protected, inherited]

bool osg::VRMLNodeDesc::_bSaveOnEnd [protected, inherited]


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

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