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 valueType const* getValues(int start) const \
00354 { evaluate(); return const_cast<valueType const*>(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, valueType const* 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 : value() \
00589 { \
00590 SO_FIELD_CHECK_INIT(className) \
00591 } \
00592 className::~className() \
00593 { \
00594 }
00595
00597
00598
00599
00600
00602
00603 #define SO_SFIELD_VALUE_SOURCE(className, valueType, valueRef) \
00604 \
00605 void \
00606 className::setValue(valueRef newValue) \
00607 { \
00608 \
00609 \
00610 if ( getSameValueNotificationEnabled() || getContainer() == NULL || !(value==newValue) ) \
00611 { \
00612 value = newValue; \
00613 valueChanged(); \
00614 } \
00615 } \
00616 \
00617 int \
00618 className::operator ==(const className &f) const \
00619 { \
00620 return getValue() == f.getValue(); \
00621 }
00622
00624
00625
00626
00627
00629
00630 #define SO_SFIELD_SOURCE(className, valueType, valueRef) \
00631 SO_SFIELD_REQUIRED_SOURCE(className) \
00632 SO_SFIELD_CONSTRUCTOR_SOURCE(className) \
00633 SO_SFIELD_VALUE_SOURCE(className, valueType, valueRef)
00634
00636
00637
00638
00639
00641
00642 #define SO_SFIELD_DERIVED_CONSTRUCTOR_SOURCE(className) \
00643 \
00644 className::className() \
00645 { \
00646 SO_FIELD_CHECK_INIT(className) \
00647 } \
00648 className::~className() \
00649 { \
00650 }
00651
00652
00654
00655
00656
00657
00658
00660
00661 #define SO_SFIELD_DERIVED_SOURCE(className, valueType, valueRef) \
00662 SO_SFIELD_REQUIRED_SOURCE(className) \
00663 SO_SFIELD_DERIVED_CONSTRUCTOR_SOURCE(className)
00664
00665
00666
00667
00668
00669
00670
00671
00673
00674
00675
00676
00678
00679 #define SO_MFIELD_INIT_CLASS(className,parentClass) \
00680 SO__FIELD_INIT_CLASS(className, SO__QUOTE(className), parentClass);
00681
00682 #define SO_MFIELD_EXIT_CLASS(className) \
00683 SO__FIELD_EXIT_CLASS(className)
00684
00686
00687
00688
00689
00691
00692 #define SO_MFIELD_REQUIRED_SOURCE(className) \
00693 \
00694 SO__FIELD_ID_SOURCE(className) \
00695 SO__FIELD_EQ_SAME_SOURCE(className) \
00696 \
00697 const className & \
00698 className::operator =(const className &f) \
00699 { \
00700 if (f.getNum() < getNum()) \
00701 deleteAllValues(); \
00702 setValues(0, f.getNum(), f.getValues(0)); \
00703 return *this; \
00704 }
00705
00707
00708
00709
00710
00711
00712
00714
00715 #define SO_MFIELD_CONSTRUCTOR_SOURCE(className) \
00716 \
00717 className::className() \
00718 { \
00719 SO_FIELD_CHECK_INIT(className) \
00720 values = NULL; \
00721 resetChangedStatus (); \
00722 m_memObj = NULL; \
00723 } \
00724 \
00725 className::~className() \
00726 { \
00727 deleteAllValues(); \
00728 \
00729 }
00730
00732
00733
00734
00735
00736
00738
00739 #define SO_MFIELD_DERIVED_CONSTRUCTOR_SOURCE(className) \
00740 \
00741 className::className() \
00742 { \
00743 SO_FIELD_CHECK_INIT(className) \
00744 resetChangedStatus (); \
00745 } \
00746 \
00747 className::~className() \
00748 { \
00749 }
00750
00752
00753
00754
00755
00757
00758 #define SO_MFIELD_VALUE_SOURCE(className, valueType, valueRef) \
00759 \
00760 int \
00761 className::find(valueRef targetValue, SbBool addIfNotFound) \
00762 { \
00763 int i, myNum = getNum(); \
00764 \
00765 if (values) { \
00766 for (i = 0; i < myNum; i++) \
00767 if (values[i] == targetValue) \
00768 return i; \
00769 } \
00770 \
00771 if (addIfNotFound) \
00772 set1Value(myNum, targetValue); \
00773 \
00774 return -1; \
00775 } \
00776 \
00777 void \
00778 className::setValues(int start, int myNum, valueType const*newValues) \
00779 { \
00780 int newNum = start + myNum, i; \
00781 \
00782 if (newNum > getNum()) \
00783 makeRoom(newNum); \
00784 \
00785 if (values) { \
00786 for (i = 0; i < myNum; i++) \
00787 values[start + i] = newValues[i]; \
00788 \
00789 valueChanged(start, myNum); \
00790 } \
00791 } \
00792 \
00793 void \
00794 className::set1Value(int index, valueRef newValue) \
00795 { \
00796 if (index >= getNum()) \
00797 makeRoom(index + 1); \
00798 else if ( !getSameValueNotificationEnabled() && (values[index]==newValue) ) \
00799 return; \
00800 if (values) { \
00801 values[index] = newValue; \
00802 valueChanged(index, 1); \
00803 } \
00804 } \
00805 \
00806 void \
00807 className::setValue(valueRef newValue) \
00808 { \
00809 makeRoom(1); \
00810 if (values) { \
00811 values[0] = newValue; \
00812 valueChanged(0,1); \
00813 } \
00814 } \
00815 \
00816 int \
00817 className::operator ==(const className &f) const \
00818 { \
00819 int i, myNum = getNum(); \
00820 valueType const*myVals, *itsVals; \
00821 \
00822 if (myNum != f.getNum()) \
00823 return FALSE; \
00824 \
00825 myVals = getValues(0); \
00826 itsVals = f.getValues(0); \
00827 \
00828 for (i = 0; i < myNum; i++) \
00829 if (! (myVals[i] == itsVals[i])) \
00830 return FALSE; \
00831 \
00832 return TRUE; \
00833 } \
00834 \
00835 void \
00836 className::deleteAllValues() \
00837 { \
00838 allocValues(0); \
00839 } \
00840 \
00841 void \
00842 className::copyValue(int to, int from) \
00843 { \
00844 values[to] = values[from]; \
00845 }
00846
00848
00849
00850
00851
00852
00854
00855 #define SO_MFIELD_ALLOC_SOURCE(className, valueType) \
00856 void \
00857 className::allocValues(int newNum) \
00858 { \
00859 if (values == NULL) { \
00860 if (newNum > 0) { \
00861 values = new valueType[newNum]; \
00862 if (values == NULL) { \
00863 SoMemoryError::post( "SO_MFIELD_ALLOC_SOURCE: Cannot allocate memory for the fields!" ); \
00864 newNum = 0; \
00865 } \
00866 } \
00867 } \
00868 else { \
00869 valueType *oldValues = values; \
00870 int i; \
00871 \
00872 if (newNum > 0) { \
00873 values = new valueType[newNum]; \
00874 if (values == NULL) { \
00875 SoMemoryError::post( "SO_MFIELD_ALLOC_SOURCE: Cannot allocate memory for the fields!" ); \
00876 newNum = num; \
00877 } \
00878 else { \
00879 for (i = 0; i < num && i < newNum; i++) \
00880 values[i] = oldValues[i]; \
00881 delete [] oldValues; \
00882 } \
00883 } \
00884 else { \
00885 values = NULL; \
00886 delete [] oldValues; \
00887 } \
00888 } \
00889 \
00890 num = newNum; \
00891 }
00892
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00905
00906 #define SO_MFIELD_MALLOC_SOURCE(className, valueType) \
00907 void \
00908 className::allocValues(int newNum) \
00909 { \
00910 void *before = (void *)values; \
00911 \
00912 if (values == NULL) { \
00913 if (newNum > 0) { \
00914 values = static_cast<valueType*>(malloc(sizeof(valueType) * newNum)); \
00915 if (values == NULL) { \
00916 SoMemoryError::post( "SO_MFIELD_MALLOC_SOURCE: Cannot allocate memory for the fields!" ); \
00917 newNum = 0; \
00918 } \
00919 } \
00920 } \
00921 else { \
00922 \
00923 \
00924 \
00925 if (newNum == 1) {\
00926 valueType value0 = *(static_cast<valueType*>(values)); \
00927 if (isDeleteValuesEnabled()) \
00928 free((char *) values);\
00929 values = (valueType *) malloc(sizeof(valueType)); \
00930 if (values == NULL) { \
00931 SoMemoryError::post( "SO_MFIELD_MALLOC_SOURCE: Cannot allocate memory for the fields!" ); \
00932 newNum = num; \
00933 } \
00934 else { \
00935 *((valueType *)values) = value0; \
00936 setUserDataIsUsed(false);\
00937 } \
00938 } \
00939 \
00940 else if (newNum > 1) { \
00941 void *after = NULL; \
00942 if (getUserDataIsUsed() == false) { \
00943 after = realloc(values, sizeof(valueType) * newNum); \
00944 } else { \
00945 \
00946 after = malloc(sizeof(valueType) * newNum); \
00947 if ( after ) \
00948 memcpy(after, before, sizeof(valueType) * (num < newNum ? num : newNum) ); \
00949 } \
00950 if (after == NULL) { \
00951 SoMemoryError::post( "SO_MFIELD_MALLOC_SOURCE: Cannot allocate memory for the fields!" ); \
00952 newNum = num; \
00953 } \
00954 else \
00955 values = (valueType *)after; \
00956 } \
00957 else { \
00958 if (getUserDataIsUsed() == false) { \
00959 free((char *)values); \
00960 } \
00961 values = NULL; \
00962 } \
00963 } \
00964 num = newNum; \
00965 \
00966 if (before != (void *)values) { \
00967 setUserDataIsUsed(false); \
00968 } \
00969 }
00970
00972
00973
00974
00975
00976
00978
00979 #define SO_MFIELD_SOURCE(className, valueType, valueRef) \
00980 SO_MFIELD_REQUIRED_SOURCE(className) \
00981 SO_MFIELD_CONSTRUCTOR_SOURCE(className) \
00982 SO_MFIELD_VALUE_SOURCE(className, valueType, valueRef) \
00983 SO_MFIELD_ALLOC_SOURCE(className, valueType)
00984
00986
00987
00988
00989
00991
00992 #define SO_MFIELD_SOURCE_MALLOC(className, valueType, valueRef) \
00993 SO_MFIELD_REQUIRED_SOURCE(className) \
00994 SO_MFIELD_CONSTRUCTOR_SOURCE(className) \
00995 SO_MFIELD_VALUE_SOURCE(className, valueType, valueRef) \
00996 SO_MFIELD_MALLOC_SOURCE(className, valueType)
00997
00999
01000
01001
01002
01003
01005
01006 #define SO_MFIELD_DERIVED_SOURCE(className, valueType, valueRef) \
01007 SO_MFIELD_REQUIRED_SOURCE(className); \
01008 SO_MFIELD_DERIVED_CONSTRUCTOR_SOURCE(className)
01009
01010
01012
01013
01014
01015
01016 #define SO_MFIELD_SETVALUESPOINTER_HEADER(userType) \
01017 public: \
01018 \
01019 \
01020 \
01021 \
01022 \
01023 \
01024 \
01025 \
01026 \
01027 \
01028 \
01029 \
01030 \
01031
01032
01033
01034
01035 void setValuesPointer(int num, userType const*userData); \
01036 \ \
01038
01039 void setValuesPointer(int num, userType *userData)
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049 #include <Inventor/errors/SoDebugError.h>
01050 #define SO_MFIELD_SETVALUESPOINTER_SOURCE(className, valueType, userType) \
01051 void \
01052 className::setValuesPointer(int myNum, userType const*userData) \
01053 { \
01054 if (myNum > 0 && userData != NULL) { \
01055 if ( getUserDataIsUsed() && userData == (userType const*)values ) { \
01056 } \
01057 else if (getNum() > 0) { \
01058 makeRoom(0); \
01059 } \
01060 values = (valueType *)userData; \
01061 setUserDataIsUsed(true); \
01062 num = myNum; \
01063 valueChanged(0, num); \
01064 } \
01065 } \
01066 \
01067 void \
01068 className::setValuesPointer(int myNum, userType *userData) \
01069 { \
01070 setValuesPointer(myNum, (userType const*)userData); \
01071 }
01072
01073 #endif
01074
01075
01076