#include <OSGVRMLNodeDescs.h>

Member | |
| static UInt32 | _uiIndent = 0 |
| FieldNameTypeHash | _mFieldTypes |
| GenericAttPtr | _pGenAtt |
| FieldContainerPtr | _pNodeProto |
| FieldContainerPtr | _pNodeCoreProto |
| Field * | _pCurrField |
| std::string | _szCurrentName |
| bool | _bSaveOnEnd |
| Field * | getField (FieldContainerPtr pFC1, FieldContainerPtr pFC2, GenericAttPtr pGenAtt, const Char8 *szFieldname) |
Public Member Functions | |
Constructors | |
| VRMLNodeDesc (void) | |
Destructor | |
| virtual | ~VRMLNodeDesc (void) |
Helper | |
| virtual void | init (const Char8 *szName) |
| virtual void | reset (void) |
| virtual void | setOnEndSave (const Char8 *szName) |
| virtual void | clearOnEndSave (void) |
| virtual bool | getOnEndSave (void) |
| virtual const Char8 * | getSavename (void) |
| virtual FieldContainerPtr | getSaveFieldContainer (void) |
Field | |
| virtual Field * | getField (const Char8 *szFieldname) |
| virtual void | getFieldAndDesc (FieldContainerPtr pFC, const Char8 *szFieldname, Field *&pField, const FieldDescription *&pDesc) |
Prototypes | |
| virtual bool | prototypeAddField (const Char8 *szFieldType, const UInt32 uiFieldTypeId, const Char8 *szFieldName) |
| virtual void | prototypeAddFieldValue (const Char8 *szFieldVal) |
| virtual void | endProtoInterface (void) |
Node | |
| virtual FieldContainerPtr | beginNode (const Char8 *szTypename, const Char8 *szName, FieldContainerPtr pCurrentFC) |
| virtual void | endNode (FieldContainerPtr) |
FieldValue | |
| virtual void | addFieldValue (Field *pField, const Char8 *szFieldVal) |
| virtual bool | use (FieldContainerPtr) |
Dump | |
| virtual void | dump (const Char8 *szNodeName) |
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 |
Private Member Functions | |
| VRMLNodeDesc (const VRMLNodeDesc &source) | |
| prohibit default function (move to 'public' if needed) | |
| void | operator= (const VRMLNodeDesc &source) |
| prohibit default function (move to 'public' if needed) | |
Definition at line 179 of file OSGVRMLNodeDescs.h.
typedef std::map< const Char8 *, UInt32, LTString> osg::VRMLNodeDesc::FieldNameTypeHash [protected] |
Definition at line 298 of file OSGVRMLNodeDescs.h.
| VRMLNodeDesc::VRMLNodeDesc | ( | void | ) |
Definition at line 158 of file OSGVRMLNodeDescs.cpp.
00158 : 00159 _mFieldTypes (), 00160 00161 _pGenAtt (NullFC), 00162 00163 _pNodeProto (NullFC), 00164 _pNodeCoreProto(NullFC), 00165 00166 _pCurrField (NULL), 00167 00168 _szCurrentName (), 00169 _bSaveOnEnd (false) 00170 { 00171 }
| VRMLNodeDesc::~VRMLNodeDesc | ( | void | ) | [virtual] |
| osg::VRMLNodeDesc::VRMLNodeDesc | ( | const VRMLNodeDesc & | source | ) | [private] |
| UInt32 VRMLNodeDesc::getIndent | ( | void | ) | [static] |
Definition at line 128 of file OSGVRMLNodeDescs.cpp.
References _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(), 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(), osg::VRMLGeometryPartDesc::getFieldAndDesc(), osg::VRMLGeometryPointSetDesc::getFieldAndDesc(), osg::VRMLGeometryDesc::getFieldAndDesc(), osg::VRMLShapeDesc::getFieldAndDesc(), 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(), osg::VRMLGeometryPartDesc::init(), osg::VRMLGeometryPointSetDesc::init(), osg::VRMLGeometryDesc::init(), osg::VRMLShapeDesc::init(), osg::VRMLPixelTextureDesc::prototypeAddField(), osg::VRMLImageTextureDesc::prototypeAddField(), osg::VRMLTextureTransformDesc::prototypeAddField(), osg::VRMLMaterialDesc::prototypeAddField(), osg::VRMLGeometryPartDesc::prototypeAddField(), osg::VRMLGeometryPointSetDesc::prototypeAddField(), osg::VRMLGeometryDesc::prototypeAddField(), osg::VRMLShapeDesc::prototypeAddField(), prototypeAddField(), osg::VRMLFile::setContainerFieldValue(), and osg::VRMLFile::use().
00129 { 00130 return _uiIndent; 00131 }
| void VRMLNodeDesc::incIndent | ( | void | ) | [static] |
Definition at line 133 of file OSGVRMLNodeDescs.cpp.
References _uiIndent.
Referenced by 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(), getField(), osg::VRMLInlineDesc::getFieldAndDesc(), osg::VRMLExtrusionDesc::getFieldAndDesc(), osg::VRMLGroupDesc::getFieldAndDesc(), osg::VRMLSwitchDesc::getFieldAndDesc(), osg::VRMLLODDesc::getFieldAndDesc(), osg::VRMLAppearanceDesc::getFieldAndDesc(), osg::VRMLGeometryObjectDesc::getFieldAndDesc(), osg::VRMLGeometryPartDesc::getFieldAndDesc(), osg::VRMLShapeDesc::getFieldAndDesc(), getFieldAndDesc(), osg::VRMLShapeDesc::prototypeAddField(), and osg::VRMLFile::use().
00134 { 00135 _uiIndent += 4; 00136 }
| void VRMLNodeDesc::decIndent | ( | void | ) | [static] |
Definition at line 138 of file OSGVRMLNodeDescs.cpp.
References _uiIndent, and PWARNING.
Referenced by osg::VRMLFile::endField(), osg::VRMLViewpointDesc::endNode(), osg::VRMLInlineDesc::endNode(), osg::VRMLGroupDesc::endNode(), osg::VRMLSwitchDesc::endNode(), osg::VRMLLODDesc::endNode(), osg::VRMLPixelTextureDesc::endNode(), osg::VRMLImageTextureDesc::endNode(), osg::VRMLTextureTransformDesc::endNode(), osg::VRMLAppearanceDesc::endNode(), osg::VRMLGeometryPointSetDesc::endNode(), osg::VRMLGeometryDesc::endNode(), osg::VRMLShapeDesc::endNode(), osg::VRMLFile::endNode(), osg::VRMLNodeFactory< BaseT >::endProto(), getField(), osg::VRMLInlineDesc::getFieldAndDesc(), osg::VRMLExtrusionDesc::getFieldAndDesc(), osg::VRMLGroupDesc::getFieldAndDesc(), osg::VRMLSwitchDesc::getFieldAndDesc(), osg::VRMLLODDesc::getFieldAndDesc(), osg::VRMLAppearanceDesc::getFieldAndDesc(), osg::VRMLGeometryObjectDesc::getFieldAndDesc(), osg::VRMLGeometryPartDesc::getFieldAndDesc(), osg::VRMLShapeDesc::getFieldAndDesc(), getFieldAndDesc(), osg::VRMLShapeDesc::prototypeAddField(), and osg::VRMLFile::use().
00139 { 00140 if(_uiIndent < 4) 00141 { 00142 PWARNING << "Indent smaller 4 decremented" << std::endl; 00143 00144 _uiIndent = 4; 00145 } 00146 00147 _uiIndent -= 4; 00148 }
| void VRMLNodeDesc::resetIndent | ( | void | ) | [static] |
Definition at line 150 of file OSGVRMLNodeDescs.cpp.
References _uiIndent.
Referenced by osg::VRMLFile::createStandardPrototypes(), osg::VRMLFile::scanFile(), osg::VRMLFile::scanStandardPrototypes(), and osg::VRMLFile::scanStream().
00151 { 00152 _uiIndent = 0; 00153 }
| void VRMLNodeDesc::init | ( | const Char8 * | szName | ) | [virtual] |
Reimplemented in osg::VRMLShapeDesc, osg::VRMLGeometryDesc, osg::VRMLGeometryPointSetDesc, osg::VRMLGeometryPartDesc, osg::VRMLGeometryObjectDesc, osg::VRMLAppearanceDesc, osg::VRMLMaterialDesc, osg::VRMLTextureTransformDesc, osg::VRMLImageTextureDesc, osg::VRMLPixelTextureDesc, osg::VRMLLODDesc, osg::VRMLSwitchDesc, osg::VRMLGroupDesc, osg::VRMLExtrusionDesc, osg::VRMLInlineDesc, and osg::VRMLViewpointDesc.
Definition at line 183 of file OSGVRMLNodeDescs.cpp.
References _pGenAtt, _pNodeCoreProto, _pNodeProto, osg::DynFieldAttachment< AttachmentDescT >::create(), osg::Node::create(), osg::ComponentTransformBase::create(), osg::GroupBase::create(), and osg::stringcasecmp().
Referenced by osg::VRMLNodeFactory< BaseT >::beginProto().
00184 { 00185 if(szName == NULL) 00186 { 00187 _pNodeCoreProto = Group::create(); 00188 } 00189 else if(stringcasecmp(szName, "Transform") == 0) 00190 { 00191 _pNodeCoreProto = ComponentTransform::create(); 00192 } 00193 else 00194 { 00195 _pNodeCoreProto = Group::create(); 00196 } 00197 00198 _pNodeProto = Node::create(); 00199 00200 _pGenAtt = GenericAtt::create(); 00201 _pGenAtt->setInternal(true); 00202 }
| void VRMLNodeDesc::reset | ( | void | ) | [virtual] |
Reimplemented in osg::VRMLMaterialDesc, osg::VRMLTextureTransformDesc, osg::VRMLImageTextureDesc, osg::VRMLPixelTextureDesc, and osg::VRMLViewpointDesc.
Definition at line 205 of file OSGVRMLNodeDescs.cpp.
Referenced by osg::VRMLFile::beginNode().
| void VRMLNodeDesc::setOnEndSave | ( | const Char8 * | szName | ) | [virtual] |
Definition at line 209 of file OSGVRMLNodeDescs.cpp.
References _bSaveOnEnd, and _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] |
Definition at line 215 of file OSGVRMLNodeDescs.cpp.
References _bSaveOnEnd.
Referenced by osg::VRMLFile::endNode().
00216 { 00217 _bSaveOnEnd = false; 00218 }
| bool VRMLNodeDesc::getOnEndSave | ( | void | ) | [virtual] |
Definition at line 220 of file OSGVRMLNodeDescs.cpp.
References _bSaveOnEnd.
Referenced by osg::VRMLFile::endNode().
00221 { 00222 return _bSaveOnEnd; 00223 }
| const Char8 * VRMLNodeDesc::getSavename | ( | void | ) | [virtual] |
Definition at line 225 of file OSGVRMLNodeDescs.cpp.
References _szCurrentName.
Referenced by osg::VRMLFile::endNode().
00226 { 00227 return _szCurrentName.c_str(); 00228 }
| FieldContainerPtr VRMLNodeDesc::getSaveFieldContainer | ( | void | ) | [virtual] |
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 }
Definition at line 238 of file OSGVRMLNodeDescs.cpp.
References _pGenAtt, _pNodeCoreProto, and _pNodeProto.
Referenced by prototypeAddField().
00239 { 00240 return getField(_pNodeProto, _pNodeCoreProto, _pGenAtt, szFieldname); 00241 }
| void VRMLNodeDesc::getFieldAndDesc | ( | FieldContainerPtr | pFC, | |
| const Char8 * | szFieldname, | |||
| Field *& | pField, | |||
| const FieldDescription *& | pDesc | |||
| ) | [virtual] |
Reimplemented in osg::VRMLShapeDesc, osg::VRMLGeometryDesc, osg::VRMLGeometryPointSetDesc, osg::VRMLGeometryPartDesc, osg::VRMLGeometryObjectDesc, osg::VRMLAppearanceDesc, osg::VRMLMaterialDesc, osg::VRMLTextureTransformDesc, osg::VRMLImageTextureDesc, osg::VRMLPixelTextureDesc, osg::VRMLLODDesc, osg::VRMLSwitchDesc, osg::VRMLGroupDesc, osg::VRMLExtrusionDesc, osg::VRMLInlineDesc, and osg::VRMLViewpointDesc.
Definition at line 243 of file OSGVRMLNodeDescs.cpp.
References osg::AttachmentContainerPtr::dcast(), osg::NodePtr::dcast(), decIndent(), osg::DynFieldAttachment< AttachmentDescT >::getClassType(), osg::NodePtr::getCore(), getIndent(), incIndent(), osg::indentLog(), osg::NullFC, and PINFO.
Referenced by osg::VRMLFile::beginFieldDecl(), osg::VRMLInlineDesc::endNode(), osg::VRMLExtrusionDesc::endNode(), osg::VRMLGeometryObjectDesc::endNode(), osg::VRMLGeometryPointSetDesc::endNode(), osg::VRMLGeometryDesc::endNode(), osg::VRMLViewpointDesc::getFieldAndDesc(), osg::VRMLInlineDesc::getFieldAndDesc(), osg::VRMLExtrusionDesc::getFieldAndDesc(), osg::VRMLGroupDesc::getFieldAndDesc(), osg::VRMLSwitchDesc::getFieldAndDesc(), osg::VRMLLODDesc::getFieldAndDesc(), osg::VRMLAppearanceDesc::getFieldAndDesc(), osg::VRMLGeometryObjectDesc::getFieldAndDesc(), osg::VRMLGeometryPartDesc::getFieldAndDesc(), osg::VRMLGeometryPointSetDesc::getFieldAndDesc(), osg::VRMLGeometryDesc::getFieldAndDesc(), osg::VRMLShapeDesc::getFieldAndDesc(), and osg::VRMLFile::getFieldType().
00248 { 00249 FieldContainerPtr pTmpFC = NullFC; 00250 NodePtr pNode = NullFC; 00251 NodeCorePtr pNodeCore = NullFC; 00252 00253 pField = NULL; 00254 pDesc = NULL; 00255 00256 if(pFC == NullFC) 00257 return; 00258 00259 #ifdef OSG_DEBUG_VRML 00260 indentLog(getIndent(), PINFO); 00261 PINFO << "VRMLNodeDesc::getFieldAndDesc : looking for " 00262 << szFieldname 00263 << std::endl; 00264 00265 incIndent(); 00266 #endif 00267 00268 pField = pFC->getField(szFieldname); 00269 00270 #ifdef OSG_DEBUG_VRML 00271 indentLog(getIndent(), PINFO); 00272 PINFO << "Got this from fieldcontainer : " << pField << std::endl; 00273 #endif 00274 00275 if(pField != NULL) 00276 { 00277 pDesc = pFC->getType().findFieldDescription(szFieldname); 00278 00279 #ifdef OSG_DEBUG_VRML 00280 decIndent(); 00281 #endif 00282 00283 return; 00284 } 00285 00286 if(pFC->getType().isNode() == true) 00287 { 00288 pNode = NodePtr::dcast(pFC); 00289 00290 pNodeCore = pNode->getCore(); 00291 00292 if(pNodeCore != NullFC) 00293 { 00294 pField = pNodeCore->getField(szFieldname); 00295 00296 #ifdef OSG_DEBUG_VRML 00297 indentLog(getIndent(), PINFO); 00298 PINFO << "Got this from nodecore : " << pField << std::endl; 00299 #endif 00300 } 00301 00302 if(pField != NULL) 00303 { 00304 pDesc = pNodeCore->getType().findFieldDescription(szFieldname); 00305 } 00306 else 00307 { 00308 pTmpFC = pNode->findAttachment( 00309 GenericAtt::getClassType().getGroupId()); 00310 00311 if(pTmpFC != NullFC) 00312 { 00313 pField = pTmpFC->getField(szFieldname); 00314 } 00315 00316 #ifdef OSG_DEBUG_VRML 00317 indentLog(getIndent(), PINFO); 00318 PINFO << "Got this from node attachment : " << pField << std::endl; 00319 #endif 00320 if(pField == NULL) 00321 { 00322 pTmpFC = 00323 pNodeCore->findAttachment( 00324 GenericAtt::getClassType().getGroupId()); 00325 00326 if(pTmpFC != NullFC) 00327 { 00328 pField = pTmpFC->getField(szFieldname); 00329 } 00330 00331 #ifdef OSG_DEBUG_VRML 00332 indentLog(getIndent(), PINFO); 00333 PINFO << "Got this from nodecore attachment : " 00334 << pField << std::endl; 00335 #endif 00336 } 00337 00338 if(pField != NULL) 00339 { 00340 pDesc = pTmpFC->getType().findFieldDescription(szFieldname); 00341 } 00342 } 00343 } 00344 else if(pFC->getType().isNodeCore() == true) 00345 { 00346 pNodeCore = NodeCorePtr::dcast(pFC); 00347 00348 pTmpFC = pNodeCore->findAttachment( 00349 GenericAtt::getClassType().getGroupId()); 00350 00351 if(pTmpFC != NullFC) 00352 { 00353 pField = pTmpFC->getField(szFieldname); 00354 } 00355 00356 if(pField != NULL) 00357 { 00358 pDesc = pTmpFC->getType().findFieldDescription(szFieldname); 00359 } 00360 00361 #ifdef OSG_DEBUG_VRML 00362 indentLog(getIndent(), PINFO); 00363 PINFO << "Got this from nodecore attachment : " 00364 << pField << std::endl; 00365 #endif 00366 } 00367 00368 #ifdef OSG_DEBUG_VRML 00369 decIndent(); 00370 #endif 00371 }
| bool VRMLNodeDesc::prototypeAddField | ( | const Char8 * | szFieldType, | |
| const UInt32 | uiFieldTypeId, | |||
| const Char8 * | szFieldName | |||
| ) | [virtual] |
Reimplemented in osg::VRMLShapeDesc, osg::VRMLGeometryDesc, osg::VRMLGeometryPointSetDesc, osg::VRMLGeometryPartDesc, osg::VRMLGeometryObjectDesc, osg::VRMLAppearanceDesc, osg::VRMLMaterialDesc, osg::VRMLTextureTransformDesc, osg::VRMLImageTextureDesc, osg::VRMLPixelTextureDesc, osg::VRMLLODDesc, osg::VRMLSwitchDesc, osg::VRMLGroupDesc, osg::VRMLExtrusionDesc, osg::VRMLInlineDesc, and osg::VRMLViewpointDesc.
Definition at line 376 of file OSGVRMLNodeDescs.cpp.
References _pCurrField, _pGenAtt, _pNodeCoreProto, _pNodeProto, osg::DynFieldAttachment< AttachmentDescT >::getDynamicField(), getField(), osg::FieldFactory::getFieldType(), osg::TypeBase::getId(), getIndent(), osg::TypeBase::getName(), osg::indentLog(), osg::NullFC, PINFO, PWARNING, and osg::FieldFactory::the().
Referenced by osg::VRMLNodeFactory< BaseT >::beginFieldDecl(), osg::VRMLViewpointDesc::prototypeAddField(), osg::VRMLInlineDesc::prototypeAddField(), osg::VRMLExtrusionDesc::prototypeAddField(), osg::VRMLGroupDesc::prototypeAddField(), osg::VRMLSwitchDesc::prototypeAddField(), osg::VRMLLODDesc::prototypeAddField(), osg::VRMLAppearanceDesc::prototypeAddField(), osg::VRMLGeometryObjectDesc::prototypeAddField(), osg::VRMLGeometryPartDesc::prototypeAddField(), osg::VRMLGeometryPointSetDesc::prototypeAddField(), osg::VRMLGeometryDesc::prototypeAddField(), and osg::VRMLShapeDesc::prototypeAddField().
00379 { 00380 FieldDescription *pDesc = NULL; 00381 FieldType *pType = NULL; 00382 00383 Field *pField = getField(_pNodeProto, 00384 _pNodeCoreProto, 00385 _pGenAtt, 00386 szFieldName); 00387 00388 00389 #ifdef OSG_DEBUG_VRML 00390 indentLog(getIndent(), PINFO); 00391 PINFO << "VRMLNodeDesc::prototypeAddField | getField " 00392 << szFieldName 00393 << " returned : " 00394 << pField 00395 << std::endl; 00396 #endif 00397 00398 if(pField == NULL) 00399 { 00400 pType = FieldFactory::the().getFieldType(uiFieldTypeId); 00401 00402 if(pType == NULL) 00403 { 00404 PWARNING << "VRMLNodeDesc::prototypeAddField " 00405 << "Could not get fieldtype " 00406 << uiFieldTypeId << " " 00407 << szFieldName << " " 00408 << std::endl; 00409 00410 return false; 00411 } 00412 00413 #ifdef OSG_DEBUG_VRML 00414 indentLog(getIndent(), PINFO); 00415 PINFO << "VRMLNodeDesc::prototypeAddField | got fieldtype : " 00416 << uiFieldTypeId 00417 << " " 00418 << pType->getName() 00419 << " " 00420 << pType->getId() 00421 << std::endl; 00422 #endif 00423 00424 if(_pGenAtt != NullFC) 00425 { 00426 pDesc = new FieldDescription(*pType, 00427 szFieldName, 00428 0, 0, 00429 false, 00430 (FieldIndexAccessMethod) 00431 &GenericAtt::getDynamicField); 00432 00433 _pGenAtt->addField(*pDesc); 00434 00435 _pCurrField = getField(_pNodeProto, 00436 _pNodeCoreProto, 00437 _pGenAtt, 00438 szFieldName); 00439 00440 delete pDesc; 00441 } 00442 00443 #ifdef OSG_DEBUG_VRML 00444 indentLog(getIndent(), PINFO); 00445 PINFO << "VRMLNodeDesc::prototypeAddField | field added : " 00446 << szFieldType 00447 << " " 00448 << uiFieldTypeId 00449 << " " 00450 << szFieldName 00451 << " " 00452 << _pCurrField 00453 << std::endl; 00454 #endif 00455 00456 if(_pCurrField != NULL) 00457 return true; 00458 else 00459 return false; 00460 } 00461 else 00462 { 00463 if((_pGenAtt != NullFC ) && 00464 (_pGenAtt->getField(szFieldName) != NULL)) 00465 { 00466 PWARNING << "VRMLNodeDesc::prototypeAddField | " 00467 << "Could not add field " 00468 << szFieldName 00469 << " a second time" 00470 << std::endl; 00471 } 00472 00473 return false; 00474 } 00475 }
| void VRMLNodeDesc::prototypeAddFieldValue | ( | const Char8 * | szFieldVal | ) | [virtual] |
Definition at line 477 of file OSGVRMLNodeDescs.cpp.
References _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] |
Reimplemented in osg::VRMLMaterialDesc, osg::VRMLTextureTransformDesc, osg::VRMLImageTextureDesc, osg::VRMLPixelTextureDesc, osg::VRMLLODDesc, osg::VRMLSwitchDesc, osg::VRMLGroupDesc, osg::VRMLExtrusionDesc, osg::VRMLInlineDesc, and osg::VRMLViewpointDesc.
Definition at line 485 of file OSGVRMLNodeDescs.cpp.
Referenced by osg::VRMLNodeFactory< BaseT >::endProto().
| FieldContainerPtr VRMLNodeDesc::beginNode | ( | const Char8 * | szTypename, | |
| const Char8 * | szName, | |||
| FieldContainerPtr | pCurrentFC | |||
| ) | [virtual] |
Reimplemented in osg::VRMLShapeDesc, osg::VRMLGeometryDesc, osg::VRMLGeometryPointSetDesc, osg::VRMLGeometryPartDesc, osg::VRMLGeometryObjectDesc, osg::VRMLAppearanceDesc, osg::VRMLMaterialDesc, osg::VRMLTextureTransformDesc, osg::VRMLImageTextureDesc, osg::VRMLPixelTextureDesc, osg::VRMLLODDesc, osg::VRMLSwitchDesc, osg::VRMLGroupDesc, osg::VRMLExtrusionDesc, osg::VRMLInlineDesc, and osg::VRMLViewpointDesc.
Definition at line 492 of file OSGVRMLNodeDescs.cpp.
References _pGenAtt, _pNodeCoreProto, _pNodeProto, osg::beginEditCP(), osg::Node::CoreFieldMask, osg::FCPtr< BasePtrTypeT, FieldContainerTypeT >::dcast(), osg::AttachmentContainerPtr::dcast(), osg::NodePtr::dcast(), osg::endEditCP(), and osg::NullFC.
Referenced by osg::VRMLFile::beginNode().
00495 { 00496 FieldContainerPtr returnValue = NullFC; 00497 NodePtr pNode = NullFC; 00498 NodeCorePtr pCore = NullFC; 00499 GenericAttPtr pAtt = NullFC; 00500 00501 if(_pNodeProto != NullFC) 00502 { 00503 returnValue = _pNodeProto->shallowCopy(); 00504 00505 if(_pNodeCoreProto != NullFC) 00506 { 00507 FieldContainerPtr pCoreClone = _pNodeCoreProto->shallowCopy(); 00508 00509 pNode = NodePtr ::dcast(returnValue); 00510 pCore = NodeCorePtr::dcast(pCoreClone ); 00511 00512 beginEditCP(pNode, Node::CoreFieldMask); 00513 { 00514 pNode->setCore(pCore); 00515 } 00516 endEditCP (pNode, Node::CoreFieldMask); 00517 } 00518 00519 if(_pGenAtt != NullFC) 00520 { 00521 FieldContainerPtr pAttClone = _pGenAtt->emptyCopy(); 00522 00523 pAtt = GenericAttPtr::dcast(pAttClone); 00524 00525 if(pAtt != NullFC) 00526 { 00527 pAtt->setInternal(true); 00528 } 00529 00530 if(pCore != NullFC) 00531 { 00532 pCore->addAttachment(pAtt); 00533 } 00534 else 00535 { 00536 pNode->addAttachment(pAtt); 00537 } 00538 } 00539 } 00540 00541 return returnValue; 00542 }
| void VRMLNodeDesc::endNode | ( | FieldContainerPtr | ) | [virtual] |
Reimplemented in osg::VRMLShapeDesc, osg::VRMLGeometryDesc, osg::VRMLGeometryPointSetDesc, osg::VRMLGeometryObjectDesc, osg::VRMLAppearanceDesc, osg::VRMLMaterialDesc, osg::VRMLTextureTransformDesc, osg::VRMLImageTextureDesc, osg::VRMLPixelTextureDesc, osg::VRMLLODDesc, osg::VRMLSwitchDesc, osg::VRMLGroupDesc, osg::VRMLExtrusionDesc, osg::VRMLInlineDesc, and osg::VRMLViewpointDesc.
Definition at line 544 of file OSGVRMLNodeDescs.cpp.
Referenced by osg::VRMLFile::endNode().
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] |
Reimplemented in osg::VRMLAppearanceDesc.
Definition at line 560 of file OSGVRMLNodeDescs.cpp.
Referenced by osg::VRMLFile::use().
| void VRMLNodeDesc::dump | ( | const Char8 * | szNodeName | ) | [virtual] |
Reimplemented in osg::VRMLShapeDesc, osg::VRMLGeometryDesc, osg::VRMLGeometryPointSetDesc, osg::VRMLGeometryPartDesc, osg::VRMLGeometryObjectDesc, osg::VRMLAppearanceDesc, osg::VRMLMaterialDesc, osg::VRMLTextureTransformDesc, osg::VRMLImageTextureDesc, osg::VRMLPixelTextureDesc, osg::VRMLLODDesc, osg::VRMLSwitchDesc, osg::VRMLGroupDesc, osg::VRMLExtrusionDesc, osg::VRMLInlineDesc, and osg::VRMLViewpointDesc.
Definition at line 569 of file OSGVRMLNodeDescs.cpp.
References _pGenAtt, _pNodeCoreProto, _pNodeProto, osg::TypeBase::getCName(), osg::FieldDescription::getCName(), osg::FieldDescription::getFieldType(), osg::Field::getValueByStr(), and osg::NullFC.
00570 { 00571 fprintf(stderr, "\tDefault %s\n", szNodeName); 00572 00573 fprintf(stderr, "\t\tGenAtt %p\n", &(*_pGenAtt)); 00574 fprintf(stderr, "\t\tNodeProto %p\n", &(*_pNodeProto)); 00575 fprintf(stderr, "\t\tNodeCoreProto %p\n", &(*_pNodeCoreProto)); 00576 00577 std::string stringVal; 00578 00579 if(_pGenAtt != NullFC) 00580 { 00581 fprintf(stderr, "\t\t%u Desc\n", 00582 _pGenAtt->getType().getNumFieldDescs()); 00583 00584 for(UInt32 i = 2; i <= _pGenAtt->getType().getNumFieldDescs(); i++) 00585 { 00586 FieldDescription *pFieldDesc = 00587 _pGenAtt->getType().getFieldDescription(i); 00588 Field *pField = 00589 _pGenAtt->getDynamicField(i); 00590 00591 stringVal.erase(stringVal.begin(), 00592 stringVal.end()); 00593 00594 pField->getValueByStr(stringVal); 00595 00596 fprintf(stderr, "\t\t%s %s %s\n", 00597 pFieldDesc->getCName(), 00598 pFieldDesc->getFieldType().getCName(), 00599 stringVal.c_str()); 00600 } 00601 } 00602 }
| Field * VRMLNodeDesc::getField | ( | FieldContainerPtr | pFC1, | |
| FieldContainerPtr | pFC2, | |||
| GenericAttPtr | pGenAtt, | |||
| const Char8 * | szFieldname | |||
| ) | [protected] |
Definition at line 607 of file OSGVRMLNodeDescs.cpp.
References decIndent(), getIndent(), 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 osg::VRMLNodeDesc::operator= | ( | const VRMLNodeDesc & | source | ) | [private] |
UInt32 VRMLNodeDesc::_uiIndent = 0 [static, protected] |
Definition at line 305 of file OSGVRMLNodeDescs.h.
Referenced by decIndent(), getIndent(), incIndent(), and resetIndent().
FieldNameTypeHash osg::VRMLNodeDesc::_mFieldTypes [protected] |
Definition at line 307 of file OSGVRMLNodeDescs.h.
GenericAttPtr osg::VRMLNodeDesc::_pGenAtt [protected] |
Definition at line 309 of file OSGVRMLNodeDescs.h.
Referenced by osg::VRMLViewpointDesc::beginNode(), osg::VRMLInlineDesc::beginNode(), osg::VRMLExtrusionDesc::beginNode(), osg::VRMLGroupDesc::beginNode(), osg::VRMLSwitchDesc::beginNode(), osg::VRMLLODDesc::beginNode(), osg::VRMLGeometryObjectDesc::beginNode(), osg::VRMLGeometryPointSetDesc::beginNode(), osg::VRMLGeometryDesc::beginNode(), beginNode(), dump(), getField(), osg::VRMLAppearanceDesc::getFieldAndDesc(), osg::VRMLViewpointDesc::init(), osg::VRMLInlineDesc::init(), osg::VRMLExtrusionDesc::init(), osg::VRMLGroupDesc::init(), osg::VRMLSwitchDesc::init(), osg::VRMLLODDesc::init(), osg::VRMLAppearanceDesc::init(), osg::VRMLGeometryObjectDesc::init(), osg::VRMLGeometryPartDesc::init(), osg::VRMLGeometryPointSetDesc::init(), osg::VRMLGeometryDesc::init(), osg::VRMLShapeDesc::init(), init(), and prototypeAddField().
FieldContainerPtr osg::VRMLNodeDesc::_pNodeProto [protected] |
Definition at line 311 of file OSGVRMLNodeDescs.h.
Referenced by osg::VRMLViewpointDesc::beginNode(), osg::VRMLInlineDesc::beginNode(), osg::VRMLExtrusionDesc::beginNode(), osg::VRMLGroupDesc::beginNode(), osg::VRMLSwitchDesc::beginNode(), osg::VRMLLODDesc::beginNode(), osg::VRMLAppearanceDesc::beginNode(), osg::VRMLGeometryObjectDesc::beginNode(), osg::VRMLGeometryPartDesc::beginNode(), osg::VRMLGeometryPointSetDesc::beginNode(), osg::VRMLGeometryDesc::beginNode(), osg::VRMLShapeDesc::beginNode(), beginNode(), dump(), getField(), osg::VRMLViewpointDesc::init(), osg::VRMLInlineDesc::init(), osg::VRMLExtrusionDesc::init(), osg::VRMLGroupDesc::init(), osg::VRMLSwitchDesc::init(), osg::VRMLLODDesc::init(), osg::VRMLAppearanceDesc::init(), osg::VRMLGeometryObjectDesc::init(), osg::VRMLGeometryPartDesc::init(), osg::VRMLGeometryPointSetDesc::init(), osg::VRMLGeometryDesc::init(), osg::VRMLShapeDesc::init(), init(), osg::VRMLShapeDesc::prototypeAddField(), and prototypeAddField().
FieldContainerPtr osg::VRMLNodeDesc::_pNodeCoreProto [protected] |
Definition at line 312 of file OSGVRMLNodeDescs.h.
Referenced by osg::VRMLViewpointDesc::beginNode(), osg::VRMLInlineDesc::beginNode(), osg::VRMLGroupDesc::beginNode(), osg::VRMLSwitchDesc::beginNode(), osg::VRMLLODDesc::beginNode(), osg::VRMLGeometryPointSetDesc::beginNode(), osg::VRMLGeometryDesc::beginNode(), osg::VRMLShapeDesc::beginNode(), beginNode(), dump(), getField(), osg::VRMLViewpointDesc::init(), osg::VRMLInlineDesc::init(), osg::VRMLGroupDesc::init(), osg::VRMLSwitchDesc::init(), osg::VRMLLODDesc::init(), osg::VRMLGeometryPointSetDesc::init(), osg::VRMLGeometryDesc::init(), osg::VRMLShapeDesc::init(), init(), osg::VRMLViewpointDesc::prototypeAddField(), osg::VRMLShapeDesc::prototypeAddField(), and prototypeAddField().
Field* osg::VRMLNodeDesc::_pCurrField [protected] |
Definition at line 314 of file OSGVRMLNodeDescs.h.
Referenced by osg::VRMLViewpointDesc::prototypeAddField(), osg::VRMLInlineDesc::prototypeAddField(), osg::VRMLExtrusionDesc::prototypeAddField(), osg::VRMLGroupDesc::prototypeAddField(), osg::VRMLSwitchDesc::prototypeAddField(), osg::VRMLLODDesc::prototypeAddField(), osg::VRMLPixelTextureDesc::prototypeAddField(), osg::VRMLImageTextureDesc::prototypeAddField(), osg::VRMLTextureTransformDesc::prototypeAddField(), osg::VRMLMaterialDesc::prototypeAddField(), osg::VRMLAppearanceDesc::prototypeAddField(), osg::VRMLGeometryObjectDesc::prototypeAddField(), osg::VRMLGeometryPartDesc::prototypeAddField(), osg::VRMLGeometryPointSetDesc::prototypeAddField(), osg::VRMLGeometryDesc::prototypeAddField(), osg::VRMLShapeDesc::prototypeAddField(), prototypeAddField(), and prototypeAddFieldValue().
std::string osg::VRMLNodeDesc::_szCurrentName [protected] |
bool osg::VRMLNodeDesc::_bSaveOnEnd [protected] |
Definition at line 317 of file OSGVRMLNodeDescs.h.
Referenced by clearOnEndSave(), getOnEndSave(), and setOnEndSave().
1.5.5