#include <OSGFieldContainerTypeImpl.h>
Inheritance diagram for osg::FieldContainerType:

Public Member Functions | |
Constructors | |
| * | FieldContainerType (const Char8 *szName, const Char8 *szParentName=NULL, const Char8 *szGroupName=NULL, PrototypeCreateF fPrototypeCreate=NULL, InitContainerF fInitMethod=NULL, FieldDescription **pDesc=NULL, UInt32 uiDescByteCounter=0, bool bDescsAddable=false) |
| FieldContainerType (const FieldContainerType &source) | |
Destructor | |
| *virtual | ~FieldContainerType (void) |
Type Information | |
| *UInt16 | getGroupId (void) const |
| FieldContainerType * | getParent (void) const |
Description | |
| *FieldDescription * | getFieldDescription (UInt32 uiFieldId) |
| const FieldDescription * | getFieldDescription (UInt32 uiFieldId) const |
| FieldDescription * | findFieldDescription (const Char8 *szFieldName) |
| const FieldDescription * | findFieldDescription (const Char8 *szFieldName) const |
| UInt32 | getNumFieldDescs (void) const |
| UInt32 | addDescription (const FieldDescription &desc) |
| bool | subDescription (UInt32 uiFieldId) |
Prototype | |
| *FieldContainerPtr | getPrototype (void) const |
| bool | setPrototype (FieldContainerPtr pPrototype) |
Query Properties | |
| *bool | isInitialized (void) const |
| bool | isAbstract (void) const |
| bool | isDerivedFrom (const TypeBase &other) const |
| bool | isDerivedFrom (const FieldContainerType &other) const |
| bool | isNode (void) const |
| bool | isNodeCore (void) const |
| bool | isAttachment (void) const |
Create Base FieldContainer | |
| *FieldContainerPtr | createFieldContainer (void) const |
| NodePtr | createNode (void) const |
| NodeCorePtr | createNodeCore (void) const |
| AttachmentPtr | createAttachment (void) const |
Dump | |
| *virtual void | dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const |
Operators | |
| *bool | operator== (const DataType &other) const |
| bool | operator!= (const DataType &other) const |
Protected Types | |
| typedef std::map< IDStringLink, FieldDescription * > | DescMap |
| typedef std::vector< FieldDescription * > | DescVec |
| typedef DescMap::iterator | DescMapIt |
| typedef DescVec::iterator | DescVecIt |
| typedef DescMap::const_iterator | DescMapConstIt |
| typedef DescVec::const_iterator | DescVecConstIt |
| enum | BaseType { IsFieldContainer, IsNode, IsNodeCore, IsAttachment } |
Protected Member Functions | |
Register | |
| *void | registerType (const Char8 *szGroupName) |
Intialization / Termination | |
| *bool | initPrototype (void) |
| bool | initBaseType (void) |
| bool | initFields (void) |
| bool | initParentFields (void) |
| bool | initialize (void) |
| void | terminate (void) |
Protected Attributes | |
Member | |
| *UInt16 | _uiGroupId |
| bool | _bInitialized |
| bool | _bDescsAddable |
| BaseType | _baseType |
| FieldContainerType * | _pParent |
| IDString | _szParentName |
| IDString | _szGroupName |
| FieldContainerPtr | _pPrototype |
| PrototypeCreateF | _fPrototypeCreate |
| FieldDescription ** | _pDesc |
| UInt32 | _uiDescByteCounter |
| DescMap | _mDescMap |
| DescVec | _vDescVec |
| bool | _bCopy |
Private Types | |
| typedef DataType | Inherited |
Private Member Functions | |
| void | operator= (const FieldContainerType &source) |
| prohibit default function (move to 'public' if needed) | |
Friends | |
| class | FieldContainerFactory |
Definition at line 75 of file OSGFieldContainerTypeImpl.h.
|
|
Definition at line 184 of file OSGFieldContainerTypeImpl.h. |
|
|
Definition at line 185 of file OSGFieldContainerTypeImpl.h. |
|
|
Definition at line 187 of file OSGFieldContainerTypeImpl.h. |
|
|
Definition at line 188 of file OSGFieldContainerTypeImpl.h. |
|
|
Definition at line 190 of file OSGFieldContainerTypeImpl.h. |
|
|
Definition at line 191 of file OSGFieldContainerTypeImpl.h. |
|
|
Reimplemented from osg::DataType. Definition at line 244 of file OSGFieldContainerTypeImpl.h. |
|
|
Definition at line 176 of file OSGFieldContainerTypeImpl.h. 00177 { 00178 IsFieldContainer, 00179 IsNode, 00180 IsNodeCore, 00181 IsAttachment 00182 };
|
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 86 of file OSGFieldContainerType.cpp. References registerType(). 00093 : 00094 Inherited (szName, 00095 szParentName ), 00096 _uiGroupId (0 ), 00097 00098 _bInitialized (false ), 00099 _bDescsAddable (bDescsAddable ), 00100 00101 _baseType (IsFieldContainer ), 00102 00103 _pParent (NULL ), 00104 00105 _szParentName (szParentName ), 00106 _szGroupName (szGroupName ), 00107 00108 _pPrototype (NullFC ), 00109 _fPrototypeCreate (fPrototypeCreate ), 00110 00111 _pDesc (pDesc ), 00112 _uiDescByteCounter(uiDescByteCounter), 00113 00114 _mDescMap ( ), 00115 _vDescVec (0 ), 00116 _bCopy (false ) 00117 { 00118 registerType(szGroupName); 00119 00120 if(fInitMethod != NULL) 00121 fInitMethod(); 00122 }
|
|
|
Definition at line 124 of file OSGFieldContainerType.cpp. References _bInitialized, _pPrototype, osg::addRefCP(), initFields(), initParentFields(), and osg::NullFC. 00124 : 00125 00126 Inherited (obj ), 00127 _uiGroupId (obj._uiGroupId ), 00128 00129 _bInitialized (false ), 00130 _bDescsAddable (obj._bDescsAddable ), 00131 00132 _baseType (obj._baseType ), 00133 00134 _pParent (obj._pParent ), 00135 00136 _szParentName (obj._szParentName ), 00137 _szGroupName (obj._szGroupName ), 00138 00139 _pPrototype (obj._pPrototype ), 00140 _fPrototypeCreate (obj._fPrototypeCreate ), 00141 00142 _pDesc (obj._pDesc ), 00143 _uiDescByteCounter(obj._uiDescByteCounter), 00144 00145 _mDescMap ( ), 00146 _vDescVec (0 ), 00147 _bCopy (true ) 00148 { 00149 if(_pPrototype != NullFC) 00150 addRefCP(_pPrototype); 00151 00152 initFields(); 00153 initParentFields(); 00154 00155 _bInitialized = true; 00156 }
|
|
|
Definition at line 161 of file OSGFieldContainerType.cpp. References _bCopy, osg::GlobalSystemState, osg::Shutdown, terminate(), osg::FieldContainerFactory::the(), and osg::FieldContainerFactory::unregisterType(). 00162 { 00163 if(GlobalSystemState != Shutdown) 00164 { 00165 terminate(); 00166 if(_bCopy == false) 00167 { 00168 FieldContainerFactory::the()->unregisterType(this); 00169 } 00170 } 00171 }
|
|
|
Definition at line 54 of file OSGFieldContainerTypeImpl.inl. References _uiGroupId. Referenced by osg::VRMLWriteAction::addNodeUse(), osg::Image::attachmentCount(), osg::Image::findAttachmentField(), osg::VRMLFile::findFCByName(), osg::FieldContainer::getClassGroupId(), osg::FieldContainer::getGroupId(), osg::Image::hasAttachment(), and osg::OSGWriter::FCInfoHelper::setName(). 00055 { 00056 return _uiGroupId; 00057 }
|
|
|
Definition at line 60 of file OSGFieldContainerTypeImpl.inl. References _pParent. Referenced by osg::FieldContainerFactory::writeSingleTypeFCD(). 00061 { 00062 return _pParent; 00063 }
|
|
|
Definition at line 66 of file OSGFieldContainerTypeImpl.inl. References _vDescVec. Referenced by osg::SharePtrGraphOp::addAttachmentParent(), osg::DynFieldAttachment< AttachmentDescT >::addField(), osg::SharePtrGraphOp::clearAttachmentParent(), osg::DynFieldAttachment< AttachmentDescT >::clone(), osg::SharePtrGraphOp::compareFCs(), osg::deepClone(), osg::BINWriter::doIndexFC(), osg::DynFieldAttachment< AttachmentDescT >::dump(), osg::DynFieldAttachment< AttachmentDescT >::emptyCopy(), osg::QFCItem::expand(), osg::FieldContainer::getField(), osg::getParentsField(), osg::SharePtrGraphOp::isEqual(), isEqual(), osg::QFCItem::setup(), subDescription(), osg::MultiDisplayWindow::updateViewport(), osg::OSGWriter::visitContainer(), osg::OSGWriter::writeContainer(), and osg::FieldContainerFactory::writeSingleTypeFCD(). 00067 { 00068 if(uiFieldId - 1 < _vDescVec.size()) 00069 return _vDescVec[uiFieldId - 1]; 00070 else 00071 return NULL; 00072 }
|
|
|
Definition at line 75 of file OSGFieldContainerTypeImpl.inl. References _vDescVec. 00077 { 00078 if(uiFieldId - 1 < _vDescVec.size()) 00079 return _vDescVec[uiFieldId - 1]; 00080 else 00081 return NULL; 00082 }
|
|
|
Definition at line 85 of file OSGFieldContainerTypeImpl.inl. References _mDescMap. Referenced by osg::FieldContainer::getField(), and osg::VRMLShapeDesc::getFieldAndDesc(). 00087 { 00088 DescMapIt descIt = _mDescMap.find(IDStringLink(szFieldName)); 00089 00090 return (descIt == _mDescMap.end()) ? NULL : (*descIt).second; 00091 }
|
|
|
Definition at line 94 of file OSGFieldContainerTypeImpl.inl. References _mDescMap. 00096 { 00097 DescMapConstIt descIt = _mDescMap.find(IDStringLink(szFieldName)); 00098 00099 return (descIt == _mDescMap.end()) ? NULL : (*descIt).second; 00100 }
|
|
|
|
Definition at line 176 of file OSGFieldContainerType.cpp. References _bDescsAddable, _mDescMap, osg::TypeBase::_szName, _vDescVec, osg::FieldDescription::getCName(), osg::FieldDescription::getTypeId(), osg::FieldDescription::isValid(), osg::IDString::str(), and SWARNING. Referenced by osg::DynFieldAttachment< AttachmentDescT >::addField(). 00177 { 00178 UInt32 returnValue = 0; 00179 DescMapConstIt descIt; 00180 DescVecIt descVIt; 00181 00182 FieldDescription *pDesc; 00183 FieldDescription *pNullDesc = NULL; 00184 00185 if(_bDescsAddable == false) 00186 return returnValue; 00187 00188 descIt = _mDescMap.find(IDStringLink(desc.getCName())); 00189 00190 if(desc.isValid()) 00191 { 00192 if(descIt == _mDescMap.end()) 00193 { 00194 pDesc = new FieldDescription(desc); 00195 00196 _mDescMap[IDStringLink(pDesc->getCName())] = pDesc; 00197 00198 descVIt = std::find(_vDescVec.begin(), 00199 _vDescVec.end(), 00200 pNullDesc); 00201 00202 if(descVIt == _vDescVec.end()) 00203 { 00204 _vDescVec.push_back(pDesc); 00205 00206 returnValue = _vDescVec.size(); 00207 } 00208 else 00209 { 00210 (*descVIt) = pDesc; 00211 00212 returnValue = descVIt - _vDescVec.begin(); 00213 returnValue += 1; 00214 } 00215 } 00216 else 00217 { 00218 SWARNING << "ERROR: Double field description " 00219 << "in " << _szName.str() << " from " 00220 << desc.getCName() << " (id:" 00221 << desc.getTypeId() << ")" << std::endl; 00222 } 00223 } 00224 else 00225 { 00226 SWARNING << "ERROR: Invalid field description " 00227 << "in " << _szName.str() << " from " 00228 << desc.getTypeId() << std::endl; 00229 } 00230 00231 return returnValue; 00232 }
|
|
|
Definition at line 234 of file OSGFieldContainerType.cpp. References _bDescsAddable, _mDescMap, _vDescVec, osg::FieldDescription::getCName(), and getFieldDescription(). Referenced by osg::DynFieldAttachment< AttachmentDescT >::subField(). 00235 { 00236 FieldDescription *pDesc = getFieldDescription(uiFieldId); 00237 DescMapIt descMIt; 00238 DescVecIt descVIt; 00239 bool returnValue = true; 00240 00241 if(pDesc == NULL || _bDescsAddable == false) 00242 return false; 00243 00244 descMIt = _mDescMap.find(IDStringLink(pDesc->getCName())); 00245 00246 if(descMIt != _mDescMap.end()) 00247 { 00248 _mDescMap.erase(descMIt); 00249 } 00250 else 00251 { 00252 returnValue = false; 00253 } 00254 00255 descVIt = std::find(_vDescVec.begin(), _vDescVec.end(), pDesc); 00256 00257 if(descVIt != _vDescVec.end()) 00258 { 00259 (*descVIt) = NULL; 00260 00261 returnValue &= true; 00262 } 00263 else 00264 { 00265 returnValue = false; 00266 } 00267 00268 delete pDesc; 00269 00270 return returnValue; 00271 }
|
|
|
|
Definition at line 60 of file OSGFieldContainerTypeDepImpl.inl. References _pPrototype, osg::NullFC, and osg::setRefdCP(). 00061 { 00062 bool returnValue = false; 00063 00064 if(pPrototype != NullFC) 00065 { 00066 setRefdCP(_pPrototype, pPrototype); 00067 returnValue = true; 00068 } 00069 00070 return returnValue; 00071 }
|
|
|
Definition at line 113 of file OSGFieldContainerTypeImpl.inl. References _bInitialized. Referenced by osg::FieldContainerFactory::initializePendingTypes(). 00114 { 00115 return _bInitialized; 00116 }
|
|
|
Definition at line 74 of file OSGFieldContainerTypeDepImpl.inl. References _pPrototype, and osg::NullFC. Referenced by createAttachment(), createFieldContainer(), createNode(), createNodeCore(), and osg::FieldContainerFactory::writeSingleTypeFCD(). 00075 { 00076 return (_pPrototype != NullFC) ? false : true; 00077 00078 }
|
|
|
Reimplemented from osg::TypeBase. Definition at line 119 of file OSGFieldContainerTypeImpl.inl. References osg::TypeBase::isDerivedFrom(). Referenced by initBaseType(), osg::SplitGraphOp::isGroup(), osg::MergeGraphOp::isGroup(), osg::OSGWriter::FCInfoHelper::setName(), osg::SplitGraphOp::splitNode(), osg::SingleTypeGraphOp< Type >::traverseEnter(), osg::SingleTypeGraphOp< Type >::traverseLeave(), and osg::VerifyGeoGraphOp::travNodeEnter(). 00120 { 00121 return Inherited::isDerivedFrom(other); 00122 }
|
|
|
Definition at line 125 of file OSGFieldContainerTypeImpl.inl. References _pParent, and osg::TypeBase::_uiTypeId. 00126 { 00127 bool returnValue = false; 00128 FieldContainerType *pCurrType = _pParent; 00129 00130 if(_uiTypeId == other._uiTypeId) 00131 { 00132 returnValue = true; 00133 } 00134 else 00135 { 00136 while(pCurrType != NULL && returnValue == false) 00137 { 00138 if(other._uiTypeId == pCurrType->_uiTypeId) 00139 { 00140 returnValue = true; 00141 } 00142 else 00143 { 00144 pCurrType = pCurrType->_pParent; 00145 } 00146 } 00147 } 00148 00149 return returnValue; 00150 }
|
|
|
Definition at line 153 of file OSGFieldContainerTypeImpl.inl. References _baseType, and IsNode. Referenced by createNode().
|
|
|
Definition at line 159 of file OSGFieldContainerTypeImpl.inl. References _baseType, and IsNodeCore. Referenced by createNodeCore(). 00160 { 00161 return (_baseType == IsNodeCore); 00162 }
|
|
|
Definition at line 165 of file OSGFieldContainerTypeImpl.inl. References _baseType, and IsAttachment. Referenced by createAttachment(). 00166 { 00167 return (_baseType == IsAttachment); 00168 }
|
|
|
Definition at line 277 of file OSGFieldContainerType.cpp. References _pPrototype, and isAbstract(). Referenced by osg::FieldContainerFactory::createFieldContainer(), and osg::RemoteAspect::receiveSync(). 00278 { 00279 FieldContainerPtr fc; 00280 00281 if(isAbstract() == false) 00282 { 00283 fc = _pPrototype->shallowCopy(); 00284 } 00285 00286 return fc; 00287 00288 }
|
|
|
Definition at line 290 of file OSGFieldContainerType.cpp. References _pPrototype, osg::NodePtr::dcast(), isAbstract(), and isNode(). Referenced by osg::FieldContainerFactory::createNode(). 00291 { 00292 NodePtr fc; 00293 00294 if(isAbstract() == false && 00295 isNode() == true) 00296 { 00297 fc = NodePtr::dcast(_pPrototype->shallowCopy()); 00298 } 00299 00300 return fc; 00301 }
|
|
|
Definition at line 303 of file OSGFieldContainerType.cpp. References _pPrototype, osg::AttachmentContainerPtr::dcast(), isAbstract(), and isNodeCore(). Referenced by osg::FieldContainerFactory::createNodeCore(). 00304 { 00305 NodeCorePtr fc; 00306 00307 if(isAbstract() == false && 00308 isNodeCore() == true) 00309 { 00310 fc = NodeCorePtr::dcast(_pPrototype->shallowCopy()); 00311 } 00312 00313 return fc; 00314 }
|
|
|
Definition at line 316 of file OSGFieldContainerType.cpp. References _pPrototype, osg::AttachmentPtr::dcast(), isAbstract(), and isAttachment(). Referenced by osg::FieldContainerFactory::createAttachment(). 00317 { 00318 AttachmentPtr fc; 00319 00320 if(isAbstract() == false && 00321 isAttachment() == true) 00322 { 00323 fc = AttachmentPtr::dcast(_pPrototype->shallowCopy()); 00324 } 00325 00326 return fc; 00327 }
|
|
||||||||||||
|
Definition at line 333 of file OSGFieldContainerType.cpp. References _pParent, _pPrototype, _uiGroupId, _vDescVec, osg::TypeBase::getCName(), osg::TypeBase::getId(), osg::NullFC, and SLOG. Referenced by osg::DVRVolume::findParameter(). 00335 { 00336 SLOG << "FieldContainerType: " 00337 << getCName() 00338 << ", Id: " 00339 << getId() 00340 << ", parentP: " 00341 << (_pParent ? _pParent->getCName() : "NONE") 00342 << ", groupId: " 00343 << _uiGroupId 00344 << ", abstract: " 00345 << ((_pPrototype != NullFC) ? "false" : "true") 00346 << " " 00347 << _vDescVec.size() 00348 << std::endl; 00349 00350 for(UInt32 i = 0; i < _vDescVec.size(); i++) 00351 { 00352 SLOG << "Desc : " << _vDescVec[i]->getCName() << std::endl; 00353 } 00354 }
|
|
|
Definition at line 75 of file OSGFieldContainerType.cpp. References osg::TypeBase::_szName, _uiGroupId, osg::FieldContainerFactory::registerGroup(), osg::FieldContainerFactory::registerType(), osg::IDString::str(), and osg::FieldContainerFactory::the(). Referenced by FieldContainerType(). 00076 { 00077 FieldContainerFactory::the()-> |