#include <OSGFieldDescriptionBase.h>
Public Types | |
dcast | |
| typedef std::vector< std::string > | StringVector |
| typedef std::vector< const FieldContainerType * > | TypePtrVector |
| typedef std::vector< UInt16 > | TypeIdVector |
| typedef FieldContainerPtrConstArg | FCPtrConstArg |
Public Member Functions | |
Constructors | |
| FieldDescriptionBase (const FieldType &elementType, const Char8 *szName, const std::string fieldDocumentation, const UInt32 uiFieldId, const BitVector vFieldMask, const bool bInternal, const UInt32 uiFieldFlags, FieldEditMethod fEditMethod, FieldGetMethod fGetMethod, const Char8 *defaultValue=NULL) | |
| FieldDescriptionBase (const FieldType &elementType, const Char8 *szName, const std::string fieldDocumentation, const UInt32 uiFieldId, const BitVector vFieldMask, const bool bInternal, const UInt32 uiFieldFlags, FieldIndexEditMethod fIndexedEditMethod, FieldIndexGetMethod fIndexedGetMethod, const Char8 *defaultValue=NULL) | |
| FieldDescriptionBase (const FieldDescriptionBase &source) | |
Destructor | |
| virtual | ~FieldDescriptionBase (void) |
Helper | |
| const Char8 * | getCName (void) const |
| std::string | getName (void) const |
| std::string | getDocumentation (void) const |
| UInt32 | getTypeId (void) const |
| BitVector | getFieldMask (void) const |
| void | setFieldMask (ConstFieldMaskArg vFieldMask) |
| UInt32 | getFieldId (void) const |
| void | setFieldId (UInt32 uiFieldId) |
| const Char8 * | getDefaultValue (void) const |
| const FieldType & | getFieldType (void) const |
| bool | isInternal (void) const |
| UInt32 | getFlags (void) const |
| bool | isValid (void) const |
| bool | isSField (void) const |
| bool | isMField (void) const |
Get | |
| EditFieldHandlePtr | editField (ReflexiveContainer &oContainer) const |
| GetFieldHandlePtr | getField (const ReflexiveContainer &oContainer) const |
Set from Field | |
| virtual Field * | createField (void) const=0 |
| virtual void | destroyField (Field *pField) const =0 |
Container Access | |
| virtual FieldDescriptionBase * | clone (void) const=0 |
Container Access | |
| virtual GetFieldHandlePtr | createGetHandler (const Field *pField)=0 |
| virtual EditFieldHandlePtr | createEditHandler (Field *pField)=0 |
Protected Member Functions | |
Changed | |
| virtual void | beginEdit (Field *pField, UInt32 uiAspect, AspectOffsetStore &oOffsets)=0 |
| virtual bool | isShared (Field *pField)=0 |
Protected Attributes | |
Member | |
| std::string | _szName |
| std::string | _documentation |
| const FieldType & | _fieldType |
| UInt32 | _uiFieldId |
| BitVector | _vFieldMask |
| bool | _bInternal |
| UInt32 | _uiFieldFlags |
| FieldEditMethod | _fEditMethod |
| FieldGetMethod | _fGetMethod |
| FieldIndexGetMethod | _fIndexedGetMethod |
| FieldIndexEditMethod | _fIndexedEditMethod |
| IDString | _defaultValue |
Private Member Functions | |
| void | operator= (const FieldDescriptionBase &source) |
| prohibit default function (move to 'public' if needed) | |
Friends | |
| class | DynFieldAttachment |
Definition at line 115 of file OSGFieldDescriptionBase.h.
| typedef std::vector< std::string > OSG::FieldDescriptionBase::StringVector |
Definition at line 125 of file OSGFieldDescriptionBase.h.
| typedef std::vector<const FieldContainerType *> OSG::FieldDescriptionBase::TypePtrVector |
Definition at line 126 of file OSGFieldDescriptionBase.h.
| typedef std::vector< UInt16 > OSG::FieldDescriptionBase::TypeIdVector |
Definition at line 127 of file OSGFieldDescriptionBase.h.
| typedef FieldContainerPtrConstArg OSG::FieldDescriptionBase::FCPtrConstArg |
Definition at line 129 of file OSGFieldDescriptionBase.h.
| FieldDescriptionBase::FieldDescriptionBase | ( | const FieldType & | elementType, | |
| const Char8 * | szName, | |||
| const std::string | fieldDocumentation, | |||
| const UInt32 | uiFieldId, | |||
| const BitVector | vFieldMask, | |||
| const bool | bInternal, | |||
| const UInt32 | uiFieldFlags, | |||
| FieldEditMethod | fEditMethod, | |||
| FieldGetMethod | fGetMethod, | |||
| const Char8 * | defaultValue = NULL | |||
| ) |
Definition at line 57 of file OSGFieldDescriptionBase.cpp.
00067 : 00068 00069 _szName (szName ), 00070 _documentation (fieldDocumentation), 00071 00072 _fieldType (elementType ), 00073 _uiFieldId (uiFieldId ), 00074 _vFieldMask (vFieldMask ), 00075 00076 _bInternal (bInternal ), 00077 _uiFieldFlags (uiFieldFlags ), 00078 00079 _fEditMethod (fEditMethod ), 00080 _fGetMethod (fGetMethod ), 00081 _fIndexedEditMethod(NULL ), 00082 _fIndexedGetMethod (NULL ), 00083 _defaultValue (defaultValue ) 00084 { 00085 }
| OSG::FieldDescriptionBase::FieldDescriptionBase | ( | const FieldType & | elementType, | |
| const Char8 * | szName, | |||
| const std::string | fieldDocumentation, | |||
| const UInt32 | uiFieldId, | |||
| const BitVector | vFieldMask, | |||
| const bool | bInternal, | |||
| const UInt32 | uiFieldFlags, | |||
| FieldIndexEditMethod | fIndexedEditMethod, | |||
| FieldIndexGetMethod | fIndexedGetMethod, | |||
| const Char8 * | defaultValue = NULL | |||
| ) |
| FieldDescriptionBase::FieldDescriptionBase | ( | const FieldDescriptionBase & | source | ) |
Definition at line 118 of file OSGFieldDescriptionBase.cpp.
00118 : 00119 _szName (source._szName ), 00120 _documentation (source._documentation ), 00121 00122 _fieldType (source._fieldType ), 00123 _uiFieldId (source._uiFieldId ), 00124 _vFieldMask (source._vFieldMask ), 00125 00126 _bInternal (source._bInternal ), 00127 _uiFieldFlags (source._uiFieldFlags ), 00128 00129 _fEditMethod (source._fEditMethod ), 00130 _fGetMethod (source._fGetMethod ), 00131 _fIndexedEditMethod(source._fIndexedEditMethod), 00132 _fIndexedGetMethod (source._fIndexedGetMethod ), 00133 00134 _defaultValue (source._defaultValue ) 00135 00136 { 00137 }
| FieldDescriptionBase::~FieldDescriptionBase | ( | void | ) | [virtual] |
| const Char8 * OSG::FieldDescriptionBase::getCName | ( | void | ) | const [inline] |
Definition at line 45 of file OSGFieldDescriptionBase.inl.
References _szName.
Referenced by OSG::ReflexiveContainerType::addDescription(), OSG::ReflexiveContainerType::subDescription(), OSG::OSBTypedGeoVectorPropertyElement< GeoPropertyTypeT >::write(), and OSG::OSBTypedGeoIntegralPropertyElement< GeoPropertyTypeT >::write().
00046 { 00047 return _szName.c_str(); 00048 }
| std::string OSG::FieldDescriptionBase::getName | ( | void | ) | const [inline] |
Definition at line 51 of file OSGFieldDescriptionBase.inl.
References _szName.
Referenced by OSG::FieldHandle::getName().
00052 { 00053 return _szName; 00054 }
| std::string OSG::FieldDescriptionBase::getDocumentation | ( | void | ) | const [inline] |
Definition at line 57 of file OSGFieldDescriptionBase.inl.
References _documentation.
00058 { 00059 return _documentation; 00060 }
| UInt32 OSG::FieldDescriptionBase::getTypeId | ( | void | ) | const [inline] |
Definition at line 63 of file OSGFieldDescriptionBase.inl.
References _fieldType, and OSG::TypeBase::getId().
Referenced by OSG::ReflexiveContainerType::addDescription().
00064 { 00065 return _fieldType.getId(); 00066 }
| BitVector OSG::FieldDescriptionBase::getFieldMask | ( | void | ) | const [inline] |
Definition at line 69 of file OSGFieldDescriptionBase.inl.
References _vFieldMask.
Referenced by OSG::OSGLoader::beginField(), OSG::DynFieldAttachment< AttachmentDescT >::editDynamicField(), OSG::NFIOGeometry::readFC(), OSG::NFIOBase::readFCFields(), OSG::OSBCommonElement::readFieldContent(), OSG::OSBTypedGeoVectorPropertyElement< GeoPropertyTypeT >::write(), OSG::OSBTypedGeoIntegralPropertyElement< GeoPropertyTypeT >::write(), and OSG::OSBCommonElement::writeFieldContent().
00070 { 00071 return _vFieldMask; 00072 }
| void OSG::FieldDescriptionBase::setFieldMask | ( | ConstFieldMaskArg | vFieldMask | ) |
Referenced by OSG::DynFieldAttachment< AttachmentDescT >::addField().
| UInt32 OSG::FieldDescriptionBase::getFieldId | ( | void | ) | const [inline] |
Definition at line 81 of file OSGFieldDescriptionBase.inl.
References _uiFieldId.
Referenced by OSG::cloneAttachments(), OSG::deepClone(), OSG::deepCloneAttachments(), OSG::FieldDescriptionBasePLT::operator()(), OSG::OSBGeometryElement::postReadV100(), OSG::NFIOGeometry::readFC(), OSG::NFIOBase::readFCFields(), OSG::OSBCommonElement::readFieldContent(), OSG::OSBGeometryElement::readV100(), OSG::VRMLNodeHelper::setContainerFieldValue(), OSG::OSBTypedGeoVectorPropertyElement< GeoPropertyTypeT >::write(), and OSG::OSBTypedGeoIntegralPropertyElement< GeoPropertyTypeT >::write().
00082 { 00083 return _uiFieldId; 00084 }
| void OSG::FieldDescriptionBase::setFieldId | ( | UInt32 | uiFieldId | ) | [inline] |
Definition at line 87 of file OSGFieldDescriptionBase.inl.
References _uiFieldId.
Referenced by OSG::DynFieldAttachment< AttachmentDescT >::addField().
00088 { 00089 _uiFieldId = uiFieldId; 00090 }
| const Char8 * OSG::FieldDescriptionBase::getDefaultValue | ( | void | ) | const [inline] |
Definition at line 93 of file OSGFieldDescriptionBase.inl.
References _defaultValue, and OSG::IDString::str().
00094 { 00095 return _defaultValue.str(); 00096 }
| const FieldType & OSG::FieldDescriptionBase::getFieldType | ( | void | ) | const [inline] |
Definition at line 99 of file OSGFieldDescriptionBase.inl.
References _fieldType.
Referenced by OSG::VRMLFile::getFieldType(), OSG::OSGLoader::getFieldType(), OSG::OSGLoader::mapExtIntFieldType(), OSG::OSBCommonElement::readFieldContent(), OSG::MultiDisplayWindow::updateViewport(), OSG::OSBTypedGeoVectorPropertyElement< GeoPropertyTypeT >::write(), and OSG::OSBTypedGeoIntegralPropertyElement< GeoPropertyTypeT >::write().
00100 { 00101 return _fieldType; 00102 }
| bool OSG::FieldDescriptionBase::isInternal | ( | void | ) | const [inline] |
Definition at line 108 of file OSGFieldDescriptionBase.inl.
References _bInternal.
Referenced by OSG::FieldHandle::isInternal().
00109 { 00110 return _bInternal; 00111 }
| UInt32 OSG::FieldDescriptionBase::getFlags | ( | void | ) | const [inline] |
Definition at line 126 of file OSGFieldDescriptionBase.inl.
References _uiFieldFlags.
00127 { 00128 return _uiFieldFlags; 00129 }
| bool OSG::FieldDescriptionBase::isValid | ( | void | ) | const [inline] |
Definition at line 132 of file OSGFieldDescriptionBase.inl.
References _szName.
Referenced by OSG::ReflexiveContainerType::addDescription().
00133 { 00134 return (this != NULL && _szName.size()) ? true : false; 00135 }
| bool OSG::FieldDescriptionBase::isSField | ( | void | ) | const [inline] |
Definition at line 114 of file OSGFieldDescriptionBase.inl.
References _fieldType, OSG::FieldType::getCardinality(), and OSG::FieldType::SINGLE_FIELD.
00115 { 00116 return (_fieldType.getCardinality() == FieldType::SINGLE_FIELD); 00117 }
| bool OSG::FieldDescriptionBase::isMField | ( | void | ) | const [inline] |
Definition at line 120 of file OSGFieldDescriptionBase.inl.
References _fieldType, OSG::FieldType::getCardinality(), and OSG::FieldType::MULTI_FIELD.
00121 { 00122 return (_fieldType.getCardinality() == FieldType::MULTI_FIELD); 00123 }
| EditFieldHandlePtr OSG::FieldDescriptionBase::editField | ( | ReflexiveContainer & | oContainer | ) | const [inline] |
Definition at line 138 of file OSGFieldDescriptionBase.inl.
References _fEditMethod, _fIndexedEditMethod, and _uiFieldId.
Referenced by OSG::DynFieldAttachment< AttachmentDescT >::editDynamicFieldByName(), OSG::ReflexiveContainer::editField(), OSG::VRMLGeometryPartHelper::getFieldAndDesc(), and OSG::VRMLNodeHelper::getFieldAndDesc().
00140 { 00141 EditFieldHandlePtr pFieldHandle; 00142 00143 #ifdef FDESC_USE_BOOST 00144 if(_fEditMethod.empty() == false) 00145 { 00146 pField = _fEditMethod(&oContainer); 00147 } 00148 else if(_fIndexedEditMethod.empty() == false) 00149 { 00150 pField = _fIndexedEditMethod(&oContainer, _uiFieldId); 00151 } 00152 #else 00153 if(_fEditMethod != 0) 00154 { 00155 pFieldHandle = ( (&oContainer)->*_fEditMethod) (); 00156 } 00157 else if(_fIndexedEditMethod != 0) 00158 { 00159 pFieldHandle = ( (&oContainer)->*_fIndexedEditMethod)(_uiFieldId); 00160 } 00161 #endif 00162 00163 return pFieldHandle; 00164 }
| GetFieldHandlePtr OSG::FieldDescriptionBase::getField | ( | const ReflexiveContainer & | oContainer | ) | const [inline] |
Definition at line 167 of file OSGFieldDescriptionBase.inl.
References _fGetMethod, _fIndexedGetMethod, and _uiFieldId.
Referenced by OSG::DynFieldAttachment< AttachmentDescT >::getDynamicFieldByName(), and OSG::ReflexiveContainer::getField().
00169 { 00170 GetFieldHandlePtr pFieldHandle; 00171 00172 #ifdef FDESC_USE_BOOST 00173 if(_fGetMethod.empty() == false) 00174 { 00175 pField = _fGetMethod(&oContainer); 00176 } 00177 else if(_fIndexedGetMethod.empty() == false) 00178 { 00179 pField = _fIndexedGetMethod(&oContainer, _uiFieldId); 00180 } 00181 #else 00182 if(_fGetMethod != 0) 00183 { 00184 pFieldHandle = ( (&oContainer)->*_fGetMethod) (); 00185 } 00186 else if(_fIndexedGetMethod != 0) 00187 { 00188 pFieldHandle = ( (&oContainer)->*_fIndexedGetMethod)(_uiFieldId); 00189 } 00190 #endif 00191 00192 return pFieldHandle; 00193 }
| virtual Field* OSG::FieldDescriptionBase::createField | ( | void | ) | const [pure virtual] |
Referenced by OSG::DynFieldAttachment< AttachmentDescT >::addField().
| virtual void OSG::FieldDescriptionBase::destroyField | ( | Field * | pField | ) | const [pure virtual] |
Referenced by OSG::DynFieldAttachment< AttachmentDescT >::subField().
| virtual FieldDescriptionBase* OSG::FieldDescriptionBase::clone | ( | void | ) | const [pure virtual] |
Referenced by OSG::ReflexiveContainerType::addDescription().
| virtual GetFieldHandlePtr OSG::FieldDescriptionBase::createGetHandler | ( | const Field * | pField | ) | [pure virtual] |
| virtual EditFieldHandlePtr OSG::FieldDescriptionBase::createEditHandler | ( | Field * | pField | ) | [pure virtual] |
| virtual void OSG::FieldDescriptionBase::beginEdit | ( | Field * | pField, | |
| UInt32 | uiAspect, | |||
| AspectOffsetStore & | oOffsets | |||
| ) | [protected, pure virtual] |
| virtual bool OSG::FieldDescriptionBase::isShared | ( | Field * | pField | ) | [protected, pure virtual] |
| void OSG::FieldDescriptionBase::operator= | ( | const FieldDescriptionBase & | source | ) | [private] |
friend class DynFieldAttachment [friend] |
Definition at line 335 of file OSGFieldDescriptionBase.h.
std::string OSG::FieldDescriptionBase::_szName [protected] |
Definition at line 351 of file OSGFieldDescriptionBase.h.
Referenced by getCName(), getName(), and isValid().
std::string OSG::FieldDescriptionBase::_documentation [protected] |
const FieldType& OSG::FieldDescriptionBase::_fieldType [protected] |
Definition at line 354 of file OSGFieldDescriptionBase.h.
Referenced by getFieldType(), getTypeId(), isMField(), and isSField().
UInt32 OSG::FieldDescriptionBase::_uiFieldId [protected] |
Definition at line 356 of file OSGFieldDescriptionBase.h.
Referenced by editField(), getField(), getFieldId(), and setFieldId().
BitVector OSG::FieldDescriptionBase::_vFieldMask [protected] |
bool OSG::FieldDescriptionBase::_bInternal [protected] |
UInt32 OSG::FieldDescriptionBase::_uiFieldFlags [protected] |
FieldGetMethod OSG::FieldDescriptionBase::_fGetMethod [protected] |
IDString OSG::FieldDescriptionBase::_defaultValue [protected] |