40#ifndef INCLUDED_GLS_METADATA_ATTRIBUTES_H
41#define INCLUDED_GLS_METADATA_ATTRIBUTES_H
80 return static_cast<T
>( value );
101 if( strcasecmp( value.c_str(),
"TRUE" ) == 0 )
105 else if( strcasecmp( value.c_str(),
"FALSE" ) == 0 )
112 temp = ConvertToIntOrBool<T>( atoi( value.c_str() ) );
129 *_attribPtr = ( val != 0 );
136 outstr << *_attribPtr;
144 *_attribPtr = ReadValueAsIntOrBool<bool>( instr );
155 *_attribPtr = (int)val;
165 *_attribPtr = (short)val;
175 *_attribPtr = (
unsigned short)val;
185 *_attribPtr = (
unsigned char)val;
193 outstr << (int)*_attribPtr;
202 *_attribPtr =
static_cast<unsigned char>( ReadValueAsIntOrBool<int>( instr ) );
208inline std::istream& DistiAttribute<int>::ReadValue( std::istream& instr )
211 *_attribPtr = ReadValueAsIntOrBool<int>( instr );
217inline std::istream& DistiAttribute<unsigned int>::ReadValue( std::istream& instr )
220 *_attribPtr = ReadValueAsIntOrBool<unsigned int>( instr );
227inline long DistiAttribute<float>::ValueInt() {
return (
long)*_attribPtr; }
230inline void DistiAttribute<float>::ValueInt(
long val )
232 *_attribPtr = (float)val;
320template<class containerClass>
324 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
329 typedef
void ( containerClass::*SetMethodType )( const
int );
330 typedef
int ( containerClass::*GetMethodType )();
338 :
DistiAttributeEnum<containerClass, const
int,
int>( frame, setMethod, getMethod, name )
340 _pairList = &TextureModeEnumList;
345static DistiAttributeEnumDefList TextureFilterEnumList(
355template<
class containerClass>
359 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
364 typedef
void ( containerClass::*SetMethodType )( const
int );
365 typedef
int ( containerClass::*GetMethodType )();
373 :
DistiAttributeEnum<containerClass, const
int,
int>( frame, setMethod, getMethod, name )
375 _pairList = &TextureFilterEnumList;
380static DistiAttributeEnumDefList PolyModeEnumList(
389template<
class containerClass>
393 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
398 typedef
void ( containerClass::*SetMethodType )( const
int );
399 typedef
int ( containerClass::*GetMethodType )();
407 :
DistiAttributeEnum<containerClass, const
int,
int>( frame, setMethod, getMethod, name )
409 _pairList = &PolyModeEnumList;
414static DistiAttributeEnumDefList PolyEndEnumList(
420template<
class containerClass>
424 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
429 typedef
void ( containerClass::*SetMethodType )(
int );
430 typedef
int ( containerClass::*GetMethodType )();
440 _pairList = &PolyEndEnumList;
445static DistiAttributeEnumDefList ShadingEnumList(
451template<
class containerClass>
455 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
460 typedef
void ( containerClass::*SetMethodType )( const
int );
461 typedef
int ( containerClass::*GetMethodType )();
469 :
DistiAttributeEnum<containerClass, const
int,
int>( frame, setMethod, getMethod, name )
471 _pairList = &ShadingEnumList;
476template<
class containerClass>
480 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
485 typedef
void ( containerClass::*SetMethodType )( const
int );
486 typedef
int ( containerClass::*GetMethodType )();
494 :
DistiAttributeEnum<containerClass, const
int,
int>( frame, setMethod, getMethod, name )
505 _pairList = &ColorMaterialModeEnum;
512template<
class containerClass>
516 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
521 typedef
void ( containerClass::*SetMethodType )( const
int );
522 typedef
int ( containerClass::*GetMethodType )();
530 :
DistiAttributeEnum<containerClass, const
int,
int>( frame, setMethod, getMethod, name )
537 _pairList = &ProtectionEnumList;
542static DistiAttributeEnumDefList AlphaModeEnumList(
550template<
class containerClass>
554 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
559 typedef
void ( containerClass::*SetMethodType )( const
int );
560 typedef
int ( containerClass::*GetMethodType )();
568 :
DistiAttributeEnum<containerClass, const
int,
int>( frame, setMethod, getMethod, name )
570 _pairList = &AlphaModeEnumList;
688 std::string _localStorageString;
796 , _attribPtr( attribPtr )
805 , _attribPtr( new Map_t() )
818 return _attribPtr != 0 && _attribPtr->size();
827 << DistiAttribDict::SpacingString() <<
"{\n";
828 DistiAttribDict::SpacingInc();
832 typename Map_t::iterator i;
833 for( i = _attribPtr->begin(); i != _attribPtr->end(); ++i )
835 std::ostringstream str;
837 const std::string second = str.str();
839 outstr << DistiAttribDict::SpacingString() << i->first <<
" "
840 << ( second.empty() ? GetEmptyValue() : second ) <<
'\n';
844 DistiAttribDict::SpacingDec();
845 outstr << DistiAttribDict::SpacingString() <<
"}\n";
850#if defined( _MSC_VER )
851# pragma warning( push )
852# pragma warning( disable : 4701 )
856 instr.ignore( INT_MAX,
'{' );
860 std::stringstream fontStream;
861 instr.get( *fontStream.rdbuf(),
'}' );
865 while( fontStream.good() )
869 std::stringstream::char_type c;
878 }
while( fontStream.good() && std::isspace( c ) );
880 }
while( fontStream.good() && isspace( c ) );
883 if( fontStream.good() )
885 fontStream.putback( c );
887 typename Map_t::key_type key;
888 typename Map_t::mapped_type value;
892 std::getline( fontStream >> std::ws, strVal );
894 if( strVal != GetEmptyValue() )
896 std::istringstream str( strVal );
900 ( *_attribPtr )[ key ] = value;
907#if defined( _MSC_VER )
908# pragma warning( pop )
938 , _attribPtr( attribPtr )
939 , _numVertices( numVertices )
941 , _fixedArray( false )
943 _compatabilityMode =
true;
953 , _attribPtr( new
Tptr( attribPtr ) )
954 , _numVertices( NULL )
955 , _numElements( numElements )
956 , _fixedArray( true )
958 _compatabilityMode =
true;
963 if( ( _fixedArray || _localStorage ) && _attribPtr )
971 return ( *_attribPtr != NULL );
979 if( *_attribPtr != NULL )
981 unsigned int numVerts = _numElements;
984 outstr << *_numVertices;
985 numVerts = *_numVertices;
987 DistiAttribDict::SpacingInc();
988 for(
unsigned int i = 0; i < numVerts; i++ )
991 outstr << ( *_attribPtr )[ i ];
993 DistiAttribDict::SpacingDec();
1003 unsigned int numVerts = _numElements;
1008 *_numVertices = numVerts;
1011 if( *_attribPtr != NULL )
1012 delete[] * _attribPtr;
1016 *_attribPtr =
new T[ numVerts ];
1021 if( !_compatabilityMode )
1025 instr.getline( buf, 1024 );
1028 for(
unsigned int i = 0; i < numVerts; i++ )
1030 if( !_compatabilityMode )
1033 instr.getline( buf, 1024 );
1037 std::sscanf( buf,
"%f %f %f",
1038 &( ( *_attribPtr )[ i ].x ),
1039 &( ( *_attribPtr )[ i ].y ),
1040 &( ( *_attribPtr )[ i ].z ) );
1042 assert( 3 == count );
1047 instr >> ( *_attribPtr )[ i ];
1068 for(
unsigned int i = 0u; i < _numElements; ++i )
1070 T leftVert = ( *_attribPtr )[ i ];
1106 , _attribPtr( attribPtr )
1107 , _numVertices( numVertices )
1109 , _fixedArray( false )
1111 _compatabilityMode =
true;
1121 , _attribPtr( new
Tptr( attribPtr ) )
1122 , _numVertices( NULL )
1123 , _numElements( numElements )
1124 , _fixedArray( true )
1126 _compatabilityMode =
true;
1131 if( ( _fixedArray || _localStorage ) && _attribPtr )
1138 return ( *_attribPtr != NULL );
1143 if( *_attribPtr != NULL )
1145 unsigned int numVerts = _numElements;
1148 outstr << *_numVertices;
1149 numVerts = *_numVertices;
1151 DistiAttribDict::SpacingInc();
1152 for(
unsigned int i = 0; i < numVerts; i++ )
1155 outstr << ( *_attribPtr )[ i ];
1157 DistiAttribDict::SpacingDec();
1164 unsigned int numVerts = _numElements;
1169 *_numVertices = numVerts;
1172 if( *_attribPtr != NULL )
1173 delete[] * _attribPtr;
1176 *_attribPtr =
new Vertex[ numVerts ];
1179 if( !_compatabilityMode )
1183 instr.getline( buf, 1024 );
1186 for(
unsigned int i = 0; i < numVerts; i++ )
1188 if( !_compatabilityMode )
1191 instr.getline( buf, 1024 );
1196 std::sscanf( buf,
"%f %f %f %d %d %d %d",
1197 &( ( *_attribPtr )[ i ].x ),
1198 &( ( *_attribPtr )[ i ].y ),
1199 &( ( *_attribPtr )[ i ].z ),
1202 assert( 7 == count );
1205 ( *_attribPtr )[ i ].color.RGBA( (
unsigned char)r, (
unsigned char)g, (
unsigned char)b, (
unsigned char)a );
1209 instr >> ( *_attribPtr )[ i ];
1227 for(
unsigned int i = 0u; i < _numElements; ++i )
1229 Vertex leftVert = ( *_attribPtr )[ i ];
1259 unsigned int numVerts = _numElements;
1261 for(
unsigned int i = 0; i < numVerts; i++ )
1264 outstr << ( *_attribPtr )[ i ];
1271 unsigned int numVerts = _numElements;
1273 for(
unsigned int i = 0; i < numVerts; i++ )
1281 std::getline( instr, line );
1283 if( i == 0 && line.length() == 0 )
1284 std::getline( instr, line );
1286 std::stringstream strm( line );
1287 strm >> ( *_attribPtr )[ i ];
1365 , _originalAttribName( originalName )
1366 , _dictionary( dict )
1395template<class T,
bool showIndex >
1407 , _attribPtr( attribPtr )
1416 , _attribPtr( new T() )
1429 return ( _attribPtr != NULL && _attribPtr->Capacity() );
1434 if( _attribPtr != NULL )
1436 unsigned numEntries = _attribPtr->Count();
1437 outstr << numEntries;
1439 DistiAttribDict::SpacingInc();
1441 for(
unsigned i = 0; i < numEntries; i++ )
1447 outstr << DistiAttribDict::SpacingString() << i <<
" ";
1450 outstr << DistiAttribDict::SpacingString() << ( *_attribPtr )[ i ] <<
" ";
1452 DistiAttribDict::SpacingDec();
1459 unsigned numEntries = 0;
1460 instr >> numEntries;
1462 _attribPtr->Count( numEntries );
1463 for(
unsigned i = 0; i < numEntries; i++ )
1471 instr >> ( *_attribPtr )[ entry ];
1482template<
class T,
bool showIndex >
1497 , _attribPtr( attribPtr )
1506 , _attribPtr( new T() )
1521 return ( _attribPtr != NULL && _attribPtr->size() );
1526 if( _attribPtr != NULL )
1528 const std::size_t numEntries = _attribPtr->size();
1529 outstr << numEntries;
1531 DistiAttribDict::SpacingInc();
1533 for( std::size_t i = 0; i < numEntries; i++ )
1539 outstr << DistiAttribDict::SpacingString() << i <<
" ";
1542 outstr << DistiAttribDict::SpacingString() << ( *_attribPtr )[ i ] <<
" ";
1544 DistiAttribDict::SpacingDec();
1551 if( _attribPtr != NULL )
1554 instr >> numEntries;
1556 _attribPtr->resize( numEntries );
1558 for(
int i = 0; i < numEntries; i++ )
1565 instr >> ( *_attribPtr )[ entry ];
1582 typedef T* ( *CreateItemCb )();
1597 , _createCb( createCb )
1608 << DistiAttribDict::SpacingString() <<
"{\n";
1609 DistiAttribDict::SpacingInc();
1610 for(
unsigned int i = 0; i < _array->
Count(); i++ )
1612 if( ( *_array )[ i ] )
1614 outstr << DistiAttribDict::SpacingString();
1616 ( ( *_array )[ i ] )->WriteValue( outstr );
1620 DistiAttribDict::SpacingDec();
1621 outstr << DistiAttribDict::SpacingString() <<
"}\n";
1630 while( DistiAttribDict::ScanToken( instr, buf ) )
1640 if( T*
const createdItem =
dynamic_cast<T*
>( _createCb() ) )
1643 _array->
Back()->ReadValue( instr );
1662template<
class containerT,
class T,
class SetArgT = const T&,
class GetReturnT = T>
1666 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
1669 typedef
void ( containerT::*SetMethodType )( SetArgT );
1670 typedef GetReturnT ( containerT::*GetMethodType )();
1671 typedef GetReturnT ( containerT::*GetMethodConstType )() const;
1674 containerT* _container;
1675 SetMethodType _setMethod;
1676 GetMethodType _getMethod;
1687 , _container( frame )
1688 , _setMethod( setMethod )
1689 , _getMethod( getMethod )
1692 if(
typeid( T ) ==
typeid(
float ) ||
typeid( T ) ==
typeid(
double ) ||
typeid( T ) ==
typeid(
long double ) )
1700 return ( this->_attribPtr || _getMethod );
1715 if( _precision > 0 )
1716 outstr.precision(
int( _precision ) );
1718 if( _getMethod && _container )
1721 T* tempAttribPtr = this->_attribPtr;
1724 T temp( ( _container->*_getMethod )() );
1727 this->_attribPtr = &temp;
1730 BaseClass::WriteValue( outstr );
1733 this->_attribPtr = tempAttribPtr;
1735 else if( this->_attribPtr )
1737 BaseClass::WriteValue( outstr );
1745 if( _setMethod && _container )
1748 T* tempAttribPtr = this->_attribPtr;
1752 this->_attribPtr = &temp;
1755 BaseClass::ReadValue( instr );
1758 ( _container->*_setMethod )(
static_cast<SetArgT
>( temp ) );
1760 this->_attribPtr = tempAttribPtr;
1762 else if( this->_attribPtr )
1764 BaseClass::ReadValue( instr );
1772 if( _getMethod && _container )
1775 return ( _container->*_getMethod )();
1777 else if( this->_attribPtr )
1779 return BaseClass::Value();
1789 if( _setMethod && _container )
1791 ( _container->*_setMethod )(
static_cast<SetArgT
>( val ) );
1793 else if( this->_attribPtr )
1795 BaseClass::Value( val );
1811template<
typename Type,
class Class>
1829template<
typename Type,
class Class>
1847template<
typename Type,
class Class>
1864template<
typename Type,
class Class>
1881template<
typename Type,
class Class>
1899template<
typename Type,
class Class>
1918template<
typename GetReturnT,
typename SetArgT,
class Class>
1936template<
class Class>
1974template<
class enumType>
1990 , _attribPtr( attribPtr )
1991 , _pairList( pairList )
2002 , _attribPtr( new enumType( value ) )
2003 , _pairList( pairList )
2009 if( _localStorage && _attribPtr )
2028 *_attribPtr = ( enumType ) * ( ptr->
_attribPtr );
2033 return DistiAttributeBase::operator=( oldClass );
2043 bool foundIt =
false;
2045 typename DistiAttributeEnumDefList::iterator item = _pairList->begin();
2046 while( item != _pairList->end() )
2048 if( ( *item )->_enum == *_attribPtr )
2050 outstr << ( *item )->_string;
2059 outstr << (int)*_attribPtr;
2075 bool foundIt =
false;
2076 typename DistiAttributeEnumDefList::iterator item = _pairList->begin();
2079 while( item != _pairList->end() )
2081 if( strcmp( ( *item )->_string, value ) == 0 )
2083 *_attribPtr = (enumType)( *item )->_enum;
2095 *_attribPtr = (enumType)atoi( value );
2122#define DISTI_REGISTER_METHOD_CALLBACK( instance, Class, Method ) \
2124 typedef CallbackMethodCallerTemplate<Class, Class> Caller; \
2125 typedef typename Caller::MethodType1 MethodType; \
2126 const MethodType callback = reinterpret_cast<MethodType>( Method ); \
2127 ThisClass::CallbackCaller( new Caller( callback, instance ) ); \
2137#define DISTI_SET_OBJECT_CALLBACK1( object, method, parent ) \
2138 ( object )->CallbackCaller( \
2139 new CallbackMethodCallerTemplate<DisplayObject, DisplayObject>( \
2140 (disti::CallbackMethodCallerTemplate<DisplayObject, DisplayObject>::MethodType1)( method ), ( parent ) ) );
2151#define DISTI_ADD_ATTRIBUTE( Type, name, memberVarAddr ) \
2153 static const AttributeName attr( name ); \
2154 CallbackAttributeNotifier<ThisClass> cb( this, attr ); \
2155 this->Attributes().Add( new DistiAttribute<Type>( &cb, ( attr ), ( memberVarAddr ) ) ); \
2170#define DISTI_ADD_ATTRIBUTE_CALLBACK( Type, name, memberVarAddr, callbackFunction ) \
2172 typedef void ( ThisClass::*Method )(); \
2173 static const AttributeName attr( name ); \
2174 CallbackAttributeNotifier<ThisClass> cb( this, attr, reinterpret_cast<Method>( callbackFunction ) ); \
2175 this->Attributes().Add( new DistiAttribute<Type>( &cb, ( attr ), ( memberVarAddr ) ) ); \
2188#define DISTI_ADD_ATTRIBUTE_SET_GET( Type, name, setter, getter ) \
2190 static const AttributeName attr( name ); \
2191 this->Attributes().Add( CreateDistiAttributeProperty<Type>( attr, this, setter, getter ) ); \
2201#define DISTI_ADD_ATTRIBUTE_STRING( name, memberVarAddr ) \
2203 static const AttributeName attr( name ); \
2204 CallbackAttributeNotifier<ThisClass> cb( this, attr ); \
2205 this->Attributes().Add( new DistiAttributeEncodedStdString( &cb, attr, memberVarAddr ) ); \
2217#define DISTI_ADD_ATTRIBUTE_STRING_CALLBACK( name, memberVarAddr, callbackFunction ) \
2219 typedef void ( ThisClass::*Method )(); \
2220 static const AttributeName attr( name ); \
2221 CallbackAttributeNotifier<ThisClass> cb( this, attr, reinterpret_cast<Method>( callbackFunction ) ); \
2222 this->Attributes().Add( new DistiAttributeEncodedStdString( &cb, attr, memberVarAddr ) ); \
2232#define DISTI_ADD_ATTRIBUTE_ALIAS( aliasName, origName, obj ) \
2234 static const AttributeName aliasAttr( aliasName ); \
2235 static const AttributeName origAttr( origName ); \
2236 DistiAttribDict& attributes = ( obj )->Attributes(); \
2237 this->Attributes().Add( new DistiAttributeAlias( NULL, aliasAttr, origAttr, &attributes ) ); \
2240#ifdef DISTI_HAS_CPP11
2251 : _func( std::move( func ) )
2267 return !_object.IsNull() && _func;
2282 const std::function<
void()>& func )
2295 auto& res = obj->
Resource( resource.c_str() );
2298 std::cout <<
"Unknown attribute name: " << resource << std::endl;
2313template<
class Class>
2319 std::cout <<
"Unknown attribute name: " << resource << std::endl;
Definition: gls_metadata_attributes.h:2244
AttributeFnCallback(WeakReferenceable *object, std::function< void()> func)
Definition: gls_metadata_attributes.h:2250
virtual bool IsValid() const override
Definition: gls_metadata_attributes.h:2265
std::function< void()> _func
The callback function pointer to call.
Definition: gls_metadata_attributes.h:2271
WeakRef< WeakReferenceable > _object
The object associated with this callback, callback will only be called if this object is valid.
Definition: gls_metadata_attributes.h:2272
void Call(DistiAttributeBase &ev) override
Definition: gls_metadata_attributes.h:2257
Definition: disti_metadata.h:417
Definition: disti_metadata.h:87
Definition: disti_metadata.h:201
Definition: callback_caller_base.h:56
virtual DistiAttributeBase & Resource(const char *name)
Definition: disti_metadata.h:734
void Add(DistiAttributeBase *attr)
Definition: gls_metadata_attributes.h:1356
DistiAttributeAlias(CallbackMethodCallerBase *callback, const AttributeName &name, const AttributeName &originalName, DistiAttribDict *dict)
Definition: gls_metadata_attributes.h:1363
Definition: gls_metadata_attributes.h:552
Definition: disti_metadata.h:220
virtual CallbackID RegisterObserver(AttributeObserver *observer)
virtual void UnregisterObserver(CallbackID id)
AttributeName _name
Definition: disti_metadata.h:226
unsigned int CallbackID
Type for unique identifiers.
Definition: disti_metadata.h:394
Definition: gls_metadata_attributes.h:478
virtual bool OkToWrite() const override
Definition: gls_metadata_attributes.h:508
Definition: gls_metadata_attributes.h:755
bool _hasRead
If true, ReadValue will be called on the sibling when ReadValue is called on this attribute.
Definition: gls_metadata_attributes.h:759
DistiAttributeDictionaryAttributeSibling(const AttributeName &name, DistiAttribDict *dict, DistiAttributeBase *sibling)
DistiAttribDict * _dict
An observing pointer to a dictionary of attributes.
Definition: gls_metadata_attributes.h:757
virtual std::istream & ReadValue(std::istream &instr) override
virtual bool OkToWrite() const override
DistiAttributeBase * _sibling
An observing pointer to this attribute's sibling.
Definition: gls_metadata_attributes.h:758
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:733
DistiAttribDict * _dict
An observing pointer to a dictionary of attributes.
Definition: gls_metadata_attributes.h:735
virtual std::istream & ReadValue(std::istream &instr) override
DistiAttributeDictionaryAttribute(const AttributeName &name, DistiAttribDict *dict)
virtual bool OkToWrite() const override
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:291
DistiAttributeDoubleArray(CallbackMethodCallerBase *callback, const AttributeName &name, double *doubleArray, int length)
virtual bool OkToWrite() const override
Definition: gls_metadata_attributes.h:1397
bool OkToWrite() const override
Definition: gls_metadata_attributes.h:1427
std::istream & ReadValue(std::istream &instr) override
Definition: gls_metadata_attributes.h:1457
DistiAttributeDynamicArray(CallbackMethodCallerBase *callback, const AttributeName &name)
Definition: gls_metadata_attributes.h:1414
std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:1432
DistiAttributeDynamicArray(CallbackMethodCallerBase *callback, const AttributeName &name, T *attribPtr)
Definition: gls_metadata_attributes.h:1405
Definition: gls_metadata_attributes.h:640
DistiAttributeEncodedStdString(CallbackMethodCallerBase *callback, const AttributeName &name, std::string initialValue)
bool OkToWrite() const override
DistiAttributeEncodedStdString(CallbackMethodCallerBase *callback, const AttributeName &name, std::string *attribPtr)
Definition: gls_metadata_attributes.h:613
DistiAttributeEncodedString(CallbackMethodCallerBase *callback, const AttributeName &name, char **attribPtr)
DistiAttributeEncodedString(CallbackMethodCallerBase *callback, const AttributeName &name, char *initialValue)
virtual std::string ValueString() override
Definition: disti_metadata.h:986
Definition: gls_metadata_attributes.h:1976
virtual void ValueInt(long val) override
Definition: gls_metadata_attributes.h:2018
enumType * _attribPtr
Underlying storage for this attribute.
Definition: gls_metadata_attributes.h:1978
DistiAttributeEnumDefList * _pairList
Observing pointer to the enum string to integer conversion data.
Definition: gls_metadata_attributes.h:1981
DistiAttributeEnumDirect(CallbackMethodCallerBase *callback, const AttributeName &name, enumType *attribPtr, DistiAttributeEnumDefList *pairList)
Definition: gls_metadata_attributes.h:1988
DistiAttributeEnumDirect(CallbackMethodCallerBase *callback, const AttributeName &name, const enumType &value, DistiAttributeEnumDefList *pairList)
Definition: gls_metadata_attributes.h:2000
virtual std::istream & ReadValue(std::istream &instr) override
Definition: gls_metadata_attributes.h:2069
virtual long ValueInt() override
Definition: gls_metadata_attributes.h:2014
virtual DistiAttributeBase & operator=(const DistiAttributeBase &oldClass) override
Definition: gls_metadata_attributes.h:2023
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:2041
Definition: disti_metadata.h:1005
Definition: gls_metadata_attributes.h:667
virtual std::istream & ReadValue(std::istream &instr) override
DistiAttributeFixedString(CallbackMethodCallerBase *callback, const AttributeName &name, char *string, int length)
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:268
DistiAttributeFloatArray(CallbackMethodCallerBase *callback, const AttributeName &name, float *floatArray, int length)
virtual bool OkToWrite() const override
Definition: gls_metadata_attributes.h:1580
DistiAttributeHomogeneousItemArray(const AttributeName &name, DynamicArray< T * > *array, CreateItemCb createCb)
Definition: gls_metadata_attributes.h:1594
CreateItemCb _createCb
Function pointer called to create new items in the list.
Definition: gls_metadata_attributes.h:1586
virtual std::istream & ReadValue(std::istream &instr) override
Definition: gls_metadata_attributes.h:1625
DynamicArray< T * > * _array
Underlying storage for this attribute.
Definition: gls_metadata_attributes.h:1585
virtual bool OkToWrite() const override
Definition: gls_metadata_attributes.h:1603
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:1605
Definition: gls_metadata_attributes.h:717
DistiAttributeLocation(CallbackMethodCallerBase *callback, const AttributeName &name, Vertex *attribPtr)
virtual std::istream & ReadValue(std::istream &instr) override
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:1300
DistiAttributeNeverWrite(CallbackMethodCallerBase *callback, const AttributeName &name, const T &initialValue)
Definition: gls_metadata_attributes.h:1315
virtual bool OkToWrite() const override
Definition: gls_metadata_attributes.h:1320
DistiAttributeNeverWrite(CallbackMethodCallerBase *callback, const AttributeName &name, T *attribPtr)
Definition: gls_metadata_attributes.h:1306
Definition: gls_metadata_attributes.h:422
Definition: gls_metadata_attributes.h:391
Definition: gls_metadata_attributes.h:1664
virtual void ValueInt(long val) override
Definition: gls_metadata_attributes.h:1708
virtual double ValueFloat() override
Definition: gls_metadata_attributes.h:1710
virtual T Value() override
Definition: gls_metadata_attributes.h:1770
virtual std::string ValueString() override
Definition: gls_metadata_attributes.h:1704
virtual std::istream & ReadValue(std::istream &instr) override
Definition: gls_metadata_attributes.h:1743
virtual void ValueString(const std::string &s) override
Definition: gls_metadata_attributes.h:1705
virtual void Value(const T &val) override
Definition: gls_metadata_attributes.h:1787
virtual void ValueFloat(double val) override
Definition: gls_metadata_attributes.h:1711
virtual long ValueInt() override
Definition: gls_metadata_attributes.h:1707
virtual bool OkToWrite() const override
Definition: gls_metadata_attributes.h:1698
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:1713
Definition: gls_metadata_attributes.h:514
Definition: gls_metadata_attributes.h:453
Definition: gls_metadata_attributes.h:785
DistiAttributeStdMap(CallbackMethodCallerBase *callback, const AttributeName &name, Map_t *attribPtr)
Definition: gls_metadata_attributes.h:793
virtual std::istream & ReadValue(std::istream &instr) override
Definition: gls_metadata_attributes.h:854
DistiAttributeStdMap(CallbackMethodCallerBase *callback, const AttributeName &name)
Definition: gls_metadata_attributes.h:803
static std::string GetEmptyValue()
Definition: gls_metadata_attributes.h:822
virtual bool OkToWrite() const override
Definition: gls_metadata_attributes.h:816
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:824
Definition: gls_metadata_attributes.h:1328
DistiAttributeStdStringNeverWrite(CallbackMethodCallerBase *callback, const AttributeName &name, const std::string &initialValue)
Definition: gls_metadata_attributes.h:1343
DistiAttributeStdStringNeverWrite(CallbackMethodCallerBase *callback, const AttributeName &name, std::string *attribPtr)
Definition: gls_metadata_attributes.h:1334
virtual bool OkToWrite() const override
Definition: gls_metadata_attributes.h:1348
Definition: gls_metadata_attributes.h:687
DistiAttributeStdString(CallbackMethodCallerBase *callback, const AttributeName &name, std::string *attribPtr)
DistiAttributeStdString(CallbackMethodCallerBase *callback, const AttributeName &name, std::string initialValue)
virtual bool OkToWrite() const override
std::string * LocalStorageString()
Definition: gls_metadata_attributes.h:1484
DistiAttributeStdVector(CallbackMethodCallerBase *callback, const AttributeName &name)
Definition: gls_metadata_attributes.h:1504
DistiAttributeStdVector(CallbackMethodCallerBase *callback, const AttributeName &name, T *attribPtr)
Definition: gls_metadata_attributes.h:1495
virtual std::istream & ReadValue(std::istream &instr) override
Definition: gls_metadata_attributes.h:1549
virtual bool OkToWrite() const override
Definition: gls_metadata_attributes.h:1519
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:1524
Definition: gls_metadata_attributes.h:577
DistiAttributeString(CallbackMethodCallerBase *callback, const AttributeName &name, char **attribPtr)
char * LocalStorageString()
DistiAttributeString(CallbackMethodCallerBase *callback, const AttributeName &name, char *initialValue)
char ** _attribPtr
A pointer to the pointer containing the underlying storage for this attribute.
Definition: gls_metadata_attributes.h:581
virtual bool OkToWrite() const override
Definition: gls_metadata_attributes.h:357
Definition: gls_metadata_attributes.h:322
Definition: gls_metadata_attributes.h:1245
virtual std::istream & ReadValue(std::istream &instr) override
Definition: gls_metadata_attributes.h:1269
DistiAttributeTexturePointArray(CallbackMethodCallerBase *callback, const AttributeName &name, Vector *attribPtr, unsigned int numElements)
Definition: gls_metadata_attributes.h:1252
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:1257
Definition: gls_metadata_attributes.h:242
DistiAttributeUCharOrBool(CallbackMethodCallerBase *callback, const AttributeName &name, unsigned char *attribPtr)
virtual long ValueInt() override
virtual DistiAttributeBase & operator=(const DistiAttributeBase &oldClass) override
DistiAttributeUCharOrBool(CallbackMethodCallerBase *callback, const AttributeName &name, unsigned char value)
Definition: gls_metadata_attributes.h:1085
Vertex * Tptr
Shorthand typedef for a pointer to a vertex.
Definition: gls_metadata_attributes.h:1088
void SetCompatabilityMode(bool mode)
Definition: gls_metadata_attributes.h:1097
unsigned int * _numVertices
The number of vertices in a variable length array.
Definition: gls_metadata_attributes.h:1089
DistiAttributeVertexArray(CallbackMethodCallerBase *callback, const AttributeName &name, Vertex *attribPtr, unsigned int numElements)
Definition: gls_metadata_attributes.h:1119
bool _fixedArray
If true, this array is not resizable.
Definition: gls_metadata_attributes.h:1091
virtual std::istream & ReadValue(std::istream &instr) override
Definition: gls_metadata_attributes.h:1162
Vertex ** _attribPtr
Underlying storage for this attribute.
Definition: gls_metadata_attributes.h:1087
unsigned int _numElements
The number of vertices in a fixed length array.
Definition: gls_metadata_attributes.h:1090
virtual bool operator==(const DistiAttributeBase &rArg) override
Definition: gls_metadata_attributes.h:1216
bool _compatabilityMode
If true, backward compatibility mode will be used, values will be read with scanf.
Definition: gls_metadata_attributes.h:1092
virtual bool OkToWrite() const override
Definition: gls_metadata_attributes.h:1136
DistiAttributeVertexArray(CallbackMethodCallerBase *callback, const AttributeName &name, Vertex **attribPtr, unsigned int *numVertices)
Definition: gls_metadata_attributes.h:1104
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:1141
Definition: gls_metadata_attributes.h:917
void SetCompatabilityMode(bool mode)
Definition: gls_metadata_attributes.h:929
T ** _attribPtr
Underlying storage for this attribute.
Definition: gls_metadata_attributes.h:919
unsigned int * _numVertices
The number of vertices in a variable length array.
Definition: gls_metadata_attributes.h:921
DistiAttributeVertexArray(CallbackMethodCallerBase *callback, const AttributeName &name, T **attribPtr, unsigned int *numVertices)
Definition: gls_metadata_attributes.h:936
DistiAttributeVertexArray(CallbackMethodCallerBase *callback, const AttributeName &name, T *attribPtr, unsigned int numElements)
Definition: gls_metadata_attributes.h:951
T * Tptr
Shorthand typedef for a pointer to the template type.
Definition: gls_metadata_attributes.h:920
bool _fixedArray
If true, this array is not resizable.
Definition: gls_metadata_attributes.h:923
virtual std::istream & ReadValue(std::istream &instr) override
Definition: gls_metadata_attributes.h:1001
unsigned int _numElements
The number of vertices in a fixed length array.
Definition: gls_metadata_attributes.h:922
virtual bool operator==(const DistiAttributeBase &rArg) override
Definition: gls_metadata_attributes.h:1057
bool _compatabilityMode
If true, backward compatibility mode will be used, values will be read with scanf.
Definition: gls_metadata_attributes.h:924
virtual bool OkToWrite() const override
Definition: gls_metadata_attributes.h:969
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:977
Definition: disti_metadata.h:547
std::istream & ReadValue(std::istream &instr) override
Definition: disti_metadata.h:647
std::ostream & WriteValue(std::ostream &outstr) override
Definition: disti_metadata.h:634
long ValueInt() override
Definition: disti_metadata.h:587
Definition: gls_metadata_attributes.h:1951
virtual std::istream & ReadValue(std::istream &instr) override
Definition: gls_metadata_attributes.h:1965
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_metadata_attributes.h:1959
unsigned Count() const
Definition: dynamic_array.h:218
T & Back()
Definition: dynamic_array.h:357
unsigned PushBack(const T &object)
Definition: dynamic_array.h:340
float y
The Y component.
Definition: vertex.h:88
float x
The X component.
Definition: vertex.h:87
float z
The Z component.
Definition: vertex.h:89
GlsColor color
The RGBA color component.
Definition: vertex.h:422
Definition: weak_reference.h:92
Definition: weak_reference.h:65
The disti::DisplayObject class and global enumerations.
#define GLS_VERIFY(exp)
Definition: disti_assert.h:170
The disti::DynamicArray class. A templated array of objects capable of dynamically growing.
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:457
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:214
A file for all GL Studio files to include.
#define GLS_EXPORT
Macro denoting which functions should be visible from the runtime library.
Definition: gls_include.h:52
The List_c class. Generic linked list.
The disti::Material class.
Force inclusion of the DirectShow library.
Definition: bmpimage.h:47
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:1919
bool Equal(T1 x, T2 y, float precision=0.001f)
Definition: util.h:495
@ TEXTURE_MAP_BLEND
Definition: display_types.h:56
@ TEXTURE_MAP_DECAL
Definition: display_types.h:55
@ TEXTURE_MAP_MODULATE
Definition: display_types.h:54
@ TEXTURE_MAP_REPLACE
Definition: display_types.h:57
@ TEXTURE_FILTER_NEAREST
Definition: display_types.h:63
@ TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR
Definition: display_types.h:66
@ TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST
Definition: display_types.h:65
@ TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST
Definition: display_types.h:68
@ TEXTURE_FILTER_LINEAR
Definition: display_types.h:64
@ TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR
Definition: display_types.h:67
@ POLY_MODE_FILLED
Definition: display_types.h:86
@ POLY_MODE_POINTS
Definition: display_types.h:84
@ POLY_MODE_OUTLINE
Definition: display_types.h:85
@ POLY_MODE_UNDEFINED
Definition: display_types.h:83
@ POLY_MODE_FILL_AND_OUTLINE
Definition: display_types.h:87
AttributeObserver * CreateAttributeFnCallback(WeakReferenceable *const obj, const std::function< void()> &func)
Definition: gls_metadata_attributes.h:2280
@ ALPHA_MODE_256_LEVEL
Definition: display_types.h:96
@ ALPHA_MODE_UNDEFINED
Definition: display_types.h:93
@ ALPHA_MODE_2_LEVEL
Definition: display_types.h:95
@ ALPHA_MODE_OPAQUE
Definition: display_types.h:94
void Disconnect(DisplayObject *obj, const std::string &resource, DistiAttributeBase::CallbackID id)
Definition: gls_metadata_attributes.h:2330
@ EMISSION_COLOR_MATERIAL
Definition: display_types.h:146
@ NO_COLOR_MATERIAL
Definition: display_types.h:142
@ DIFFUSE_COLOR_MATERIAL
Definition: display_types.h:143
@ SPECULAR_COLOR_MATERIAL
Definition: display_types.h:147
@ DIFFUSE_AND_AMBIENT_COLOR_MATERIAL
Definition: display_types.h:145
@ AMBIENT_COLOR_MATERIAL
Definition: display_types.h:144
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:1937
AttributeObserver * CreateAttributeMethodCallback(Class *const obj, const typename AttributeMethodCallback< Class >::Callback method)
Definition: disti_metadata.h:455
const DistiAttributeBase::CallbackID DISTI_INVALID_CALLBACK_ID
Value to represent that a given callback was not successfully created.
Definition: gls_metadata_attributes.h:72
bool operator==(const AttributeName &attr1, const AttributeName &attr2)
Definition: disti_metadata.h:154
T ReadValueAsIntOrBool(std::istream &instr)
Definition: gls_metadata_attributes.h:96
@ PRIVATE
Definition: display_types.h:117
@ PROTECTED
Definition: display_types.h:118
@ PUBLIC
Definition: display_types.h:116
@ SHADING_FLAT
Definition: display_types.h:109
@ SHADING_GOURAUD
Definition: display_types.h:110
DistiAttributeBase::CallbackID Connect(DisplayObject *obj, const std::string &resource, Class *const methodInstance, const typename AttributeMethodCallback< Class >::Callback method)
Definition: gls_metadata_attributes.h:2314
@ POLY_OPEN
Definition: display_types.h:102
@ POLY_CLOSED
Definition: display_types.h:103
T ConvertToIntOrBool(int value)
Definition: gls_metadata_attributes.h:78
Generally useful defines, macros, enumerations and function prototypes.
The disti::Vertex class. A class for manipulating 3D vertices.