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
00100 class SoMFImage : public SoMField {
00101
00102
00103
00104 SO_MFIELD_REQUIRED_HEADER(SoMFImage);
00105 SO__MFIELD_RW_HEADER(SoMFImage);
00106 SO_MFIELD_CONSTRUCTOR_HEADER(SoMFImage);
00107
00108 public:
00116 enum CopyPolicy {
00120 COPY = 0,
00124 NO_COPY = 1,
00129 NO_COPY_AND_DELETE = 2,
00134 NO_COPY_AND_FREE = 3
00135 };
00136
00137
00138
00139
00146 const unsigned char *getValue(SbVec2s &size, int &nc) const;
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00169 void setValue(const SbVec2s &size, int nc,
00170 const unsigned char *bytes,
00171 CopyPolicy copy = COPY);
00172 #ifdef NOTNOW
00173
00183 void setSubValue(const SbVec2s &subSize,
00184 const SbVec2s &offset,
00185 unsigned char *bytes);
00186
00197 void setSubValues(const SbVec2s *subSizes,
00198 const SbVec2s *offsets,
00199 int num, unsigned char **bytes);
00203 int operator ==(const SoMFImage &f) const;
00204
00208 int operator !=(const SoMFImage &f) const
00209 { return ! ((*this) == f); }
00210
00218 unsigned char *startEditing(SbVec2s &size, int &nc);
00219
00224 void finishEditing();
00225
00232 unsigned char *getSubTexture(int index, SbVec2s &size, SbVec2s &offset);
00233
00238 SbBool hasSubTextures(int &numSubTextures);
00239 #endif
00240
00247 void setNeverWrite(SbBool neverWrite);
00248
00252 SbBool isNeverWrite()
00253 { return neverWrite ; }
00254
00260 SbBool hasTransparency() const;
00261
00262 private:
00263
00264 static void initClass();
00265
00266 void resetSubTextures();
00267
00268 private:
00269
00270
00271 SbVec2s size;
00272
00273
00274 int numComponents;
00275
00276
00277 unsigned char *bytes;
00278
00279 CopyPolicy copyPolicy;
00280
00281
00282
00283 SbBool neverWrite;
00284
00285
00286 int m_hasTransparency;
00287
00288
00289 virtual SbBool readValue(SoInput *in);
00290 virtual void writeValue(SoOutput *out) const;
00291 };
00292
00293 #endif
00294
00295