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
00051 #ifndef _SO_VRMLIMAGE_TEXTURE_
00052 #define _SO_VRMLIMAGE_TEXTURE_
00053
00054 #include <Inventor/VRMLnodes/SoVRMLTexture.h>
00055 #include <Inventor/fields/SoSFImage.h>
00056 #include <Inventor/fields/SoSFColor.h>
00057 #include <Inventor/fields/SoSFEnum.h>
00058 #include <Inventor/fields/SoSFBool.h>
00059 #include <Inventor/fields/SoSFBool.h>
00060 #include <Inventor/fields/SoMFString.h>
00061 #include <Inventor/fields/SoMFFilePathString.h>
00062 #include <Inventor/nodes/SoNode.h>
00063 #include <Inventor/nodes/SoTexture.h>
00064 #include <Inventor/image/SbRasterImage.h>
00065 #include <Inventor/caches/SoGLTexCacheList.h>
00066 #include <Inventor/threads/SbThreadStorage.h>
00067
00068
00069 #if defined(OIV_IGNORE_VRML_DEPRECATED)
00070 #include <SoDeprecationRules.h>
00071 #pragma push_macro("SoDEPRECATED_CLASS")
00072 #pragma push_macro("SoDEPRECATED_TYPEDEF")
00073 #undef SoDEPRECATED_CLASS
00074 #undef SoDEPRECATED_TYPEDEF
00075 #define SoDEPRECATED_CLASS(x,y)
00076 #define SoDEPRECATED_TYPEDEF(x,y)
00077 #endif
00078
00079 class SoSensor;
00080 class SoFieldSensor;
00081 class SbThreadRWMutex;
00082
00083 #ifdef _MSC_VER
00084 #pragma warning( push )
00085 #pragma warning(disable:4251)
00086
00087 #endif
00089 //
00090
00091
00092
00093
00095
00096 class SoVRMLImageTexture;
00100 typedef SoDEPRECATED SbBool VRMLPrequalifyFileCallback(const SbString &, void *, SoVRMLImageTexture *);
00101 class SoDEPRECATED SoVRMLImageTexture : public SoVRMLTexture {
00254
00255 SO_NODE_HEADER(SoVRMLImageTexture);
00256
00257 public:
00263 SoMFFilePathString url;
00264
00268 SoVRMLImageTexture();
00269
00274 static void setPrequalifyFileCallBack(VRMLPrequalifyFileCallback *, void *);
00279 void allowPrequalifyFile(SbBool);
00280
00282 enum FileType {
00284 UNKNOWN = SoTexture::UNKNOWN,
00286 RGB = SoTexture::RGB,
00288 SGI = SoTexture::SGI,
00290 TIFF = SoTexture::TIFF,
00292 GIF = SoTexture::GIF,
00294 JPEG = SoTexture::JPEG,
00296 BMP = SoTexture::BMP,
00298 PNG = SoTexture::PNG,
00300 JPEG2000 = SoTexture::JPEG2000,
00302 PGX = SoTexture::PGX,
00304 PNM = SoTexture::PNM,
00306 RAS = SoTexture::RAS,
00308 DDS = SoTexture::DDS,
00310 HDRI = SoTexture::HDRI,
00312 NUM_FILETYPES };
00313
00314 void setBitmapFileType(FileType in_type) { m_filetype = in_type; }
00315 FileType getBitmapFileType(void) { return (m_filetype); }
00321 const unsigned char * getImage(SbVec2s &size, int &numcomp);
00322
00323 private:
00324
00325 virtual void doAction(SoAction *action);
00326 virtual void GLRender(SoGLRenderAction *action);
00327 virtual void callback(SoCallbackAction *action);
00328
00329 private:
00330 static void initClass();
00331 static void exitClass();
00332 const SbString & getOverrideURL() { return overrideURL; }
00333 void setOverrideURL(const SbString &path) { overrideURL = path; }
00334
00335
00336
00337
00338
00339 SoSFEnum textureModel;
00340
00341 private:
00342
00343 virtual SbBool readInstance(SoInput *in, unsigned short flags);
00344
00345 virtual ~SoVRMLImageTexture();
00346
00347
00348 void checkTextureModel( int numComponents );
00349
00350 int getReadStatus() { return readStatus; }
00351 void setReadStatus(int s) { readStatus = s; }
00352
00353
00354 virtual void copyContents(const SoFieldContainer *fromFC,
00355 SbBool copyConnections);
00356
00357 private:
00358
00359 SbString overrideURL;
00360 SoFieldSensor *imageSensor;
00361 static void imageChangedCB(void *, SoSensor *);
00362 SoFieldSensor *filenameSensor;
00363 static void filenameChangedCB(void *, SoSensor *);
00364 SoFieldSensor *repeatSSensor;
00365 static void repeatChangedCB(void *, SoSensor *);
00366 SoFieldSensor *repeatTSensor;
00367
00368 int readStatus;
00369
00370 static VRMLPrequalifyFileCallback *prequalifyFileCB;
00371 static void *prequalifyFileCB_udata;
00372
00373 SbBool prequalifyFileFlag;
00374
00375
00376 SbThreadStorage< SoGLTexCacheList* > m_texList;
00377
00378 SbThreadRWMutex *m_mutex;
00379
00380
00381
00382 SoMFString model;
00383 SoSFColor blendColor;
00384 SoSFImage image;
00385
00386 FileType m_filetype;
00387
00388 int m_numRenderCaches;
00389 };
00390
00391 #ifdef _MSC_VER
00392 #pragma warning( pop )
00393
00394 #endif
00395
00396
00397 #if defined(OIV_IGNORE_VRML_DEPRECATED)
00398 #pragma pop_macro("SoDEPRECATED_TYPEDEF")
00399 #pragma pop_macro("SoDEPRECATED_CLASS")
00400 #endif
00401
00402 #endif
00403