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

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 | |
| * | VRMLInlineDesc (void) |
Destructor | |
| *virtual | ~VRMLInlineDesc (void) |
Helper | |
| *virtual void | init (const Char8 *szName) |
Field | |
| *virtual bool | prototypeAddField (const Char8 *szFieldType, const UInt32 uiFieldTypeId, const Char8 *szFieldName) |
| virtual void | endProtoInterface (void) |
| 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) |
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 | |
| *SFVec3f | _defaultBoxCenter |
| SFVec3f | _defaultBoxSize |
| SFVec3f | _boxCenter |
| SFVec3f | _boxSize |
Private Types | |
| typedef VRMLNodeDesc | Inherited |
Private Member Functions | |
| VRMLInlineDesc (const VRMLInlineDesc &source) | |
| prohibit default function (move to 'public' if needed) | |
| void | operator= (const VRMLInlineDesc &source) |
| prohibit default function (move to 'public' if needed) | |
Definition at line 1659 of file OSGVRMLNodeDescs.h.
|
|
Definition at line 1736 of file OSGVRMLNodeDescs.h. |
|
|
Definition at line 298 of file OSGVRMLNodeDescs.h. |
|
|
Definition at line 4892 of file OSGVRMLNodeDescs.cpp. 04892 : 04893 Inherited(), 04894 04895 _defaultBoxCenter(), 04896 _defaultBoxSize (), 04897 04898 _boxCenter (), 04899 _boxSize () 04900 { 04901 }
|
|
|
Definition at line 4906 of file OSGVRMLNodeDescs.cpp.
|
|
|
|
|
|
Reimplemented from osg::VRMLNodeDesc. Definition at line 4913 of file OSGVRMLNodeDescs.cpp. References osg::VRMLNodeDesc::_pGenAtt, osg::VRMLNodeDesc::_pNodeCoreProto, osg::VRMLNodeDesc::_pNodeProto, osg::DynFieldAttachment< AttachmentDescT >::create(), osg::InlineBase::create(), osg::Node::create(), osg::VRMLNodeDesc::getIndent(), osg::indentLog(), and PINFO. 04914 { 04915 #ifdef OSG_DEBUG_VRML 04916 indentLog(getIndent(), PINFO); 04917 PINFO << "InlineDesc::init : " << szName << std::endl; 04918 #endif 04919 04920 _pNodeProto = Node::create(); 04921 _pNodeCoreProto = Inline::create(); 04922 04923 _pGenAtt = GenericAtt::create(); 04924 _pGenAtt->setInternal(true); 04925 }
|
|
||||||||||||||||
|
Reimplemented from osg::VRMLNodeDesc. Definition at line 4930 of file OSGVRMLNodeDescs.cpp. References _defaultBoxCenter, _defaultBoxSize, osg::VRMLNodeDesc::_pCurrField, osg::VRMLNodeDesc::prototypeAddField(), and osg::stringcasecmp(). 04933 { 04934 bool bFound = false; 04935 04936 _pCurrField = NULL; 04937 04938 if(stringcasecmp("bboxCenter", szFieldname) == 0) 04939 { 04940 _pCurrField = &_defaultBoxCenter; 04941 bFound = true; 04942 } 04943 else if(stringcasecmp("bboxSize", szFieldname) == 0) 04944 { 04945 _pCurrField = &_defaultBoxSize; 04946 bFound = true; 04947 } 04948 else if(stringcasecmp("url", szFieldname) == 0) 04949 { 04950 bFound = true; 04951 } 04952 04953 if(bFound == true) 04954 { 04955 return true; 04956 } 04957 else 04958 { 04959 return Inherited::prototypeAddField(szFieldType, 04960 uiFieldTypeId, 04961 szFieldname); 04962 } 04963 }
|
|
|
Reimplemented from osg::VRMLNodeDesc. Definition at line 4965 of file OSGVRMLNodeDescs.cpp.
|
|
||||||||||||||||||||
|
Reimplemented from osg::VRMLNodeDesc. Definition at line 4969 of file OSGVRMLNodeDescs.cpp. References _boxCenter, _boxSize, osg::AttachmentContainerPtr::dcast(), osg::NodePtr::dcast(), osg::VRMLNodeDesc::decIndent(), osg::NodePtr::getCore(), osg::VRMLNodeDesc::getFieldAndDesc(), osg::VRMLNodeDesc::getIndent(), osg::VRMLNodeDesc::incIndent(), osg::indentLog(), osg::NullFC, PINFO, PWARNING, and osg::stringcasecmp(). 04974 { 04975 if(szFieldname == NULL) 04976 return; 04977 04978 if(pFC == NullFC) 04979 return; 04980 04981 NodePtr pNode = NodePtr::dcast(pFC); 04982 04983 #ifdef OSG_DEBUG_VRML 04984 indentLog(getIndent(), PINFO); 04985 PINFO << "VRMLInlineDesc::getFieldAndDesc : looking for " 04986 << szFieldname 04987 << std::endl; 04988 #endif 04989 04990 if(pNode == NullFC) 04991 { 04992 PWARNING << "VRMLInlineDesc::getFieldAndDesc : No Node" << std::endl; 04993 return; 04994 } 04995 04996 NodeCorePtr pNodeCore = pNode->getCore(); 04997 04998 InlinePtr pInline = InlinePtr::dcast(pNodeCore); 04999 05000 if(pInline == NullFC) 05001 { 05002 PWARNING << "VRMLInlineDesc::getFieldAndDesc : No Inline" << std::endl; 05003 return; 05004 } 05005 05006 incIndent(); 05007 05008 if(stringcasecmp("bboxCenter", szFieldname) == 0) 05009 { 05010 #ifdef OSG_DEBUG_VRML 05011 indentLog(getIndent(), PINFO); 05012 PINFO << "VRMLInlineDesc::getFieldAndDesc : : request internal " 05013 << szFieldname 05014 << std::endl; 05015 #endif 05016 05017 pField = &_boxCenter; 05018 pDesc = NULL; 05019 } 05020 else if(stringcasecmp("bboxSize", szFieldname) == 0) 05021 { 05022 #ifdef OSG_DEBUG_VRML 05023 indentLog(getIndent(), PINFO); 05024 PINFO << "VRMLInlineDesc::getFieldAndDesc : : request internal " 05025 << szFieldname 05026 << std::endl; 05027 #endif 05028 05029 pField = &_boxSize; 05030 pDesc = NULL; 05031 } 05032 else 05033 { 05034 VRMLNodeDesc::getFieldAndDesc(pInline, 05035 szFieldname, 05036 pField, 05037 pDesc); 05038 } 05039 05040 #ifdef OSG_DEBUG_VRML 05041 decIndent(); 05042 #endif 05043 }
|
|
||||||||||||||||
|
Reimplemented from osg::VRMLNodeDesc. Definition at line 5048 of file OSGVRMLNodeDescs.cpp. References osg::VRMLNodeDesc::_pGenAtt, osg::VRMLNodeDesc::_pNodeCoreProto, osg::VRMLNodeDesc::_pNodeProto, osg::beginEditCP(), osg::AttachmentContainerPtr::dcast(), osg::NodePtr::dcast(), osg::endEditCP(), osg::VRMLNodeDesc::getIndent(), osg::VRMLNodeDesc::incIndent(), osg::indentLog(), osg::NullFC, and PINFO. 05052 { 05053 FieldContainerPtr pFC = NullFC; 05054 NodePtr pNode = NullFC; 05055 NodeCorePtr pNodeCore = NullFC; 05056 GenericAttPtr pAtt = NullFC; 05057 05058 if(_pNodeProto != NullFC) 05059 { 05060 FieldContainerPtr pAttClone = _pGenAtt->emptyCopy(); 05061 05062 pAtt = GenericAttPtr::dcast(pAttClone); 05063 05064 if(pAtt != NullFC) 05065 { 05066 pAtt->setInternal(true); 05067 } 05068 05069 pFC = _pNodeProto->shallowCopy(); 05070 05071 pNode = NodePtr::dcast(pFC); 05072 05073 pFC = _pNodeCoreProto->shallowCopy(); 05074 05075 pNodeCore = NodeCorePtr::dcast(pFC); 05076 05077 beginEditCP(pNode); 05078 { 05079 pNode ->setCore (pNodeCore); 05080 pNodeCore->addAttachment(pAtt); 05081 } 05082 endEditCP (pNode); 05083 } 05084 05085 #ifdef OSG_DEBUG_VRML 05086 indentLog(getIndent(), PINFO); 05087 PINFO << "Begin Inline" << &(*pNode) << std::endl; 05088 05089 incIndent(); 05090 #endif 05091 05092 return pNode; 05093 }
|
|
|
Reimplemented from osg::VRMLNodeDesc. Definition at line 5095 of file OSGVRMLNodeDescs.cpp. References osg::beginEditCP(), osg::Node::ChildrenFieldMask, osg::VRMLFile::createStandardPrototypes(), osg::NodePtr::dcast(), osg::VRMLNodeDesc::decIndent(), osg::endEditCP(), FDEBUG, osg::PathHandler::findFile(), FWARNING, osg::VRMLNodeDesc::getFieldAndDesc(), osg::VRMLNodeDesc::getIndent(), osg::ImageFileHandler::getPathHandler(), osg::SceneFileHandler::getPathHandler(), osg::VRMLFile::getRoot(), osg::indentLog(), osg::isGZip(), osg::NullFC, PINFO, osg::PathHandler::push_backPath(), osg::VRMLFile::scanStream(), osg::PathHandler::subPath(), osg::ImageFileHandler::the(), and osg::SceneFileHandler::the(). 05096 { 05097 Field *pField; 05098 const FieldDescription *pFieldDesc; 05099 05100 NodePtr pNode = NodePtr::dcast(pFC); 05101 05102 VRMLNodeDesc::getFieldAndDesc(pFC, 05103 "url", 05104 pField, 05105 pFieldDesc); 05106 05107 MFString *pUrl = dynamic_cast<MFString *>(pField); 05108 05109 FDEBUG(("Inline : %s\n", (*pUrl)[0].c_str())); 05110 05111 VRMLFile *pVRMLLoader = new VRMLFile(); 05112 05113 pVRMLLoader->createStandardPrototypes(); 05114 05115 std::string filename = 05116 SceneFileHandler::the().getPathHandler()->findFile((*pUrl)[0].c_str()); 05117 05118 // read it via stream could be a compressed file. 05119 std::ifstream in(filename.c_str(), std::ios::binary); 05120 if(in) 05121 { 05122 std::string path = SceneFileHandler::the().getPathHandler()-> 05123 extractPath(filename.c_str()); 05124 05125 SceneFileHandler::the().getPathHandler()->push_backPath(path.c_str()); 05126 ImageFileHandler::the().getPathHandler()->push_backPath(path.c_str()); 05127 05128 if(OSG::isGZip(in)) 05129 { 05130 #ifdef OSG_ZSTREAM_SUPPORTED 05131 zip_istream unzipper(in); 05132 pVRMLLoader->scanStream(unzipper); 05133 #else 05134 FWARNING(("zstream no configured, could not read " 05135 "compressed file")); 05136 #endif 05137 } 05138 else 05139 { 05140 pVRMLLoader->scanStream(in); 05141 } 05142 in.close(); 05143 ImageFileHandler::the().getPathHandler()->subPath(path.c_str()); 05144 SceneFileHandler::the().getPathHandler()->subPath(path.c_str()); 05145 } 05146 //pVRMLLoader->scanFile(filename.c_str()); 05147 05148 NodePtr pFile = pVRMLLoader->getRoot(); 05149 05150 // NodePtr pFile = SceneFileHandler::the().read((*pUrl)[0].c_str()); 05151 05152 if(pFile != NullFC) 05153 { 05154 beginEditCP(pNode, Node::ChildrenFieldMask); 05155 { 05156 pNode->addChild(pFile); 05157 } 05158 endEditCP (pNode, Node::ChildrenFieldMask); 05159 } 05160 05161 delete pVRMLLoader; 05162 05163 #ifdef OSG_DEBUG_VRML 05164 decIndent(); 05165 05166 indentLog(getIndent(), PINFO); 05167 PINFO << "End Inline " 05168 << &(*pFC) << std::endl; 05169 #endif 05170 }
|
|
|
Reimplemented from osg::VRMLNodeDesc. Definition at line 5175 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::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 1726 of file OSGVRMLNodeDescs.h. Referenced by prototypeAddField(). |
|
|
Definition at line 1727 of file OSGVRMLNodeDescs.h. Referenced by prototypeAddField(). |
|
|
Definition at line 1729 of file OSGVRMLNodeDescs.h. Referenced by getFieldAndDesc(). |
|
|
Definition at line 1730 of file OSGVRMLNodeDescs.h. Referenced by getFieldAndDesc(). |
|
|
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. |
|
|
|