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

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 | |
| * | VRMLGeometryObjectDesc (Char8 *szVRMLObjectname) |
Destructor | |
| *virtual | ~VRMLGeometryObjectDesc (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) |
| virtual void | endNode (FieldContainerPtr) |
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 Char8 * | getSavename (void) |
| virtual FieldContainerPtr | getSaveFieldContainer (void) |
Field | |
| *virtual Field * | getField (const Char8 *szFieldname) |
Prototypes | |
| virtual void | prototypeAddFieldValue (const Char8 *szFieldVal) |
| virtual void | endProtoInterface (void) |
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 * | _szVRMLObjectname |
Private Types | |
| typedef VRMLNodeDesc | Inherited |
Private Member Functions | |
| VRMLGeometryObjectDesc (const VRMLGeometryObjectDesc &source) | |
| prohibit default function (move to 'public' if needed) | |
| void | operator= (const VRMLGeometryObjectDesc &source) |
| prohibit default function (move to 'public' if needed) | |
Definition at line 723 of file OSGVRMLNodeDescs.h.
|
|
Definition at line 794 of file OSGVRMLNodeDescs.h. |
|
|
Definition at line 298 of file OSGVRMLNodeDescs.h. |
|
|
Definition at line 2225 of file OSGVRMLNodeDescs.cpp. References _szVRMLObjectname, and osg::stringDup(). 02225 : 02226 Inherited(), 02227 02228 _szVRMLObjectname(NULL) 02229 { 02230 stringDup(szVRMLObjectname, _szVRMLObjectname); 02231 }
|
|
|
Definition at line 2236 of file OSGVRMLNodeDescs.cpp.
|
|
|
|
|
|
Reimplemented from osg::VRMLNodeDesc. Definition at line 2243 of file OSGVRMLNodeDescs.cpp. References osg::VRMLNodeDesc::_pGenAtt, osg::VRMLNodeDesc::_pNodeProto, _szVRMLObjectname, osg::DynFieldAttachment< AttachmentDescT >::create(), osg::Node::create(), osg::VRMLNodeDesc::getIndent(), osg::indentLog(), osg::NullFC, PINFO, and PWARNING. 02244 { 02245 #ifdef OSG_DEBUG_VRML 02246 indentLog(getIndent(), PINFO); 02247 PINFO << "GeoObjDesc::init : " 02248 << szName << " " 02249 << _szVRMLObjectname 02250 << std::endl; 02251 #endif 02252 02253 _pNodeProto = Node::create(); 02254 02255 if(_pNodeProto == NullFC) 02256 { 02257 PWARNING << "GeoObjDesc::init : no prototype available" << std::endl; 02258 } 02259 02260 _pGenAtt = GenericAtt::create(); 02261 _pGenAtt->setInternal(true); 02262 }
|
|
||||||||||||||||
|
Reimplemented from osg::VRMLNodeDesc. Definition at line 2267 of file OSGVRMLNodeDescs.cpp. References osg::VRMLNodeDesc::_pCurrField, and osg::VRMLNodeDesc::prototypeAddField(). 02270 { 02271 _pCurrField = NULL; 02272 02273 bool rc = VRMLNodeDesc::prototypeAddField(szFieldType, 02274 uiFieldTypeId, 02275 szFieldname); 02276 02277 return rc; 02278 }
|
|
||||||||||||||||||||
|
Reimplemented from osg::VRMLNodeDesc. Definition at line 2280 of file OSGVRMLNodeDescs.cpp. References osg::VRMLNodeDesc::decIndent(), osg::VRMLNodeDesc::getFieldAndDesc(), osg::VRMLNodeDesc::getIndent(), osg::VRMLNodeDesc::incIndent(), osg::indentLog(), osg::NullFC, and PINFO. 02285 { 02286 #ifdef OSG_DEBUG_VRML 02287 indentLog(getIndent(), PINFO); 02288 PINFO << "VRMLGeometryObjectDesc::getFieldAndDesc : looking for " 02289 << szFieldname 02290 << std::endl; 02291 #endif 02292 02293 if(szFieldname == NULL) 02294 return; 02295 02296 if(pFC == NullFC) 02297 return; 02298 02299 incIndent(); 02300 02301 Inherited::getFieldAndDesc(pFC, 02302 szFieldname, 02303 pField, 02304 pDesc); 02305 02306 #ifdef OSG_DEBUG_VRML 02307 decIndent(); 02308 #endif 02309 }
|
|
||||||||||||||||
|
Reimplemented from osg::VRMLNodeDesc. Definition at line 2314 of file OSGVRMLNodeDescs.cpp. References osg::VRMLNodeDesc::_pGenAtt, osg::VRMLNodeDesc::_pNodeProto, osg::NodePtr::dcast(), and osg::NullFC. 02318 { 02319 FieldContainerPtr returnValue = NullFC; 02320 NodePtr pNode = NullFC; 02321 GenericAttPtr pAtt = NullFC; 02322 02323 if(_pNodeProto != NullFC) 02324 { 02325 FieldContainerPtr pAttClone = _pGenAtt->clone(); 02326 02327 pAtt = GenericAttPtr::dcast(pAttClone); 02328 02329 if(pAtt != NullFC) 02330 { 02331 pAtt->setInternal(true); 02332 } 02333 02334 returnValue = _pNodeProto->shallowCopy(); 02335 02336 pNode = NodePtr::dcast(returnValue); 02337 02338 pNode->addAttachment(pAtt); 02339 } 02340 02341 return returnValue; 02342 }
|
|
|
Reimplemented from osg::VRMLNodeDesc. Definition at line 2344 of file OSGVRMLNodeDescs.cpp. References _szVRMLObjectname, osg::beginEditCP(), osg::Node::CoreFieldMask, osg::NodePtr::dcast(), osg::endEditCP(), osg::VRMLNodeDesc::getFieldAndDesc(), osg::VRMLNodeDesc::getIndent(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::indentLog(), osg::makeBoxGeo(), osg::makeConeGeo(), osg::makeCylinderGeo(), osg::makeLatLongSphereGeo(), osg::NullFC, PINFO, and osg::stringcasecmp(). 02345 { 02346 Field *pField = NULL; 02347 const FieldDescription *pDesc = NULL; 02348 NodePtr pNode = NullFC; 02349 02350 if(pFC == NullFC) 02351 return; 02352 02353 pNode = NodePtr::dcast(pFC); 02354 02355 if(pNode == NullFC) 02356 return; 02357 02358 if( stringcasecmp("Box", _szVRMLObjectname) == 0) 02359 { 02360 Inherited::getFieldAndDesc(pFC, 02361 "size", 02362 pField, 02363 pDesc); 02364 02365 if(pField != NULL) 02366 { 02367 SFVec3f *pVec = static_cast<SFVec3f *>(pField); 02368 02369 #ifdef OSG_DEBUG_VRML 02370 indentLog(getIndent(), PINFO); 02371 PINFO << "VRMLGeometryObjectDesc::endNode : Create box" 02372 << std::endl; 02373 #endif 02374 02375 GeometryPtr pGeo = makeBoxGeo(pVec->getValue()[0], 02376 pVec->getValue()[1], 02377 pVec->getValue()[2], 02378 1,1,1); 02379 02380 beginEditCP(pNode, Node::CoreFieldMask); 02381 { 02382 pNode->setCore(pGeo); 02383 } 02384 endEditCP (pNode, Node::CoreFieldMask); 02385 } 02386 } 02387 else if(stringcasecmp("Cone", _szVRMLObjectname) == 0) 02388 { 02389 SFReal32 *pBotRad = NULL; 02390 SFReal32 *pHeight = NULL; 02391 SFBool *pSide = NULL; 02392 SFBool *pBottom = NULL; 02393 02394 Inherited::getFieldAndDesc(pFC, 02395 "bottomRadius", 02396 pField, 02397 pDesc); 02398 02399 if(pField != NULL) 02400 { 02401 pBotRad = static_cast<SFReal32 *>(pField); 02402 } 02403 02404 Inherited::getFieldAndDesc(pFC, 02405 "height", 02406 pField, 02407 pDesc); 02408 02409 if(pField != NULL) 02410 { 02411 pHeight = static_cast<SFReal32 *>(pField); 02412 } 02413 02414 Inherited::getFieldAndDesc(pFC, 02415 "side", 02416 pField, 02417 pDesc); 02418 02419 if(pField != NULL) 02420 { 02421 pSide = static_cast<SFBool *>(pField); 02422 } 02423 02424 Inherited::getFieldAndDesc(pFC, 02425 "bottom", 02426 pField, 02427 pDesc); 02428 02429 if(pField != NULL) 02430 { 02431 pBottom = static_cast<SFBool *>(pField); 02432 } 02433 02434 if(pBotRad != NULL && 02435 pHeight != NULL && 02436 pSide != NULL && 02437 pBottom != NULL) 02438 { 02439 #ifdef OSG_DEBUG_VRML 02440 indentLog(getIndent(), PINFO); 02441 PINFO << "VRMLGeometryObjectDesc::endNode : Create cone" 02442 << std::endl; 02443 #endif 02444 02445 GeometryPtr pGeo = makeConeGeo(pHeight->getValue(), 02446 pBotRad->getValue(), 02447 32, 02448 pSide ->getValue(), 02449 pBottom->getValue()); 02450 02451 beginEditCP(pNode, Node::CoreFieldMask); 02452 { 02453 pNode->setCore(pGeo); 02454 } 02455 endEditCP (pNode, Node::CoreFieldMask); 02456 } 02457 } 02458 else if(stringcasecmp("Cylinder", _szVRMLObjectname) == 0) 02459 { 02460 SFBool *pBottom = NULL; 02461 SFReal32 *pHeight = NULL; 02462 SFReal32 *pRadius = NULL; 02463 SFBool *pSide = NULL; 02464 SFBool *pTop = NULL; 02465 02466 Inherited::getFieldAndDesc(pFC, 02467 "bottom", 02468 pField, 02469 pDesc); 02470 02471 if(pField != NULL) 02472 { 02473 pBottom = static_cast<SFBool *>(pField); 02474 } 02475 02476 Inherited::getFieldAndDesc(pFC, 02477 "height", 02478 pField, 02479 pDesc); 02480 02481 if(pField != NULL) 02482 { 02483 pHeight = static_cast<SFReal32 *>(pField); 02484 } 02485 02486 Inherited::getFieldAndDesc(pFC, 02487 "radius", 02488 pField, 02489 pDesc); 02490 02491 if(pField != NULL) 02492 { 02493 pRadius = static_cast<SFReal32 *>(pField); 02494 } 02495 02496 Inherited::getFieldAndDesc(pFC, 02497 "side", 02498 pField, 02499 pDesc); 02500 02501 if(pField != NULL) 02502 { 02503 pSide = static_cast<SFBool *>(pField); 02504 } 02505 02506 Inherited::getFieldAndDesc(pFC, 02507 "top", 02508 pField, 02509 pDesc); 02510 02511 if(pField != NULL) 02512 { 02513 pTop = static_cast<SFBool *>(pField); 02514 } 02515 02516 02517 if(pBottom != NULL && 02518 pHeight != NULL && 02519 pRadius != NULL && 02520 pSide != NULL && 02521 pTop != NULL) 02522 { 02523 #ifdef OSG_DEBUG_VRML 02524 indentLog(getIndent(), PINFO); 02525 PINFO << "VRMLGeometryObjectDesc::endNode : Create cylinder" 02526 << std::endl; 02527 #endif 02528 02529 GeometryPtr pGeo = makeCylinderGeo(pHeight->getValue(), 02530 pRadius->getValue(), 02531 32, 02532 pSide ->getValue(), 02533 pTop ->getValue(), 02534 pBottom->getValue()); 02535 02536 beginEditCP(pNode, Node::CoreFieldMask); 02537 { 02538 pNode->setCore(pGeo); 02539 } 02540 endEditCP (pNode, Node::CoreFieldMask); 02541 } 02542 } 02543 else if(stringcasecmp("Sphere", _szVRMLObjectname) == 0) 02544 { 02545 Inherited::getFieldAndDesc(pFC, 02546 "radius", 02547 pField, 02548 pDesc); 02549 02550 if(pField != NULL) 02551 { 02552 SFReal32 *pValue = static_cast<SFReal32 *>(pField); 02553 02554 #ifdef OSG_DEBUG_VRML 02555 indentLog(getIndent(), PINFO); 02556 PINFO << "VRMLGeometryObjectDesc::endNode : Create sphere" 02557 << std::endl; 02558 #endif 02559 02560 GeometryPtr pGeo = makeLatLongSphereGeo(8, 16, pValue->getValue()); 02561 02562 beginEditCP(pNode, Node::CoreFieldMask); 02563 { 02564 pNode->setCore(pGeo); 02565 } 02566 endEditCP (pNode, Node::CoreFieldMask); 02567 } 02568 02569 } 02570 }
|
|
|
Reimplemented from osg::VRMLNodeDesc. Definition at line 2575 of file OSGVRMLNodeDescs.cpp.
|
|
|
|
|
|
|
|
|
Definition at line 150 of file OSGVRMLNodeDescs.cpp. References osg::VRMLNodeDesc::_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 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 }
|
|
|
Definition at line 215 of file OSGVRMLNodeDescs.cpp. References osg::VRMLNodeDesc::_bSaveOnEnd. Referenced by osg::VRMLFile::endNode(). 00216 { 00217 _bSaveOnEnd = false; 00218 }
|
|
|
Definition at line 220 of file OSGVRMLNodeDescs.cpp. References osg::VRMLNodeDesc::_bSaveOnEnd. Referenced by osg::VRMLFile::endNode(). 00221 { 00222 return _bSaveOnEnd; 00223 }
|
|
|
Definition at line 225 of file OSGVRMLNodeDescs.cpp. References osg::VRMLNodeDesc::_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 osg::VRMLNodeDesc::_pGenAtt, osg::VRMLNodeDesc::_pNodeCoreProto, and osg::VRMLNodeDesc::_pNodeProto. Referenced by osg::VRMLNodeDesc::prototypeAddField(). 00239 { 00240 return getField(_pNodeProto, _pNodeCoreProto, _pGenAtt, szFieldname); 00241 }
|
|
||||||||||||||||||||
|
Definition at line 604 of file OSGVRMLNodeDescs.cpp. References osg::VRMLNodeDesc::decIndent(), osg::VRMLNodeDesc::getIndent(), osg::VRMLNodeDesc::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 indentLog(getIndent(), PINFO); 00654 PINFO << "No core to check" << std::endl; 00655 #endif 00656 } 00657 00658 00659 if(returnValue != NULL) 00660 return returnValue; 00661 00662 if(pGenAtt != NullFC) 00663 { 00664 returnValue = pGenAtt->getField(szFieldname); 00665 } 00666 00667 #ifdef OSG_DEBUG_VRML 00668 indentLog(getIndent(), PINFO); 00669 PINFO << "Got this from attachment : " << returnValue << std::endl; 00670 00671 decIndent(); 00672 decIndent(); 00673 #endif 00674 00675 return returnValue; 00676 }
|
|
|
Definition at line 474 of file OSGVRMLNodeDescs.cpp. References osg::VRMLNodeDesc::_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::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().
|
|
|
Definition at line 788 of file OSGVRMLNodeDescs.h. Referenced by endNode(), init(), and VRMLGeometryObjectDesc(). |
|
|
Definition at line 123 of file OSGVRMLNodeDescs.cpp. Referenced by osg::VRMLNodeDesc::decIndent(), osg::VRMLNodeDesc::getIndent(), osg::VRMLNodeDesc::incIndent(), and osg::VRMLNodeDesc::resetIndent(). |
|
|
Definition at line 307 of file OSGVRMLNodeDescs.h. |
|
|
|