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 #ifndef _SO_MF_IMAGE_
00026 #define _SO_MF_IMAGE_
00027
00028 #include <Inventor/fields/SoSubField.h>
00029 #include <Inventor/SbLinear.h>
00030 #include <Inventor/SbPList.h>
00031
00033
00034
00035
00037
00101 class SoMFImage : public SoMField {
00102
00103
00104
00105 SO_MFIELD_REQUIRED_HEADER(SoMFImage);
00106 SO__MFIELD_RW_HEADER(SoMFImage);
00107 SO_MFIELD_CONSTRUCTOR_HEADER(SoMFImage);
00108
00109 public:
00117 enum CopyPolicy {
00121 COPY = 0,
00125 NO_COPY = 1,
00130 NO_COPY_AND_DELETE = 2,
00135 NO_COPY_AND_FREE = 3
00136 };
00137
00138
00139
00140
00147 const unsigned char *getValue(SbVec2s &size, int &nc) const;
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00170 void setValue(const SbVec2s &size, int nc,
00171 const unsigned char *bytes,
00172 CopyPolicy copy = COPY);
00173 #ifdef NOTNOW
00174
00184 void setSubValue(const SbVec2s &subSize,
00185 const SbVec2s &offset,
00186 unsigned char *bytes);
00187
00198 void setSubValues(const SbVec2s *subSizes,
00199 const SbVec2s *offsets,
00200 int num, unsigned char **bytes);
00204 int operator ==(const SoMFImage &f) const;
00205
00209 int operator !=(const SoMFImage &f) const
00210 { return ! ((*this) == f); }
00211
00219 unsigned char *startEditing(SbVec2s &size, int &nc);
00220
00225 void finishEditing();
00226
00233 unsigned char *getSubTexture(int index, SbVec2s &size, SbVec2s &offset);
00234
00239 SbBool hasSubTextures(int &numSubTextures);
00240 #endif
00241
00248 void setNeverWrite(SbBool neverWrite);
00249
00253 SbBool isNeverWrite()
00254 { return neverWrite ; }
00255
00261 SbBool hasTransparency() const;
00262
00263 private:
00264
00265 static void initClass();
00266
00267 void resetSubTextures();
00268
00269 private:
00270
00271
00272 SbVec2s size;
00273
00274
00275 int numComponents;
00276
00277
00278 unsigned char *bytes;
00279
00280 CopyPolicy copyPolicy;
00281
00282
00283
00284 SbBool neverWrite;
00285
00286
00287 int m_hasTransparency;
00288
00289
00290 virtual SbBool readValue(SoInput *in);
00291 virtual void writeValue(SoOutput *out) const;
00292 };
00293
00294 #endif
00295
00296