#include <OSGFieldContainerTypeImpl.h>

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 |
Comparison | |
| bool | operator== (const TypeBase &other) const |
| bool | operator!= (const TypeBase &other) const |
Id | |
| UInt32 | getId (void) const |
| const IDString & | getName (void) const |
| const Char8 * | getCName (void) const |
| const IDString & | getParentName (void) const |
| const Char8 * | getCParentName (void) const |
| UInt32 | getNameSpace (void) const |
Protected Types | |
| enum | BaseType { IsFieldContainer, IsNode, IsNodeCore, IsAttachment } |
| 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 |
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 |
Members | |
| UInt32 | _uiTypeId |
| UInt32 | _uiTypeRootId |
| IDString | _szName |
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.
typedef std::map<IDStringLink, FieldDescription *> osg::FieldContainerType::DescMap [protected] |
Definition at line 184 of file OSGFieldContainerTypeImpl.h.
typedef std::vector< FieldDescription *> osg::FieldContainerType::DescVec [protected] |
Definition at line 185 of file OSGFieldContainerTypeImpl.h.
typedef DescMap::iterator osg::FieldContainerType::DescMapIt [protected] |
Definition at line 187 of file OSGFieldContainerTypeImpl.h.
typedef DescVec::iterator osg::FieldContainerType::DescVecIt [protected] |
Definition at line 188 of file OSGFieldContainerTypeImpl.h.
typedef DescMap::const_iterator osg::FieldContainerType::DescMapConstIt [protected] |
Definition at line 190 of file OSGFieldContainerTypeImpl.h.
typedef DescVec::const_iterator osg::FieldContainerType::DescVecConstIt [protected] |
Definition at line 191 of file OSGFieldContainerTypeImpl.h.
typedef DataType osg::FieldContainerType::Inherited [private] |
enum osg::FieldContainerType::BaseType [protected] |
Definition at line 176 of file OSGFieldContainerTypeImpl.h.
00177 { 00178 IsFieldContainer, 00179 IsNode, 00180 IsNodeCore, 00181 IsAttachment 00182 };
| FieldContainerType::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 | |||
| ) |
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 }
| FieldContainerType::FieldContainerType | ( | const FieldContainerType & | source | ) |
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 }
| FieldContainerType::~FieldContainerType | ( | void | ) | [virtual] |
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 }
| UInt16 osg::FieldContainerType::getGroupId | ( | void | ) | const [inline] |
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 }
| FieldContainerType * osg::FieldContainerType::getParent | ( | void | ) | const [inline] |
Definition at line 60 of file OSGFieldContainerTypeImpl.inl.
References _pParent.
Referenced by osg::FieldContainerFactory::writeSingleTypeFCD().
00061 { 00062 return _pParent; 00063 }
| FieldDescription * osg::FieldContainerType::getFieldDescription | ( | UInt32 | uiFieldId | ) | [inline] |
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 }
| const FieldDescription * osg::FieldContainerType::getFieldDescription | ( | UInt32 | uiFieldId | ) | const [inline] |
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 }
| FieldDescription * osg::FieldContainerType::findFieldDescription | ( | const Char8 * | szFieldName | ) | [inline] |
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 }
| const FieldDescription * osg::FieldContainerType::findFieldDescription | ( | const Char8 * | szFieldName | ) | const [inline] |
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 }
| UInt32 osg::FieldContainerType::getNumFieldDescs | ( | void | ) | const [inline] |
Definition at line 103 of file OSGFieldContainerTypeImpl.inl.
References _vDescVec.
Referenced by osg::SharePtrGraphOp::addAttachmentParent(), 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::getParentsField(), osg::SharePtrGraphOp::isEqual(), isEqual(), osg::RemoteAspect::receiveSync(), osg::QFCItem::setup(), osg::OSGWriter::visitContainer(), osg::OSGWriter::writeContainer(), and osg::FieldContainerFactory::writeSingleTypeFCD().
00104 { 00105 return _vDescVec.size(); 00106 }
| UInt32 FieldContainerType::addDescription | ( | const FieldDescription & | desc | ) |
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 }
| bool FieldContainerType::subDescription | ( | UInt32 | uiFieldId | ) |
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 }
| FieldContainerPtr osg::FieldContainerType::getPrototype | ( | void | ) | const [inline] |
Definition at line 54 of file OSGFieldContainerTypeDepImpl.inl.
References _pPrototype.
00055 { 00056 return _pPrototype; 00057 }
| bool osg::FieldContainerType::setPrototype | ( | FieldContainerPtr | pPrototype | ) | [inline] |
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 }
| bool osg::FieldContainerType::isInitialized | ( | void | ) | const [inline] |
Definition at line 113 of file OSGFieldContainerTypeImpl.inl.
References _bInitialized.
Referenced by osg::FieldContainerFactory::initializePendingTypes().
00114 { 00115 return _bInitialized; 00116 }
| bool osg::FieldContainerType::isAbstract | ( | void | ) | const [inline] |
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 }
| bool osg::FieldContainerType::isDerivedFrom | ( | const TypeBase & | other | ) | const [inline, virtual] |
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 }
| bool osg::FieldContainerType::isDerivedFrom | ( | const FieldContainerType & | other | ) | const [inline] |
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 }
| bool osg::FieldContainerType::isNode | ( | void | ) | const [inline] |
Definition at line 153 of file OSGFieldContainerTypeImpl.inl.
References _baseType, and IsNode.
Referenced by createNode().
| bool osg::FieldContainerType::isNodeCore | ( | void | ) | const [inline] |
Definition at line 159 of file OSGFieldContainerTypeImpl.inl.
References _baseType, and IsNodeCore.
Referenced by createNodeCore().
00160 { 00161 return (_baseType == IsNodeCore); 00162 }
| bool osg::FieldContainerType::isAttachment | ( | void | ) | const [inline] |
Definition at line 165 of file OSGFieldContainerTypeImpl.inl.
References _baseType, and IsAttachment.
Referenced by createAttachment().
00166 { 00167 return (_baseType == IsAttachment); 00168 }
| FieldContainerPtr FieldContainerType::createFieldContainer | ( | void | ) | const |
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 }
| NodePtr FieldContainerType::createNode | ( | void | ) | const |
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 }
| NodeCorePtr FieldContainerType::createNodeCore | ( | void | ) | const |
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 }
| AttachmentPtr FieldContainerType::createAttachment | ( | void | ) | const |
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 }
| void FieldContainerType::registerType | ( | const Char8 * | szGroupName | ) | [inline, protected] |
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()->registerType (this); 00078 00079 _uiGroupId = FieldContainerFactory::the()->registerGroup( 00080 szGroupName != NULL ? szGroupName : _szName.str()); 00081 }
| bool FieldContainerType::initPrototype | ( | void | ) | [protected] |
Definition at line 360 of file OSGFieldContainerType.cpp.
References _bInitialized, _fPrototypeCreate, _pPrototype, and osg::addRefCP().
Referenced by initialize().
00361 { 00362 _bInitialized = true; 00363 00364 if(_fPrototypeCreate != NULL) 00365 { 00366 _pPrototype = _fPrototypeCreate(); 00367 00368 addRefCP(_pPrototype); 00369 } 00370 00371 return _bInitialized; 00372 }
| bool FieldContainerType::initBaseType | ( | void | ) | [protected] |
Definition at line 374 of file OSGFieldContainerType.cpp.
References _baseType, osg::Node::getClassType(), osg::Attachment::getClassType(), osg::NodeCore::getClassType(), IsAttachment, isDerivedFrom(), IsNode, and IsNodeCore.
Referenced by initialize().
00375 { 00376 if (isDerivedFrom(NodeCore::getClassType()) == true) 00377 { 00378 _baseType = IsNodeCore; 00379 } 00380 else if(isDerivedFrom(Attachment::getClassType()) == true) 00381 { 00382 _baseType = IsAttachment; 00383 } 00384 else if(isDerivedFrom(Node::getClassType()) == true) 00385 { 00386 _baseType = IsNode; 00387 } 00388 00389 return true; 00390 }
| bool FieldContainerType::initFields | ( | void | ) | [protected] |
Definition at line 392 of file OSGFieldContainerType.cpp.
References _bInitialized, _mDescMap, _pDesc, osg::TypeBase::_szName, _uiDescByteCounter, _vDescVec, osg::FieldDescription::getCName(), osg::TypeBase::getCName(), osg::FieldDescription::getTypeId(), osg::IDString::str(), and SWARNING.
Referenced by FieldContainerType(), and initialize().
00393 { 00394 UInt32 i; 00395 DescMapIt descIt; 00396 00397 _bInitialized = true; 00398 00399 if(_pDesc == NULL) 00400 return true; 00401 00402 for(i = 0; i < _uiDescByteCounter / sizeof(FieldDescription *); i++) 00403 { 00404 if(_pDesc[i]->isValid()) 00405 { 00406 descIt = _mDescMap.find(IDStringLink(_pDesc[i]->getCName())); 00407 00408 if(descIt == _mDescMap.end()) 00409 { 00410 _mDescMap[IDStringLink(_pDesc[i]->getCName())] = _pDesc[i]; 00411 00412 _vDescVec.push_back(_pDesc[i]); 00413 } 00414 else 00415 { 00416 SWARNING << "ERROR: Double field description " 00417 << "in " << _szName.str() << " from " 00418 << _pDesc[i]->getCName() << " (id:" 00419 << _pDesc[i]->getTypeId() << ")" << std::endl; 00420 00421 _bInitialized = false; 00422 } 00423 } 00424 else 00425 { 00426 SWARNING << "ERROR: Invalid field description " 00427 << "in " << _szName.str() << "from " 00428 << (_pDesc[i]?_pDesc[i]->getTypeId():0) << std::endl; 00429 00430 _bInitialized = false; 00431 } 00432 00433 } 00434 00435 std::sort(_vDescVec.begin(), _vDescVec.end(), FieldDescriptionPLT()); 00436 00437 return _bInitialized; 00438 }
| bool FieldContainerType::initParentFields | ( | void | ) | [protected] |
Definition at line 440 of file OSGFieldContainerType.cpp.
References _bInitialized, _mDescMap, _pParent, _szParentName, _vDescVec, osg::FieldContainerFactory::findType(), osg::FieldContainerFactory::findUninitializedType(), initialize(), osg::IDString::str(), SWARNING, and osg::FieldContainerFactory::the().
Referenced by FieldContainerType(), and initialize().
00441 { 00442 DescMapIt dPIt; 00443 00444 _bInitialized = true; 00445 00446 if(_szParentName.str() != NULL) 00447 { 00448 _pParent = 00449 FieldContainerFactory::the()->findType(_szParentName.str()); 00450 00451 if(_pParent == NULL) 00452 { 00453 _pParent = 00454 FieldContainerFactory::the()->findUninitializedType( 00455 _szParentName.str()); 00456 } 00457 00458 if(_pParent != NULL) 00459 { 00460 _bInitialized = _pParent->initialize(); 00461 00462 if(_bInitialized == false) 00463 { 00464 return _bInitialized; 00465 } 00466 00467 for( dPIt = _pParent->_mDescMap.begin(); 00468 dPIt != _pParent->_mDescMap.end(); 00469 ++dPIt) 00470 { 00471 if(_mDescMap.find((*dPIt).first) == _mDescMap.end()) 00472 { 00473 _mDescMap[(*dPIt).first] = (*dPIt).second; 00474 } 00475 else 00476 { 00477 SWARNING << "ERROR: Can't add field " 00478 << "description a second time: " 00479 << (*dPIt).first.str() << std::endl; 00480 } 00481 } 00482 00483 _vDescVec.insert(_vDescVec.end(), 00484 _pParent->_vDescVec.begin(), 00485 _pParent->_vDescVec.end()); 00486 00487 } 00488 else 00489 { 00490 SWARNING << "ERROR: Can't find type with " 00491 << "name " << _szParentName.str() 00492 << std::endl; 00493 00494 _bInitialized = false; 00495 } 00496 } 00497 00498 return _bInitialized; 00499 }
| bool FieldContainerType::initialize | ( | void | ) | [protected] |
Definition at line 501 of file OSGFieldContainerType.cpp.
References _bInitialized, osg::TypeBase::_szName, _vDescVec, FDEBUG, FWARNING, osg::TypeBase::getCName(), initBaseType(), initFields(), initParentFields(), initPrototype(), and osg::IDString::str().
Referenced by osg::FieldContainerFactory::initializePendingTypes(), and initParentFields().
00502 { 00503 if(_bInitialized == true) 00504 return _bInitialized; 00505 00506 _bInitialized = initParentFields(); 00507 00508 if(_bInitialized == false) 00509 return _bInitialized; 00510 00511 _bInitialized = initFields (); 00512 00513 if(_bInitialized == false) 00514 return _bInitialized; 00515 00516 _bInitialized = initPrototype (); 00517 00518 if(_bInitialized == false) 00519 return _bInitialized; 00520 00521 _bInitialized = initBaseType (); 00522 00523 FDEBUG ( ( "init FieldContainerType %s (%d)\n", 00524 _szName.str(), int(_bInitialized) )); 00525 00526 if(_vDescVec.size() > sizeof(BitVector) * 8) 00527 { 00528 FWARNING(("FCType %s has %d (>%d) fields!\n", getCName(), 00529 _vDescVec.size(), sizeof(BitVector) * 8)); 00530 } 00531 00532 return _bInitialized; 00533 }
| void FieldContainerType::terminate | ( | void | ) | [protected] |
Definition at line 535 of file OSGFieldContainerType.cpp.
References _bInitialized, _pDesc, _pPrototype, _uiDescByteCounter, and osg::subRefCP().
Referenced by ~FieldContainerType().
00536 { 00537 UInt32 i; 00538 00539 subRefCP(_pPrototype); 00540 00541 _bInitialized = false; 00542 00543 for(i = 0; i < _uiDescByteCounter / sizeof(FieldDescription *); i++) 00544 { 00545 delete _pDesc[i]; 00546 } 00547 }
| void osg::FieldContainerType::operator= | ( | const FieldContainerType & | source | ) | [private] |
| bool DataType::operator== | ( | const DataType & | other | ) | const [inherited] |
Definition at line 84 of file OSGDataType.cpp.
00085 { 00086 return *(static_cast<const Inherited *>(this)) == other; 00087 }
| bool TypeBase::operator== | ( | const TypeBase & | other | ) | const [inherited] |
| bool DataType::operator!= | ( | const DataType & | other | ) | const [inherited] |
| bool TypeBase::operator!= | ( | const TypeBase & | other | ) | const [inherited] |
| UInt32 TypeBase::getId | ( | void | ) | const [inherited] |
Definition at line 80 of file OSGTypeBase.cpp.
References osg::TypeBase::_uiTypeId.
Referenced by osg::FieldFactory::addType(), osg::Action::callEnter(), osg::Action::callLeave(), dump(), osg::XWindowBase::getClassTypeId(), osg::WindowBase::getClassTypeId(), osg::WIN32WindowBase::getClassTypeId(), osg::ViewportBase::getClassTypeId(), osg::VertexProgramChunkBase::getClassTypeId(), osg::TwoSidedLightingChunkBase::getClassTypeId(), osg::TransformChunkBase::getClassTypeId(), osg::TransformBase::getClassTypeId(), osg::TileCameraDecoratorBase::getClassTypeId(), osg::TextureTransformChunkBase::getClassTypeId(), osg::TextureGrabForegroundBase::getClassTypeId(), osg::TextureGrabBackgroundBase::getClassTypeId(), osg::TextureChunkBase::getClassTypeId(), osg::TextureBackgroundBase::getClassTypeId(), osg::TexGenChunkBase::getClassTypeId(), osg::SwitchMaterialBase::getClassTypeId(), osg::SwitchBase::getClassTypeId(), osg::SurfaceBase::getClassTypeId(), osg::StringAttributeMapBase::getClassTypeId(), osg::StereoCameraDecoratorBase::getClassTypeId(), osg::StereoBufferViewportBase::getClassTypeId(), osg::StencilChunkBase::getClassTypeId(), osg::StatisticsForegroundBase::getClassTypeId(), osg::StateSortingGroupBase::getClassTypeId(), osg::StateChunkBase::getClassTypeId(), osg::StateBase::getClassTypeId(), osg::SpotLightBase::getClassTypeId(), osg::SortFirstWindowBase::getClassTypeId(), osg::SolidBackgroundBase::getClassTypeId(), osg::SlicesBase::getClassTypeId(), osg::SkyBackgroundBase::getClassTypeId(), osg::SimpleTexturedMaterialBase::getClassTypeId(), osg::SimpleStatisticsForegroundBase::getClassTypeId(), osg::SimpleMaterialBase::getClassTypeId(), osg::SHLParameterChunkBase::getClassTypeId(), osg::SHLChunkBase::getClassTypeId(), osg::ShearedStereoCameraDecoratorBase::getClassTypeId(), osg::ShaderParameterVec4fBase::getClassTypeId(), osg::ShaderParameterVec3fBase::getClassTypeId(), osg::ShaderParameterVec2fBase::getClassTypeId(), osg::ShaderParameterStringBase::getClassTypeId(), osg::ShaderParameterRealBase::getClassTypeId(), osg::ShaderParameterMVec4fBase::getClassTypeId(), osg::ShaderParameterMVec3fBase::getClassTypeId(), osg::ShaderParameterMVec2fBase::getClassTypeId(), osg::ShaderParameterMRealBase::getClassTypeId(), osg::ShaderParameterMMatrixBase::getClassTypeId(), osg::ShaderParameterMIntBase::getClassTypeId(), osg::ShaderParameterMatrixBase::getClassTypeId(), osg::ShaderParameterIntBase::getClassTypeId(), osg::ShaderParameterChunkBase::getClassTypeId(), osg::ShaderParameterBoolBase::getClassTypeId(), osg::ShaderParameterBase::getClassTypeId(), osg::ShaderChunkBase::getClassTypeId(), osg::ScreenGroupBase::getClassTypeId(), osg::SClipPlaneChunkBase::getClassTypeId(), osg::ResolutionDisplayFilterBase::getClassTypeId(), osg::RenderOptionsBase::getClassTypeId(), osg::RegisterCombinersChunkBase::getClassTypeId(), osg::QTWindowBase::getClassTypeId(), osg::ProxyGroupBase::getClassTypeId(), osg::ProjectionCameraDecoratorBase::getClassTypeId(), osg::ProgramChunkBase::getClassTypeId(), osg::PolygonForegroundBase::getClassTypeId(), osg::PolygonChunkBase::getClassTypeId(), osg::PolygonBackgroundBase::getClassTypeId(), osg::PointLightBase::getClassTypeId(), osg::PointChunkBase::getClassTypeId(), osg::PhongMaterialBase::getClassTypeId(), osg::PerspectiveCameraBase::getClassTypeId(), osg::PassiveWindowBase::getClassTypeId(), osg::PassiveViewportBase::getClassTypeId(), osg::PassiveBackgroundBase::getClassTypeId(), osg::ParticlesBase::getClassTypeId(), osg::OrthographicCameraBase::getClassTypeId(), osg::OffCenterPerspectiveCameraBase::getClassTypeId(), osg::MultiPassMaterialBase::getClassTypeId(), osg::MultiDisplayWindowBase::getClassTypeId(), osg::MatrixCameraDecoratorBase::getClassTypeId(), osg::MatrixCameraBase::getClassTypeId(), osg::MaterialPoolBase::getClassTypeId(), osg::MaterialGroupBase::getClassTypeId(), osg::MaterialDrawableBase::getClassTypeId(), osg::MaterialChunkBase::getClassTypeId(), osg::MaterialBase::getClassTypeId(), osg::LogicOpChunkBase::getClassTypeId(), osg::LineChunkBase::getClassTypeId(), osg::LightModelChunkBase::getClassTypeId(), osg::LightEnvBase::getClassTypeId(), osg::LightChunkBase::getClassTypeId(), osg::LightBase::getClassTypeId(), osg::InverseTransformBase::getClassTypeId(), osg::InlineBase::getClassTypeId(), osg::ImageForegroundBase::getClassTypeId(), osg::ImageComposerBase::getClassTypeId(), osg::ImageBase::getClassTypeId(), osg::ImageBackgroundBase::getClassTypeId(), osg::GroupBase::getClassTypeId(), osg::GraphicStatisticsForegroundBase::getClassTypeId(), osg::GradientBackgroundBase::getClassTypeId(), osg::GrabForegroundBase::getClassTypeId(), osg::GLUTWindowBase::getClassTypeId(), osg::GeometryBase::getClassTypeId(), osg::FresnelMaterialBase::getClassTypeId(), osg::FragmentProgramChunkBase::getClassTypeId(), osg::ForegroundBase::getClassTypeId(), osg::FileGrabForegroundBase::getClassTypeId(), osg::FieldContainer::getClassTypeId(), osg::FCPtrAttributeMapBase::getClassTypeId(), osg::FBOViewportBase::getClassTypeId(), osg::FatBorderChunkBase::getClassTypeId(), osg::DVRVolumeTextureBase::getClassTypeId(), osg::DVRVolumeBase::getClassTypeId(), osg::DVRSimpleShaderBase::getClassTypeId(), osg::DVRSimpleLUTShaderBase::getClassTypeId(), osg::DVRShaderBase::getClassTypeId(), osg::DVRMtexLUTShaderBase::getClassTypeId(), osg::DVRLookupTableBase::getClassTypeId(), osg::DVRIsoSurfaceBase::getClassTypeId(), osg::DVRIsoShaderBase::getClassTypeId(), osg::DVRGeometryBase::getClassTypeId(), osg::DVRClipObjectsBase::getClassTypeId(), osg::DVRClipGeometryBase::getClassTypeId(), osg::DVRAppearanceBase::getClassTypeId(), osg::DrawableBase::getClassTypeId(), osg::DistortionDisplayFilterBase::getClassTypeId(), osg::DistanceLODBase::getClassTypeId(), osg::DisplayFilterForegroundBase::getClassTypeId(), osg::DisplayFilterBase::getClassTypeId(), osg::DisplayCalibrationBase::getClassTypeId(), osg::DirectionalLightBase::getClassTypeId(), osg::DepthClearBackgroundBase::getClassTypeId(), osg::DepthChunkBase::getClassTypeId(), osg::CubeTextureChunkBase::getClassTypeId(), osg::ComponentTransformBase::getClassTypeId(), osg::ColorMaskChunkBase::getClassTypeId(), osg::ColorDisplayFilterBase::getClassTypeId(), osg::ColorBufferViewportBase::getClassTypeId(), osg::ClusterWindowBase::getClassTypeId(), osg::ClipPlaneChunkBase::getClassTypeId(), osg::ClipPlaneBase::getClassTypeId(), osg::ChunkMaterialBase::getClassTypeId(), osg::CameraDecoratorBase::getClassTypeId(), osg::CameraBase::getClassTypeId(), osg::BlendChunkBase::getClassTypeId(), osg::BillboardBase::getClassTypeId(), osg::BackgroundBase::getClassTypeId(), osg::VRMLFile::getFieldType(), osg::SingleFunctorStore::getFunctor(), osg::MultiFunctorStore::getFunctor(), osg::FieldType::getScanTypeId(), osg::MPBase::getTypeId(), osg::FieldDescription::getTypeId(), osg::FieldContainer::getTypeId(), osg::FieldContainerFactory::initializePendingTypes(), osg::VRMLNodeDesc::prototypeAddField(), osg::SingleFunctorStore::regFunctor(), osg::MultiFunctorStore::regFunctor(), osg::RemoteAspect::registerChanged(), osg::RemoteAspect::registerCreated(), osg::RemoteAspect::registerDestroyed(), osg::RenderAction::registerEnterDefault(), osg::IntersectAction::registerEnterDefault(), osg::DrawAction::registerEnterDefault(), osg::Action::registerEnterDefault(), osg::Action::registerEnterFunction(), osg::RenderAction::registerLeaveDefault(), osg::IntersectAction::registerLeaveDefault(), osg::DrawAction::registerLeaveDefault(), osg::Action::registerLeaveDefault(), osg::Action::registerLeaveFunction(), osg::FieldContainerFactory::registerType(), osg::RemoteAspect::RemoteAspect(), osg::MultiFunctorStore::unregFunctor(), and osg::FieldContainerFactory::unregisterType().
00081 { 00082 return _uiTypeId; 00083 }
| const IDString & TypeBase::getName | ( | void | ) | const [inherited] |
Definition at line 86 of file OSGTypeBase.cpp.
References osg::TypeBase::_szName.
Referenced by osg::SharePtrGraphOp::compareFCs(), osg::deepClone(), osg::NodeCore::dump(), osg::Geometry::dump(), osg::Attachment::dump(), osg::VRMLFile::getFieldType(), osg::VRMLNodeDesc::prototypeAddField(), and osg::TypeFactory::registerType().
00087 { 00088 return _szName; 00089 }
| const Char8 * TypeBase::getCName | ( | void | ) | const [inherited] |
Definition at line 92 of file OSGTypeBase.cpp.
References osg::TypeBase::_szName, and osg::IDString::str().
Referenced by osg::SharePtrGraphOp::addAttachmentParent(), osg::StandardStringConversionState::beginField(), osg::SharePtrGraphOp::clearAttachmentParent(), osg::SharePtrGraphOp::compareFCs(), osg::QFieldLabelFactory::createLabel(), osg::deepClone(), osg::BINWriter::doIndexFC(), osg::VRMLNodeDesc::dump(), dump(), osg::FieldType::FieldType(), osg::FieldFactory::getFieldTypeName(), osg::getParentsField(), osg::FieldContainer::getTypeName(), initFields(), initialize(), osg::FieldContainerFactory::initializePendingTypes(), osg::SharePtrGraphOp::isEqual(), isEqual(), osg::isMFFieldContainerPtr(), osg::isSFFieldContainerPtr(), osg::OSGLoader::mapExtIntFieldType(), osg::RemoteAspect::receiveSync(), osg::TypeFactory::registerType(), osg::FieldContainerFactory::unregisterType(), osg::MultiDisplayWindow::updateViewport(), osg::OSGWriter::visitField(), osg::FieldContainerFactory::writeFCD(), osg::OSGWriter::writeField(), osg::FieldContainerFactory::writeSingleTypeFCD(), and osg::TypeFactory::writeTypeDot().
| const IDString & TypeBase::getParentName | ( | void | ) | const [inherited] |
Definition at line 98 of file OSGTypeBase.cpp.
References osg::TypeBase::_szParentName.
00099 { 00100 return _szParentName; 00101 }
| const Char8 * TypeBase::getCParentName | ( | void | ) | const [inherited] |
Definition at line 104 of file OSGTypeBase.cpp.
References osg::TypeBase::_szParentName, and osg::IDString::str().
Referenced by osg::TypeFactory::writeTypeDot().
00105 { 00106 return _szParentName.str(); 00107 }
| UInt32 TypeBase::getNameSpace | ( | void | ) | const [inherited] |
friend class FieldContainerFactory [friend] |
Definition at line 246 of file OSGFieldContainerTypeImpl.h.
UInt16 osg::FieldContainerType::_uiGroupId [protected] |
Definition at line 197 of file OSGFieldContainerTypeImpl.h.
Referenced by dump(), getGroupId(), and registerType().
bool osg::FieldContainerType::_bInitialized [protected] |
Definition at line 199 of file OSGFieldContainerTypeImpl.h.
Referenced by FieldContainerType(), initFields(), initialize(), initParentFields(), initPrototype(), isInitialized(), and terminate().
bool osg::FieldContainerType::_bDescsAddable [protected] |
Definition at line 200 of file OSGFieldContainerTypeImpl.h.
Referenced by addDescription(), and subDescription().
BaseType osg::FieldContainerType::_baseType [protected] |
Definition at line 202 of file OSGFieldContainerTypeImpl.h.
Referenced by initBaseType(), isAttachment(), isNode(), and isNodeCore().
FieldContainerType* osg::FieldContainerType::_pParent [protected] |
Reimplemented from osg::TypeBase.
Definition at line 204 of file OSGFieldContainerTypeImpl.h.
Referenced by dump(), getParent(), initParentFields(), and isDerivedFrom().
IDString osg::FieldContainerType::_szParentName [protected] |
Reimplemented from osg::TypeBase.
Definition at line 205 of file OSGFieldContainerTypeImpl.h.
Referenced by initParentFields().
IDString osg::FieldContainerType::_szGroupName [protected] |
Definition at line 206 of file OSGFieldContainerTypeImpl.h.
Definition at line 208 of file OSGFieldContainerTypeImpl.h.
Referenced by createAttachment(), createFieldContainer(), createNode(), createNodeCore(), dump(), FieldContainerType(), getPrototype(), initPrototype(), isAbstract(), setPrototype(), and terminate().
FieldDescription** osg::FieldContainerType::_pDesc [protected] |
Definition at line 211 of file OSGFieldContainerTypeImpl.h.
Referenced by initFields(), and terminate().
UInt32 osg::FieldContainerType::_uiDescByteCounter [protected] |
Definition at line 212 of file OSGFieldContainerTypeImpl.h.
Referenced by initFields(), and terminate().
DescMap osg::FieldContainerType::_mDescMap [protected] |
Definition at line 214 of file OSGFieldContainerTypeImpl.h.
Referenced by addDescription(), findFieldDescription(), initFields(), initParentFields(), and subDescription().
DescVec osg::FieldContainerType::_vDescVec [protected] |
Definition at line 215 of file OSGFieldContainerTypeImpl.h.
Referenced by addDescription(), dump(), getFieldDescription(), getNumFieldDescs(), initFields(), initialize(), initParentFields(), and subDescription().
bool osg::FieldContainerType::_bCopy [protected] |
UInt32 osg::TypeBase::_uiTypeId [protected, inherited] |
Definition at line 114 of file OSGTypeBase.h.
Referenced by osg::TypeBase::getId(), isDerivedFrom(), osg::TypeBase::operator==(), and osg::TypeBase::TypeBase().
UInt32 osg::TypeBase::_uiTypeRootId [protected, inherited] |
Definition at line 115 of file OSGTypeBase.h.
IDString osg::TypeBase::_szName [protected, inherited] |
Definition at line 119 of file OSGTypeBase.h.
Referenced by addDescription(), osg::TypeBase::getCName(), osg::TypeBase::getName(), initFields(), initialize(), and registerType().
1.5.5