#include <OSGVRMLNodeDescs.h>
Inheritance diagram for osg::VRMLNodeDesc:

Member | |
| Field * | getField (FieldContainerPtr pFC1, FieldContainerPtr pFC2, GenericAttPtr pGenAtt, const Char8 *szFieldname) |
| FieldNameTypeHash | _mFieldTypes |
| GenericAttPtr | _pGenAtt |
| FieldContainerPtr | _pNodeProto |
| FieldContainerPtr | _pNodeCoreProto |
| Field * | _pCurrField |
| std::string | _szCurrentName |
| bool | _bSaveOnEnd |
| *static UInt32 | _uiIndent = 0 |
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.
|
|
Definition at line 298 of file OSGVRMLNodeDescs.h. |
|
|
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 }
|
|
|
Definition at line 176 of file OSGVRMLNodeDescs.cpp.
|
|
|
|
|
|
|
|
|
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 }
|
|
|
|
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().
|
|
|
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 }
|
|
|
Definition at line 215 of file OSGVRMLNodeDescs.cpp. References _bSaveOnEnd. Referenced by osg::VRMLFile::endNode(). 00216 { 00217 _bSaveOnEnd = false; 00218 }
|
|
|
Definition at line 220 of file OSGVRMLNodeDescs.cpp. References _bSaveOnEnd. Referenced by osg::VRMLFile::endNode(). 00221 { 00222 return _bSaveOnEnd; 00223 }
|
|
|
Definition at line 225 of file OSGVRMLNodeDescs.cpp. References _szCurrentName. Referenced by osg::VRMLFile::endNode(). 00226 { 00227 return _szCurrentName.c_str(); 00228 }
|
|
|
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 }
|
|
||||||||||||||||||||
|
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 }
|
|
||||||||||||||||
|
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::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 pDesc = new FieldDescription(*pType, 00425 szFieldName, 00426 0, 0, 00427 false, 00428 (FieldIndexAccessMethod) 00429 &GenericAtt::getDynamicField); 00430 00431 _pGenAtt->addField(*pDesc); 00432 00433 _pCurrField = getField(_pNodeProto, 00434 _pNodeCoreProto, 00435 _pGenAtt, 00436 szFieldName); 00437 00438 delete pDesc; 00439 00440 #ifdef OSG_DEBUG_VRML 00441 indentLog(getIndent(), PINFO); 00442 PINFO << "VRMLNodeDesc::prototypeAddField | field added : " 00443 << szFieldType 00444 << " " 00445 << uiFieldTypeId 00446 << " " 00447 << szFieldName 00448 << " " 00449 << _pCurrField 00450 << std::endl; 00451 #endif 00452 00453 if(_pCurrField != NULL) 00454 return true; 00455 else 00456 return false; 00457 } 00458 else 00459 { 00460 if((_pGenAtt != NullFC ) && 00461 (_pGenAtt->getField(szFieldName) != NULL)) 00462 { 00463 PWARNING << "VRMLNodeDesc::prototypeAddField | " 00464 << "Could not add field " 00465 << szFieldName 00466 << " a second time" 00467 << std::endl; 00468 } 00469 00470 return false; 00471 } 00472 }
|
|
|
Definition at line 474 of file OSGVRMLNodeDescs.cpp. References _pCurrField, and osg::Field::pushValueByStr(). 00475 { 00476 if(_pCurrField != NULL) 00477 { 00478 _pCurrField->pushValueByStr(szFieldVal); 00479 } 00480 }
|
|
|
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 482 of file OSGVRMLNodeDescs.cpp.
|
|
||||||||||||||||
|
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 489 of file OSGVRMLNodeDescs.cpp. References _pGenAtt, _pNodeCoreProto, _pNodeProto, osg::beginEditCP(), osg::Node::CoreFieldMask, osg::AttachmentContainerPtr::dcast(), osg::NodePtr::dcast(), osg::endEditCP(), and osg::NullFC. Referenced by osg::VRMLFile::beginNode(). 00492 { 00493 FieldContainerPtr returnValue = NullFC; 00494 NodePtr pNode = NullFC; 00495 NodeCorePtr pCore = NullFC; 00496 GenericAttPtr pAtt = NullFC; 00497 00498 if(_pNodeProto != NullFC) 00499 { 00500 returnValue = _pNodeProto->shallowCopy(); 00501 00502 if(_pNodeCoreProto != NullFC) 00503 { 00504 FieldContainerPtr pCoreClone = _pNodeCoreProto->shallowCopy(); 00505 00506 pNode = NodePtr ::dcast(returnValue); 00507 pCore = NodeCorePtr::dcast(pCoreClone ); 00508 00509 beginEditCP(pNode, Node::CoreFieldMask); 00510 { 00511 pNode->setCore(pCore); 00512 } 00513 endEditCP (pNode, Node::CoreFieldMask); 00514 } 00515 00516 if(_pGenAtt != NullFC) 00517 { 00518 FieldContainerPtr pAttClone = _pGenAtt->emptyCopy(); 00519 00520 pAtt = GenericAttPtr::dcast(pAttClone); 00521 00522 if(pAtt != NullFC) 00523 { 00524 pAtt->setInternal(true); 00525 } 00526 00527 if(pCore != NullFC) 00528 { 00529 pCore->addAttachment(pAtt); 00530 } 00531 else 00532 { 00533 pNode->addAttachment(pAtt); 00534 } 00535 } 00536 } 00537 00538 return returnValue; 00539 }
|
|
|
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 541 of file OSGVRMLNodeDescs.cpp. Referenced by osg::VRMLFile::endNode().
|
|
||||||||||||
|
Reimplemented in osg::VRMLGeometryDesc, osg::VRMLGeometryPointSetDesc, and osg::VRMLPixelTextureDesc. Definition at line 548 of file OSGVRMLNodeDescs.cpp. References osg::Field::pushValueByStr(). Referenced by osg::VRMLFile::addFieldValue(). 00550 { 00551 if(pField != NULL) 00552 { 00553 pField->pushValueByStr(szFieldVal); 00554 } 00555 }
|
|
|
Reimplemented in osg::VRMLAppearanceDesc. Definition at line 557 of file OSGVRMLNodeDescs.cpp. Referenced by osg::VRMLFile::use().
|
|
|
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 566 of file OSGVRMLNodeDescs.cpp. References _pGenAtt, _pNodeCoreProto, _pNodeProto, osg::TypeBase::getCName(), osg::FieldDescription::getCName(), osg::FieldDescription::getFieldType(), osg::Field::getValueByStr(), and osg::NullFC. 00567 { 00568 fprintf(stderr, "\tDefault %s\n", szNodeName); 00569 00570 fprintf(stderr, "\t\tGenAtt %p\n", &(*_pGenAtt)); 00571 fprintf(stderr, "\t\tNodeProto %p\n", &(*_pNodeProto)); 00572 fprintf(stderr, "\t\tNodeCoreProto %p\n", &(*_pNodeCoreProto)); 00573 00574 std::string stringVal; 00575 00576 if(_pGenAtt != NullFC) 00577 { 00578 fprintf(stderr, "\t\t%u Desc\n", 00579 _pGenAtt->getType().getNumFieldDescs()); 00580 00581 for(UInt32 i = 2; i <= _pGenAtt->getType().getNumFieldDescs(); i++) 00582 { 00583 FieldDescription *pFieldDesc = 00584 _pGenAtt->getType().getFieldDescription(i); 00585 Field *pField = 00586 _pGenAtt->getDynamicField(i); 00587 00588 stringVal.erase(stringVal.begin(), 00589 stringVal.end()); 00590 00591 pField->getValueByStr(stringVal); 00592 00593 fprintf(stderr, "\t\t%s %s %s\n", 00594 pFieldDesc->getCName(), 00595 pFieldDesc->getFieldType().getCName(), 00596 stringVal.c_str()); 00597 } 00598 } 00599 }
|
|
||||||||||||||||||||
|
Definition at line 604 of file OSGVRMLNodeDescs.cpp. References decIndent(), getIndent(), incIndent(), osg::indentLog(), osg::NullFC, and PINFO. 00608 { 00609 Field *returnValue = NULL; 00610 00611 if(szFieldname == NULL) 00612 { 00613 return returnValue; 00614 } 00615 00616 #ifdef OSG_DEBUG_VRML 00617 indentLog(getIndent(), PINFO); 00618 PINFO << "VRMLNodeDesc::getField " << std::endl; 00619 00620 incIndent(); 00621 00622 indentLog(getIndent(), PINFO); 00623 PINFO << "Trying to find field : " << szFieldname << std::endl; 00624 #endif 00625 00626 if(pFC1 != NullFC) 00627 { 00628 returnValue = pFC1->getField(szFieldname); 00629 } 00630 00631 #ifdef OSG_DEBUG_VRML 00632 incIndent(); 00633 00634 indentLog(getIndent(), PINFO); 00635 PINFO << "Got this from node : " << returnValue << std::endl; 00636 #endif 00637 00638 if(returnValue != NULL) 00639 return returnValue; 00640 00641 if(pFC2 != NullFC) 00642 { 00643 returnValue = pFC2->getField(szFieldname); 00644 00645 #ifdef OSG_DEBUG_VRML 00646 indentLog(getIndent(), PINFO); 00647 PINFO << "Got this from nodecore : " << returnValue << std::endl; 00648 #endif 00649 } 00650 else 00651 { 00652 #ifdef OSG_DEBUG_VRML 00653 |