00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef COIN_SOMFIELD_H
00021 #define COIN_SOMFIELD_H
00022
00023 #include <Inventor/fields/SoField.h>
00024
00025 class SoInput;
00026 class SoOutput;
00027
00028
00029 class COIN_DLL_API SoMField : public SoField {
00030 typedef SoField inherited;
00031
00032 public:
00033 virtual ~SoMField();
00034
00035 static SoType getClassTypeId(void);
00036
00037 int getNum(void) const;
00038 void setNum(const int num);
00039
00040 virtual void deleteValues(int start, int num = -1);
00041 virtual void insertSpace(int start, int num);
00042
00043 SbBool set1(const int index, const char * const valuestring);
00044 void get1(const int index, SbString & valuestring);
00045
00046 static void initClass(void);
00047
00048 protected:
00049 SoMField(void);
00050 virtual void makeRoom(int newnum);
00051
00052 #ifndef DOXYGEN_SKIP_THIS // Internal methods.
00053 virtual int fieldSizeof(void) const = 0;
00054 virtual void * valuesPtr(void) = 0;
00055 virtual void setValuesPtr(void * ptr) = 0;
00056 virtual void allocValues(int num);
00057 #endif // DOXYGEN_SKIP_THIS
00058
00059 int num;
00060 int maxNum;
00061
00062 private:
00063 virtual void deleteAllValues(void) = 0;
00064 virtual void copyValue(int to, int from) = 0;
00065 virtual SbBool readValue(SoInput * in);
00066 virtual SbBool read1Value(SoInput * in, int idx) = 0;
00067 virtual void writeValue(SoOutput * out) const;
00068 virtual void write1Value(SoOutput * out, int idx) const = 0;
00069 virtual SbBool readBinaryValues(SoInput * in, int num);
00070 virtual void writeBinaryValues(SoOutput * out) const;
00071 virtual int getNumValuesPerLine(void) const;
00072
00073 static SoType classTypeId;
00074 };
00075
00076
00077
00078 inline int
00079 SoMField::getNum(void) const
00080 {
00081 this->evaluate();
00082 return this->num;
00083 }
00084
00085
00086 #endif // !COIN_SOMFIELD_H