40 #ifndef INCLUDED_GLS_METADATA_ATTRIBUTES_H
41 #define INCLUDED_GLS_METADATA_ATTRIBUTES_H
78 *_attribPtr = ( val != 0 );
85 outstr << *_attribPtr;
92 T ConvertToIntOrBool(
int value )
97 inline bool ConvertToIntOrBool(
int value )
103 T ReadValueAsIntOrBool( std::istream& instr )
108 if( strcasecmp( value.c_str(),
"TRUE" ) == 0 )
112 else if( strcasecmp( value.c_str(),
"FALSE" ) == 0 )
119 temp = ConvertToIntOrBool<T>( atoi( value.c_str() ) );
127 *_attribPtr = ReadValueAsIntOrBool<bool>( instr );
138 *_attribPtr = (int)val;
148 *_attribPtr = (short)val;
158 *_attribPtr = (
unsigned short)val;
168 *_attribPtr = (
unsigned char)val;
176 outstr << (int)*_attribPtr;
185 *_attribPtr =
static_cast<unsigned char>( ReadValueAsIntOrBool<int>( instr ) );
194 *_attribPtr = ReadValueAsIntOrBool<int>( instr );
203 *_attribPtr = ReadValueAsIntOrBool<unsigned int>( instr );
215 *_attribPtr = (float)val;
231 virtual GLS_EXPORT
long ValueInt();
232 virtual GLS_EXPORT
void ValueInt(
long val );
234 virtual GLS_EXPORT std::ostream& WriteValue( std::ostream& outstr );
235 virtual GLS_EXPORT std::istream& ReadValue( std::istream& instr );
247 virtual GLS_EXPORT ~DistiAttributeFloatArray();
249 virtual GLS_EXPORT
bool OkToWrite()
const;
251 virtual GLS_EXPORT std::ostream& WriteValue( std::ostream& outstr );
252 virtual GLS_EXPORT std::istream& ReadValue( std::istream& instr );
264 virtual GLS_EXPORT ~DistiAttributeDoubleArray();
266 virtual GLS_EXPORT
bool OkToWrite()
const;
268 virtual GLS_EXPORT std::ostream& WriteValue( std::ostream& outstr );
269 virtual GLS_EXPORT std::istream& ReadValue( std::istream& instr );
281 template<
class containerClass>
285 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
288 using BaseClass::_pairList;
290 typedef void ( containerClass::*SetMethodType )(
const int );
291 typedef int ( containerClass::*GetMethodType )();
296 _pairList = &TextureModeEnumList;
311 template<
class containerClass>
315 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
318 using BaseClass::_pairList;
320 typedef void ( containerClass::*SetMethodType )(
const int );
321 typedef int ( containerClass::*GetMethodType )();
326 _pairList = &TextureFilterEnumList;
340 template<
class containerClass>
344 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
347 using BaseClass::_pairList;
349 typedef void ( containerClass::*SetMethodType )(
const int );
350 typedef int ( containerClass::*GetMethodType )();
355 _pairList = &PolyModeEnumList;
366 template<
class containerClass>
370 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
373 using BaseClass::_pairList;
375 typedef void ( containerClass::*SetMethodType )( int );
376 typedef int ( containerClass::*GetMethodType )();
381 _pairList = &PolyEndEnumList;
392 template<
class containerClass>
396 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
399 using BaseClass::_pairList;
401 typedef void ( containerClass::*SetMethodType )(
const int );
402 typedef int ( containerClass::*GetMethodType )();
407 _pairList = &ShadingEnumList;
412 template<
class containerClass>
416 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
419 using BaseClass::_pairList;
421 typedef void ( containerClass::*SetMethodType )(
const int );
422 typedef int ( containerClass::*GetMethodType )();
436 _pairList = &ColorMaterialModeEnum;
439 virtual GLS_EXPORT
bool OkToWrite()
const {
return false; }
443 template<
class containerClass>
447 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
450 using BaseClass::_pairList;
452 typedef void ( containerClass::*SetMethodType )(
const int );
453 typedef int ( containerClass::*GetMethodType )();
463 _pairList = &ProtectionEnumList;
476 template<
class containerClass>
480 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
483 using BaseClass::_pairList;
485 typedef void ( containerClass::*SetMethodType )(
const int );
486 typedef int ( containerClass::*GetMethodType )();
491 _pairList = &AlphaModeEnumList;
511 virtual GLS_EXPORT ~DistiAttributeString();
514 GLS_EXPORT
char* LocalStorageString();
515 virtual GLS_EXPORT
bool OkToWrite()
const;
517 virtual GLS_EXPORT std::ostream& WriteValue( std::ostream& outstr );
518 virtual GLS_EXPORT std::istream& ReadValue( std::istream& instr );
534 virtual GLS_EXPORT std::string ValueString();
535 virtual GLS_EXPORT
void ValueString(
const std::string& s );
537 virtual GLS_EXPORT std::ostream& WriteValue( std::ostream& outstr );
538 virtual GLS_EXPORT std::istream& ReadValue( std::istream& instr );
552 GLS_EXPORT
bool OkToWrite()
const DISTI_METHOD_OVERRIDE;
556 GLS_EXPORT std::string ValueString() DISTI_METHOD_OVERRIDE;
557 GLS_EXPORT
void ValueString(
const std::string& s ) DISTI_METHOD_OVERRIDE;
559 GLS_EXPORT std::ostream& WriteValue( std::ostream& outstr ) DISTI_METHOD_OVERRIDE;
560 GLS_EXPORT std::istream& ReadValue( std::istream& instr ) DISTI_METHOD_OVERRIDE;
570 virtual GLS_EXPORT ~DistiAttributeFixedString();
572 virtual GLS_EXPORT std::ostream& WriteValue( std::ostream& outstr );
573 virtual GLS_EXPORT std::istream& ReadValue( std::istream& instr );
579 std::string _localStorageString;
587 virtual GLS_EXPORT ~DistiAttributeStdString();
590 GLS_EXPORT std::string* LocalStorageString();
592 virtual GLS_EXPORT
bool OkToWrite()
const;
594 virtual GLS_EXPORT std::ostream& WriteValue( std::ostream& outstr );
595 virtual GLS_EXPORT std::istream& ReadValue( std::istream& instr );
603 virtual GLS_EXPORT ~DistiAttributeLocation();
605 virtual GLS_EXPORT std::ostream& WriteValue( std::ostream& outstr );
606 virtual GLS_EXPORT std::istream& ReadValue( std::istream& instr );
618 virtual GLS_EXPORT
bool OkToWrite()
const;
621 virtual GLS_EXPORT std::ostream& WriteValue( std::ostream& outstr );
622 virtual GLS_EXPORT std::istream& ReadValue( std::istream& instr );
636 virtual GLS_EXPORT
bool OkToWrite()
const;
639 virtual GLS_EXPORT std::ostream& WriteValue( std::ostream& outstr );
640 virtual GLS_EXPORT std::istream& ReadValue( std::istream& instr );
648 template<
class Map_t>
658 , _attribPtr( attribPtr )
664 , _attribPtr(
new Map_t() )
677 return _attribPtr != 0 && _attribPtr->size();
680 static std::string GetEmptyValue() {
return "$$DISTI_EMPTY$$"; }
685 << DistiAttribDict::SpacingString() <<
"{\n";
686 DistiAttribDict::SpacingInc();
690 typename Map_t::iterator i;
691 for( i = _attribPtr->begin(); i != _attribPtr->end(); ++i )
693 std::ostringstream str;
695 const std::string second = str.str();
697 outstr << DistiAttribDict::SpacingString() << i->first <<
" "
698 << ( second.empty() ? GetEmptyValue() : second ) <<
'\n';
702 DistiAttribDict::SpacingDec();
703 outstr << DistiAttribDict::SpacingString() <<
"}\n";
710 instr.ignore( INT_MAX,
'{' );
714 std::stringstream fontStream;
715 instr.get( *fontStream.rdbuf(),
'}' );
719 while( fontStream.good() )
723 std::stringstream::char_type c;
731 }
while( fontStream.good() && isspace( c ) );
733 if( fontStream.good() )
735 fontStream.putback( c );
737 #if _WIN32 && _MSC_VER < 1300 // if _MSC_VER < vc70
739 Map_t::referent_type value;
741 typename Map_t::key_type key;
742 typename Map_t::mapped_type value;
746 std::getline( fontStream >> std::ws, strVal );
748 if( strVal != GetEmptyValue() )
750 std::istringstream str( strVal );
754 ( *_attribPtr )[ key ] = value;
772 unsigned int* _numVertices;
773 unsigned int _numElements;
775 bool _compatabilityMode;
778 void SetCompatabilityMode(
bool mode ) { _compatabilityMode = mode; }
782 , _attribPtr( attribPtr )
783 , _numVertices( numVertices )
785 , _fixedArray(
false )
787 _compatabilityMode =
true;
792 , _attribPtr(
new Tptr( attribPtr ) )
793 , _numVertices( NULL )
794 , _numElements( numElements )
795 , _fixedArray(
true )
797 _compatabilityMode =
true;
802 if( ( _fixedArray || _localStorage ) && _attribPtr )
809 return ( *_attribPtr != NULL );
814 if( *_attribPtr != NULL )
816 unsigned int numVerts = _numElements;
819 outstr << *_numVertices;
820 numVerts = *_numVertices;
822 DistiAttribDict::SpacingInc();
823 for(
unsigned int i = 0; i < numVerts; i++ )
826 outstr << ( *_attribPtr )[ i ];
828 DistiAttribDict::SpacingDec();
834 unsigned int numVerts = _numElements;
839 *_numVertices = numVerts;
842 if( *_attribPtr != NULL )
843 delete[] * _attribPtr;
847 *_attribPtr =
new T[ numVerts ];
852 if( !_compatabilityMode )
856 instr.getline( buf, 1024 );
859 for(
unsigned int i = 0; i < numVerts; i++ )
861 if( !_compatabilityMode )
864 instr.getline( buf, 1024 );
868 std::sscanf( buf,
"%f %f %f",
869 &( ( *_attribPtr )[ i ].x ),
870 &( ( *_attribPtr )[ i ].y ),
871 &( ( *_attribPtr )[ i ].z ) );
873 assert( 3 == count );
878 instr >> ( *_attribPtr )[ i ];
893 if( !( _name == r->
_name ) || _numElements != r->_numElements )
896 for(
unsigned int i = 0u; i < _numElements; ++i )
898 T leftVert = ( *_attribPtr )[ i ];
899 T rightVert = ( *r->_attribPtr )[ i ];
917 unsigned int* _numVertices;
918 unsigned int _numElements;
920 bool _compatabilityMode;
923 void SetCompatabilityMode(
bool mode ) { _compatabilityMode = mode; }
927 , _attribPtr( attribPtr )
928 , _numVertices( numVertices )
930 , _fixedArray(
false )
932 _compatabilityMode =
true;
937 , _attribPtr(
new Tptr( attribPtr ) )
938 , _numVertices( NULL )
939 , _numElements( numElements )
940 , _fixedArray(
true )
942 _compatabilityMode =
true;
947 if( ( _fixedArray || _localStorage ) && _attribPtr )
954 return ( *_attribPtr != NULL );
959 if( *_attribPtr != NULL )
961 unsigned int numVerts = _numElements;
964 outstr << *_numVertices;
965 numVerts = *_numVertices;
967 DistiAttribDict::SpacingInc();
968 for(
unsigned int i = 0; i < numVerts; i++ )
971 outstr << ( *_attribPtr )[ i ];
973 DistiAttribDict::SpacingDec();
979 unsigned int numVerts = _numElements;
984 *_numVertices = numVerts;
987 if( *_attribPtr != NULL )
988 delete[] * _attribPtr;
991 *_attribPtr =
new Vertex[ numVerts ];
994 if( !_compatabilityMode )
998 instr.getline( buf, 1024 );
1001 for(
unsigned int i = 0; i < numVerts; i++ )
1003 if( !_compatabilityMode )
1006 instr.getline( buf, 1024 );
1011 std::sscanf( buf,
"%f %f %f %d %d %d %d",
1012 &( ( *_attribPtr )[ i ].x ),
1013 &( ( *_attribPtr )[ i ].y ),
1014 &( ( *_attribPtr )[ i ].z ),
1017 assert( 7 == count );
1020 ( *_attribPtr )[ i ].color.RGBA( (
unsigned char)r, (
unsigned char)g, (
unsigned char)b, (
unsigned char)a );
1024 instr >> ( *_attribPtr )[ i ];
1039 if( !( _name == r->
_name ) || _numElements != r->_numElements )
1042 for(
unsigned int i = 0u; i < _numElements; ++i )
1044 Vertex leftVert = ( *_attribPtr )[ i ];
1045 Vertex rightVert = ( *r->_attribPtr )[ i ];
1070 unsigned int numVerts = _numElements;
1072 for(
unsigned int i = 0; i < numVerts; i++ )
1075 outstr << ( *_attribPtr )[ i ];
1082 unsigned int numVerts = _numElements;
1084 for(
unsigned int i = 0; i < numVerts; i++ )
1092 std::getline( instr, line );
1094 if( i == 0 && line.length() == 0 )
1095 std::getline( instr, line );
1097 std::stringstream strm( line );
1098 strm >> ( *_attribPtr )[ i ];
1134 , _originalAttribName( originalName )
1135 , _dictionary( dict )
1140 virtual DISTI_EXPORT
bool OkToWrite()
const DISTI_METHOD_OVERRIDE;
1143 virtual DISTI_EXPORT
bool ValueChanged() DISTI_METHOD_OVERRIDE;
1146 virtual DISTI_EXPORT
void ResetValueChanged() DISTI_METHOD_OVERRIDE;
1149 virtual DISTI_EXPORT std::string ValueString() DISTI_METHOD_OVERRIDE;
1152 virtual DISTI_EXPORT
void ValueString(
const std::string& s ) DISTI_METHOD_OVERRIDE;
1155 virtual DISTI_EXPORT
long ValueInt() DISTI_METHOD_OVERRIDE;
1158 virtual DISTI_EXPORT
void ValueInt(
long val ) DISTI_METHOD_OVERRIDE;
1161 virtual DISTI_EXPORT
double ValueFloat() DISTI_METHOD_OVERRIDE;
1164 virtual DISTI_EXPORT
void ValueFloat(
double val ) DISTI_METHOD_OVERRIDE;
1167 virtual DISTI_EXPORT std::ostream& WriteValue( std::ostream& outstr ) DISTI_METHOD_OVERRIDE;
1170 virtual DISTI_EXPORT std::istream& ReadValue( std::istream& instr ) DISTI_METHOD_OVERRIDE;
1178 virtual DISTI_EXPORT
void UnregisterObserver(
CallbackID id ) DISTI_METHOD_OVERRIDE;
1180 virtual DISTI_EXPORT
void NotifyObservers() DISTI_METHOD_OVERRIDE;
1191 template<
class T,
bool showIndex >
1199 , _attribPtr( attribPtr )
1206 , _attribPtr(
new T() )
1219 return ( _attribPtr != NULL && _attribPtr->Capacity() );
1222 std::ostream&
WriteValue( std::ostream& outstr ) DISTI_METHOD_OVERRIDE
1224 if( _attribPtr != NULL )
1226 unsigned numEntries = _attribPtr->Count();
1227 outstr << numEntries;
1229 DistiAttribDict::SpacingInc();
1231 for(
unsigned i = 0; i < numEntries; i++ )
1237 outstr << DistiAttribDict::SpacingString() << i <<
" ";
1240 outstr << DistiAttribDict::SpacingString() << ( *_attribPtr )[ i ] <<
" ";
1242 DistiAttribDict::SpacingDec();
1247 std::istream&
ReadValue( std::istream& instr ) DISTI_METHOD_OVERRIDE
1249 unsigned numEntries = 0;
1250 instr >> numEntries;
1252 _attribPtr->Count( numEntries );
1253 for(
unsigned i = 0; i < numEntries; i++ )
1261 instr >> ( *_attribPtr )[ entry ];
1272 template<
class T,
bool showIndex >
1283 , _attribPtr( attribPtr )
1290 , _attribPtr(
new T() )
1305 return ( _attribPtr != NULL && _attribPtr->size() );
1310 if( _attribPtr != NULL )
1312 const std::size_t numEntries = _attribPtr->size();
1313 outstr << numEntries;
1315 DistiAttribDict::SpacingInc();
1317 for( std::size_t i = 0; i < numEntries; i++ )
1323 outstr << DistiAttribDict::SpacingString() << i <<
" ";
1326 outstr << DistiAttribDict::SpacingString() << ( *_attribPtr )[ i ] <<
" ";
1328 DistiAttribDict::SpacingDec();
1335 if( _attribPtr != NULL )
1338 instr >> numEntries;
1340 _attribPtr->resize( numEntries );
1342 for(
int i = 0; i < numEntries; i++ )
1349 instr >> ( *_attribPtr )[ entry ];
1366 typedef T* ( *CreateItemCb )();
1370 CreateItemCb _createCb;
1377 , _createCb( createCb )
1387 << DistiAttribDict::SpacingString() <<
"{\n";
1388 DistiAttribDict::SpacingInc();
1389 for(
unsigned int i = 0; i < _array->
Count(); i++ )
1391 if( ( *_array )[ i ] )
1393 outstr << DistiAttribDict::SpacingString();
1395 ( ( *_array )[ i ] )->WriteValue( outstr );
1399 DistiAttribDict::SpacingDec();
1400 outstr << DistiAttribDict::SpacingString() <<
"}\n";
1408 while( DistiAttribDict::ScanToken( instr, buf ) )
1418 if( T*
const createdItem = dynamic_cast<T*>( _createCb() ) )
1421 _array->
Back()->ReadValue( instr );
1440 template<
class containerT,
class T,
class SetArgT = const T&,
class GetReturnT = T>
1444 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
1447 typedef void ( containerT::*SetMethodType )( SetArgT );
1448 typedef GetReturnT ( containerT::*GetMethodType )();
1449 typedef GetReturnT ( containerT::*GetMethodConstType )()
const;
1453 containerT* _container;
1454 SetMethodType _setMethod;
1455 GetMethodType _getMethod;
1459 : BaseClass( NULL, name, attribPtr )
1461 , _container( frame )
1462 , _setMethod( setMethod )
1463 , _getMethod( getMethod )
1466 if(
typeid( T ) ==
typeid(
float ) ||
typeid( T ) ==
typeid(
double ) ||
typeid( T ) ==
typeid(
long double ) )
1474 return ( this->_attribPtr || _getMethod );
1479 virtual std::string
ValueString() DISTI_METHOD_OVERRIDE {
return DistiAttributeBase::ValueString(); }
1480 virtual void ValueString(
const std::string& s ) DISTI_METHOD_OVERRIDE { DistiAttributeBase::ValueString( s ); }
1482 virtual long ValueInt() DISTI_METHOD_OVERRIDE {
return DistiAttributeBase::ValueInt(); }
1483 virtual void ValueInt(
long val ) DISTI_METHOD_OVERRIDE { DistiAttributeBase::ValueInt( val ); }
1485 virtual double ValueFloat() DISTI_METHOD_OVERRIDE {
return DistiAttributeBase::ValueFloat(); }
1486 virtual void ValueFloat(
double val ) DISTI_METHOD_OVERRIDE { DistiAttributeBase::ValueFloat( val ); }
1488 virtual std::ostream&
WriteValue( std::ostream& outstr ) DISTI_METHOD_OVERRIDE
1490 if( _precision > 0 )
1491 outstr.precision(
int( _precision ) );
1493 if( _getMethod && _container )
1496 T* tempAttribPtr = this->_attribPtr;
1499 T temp( ( _container->*_getMethod )() );
1502 this->_attribPtr = &temp;
1505 BaseClass::WriteValue( outstr );
1508 this->_attribPtr = tempAttribPtr;
1510 else if( this->_attribPtr )
1512 BaseClass::WriteValue( outstr );
1518 virtual std::istream&
ReadValue( std::istream& instr ) DISTI_METHOD_OVERRIDE
1520 if( _setMethod && _container )
1523 T* tempAttribPtr = this->_attribPtr;
1527 this->_attribPtr = &temp;
1530 BaseClass::ReadValue( instr );
1533 ( _container->*_setMethod )( temp );
1535 this->_attribPtr = tempAttribPtr;
1537 else if( this->_attribPtr )
1539 BaseClass::ReadValue( instr );
1547 if( _getMethod && _container )
1550 return ( _container->*_getMethod )();
1552 else if( this->_attribPtr )
1554 return BaseClass::Value();
1562 virtual void Value(
const T& val ) DISTI_METHOD_OVERRIDE
1564 if( _setMethod && _container )
1566 ( _container->*_setMethod )( val );
1568 else if( this->_attribPtr )
1570 BaseClass::Value( val );
1587 template<
typename Type,
class Class>
1598 template<
typename Type,
class Class>
1610 template<
typename Type,
class Class>
1621 template<
typename Type,
class Class>
1631 template<
typename Type,
class Class>
1642 template<
typename Type,
class Class>
1654 template<
typename GetReturnT,
typename SetArgT,
class Class>
1665 template<
class Class>
1702 template<
class enumType>
1706 enumType* _attribPtr;
1713 , _attribPtr( attribPtr )
1714 , _pairList( pairList )
1719 , _attribPtr(
new enumType( value ) )
1720 , _pairList( pairList )
1726 if( _localStorage && _attribPtr )
1732 virtual void ValueInt(
long val ) { *_attribPtr = (enumType)val; };
1739 *_attribPtr = ( enumType ) * ( ptr->_attribPtr );
1744 return DistiAttributeBase::operator=( oldClass );
1750 bool foundIt =
false;
1752 typename DistiAttributeEnumDefList::iterator item = _pairList->begin();
1753 while( item != _pairList->end() )
1755 if( ( *item )->_enum == *_attribPtr )
1757 outstr << ( *item )->_string;
1766 outstr << (int)*_attribPtr;
1778 bool foundIt =
false;
1779 typename DistiAttributeEnumDefList::iterator item = _pairList->begin();
1782 while( item != _pairList->end() )
1784 if( strcmp( ( *item )->_string, value ) == 0 )
1786 *_attribPtr = ( enumType )( *item )->_enum;
1798 *_attribPtr = (enumType)atoi( value );
1825 #define DISTI_REGISTER_METHOD_CALLBACK( instance, Class, Method ) \
1827 typedef CallbackMethodCallerTemplate<Class, Class> Caller; \
1828 typedef typename Caller::MethodType1 MethodType; \
1829 const MethodType callback = reinterpret_cast<MethodType>( Method ); \
1830 ThisClass::CallbackCaller( new Caller( callback, instance ) ); \
1840 #define DISTI_SET_OBJECT_CALLBACK1( object, method, parent ) \
1841 ( object )->CallbackCaller( \
1842 new CallbackMethodCallerTemplate<DisplayObject, DisplayObject>( \
1843 ( disti::CallbackMethodCallerTemplate<DisplayObject, DisplayObject>::MethodType1 )( method ), ( parent ) ) );
1854 #define DISTI_ADD_ATTRIBUTE( Type, name, memberVarAddr ) \
1856 static const AttributeName attr( name ); \
1857 CallbackAttributeNotifier<ThisClass> cb( this, attr ); \
1858 this->Attributes().Add( new DistiAttribute<Type>( &cb, ( attr ), ( memberVarAddr ) ) ); \
1873 #define DISTI_ADD_ATTRIBUTE_CALLBACK( Type, name, memberVarAddr, callbackFunction ) \
1875 typedef void ( ThisClass::*Method )(); \
1876 static const AttributeName attr( name ); \
1877 CallbackAttributeNotifier<ThisClass> cb( this, attr, reinterpret_cast<Method>( callbackFunction ) ); \
1878 this->Attributes().Add( new DistiAttribute<Type>( &cb, ( attr ), ( memberVarAddr ) ) ); \
1891 #define DISTI_ADD_ATTRIBUTE_SET_GET( Type, name, setter, getter ) \
1893 static const AttributeName attr( name ); \
1894 this->Attributes().Add( CreateDistiAttributeProperty<Type>( attr, this, setter, getter ) ); \
1904 #define DISTI_ADD_ATTRIBUTE_STRING( name, memberVarAddr ) \
1906 static const AttributeName attr( name ); \
1907 CallbackAttributeNotifier<ThisClass> cb( this, attr ); \
1908 this->Attributes().Add( new DistiAttributeEncodedStdString( &cb, attr, memberVarAddr ) ); \
1920 #define DISTI_ADD_ATTRIBUTE_STRING_CALLBACK( name, memberVarAddr, callbackFunction ) \
1922 typedef void ( ThisClass::*Method )(); \
1923 static const AttributeName attr( name ); \
1924 CallbackAttributeNotifier<ThisClass> cb( this, attr, reinterpret_cast<Method>( callbackFunction ) ); \
1925 this->Attributes().Add( new DistiAttributeEncodedStdString( &cb, attr, memberVarAddr ) ); \
1935 #define DISTI_ADD_ATTRIBUTE_ALIAS( aliasName, origName, obj ) \
1937 static const AttributeName aliasAttr( aliasName ); \
1938 static const AttributeName origAttr( origName ); \
1939 DistiAttribDict& attributes = ( obj )->Attributes(); \
1940 this->Attributes().Add( new DistiAttributeAlias( NULL, aliasAttr, origAttr, &attributes ) ); \
Definition: display_types.h:75
Definition: gls_metadata_attributes.h:240
Definition: gls_metadata_attributes.h:599
Definition: gls_metadata_attributes.h:257
Definition: display_types.h:100
virtual void ValueString(const std::string &s) override
Definition: gls_metadata_attributes.h:1480
virtual std::ostream & WriteValue(std::ostream &outstr)
Definition: gls_metadata_attributes.h:1384
Definition: display_types.h:73
Definition: gls_metadata_attributes.h:1679
std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:1222
virtual std::ostream & WriteValue(std::ostream &outstr)
Definition: gls_metadata_attributes.h:812
virtual std::ostream & WriteValue(std::ostream &outstr)
Definition: gls_metadata_attributes.h:1068
The disti::Material class.
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:436
Definition: gls_metadata_attributes.h:577
virtual std::istream & ReadValue(std::istream &instr)
Definition: gls_metadata_attributes.h:832
Definition: gls_metadata_attributes.h:282
virtual std::ostream & WriteValue(std::ostream &outstr)
Definition: gls_metadata_attributes.h:957
unsigned Count() const
Definition: dynamic_array.h:204
virtual std::istream & ReadValue(std::istream &instr)
Definition: gls_metadata_attributes.h:1080
The disti::DynamicArray class. A templated array of objects capable of dynamically growing...
Definition: gls_metadata_attributes.h:1273
Definition: gls_metadata_attributes.h:223
Definition: gls_metadata_attributes.h:477
Definition: gls_metadata_attributes.h:393
std::istream & ReadValue(std::istream &instr) override
Definition: disti_metadata.h:585
Definition: display_types.h:153
Definition: gls_metadata_attributes.h:524
Definition: gls_metadata_attributes.h:649
virtual long ValueInt()
Definition: gls_metadata_attributes.h:1731
Definition: display_types.h:151
Definition: display_types.h:91
virtual bool OkToWrite() const
Definition: gls_metadata_attributes.h:675
virtual double ValueFloat() override
Definition: gls_metadata_attributes.h:1485
Definition: display_types.h:103
virtual void ValueFloat(double val) override
Definition: gls_metadata_attributes.h:1486
Definition: gls_metadata_attributes.h:1703
Definition: display_types.h:92
virtual bool operator==(const DistiAttributeBase &rArg)
Definition: gls_metadata_attributes.h:1031
std::ostream & WriteValue(std::ostream &outstr) override
Definition: disti_metadata.h:571
Definition: gls_metadata_attributes.h:1059
virtual std::ostream & WriteValue(std::ostream &outstr)
Definition: gls_metadata_attributes.h:682
virtual std::istream & ReadValue(std::istream &instr)
Definition: gls_metadata_attributes.h:1333
Definition: display_types.h:102
Definition: display_types.h:110
A file for all GL Studio files to include.
virtual std::string ValueString() override
Definition: gls_metadata_attributes.h:1479
Definition: display_types.h:63
Definition: display_types.h:116
The disti::DisplayObject class and global enumerations.
Definition: gls_metadata_attributes.h:912
unsigned int CallbackID
Type for unique identifiers.
Definition: disti_metadata.h:342
Definition: display_types.h:90
Definition: gls_metadata_attributes.h:1192
Definition: gls_metadata_attributes.h:1363
virtual std::istream & ReadValue(std::istream &instr)
Definition: gls_metadata_attributes.h:1403
Definition: gls_metadata_attributes.h:312
virtual bool OkToWrite() const
Definition: gls_metadata_attributes.h:439
Definition: gls_metadata_attributes.h:1129
Definition: display_types.h:101
Definition: disti_metadata.h:891
bool OkToWrite() const override
Definition: gls_metadata_attributes.h:1217
Definition: display_types.h:123
virtual void ValueInt(long val)
Definition: gls_metadata_attributes.h:1732
The List_c class. Generic linked list.
virtual std::ostream & WriteValue(std::ostream &outstr)
Definition: gls_metadata_attributes.h:1688
bool operator==(const AttributeName &attr1, const AttributeName &attr2)
Definition: disti_metadata.h:141
virtual void Value(const T &val) override
Definition: gls_metadata_attributes.h:1562
Definition: display_types.h:152
Definition: display_types.h:64
Definition: display_types.h:62
Definition: gls_metadata_attributes.h:1110
Definition: disti_metadata.h:488
The disti::Vertex class. A class for manipulating 3D vertices.
Generally useful defines, macros, enumerations and function prototypes.
Definition: gls_metadata_attributes.h:1441
Definition: gls_metadata_attributes.h:444
virtual std::ostream & WriteValue(std::ostream &outstr)
Definition: gls_metadata_attributes.h:1748
Definition: disti_metadata.h:183
virtual std::istream & ReadValue(std::istream &instr)
Definition: gls_metadata_attributes.h:977
Definition: disti_metadata.h:166
Definition: display_types.h:61
Definition: gls_metadata_attributes.h:497
virtual long ValueInt() override
Definition: gls_metadata_attributes.h:1482
Definition: disti_metadata.h:665
DistiAttributeProperty< Class, GetReturnT, SetArgT > * CreateDistiAttributeProperty(const AttributeName &attrName, Class *const obj, const typename DistiAttributeProperty< Class, GetReturnT, SetArgT >::SetMethodType setMethod, const typename DistiAttributeProperty< Class, GetReturnT, SetArgT >::GetMethodType getMethod)
Definition: gls_metadata_attributes.h:1655
Definition: disti_metadata.h:879
Definition: callback_caller_base.h:55
DistiAttributeProperty< Class, Vector, const Vertex &, const Vertex & > * CreateDistiAttributePropertyVertexToVector(const AttributeName &attrName, Class *const obj, const typename DistiAttributeProperty< Class, Vector, const Vertex &, const Vertex & >::SetMethodType setMethod, const typename DistiAttributeProperty< Class, Vector, const Vertex &, const Vertex & >::GetMethodConstType getMethod)
Definition: gls_metadata_attributes.h:1666
std::istream & ReadValue(std::istream &instr) override
Definition: gls_metadata_attributes.h:1247
virtual bool OkToWrite() const
Definition: gls_metadata_attributes.h:1382
T & Back()
Definition: dynamic_array.h:342
virtual std::istream & ReadValue(std::istream &instr)
Definition: gls_metadata_attributes.h:1693
Definition: display_types.h:94
bool Equal(T1 x, T2 y, float precision=0.001f)
Definition: util.h:246
Definition: display_types.h:71
Definition: display_types.h:150
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:1488
Definition: gls_metadata_attributes.h:610
AttributeName _name
Definition: disti_metadata.h:190
void Add(DistiAttributeBase *attr)
virtual bool OkToWrite() const
Definition: gls_metadata_attributes.h:952
Definition: display_types.h:117
virtual void ValueInt(long val) override
Definition: gls_metadata_attributes.h:1483
virtual std::istream & ReadValue(std::istream &instr)
Definition: gls_metadata_attributes.h:708
virtual std::ostream & WriteValue(std::ostream &outstr)
Definition: gls_metadata_attributes.h:1308
Definition: display_types.h:93
Definition: gls_metadata_attributes.h:563
Definition: gls_metadata_attributes.h:767
Definition: display_types.h:74
virtual DistiAttributeBase & operator=(const DistiAttributeBase &oldClass)
Definition: gls_metadata_attributes.h:1734
Definition: display_types.h:70
unsigned PushBack(const T &object)
Definition: dynamic_array.h:325
Definition: display_types.h:72
virtual bool OkToWrite() const
Definition: gls_metadata_attributes.h:1122
virtual std::istream & ReadValue(std::istream &instr)
Definition: gls_metadata_attributes.h:1772
Definition: gls_metadata_attributes.h:626
Definition: gls_metadata_attributes.h:413
Definition: gls_metadata_attributes.h:544
Definition: display_types.h:154
Definition: gls_metadata_attributes.h:341
Definition: disti_metadata.h:85
Definition: display_types.h:125
Definition: display_types.h:124
Definition: gls_metadata_attributes.h:367
Definition: bmpimage.h:46
long ValueInt() override
Definition: disti_metadata.h:531
Definition: display_types.h:149
virtual bool OkToWrite() const override
Definition: gls_metadata_attributes.h:1472
virtual std::istream & ReadValue(std::istream &instr) override
Definition: gls_metadata_attributes.h:1518
virtual bool OkToWrite() const
Definition: gls_metadata_attributes.h:1303
virtual bool operator==(const DistiAttributeBase &rArg)
Definition: gls_metadata_attributes.h:885
Definition: display_types.h:109
virtual bool OkToWrite() const
Definition: gls_metadata_attributes.h:807
virtual T Value() override
Definition: gls_metadata_attributes.h:1545