00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #ifndef _SO_SUB_FIELD_
00051 #define _SO_SUB_FIELD_
00052
00053 #include <Inventor/fields/SoField.h>
00054 #include <Inventor/SoInput.h>
00055 #include <Inventor/SoOutput.h>
00056 #include <Inventor/errors/SoMemoryError.h>
00057
00058
00059
00060
00061
00062
00063
00064 #define SO__FIELD_HEADER(className) \
00065 public: \
00066 \
00067 virtual SoType getTypeId() const; \
00068 \
00069 static SoType getClassTypeId(); \
00070 \
00071 \
00072 const className & operator =(const className &f); \
00073 \
00074 private:\
00075 \
00076 virtual void copyFrom(const SoField &f); \
00077 \
00078 static void * createInstance(SoType* dynamicType = NULL); \
00079 \
00080 \
00081 virtual SbBool isSame(const SoField &f) const; \
00082 \
00083 private: \
00084 static SoType classTypeId
00085
00086 #define SO__SFIELD_RW_HEADER(className) \
00087 private: \
00088 \
00089 virtual SbBool readValue(SoInput *in); \
00090 \
00091 \
00092 virtual void writeValue(SoOutput *out) const
00093
00094 #define SO__MFIELD_RW_HEADER(className) \
00095 private: \
00096 \
00097 virtual SbBool read1Value(SoInput *in, int index); \
00098 \
00099 \
00100 virtual void write1Value(SoOutput *out, int index) const
00101
00102 #if defined(_DEBUG)
00103 #define SO_FIELD_INIT_CLASS_CHECK_PARENT(className, parentClass) \
00104 if (parentClass::getClassTypeId().isBad()) { \
00105 SoDebugError::post( SO__QUOTE(className)"::initClass", \
00106 SO__QUOTE(className)" initialized before parent class " \
00107 SO__QUOTE(parentClass)"\n"); \
00108 parentClass::initClass(); \
00109 }
00110 #else
00111 #define SO_FIELD_INIT_CLASS_CHECK_PARENT(className, parentClass) \
00112 if (parentClass::getClassTypeId().isBad()) \
00113 parentClass::initClass()
00114 #endif
00115
00116 #define SO__FIELD_INIT_CLASS_INTERNAL(className,classPrintName,parentClass) \
00117 SO_FIELD_INIT_CLASS_CHECK_PARENT(className, parentClass); \
00118 classTypeId = SoType::createType(parentClass::getClassTypeId(), \
00119 classPrintName, \
00120 &className::createInstance)
00121
00122 #define SO__FIELD_INIT_CLASS(className,classPrintName,parentClass) \
00123 SO__FIELD_INIT_CLASS_INTERNAL(className,classPrintName,parentClass);
00124
00125 #define SO__FIELD_INIT_ABSTRACT_CLASS_INTERNAL(className,classPrintName,parentClass) \
00126 SO_FIELD_INIT_CLASS_CHECK_PARENT(className, parentClass); \
00127 classTypeId = SoType::createType(parentClass::getClassTypeId(), \
00128 classPrintName, \
00129 NULL)
00130
00131 #define SO__FIELD_INIT_ABSTRACT_CLASS(className,classPrintName,parentClass) \
00132 SO__FIELD_INIT_ABSTRACT_CLASS_INTERNAL(className,classPrintName,parentClass);
00133
00134 #if defined(_DEBUG)
00135 #define SO__FIELD_EXIT_CLASS(className) { \
00136 if (! SoType::removeType(classTypeId.getName())) { \
00137 SoDebugError::post(SO__QUOTE(className)"::exitClass", \
00138 "Unable to remove type (%s) for this class. Check exitClass() " \
00139 "method is implemented and is called only once.\n", \
00140 classTypeId.getName().getString() ); \
00141 } \
00142 else \
00143 classTypeId = SoType::badType(); \
00144 }
00145 #else
00146 #define SO__FIELD_EXIT_CLASS(className) \
00147 SoType::removeType(classTypeId.getName()); \
00148 classTypeId = SoType::badType()
00149 #endif
00150
00151 #define SO__FIELD_ID_ABSTRACT_SOURCE(className) \
00152 \
00153 SoType className::classTypeId; \
00154 \
00155 SoType \
00156 className::getClassTypeId() \
00157 { \
00158 return classTypeId; \
00159 } \
00160 \
00161 SoType \
00162 className::getTypeId() const \
00163 { \
00164 return classTypeId; \
00165 }
00166
00167 #define SO__FIELD_ID_SOURCE(className) \
00168 SO__FIELD_ID_ABSTRACT_SOURCE(className); \
00169 void * \
00170 className::createInstance(SoType *) \
00171 { \
00172 return (void *)(new className); \
00173 }
00174
00175
00176 #define SO__FIELD_EQ_SAME_SOURCE(className) \
00177 \
00178 void \
00179 className::copyFrom(const SoField &f) \
00180 { \
00181 *this = * (const className *) &f; \
00182 } \
00183 \
00184 SbBool \
00185 className::isSame(const SoField &f) const \
00186 { \
00187 return (getTypeId() == f.getTypeId() && \
00188 (*this) == (const className &) f); \
00189 }
00190
00191
00192
00193
00194
00195
00196
00197
00199
00200
00201
00203
00204 #define SO_SFIELD_REQUIRED_HEADER(className) \
00205 SO__FIELD_HEADER(className)
00206
00208
00209
00210
00212
00213 #define SO_SFIELD_CONSTRUCTOR_HEADER(className) \
00214 public: \
00215 \
00216 className(); \
00217 \
00218 \
00219 virtual ~className()
00220
00222
00223
00224
00225
00227
00228 #define SO_SFIELD_VALUE_HEADER(className, valueType, valueRef) \
00229 SO__SFIELD_RW_HEADER(className); \
00230 \
00231 public: \
00232 \
00233
00234 valueRef getValue() const \
00235 { evaluate(); return value; } \
00236 \ \
00238
00239 void setValue(valueRef newValue); \
00240 \ \
00242 valueRef operator =(valueRef newValue) \
00243 { setValue(newValue); return value; } \
00244 \ \
00246 int operator ==(const className &f) const; \
00247 \ \
00249 int operator !=(const className &f) const \
00250 { return ! ((*this) == f); } \
00251 \ \
00253 virtual size_t getValueSize() const { return sizeof(valueType); } \
00254 \
00255 private: \
00256 valueType value
00257
00259
00260
00261
00262
00263
00265
00266 #define SO_SFIELD_DERIVED_VALUE_HEADER(className, valueType, valueRef) \
00267 SO__SFIELD_RW_HEADER(className); \
00268 public: \
00269 \
00270 valueRef operator =(valueRef newValue) \
00271 { setValue(newValue); return (valueRef)value; }
00272
00274
00275
00276
00277
00279
00280 #define SO_SFIELD_HEADER(className, valueType, valueRef) \
00281 SO_SFIELD_REQUIRED_HEADER(className); \
00282 SO_SFIELD_CONSTRUCTOR_HEADER(className); \
00283 SO_SFIELD_VALUE_HEADER(className, valueType, valueRef)
00284
00286
00287
00288
00289
00290
00292
00293 #define SO_SFIELD_DERIVED_HEADER(className, valueType, valueRef) \
00294 SO_SFIELD_REQUIRED_HEADER(className); \
00295 SO_SFIELD_CONSTRUCTOR_HEADER(className); \
00296 SO_SFIELD_DERIVED_VALUE_HEADER(className, valueType, valueRef)
00297
00298
00299
00300
00301
00302
00303
00304
00306
00307
00308
00310
00311 #define SO_MFIELD_REQUIRED_HEADER(className) \
00312 SO__FIELD_HEADER(className)
00313
00315
00316
00317
00319
00320 #define SO_MFIELD_CONSTRUCTOR_HEADER(className) \
00321 public: \
00322 \
00323 className(); \
00324 \
00325 \
00326 virtual ~className()
00327
00329
00330
00331
00332
00334
00335 #define SO_MFIELD_VALUE_HEADER(className, valueType, valueRef) \
00336 SO__MFIELD_RW_HEADER(className); \
00337 \
00338 public: \
00339 \
00340
00341
00342 valueRef operator [](int i) const \
00343 { evaluate(); return values[i]; } \
00344 \ \ \ \
00348
00349
00350
00351
00352
00353 const valueType *getValues(int start) const \
00354 { evaluate(); return const_cast<const valueType*>(static_cast<valueType *>(values + start)); } \
00355 \ \ \ \ \
00360 int find(valueRef targetValue, SbBool addIfNotFound = FALSE); \
00361 \ \ \ \ \
00366
00367
00368
00369
00370 void setValues(int start, int num, const valueType *newValues); \
00371 \ \ \ \
00375
00376
00377
00378 void set1Value(int index, valueRef newValue); \
00379 \ \ \ \
00383
00384
00385 void setValue(valueRef newValue); \
00386 \ \ \ \
00390
00391
00392 valueRef operator =(valueRef newValue) \
00393 { setValue(newValue); return newValue; } \
00394 \ \ \ \
00398 int operator ==(const className &f) const; \
00399 \ \ \ \
00403 int operator !=(const className &f) const \
00404 { return ! ((*this) == f); } \
00405 \ \ \ \
00409
00410 virtual void enableDeleteValues() \
00411 { setUserDataIsUsed(false); } \
00412 \ \
00414 virtual void disableDeleteValues() \
00415 { setUserDataIsUsed(true); } \
00416 \ \ \ \ \
00421
00422 virtual SbBool isDeleteValuesEnabled() \
00423 { return (!getUserDataIsUsed())?TRUE:FALSE; } \
00424 \ \
00426 virtual size_t getValueSize() const { return sizeof(valueType); } \
00427 \
00428 private: \
00429 \
00430 \
00431 \
00432 virtual void allocValues(int newNum); \
00433 \
00434 \
00435 virtual void deleteAllValues(); \
00436 \
00437 \
00438 virtual void copyValue(int to, int from); \
00439 \
00440 valueType *values; \
00441 \
00442 \
00443 virtual void* getValuesPointer(int start) \
00444 { return static_cast<void*>(values + start); }
00445
00446
00448
00449
00450
00451
00452
00454
00455 #define SO_MFIELD_DERIVED_VALUE_HEADER(className, valueType, valueRef) \
00456 SO__MFIELD_RW_HEADER(className); \
00457 public: \
00458 \
00459 valueRef operator =(valueRef newValue) \
00460 { setValue(newValue); return newValue; }
00461
00462 #define SO_FIELD_SUPPORT_MEMOBJ() \
00463 private: \
00464 virtual bool isEnabledMemObj() { return true; } \
00465 virtual SoMemoryObject* getMemObj() { return m_memObj; } \
00466 virtual void setMemObj( SoMemoryObject* memObj ) { m_memObj = memObj; }
00467
00468
00470
00471
00472
00474
00475 #define SO_MFIELD_EDITING_HEADER(className, valueType) \
00476 \
00477 \
00478 \
00479 \
00480 \
00481 \
00482 \
00483
00484
00485 valueType *startEditing() { \
00486 evaluate(); \
00487 return values; \
00488 } \
00489 \ \
00491 void finishEditing() { \
00492 valueChanged(0, getNum()); \
00493 }
00494
00496
00497
00498
00499
00501
00502 #define SO_MFIELD_HEADER(className, valueType, valueRef) \
00503 SO_MFIELD_REQUIRED_HEADER(className); \
00504 SO_MFIELD_CONSTRUCTOR_HEADER(className); \
00505 SO_MFIELD_EDITING_HEADER(className, valueType); \
00506 SO_MFIELD_VALUE_HEADER(className, valueType, valueRef)
00507
00509
00510
00511
00512
00513
00515
00516 #define SO_MFIELD_DERIVED_HEADER(className, valueType, valueRef) \
00517 SO_MFIELD_REQUIRED_HEADER(className); \
00518 SO_MFIELD_CONSTRUCTOR_HEADER(className); \
00519 SO_MFIELD_DERIVED_VALUE_HEADER(className, valueType, valueRef)
00520
00521
00522
00523
00524
00525
00526
00527
00529
00530
00531
00532
00534
00535 #define SO_SFIELD_INIT_CLASS(className,parentClass) \
00536 SO__FIELD_INIT_CLASS(className, SO__QUOTE(className), parentClass);
00537
00538 #define SO_SFIELD_EXIT_CLASS(className) \
00539 SO__FIELD_EXIT_CLASS(className)
00540
00542
00543
00544
00545
00547
00548 #define SO_SFIELD_REQUIRED_SOURCE(className) \
00549 \
00550 SO__FIELD_ID_SOURCE(className) \
00551 SO__FIELD_EQ_SAME_SOURCE(className) \
00552 \
00553 const className & \
00554 className::operator =(const className &f) \
00555 { \
00556 setValue(f.getValue()); \
00557 return *this; \
00558 }
00559
00560 #if defined(_DEBUG)
00561 #define SO_FIELD_CHECK_INIT(className) { \
00562 if (classTypeId.isBad()) { \
00563 SoDebugError::post("Field Constructor", \
00564 "Can't construct a field of type " \
00565 SO__QUOTE(className) \
00566 " until initClass() has been called"); \
00567 className::initClass(); \
00568 } \
00569 SoTypedObject::checkDatabase(SO__QUOTE(className), this, className::getClassTypeId(), classTypeId); \
00570 }
00571 #else
00572 #define SO_FIELD_CHECK_INIT(className) { \
00573 if (classTypeId.isBad()) { \
00574 className::initClass(); \
00575 } \
00576 }
00577 #endif
00578
00580
00581
00582
00584
00585 #define SO_SFIELD_CONSTRUCTOR_SOURCE(className) \
00586 \
00587 className::className() \
00588 { \
00589 SO_FIELD_CHECK_INIT(className) \
00590 } \
00591 className::~className() \
00592 { \
00593 }
00594
00596
00597
00598
00599
00601
00602 #define SO_SFIELD_VALUE_SOURCE(className, valueType, valueRef) \
00603 \
00604 void \
00605 className::setValue(valueRef newValue) \
00606 { \
00607 \
00608 \
00609 if ( getSameValueNotificationEnabled() || getContainer() == NULL || !(value==newValue) ) \
00610 { \
00611 value = newValue; \
00612 valueChanged(); \
00613 } \
00614 } \
00615 \
00616 int \
00617 className::operator ==(const className &f) const \
00618 { \
00619 return getValue() == f.getValue(); \
00620 }
00621
00623
00624
00625
00626
00628
00629 #define SO_SFIELD_SOURCE(className, valueType, valueRef) \
00630 SO_SFIELD_REQUIRED_SOURCE(className) \
00631 SO_SFIELD_CONSTRUCTOR_SOURCE(className) \
00632 SO_SFIELD_VALUE_SOURCE(className, valueType, valueRef)
00633
00635
00636
00637
00638
00639
00641
00642 #define SO_SFIELD_DERIVED_SOURCE(className, valueType, valueRef) \
00643 SO_SFIELD_REQUIRED_SOURCE(className) \
00644 SO_SFIELD_CONSTRUCTOR_SOURCE(className)
00645
00646
00647
00648
00649
00650
00651
00652
00654
00655
00656
00657
00659
00660 #define SO_MFIELD_INIT_CLASS(className,parentClass) \
00661 SO__FIELD_INIT_CLASS(className, SO__QUOTE(className), parentClass);
00662
00663 #define SO_MFIELD_EXIT_CLASS(className) \
00664 SO__FIELD_EXIT_CLASS(className)
00665
00667
00668
00669
00670
00672
00673 #define SO_MFIELD_REQUIRED_SOURCE(className) \
00674 \
00675 SO__FIELD_ID_SOURCE(className) \
00676 SO__FIELD_EQ_SAME_SOURCE(className) \
00677 \
00678 const className & \
00679 className::operator =(const className &f) \
00680 { \
00681 if (f.getNum() < getNum()) \
00682 deleteAllValues(); \
00683 setValues(0, f.getNum(), f.getValues(0)); \
00684 return *this; \
00685 }
00686
00688
00689
00690
00691
00692
00693
00695
00696 #define SO_MFIELD_CONSTRUCTOR_SOURCE(className) \
00697 \
00698 className::className() \
00699 { \
00700 SO_FIELD_CHECK_INIT(className) \
00701 values = NULL; \
00702 resetChangedStatus (); \
00703 m_memObj = NULL; \
00704 } \
00705 \
00706 className::~className() \
00707 { \
00708 deleteAllValues(); \
00709 \
00710 }
00711
00713
00714
00715
00716
00717
00719
00720 #define SO_MFIELD_DERIVED_CONSTRUCTOR_SOURCE(className) \
00721 \
00722 className::className() \
00723 { \
00724 SO_FIELD_CHECK_INIT(className) \
00725 resetChangedStatus (); \
00726 } \
00727 \
00728 className::~className() \
00729 { \
00730 }
00731
00733
00734
00735
00736
00738
00739 #define SO_MFIELD_VALUE_SOURCE(className, valueType, valueRef) \
00740 \
00741 int \
00742 className::find(valueRef targetValue, SbBool addIfNotFound) \
00743 { \
00744 int i, myNum = getNum(); \
00745 \
00746 if (values) { \
00747 for (i = 0; i < myNum; i++) \
00748 if (values[i] == targetValue) \
00749 return i; \
00750 } \
00751 \
00752 if (addIfNotFound) \
00753 set1Value(myNum, targetValue); \
00754 \
00755 return -1; \
00756 } \
00757 \
00758 void \
00759 className::setValues(int start, int myNum, const valueType *newValues) \
00760 { \
00761 int newNum = start + myNum, i; \
00762 \
00763 if (newNum > getNum()) \
00764 makeRoom(newNum); \
00765 \
00766 if (values) { \
00767 for (i = 0; i < myNum; i++) \
00768 values[start + i] = newValues[i]; \
00769 \
00770 valueChanged(start, myNum); \
00771 } \
00772 } \
00773 \
00774 void \
00775 className::set1Value(int index, valueRef newValue) \
00776 { \
00777 if (index >= getNum()) \
00778 makeRoom(index + 1); \
00779 if (values) { \
00780 values[index] = newValue; \
00781 valueChanged(index, 1); \
00782 } \
00783 } \
00784 \
00785 void \
00786 className::setValue(valueRef newValue) \
00787 { \
00788 makeRoom(1); \
00789 if (values) { \
00790 values[0] = newValue; \
00791 valueChanged(0,1); \
00792 } \
00793 } \
00794 \
00795 int \
00796 className::operator ==(const className &f) const \
00797 { \
00798 int i, myNum = getNum(); \
00799 const valueType *myVals, *itsVals; \
00800 \
00801 if (myNum != f.getNum()) \
00802 return FALSE; \
00803 \
00804 myVals = getValues(0); \
00805 itsVals = f.getValues(0); \
00806 \
00807 for (i = 0; i < myNum; i++) \
00808 if (! (myVals[i] == itsVals[i])) \
00809 return FALSE; \
00810 \
00811 return TRUE; \
00812 } \
00813 \
00814 void \
00815 className::deleteAllValues() \
00816 { \
00817 allocValues(0); \
00818 } \
00819 \
00820 void \
00821 className::copyValue(int to, int from) \
00822 { \
00823 values[to] = values[from]; \
00824 }
00825
00827
00828
00829
00830
00831
00833
00834 #define SO_MFIELD_ALLOC_SOURCE(className, valueType) \
00835 void \
00836 className::allocValues(int newNum) \
00837 { \
00838 if (values == NULL) { \
00839 if (newNum > 0) { \
00840 values = new valueType[newNum]; \
00841 if (values == NULL) { \
00842 SoMemoryError::post( "SO_MFIELD_ALLOC_SOURCE: Cannot allocate memory for the fields!" ); \
00843 newNum = 0; \
00844 } \
00845 } \
00846 } \
00847 else { \
00848 valueType *oldValues = values; \
00849 int i; \
00850 \
00851 if (newNum > 0) { \
00852 values = new valueType[newNum]; \
00853 if (values == NULL) { \
00854 SoMemoryError::post( "SO_MFIELD_ALLOC_SOURCE: Cannot allocate memory for the fields!" ); \
00855 newNum = num; \
00856 } \
00857 else { \
00858 for (i = 0; i < num && i < newNum; i++) \
00859 values[i] = oldValues[i]; \
00860 delete [] oldValues; \
00861 } \
00862 } \
00863 else { \
00864 values = NULL; \
00865 delete [] oldValues; \
00866 } \
00867 } \
00868 \
00869 num = newNum; \
00870 }
00871
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00884
00885 #define SO_MFIELD_MALLOC_SOURCE(className, valueType) \
00886 void \
00887 className::allocValues(int newNum) \
00888 { \
00889 void *before = (void *)values; \
00890 \
00891 if (values == NULL) { \
00892 if (newNum > 0) { \
00893 values = static_cast<valueType*>(malloc(sizeof(valueType) * newNum)); \
00894 if (values == NULL) { \
00895 SoMemoryError::post( "SO_MFIELD_MALLOC_SOURCE: Cannot allocate memory for the fields!" ); \
00896 newNum = 0; \
00897 } \
00898 } \
00899 } \
00900 else { \
00901 \
00902 \
00903 \
00904 if (newNum == 1) {\
00905 valueType value0 = *(static_cast<valueType*>(values)); \
00906 if (isDeleteValuesEnabled()) \
00907 free((char *) values);\
00908 values = (valueType *) malloc(sizeof(valueType)); \
00909 if (values == NULL) { \
00910 SoMemoryError::post( "SO_MFIELD_MALLOC_SOURCE: Cannot allocate memory for the fields!" ); \
00911 newNum = num; \
00912 } \
00913 else { \
00914 *((valueType *)values) = value0; \
00915 setUserDataIsUsed(false);\
00916 } \
00917 } \
00918 \
00919 else if (newNum > 1) { \
00920 void *after = NULL; \
00921 if (getUserDataIsUsed() == false) { \
00922 after = realloc(values, sizeof(valueType) * newNum); \
00923 } else { \
00924 \
00925 after = malloc(sizeof(valueType) * newNum); \
00926 if ( after ) \
00927 memcpy(after, before, sizeof(valueType) * (num < newNum ? num : newNum) ); \
00928 } \
00929 if (after == NULL) { \
00930 SoMemoryError::post( "SO_MFIELD_MALLOC_SOURCE: Cannot allocate memory for the fields!" ); \
00931 newNum = num; \
00932 } \
00933 else \
00934 values = (valueType *)after; \
00935 } \
00936 else { \
00937 if (getUserDataIsUsed() == false) { \
00938 free((char *)values); \
00939 } \
00940 values = NULL; \
00941 } \
00942 } \
00943 num = newNum; \
00944 \
00945 if (before != (void *)values) { \
00946 setUserDataIsUsed(false); \
00947 } \
00948 }
00949
00951
00952
00953
00954
00955
00957
00958 #define SO_MFIELD_SOURCE(className, valueType, valueRef) \
00959 SO_MFIELD_REQUIRED_SOURCE(className) \
00960 SO_MFIELD_CONSTRUCTOR_SOURCE(className) \
00961 SO_MFIELD_VALUE_SOURCE(className, valueType, valueRef) \
00962 SO_MFIELD_ALLOC_SOURCE(className, valueType)
00963
00965
00966
00967
00968
00970
00971 #define SO_MFIELD_SOURCE_MALLOC(className, valueType, valueRef) \
00972 SO_MFIELD_REQUIRED_SOURCE(className) \
00973 SO_MFIELD_CONSTRUCTOR_SOURCE(className) \
00974 SO_MFIELD_VALUE_SOURCE(className, valueType, valueRef) \
00975 SO_MFIELD_MALLOC_SOURCE(className, valueType)
00976
00978
00979
00980
00981
00982
00984
00985 #define SO_MFIELD_DERIVED_SOURCE(className, valueType, valueRef) \
00986 SO_MFIELD_REQUIRED_SOURCE(className); \
00987 SO_MFIELD_DERIVED_CONSTRUCTOR_SOURCE(className)
00988
00989
00991
00992
00993
00994
00995 #define SO_MFIELD_SETVALUESPOINTER_HEADER(userType) \
00996 public: \
00997 \
00998 \
00999 \
01000 \
01001 \
01002 \
01003 \
01004 \
01005 \
01006 \
01007 \
01008 \
01009 \
01010
01011
01012
01013
01014 void setValuesPointer(int num, const userType *userData); \
01015 \ \
01017
01018 void setValuesPointer(int num, userType *userData)
01019
01020
01021
01022
01023
01024
01025
01026
01027
01028 #include <Inventor/errors/SoDebugError.h>
01029 #define SO_MFIELD_SETVALUESPOINTER_SOURCE(className, valueType, userType) \
01030 void \
01031 className::setValuesPointer(int myNum, const userType *userData) \
01032 { \
01033 if (myNum > 0 && userData != NULL) { \
01034 if ( getUserDataIsUsed() && userData == (const userType*)values ) { \
01035 } \
01036 else if (getNum() > 0) { \
01037 makeRoom(0); \
01038 } \
01039 values = (valueType *)userData; \
01040 setUserDataIsUsed(true); \
01041 num = myNum; \
01042 valueChanged(0, num); \
01043 } \
01044 } \
01045 \
01046 void \
01047 className::setValuesPointer(int myNum, userType *userData) \
01048 { \
01049 setValuesPointer(myNum, (const userType *)userData); \
01050 }
01051
01052 #endif
01053
01054
01055