00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _SO_EXTTEXTURE_2_
00025 #define _SO_EXTTEXTURE_2_
00026
00027 #include <Inventor/nodes/SoTexture.h>
00028 #include <Inventor/fields/SoSFInt32.h>
00029 #include <Inventor/fields/SoSFFilePathString.h>
00030 #include <Inventor/fields/SoSFTime.h>
00031 #include <Inventor/threads/SbThreadStorage.h>
00032
00033 #include <Inventor/image/SbRasterImage.h>
00034 #include <Inventor/sys/SoGLType.h>
00035
00036 class SoSensor;
00037 class SoDither;
00038
00039 #ifdef _MSC_VER
00040 #pragma warning( push )
00041 #pragma warning(disable:4251)
00042 #endif
00043
00045
00046
00047
00048
00049
00051
00052 class SoExtTexture2;
00056 typedef SbBool ExtPrequalifyFileCallback(const SbString &, void *, SoExtTexture2 *);
00057
00058 SO_PIMPL_PUBLIC_DECLARATION(SoExtTexture2);
00059
00179 class SoExtTexture2 : public SoTexture {
00180
00181 SO_NODE_HEADER(SoExtTexture2);
00182
00183 SO_PIMPL_PUBLIC_HEADER(SoExtTexture2);
00184
00185 public:
00189 typedef void SoExtTexture2CB(void *userData, SoExtTexture2 *tex);
00190
00192 enum Sync
00193 {
00197 SYNCHRONOUS = 0,
00198
00202 ASYNCHRONOUS
00203 };
00204
00206 enum Loading {
00210 AUTO = 0,
00211
00215 MANUAL
00216 };
00217
00230 SoSFFilePathString filename;
00231
00237 SoSFEnum wrapT;
00238
00243 SoSFBool loadingStatus;
00244
00249 SoSFEnum syncMode;
00250
00255 SoSFEnum loadingMode;
00256
00261 SoSFInt32 loadingThreadPriority;
00262
00266 SoExtTexture2();
00267
00281 static void setPrequalifyFileCallBack(ExtPrequalifyFileCallback *p_cb, void *u_data);
00282
00286 void allowPrequalifyFile(SbBool);
00287
00292 void getImageSize(SbVec2s &size, int &nc);
00293
00298 static void setMemorySpace(double megaBytes);
00299
00304 static double getMemorySpace();
00305
00309 static double getGlobalMemoryUsed();
00310
00319 static void useTexturePalette(SbBool value);
00320
00321
00322
00327 void addOnLoadStartCB(SoExtTexture2CB* cb, void* userData);
00328
00333 void addOnLoadFinishCB(SoExtTexture2CB* cb, void* userData);
00334
00340 void addOnUnloadCB(SoExtTexture2CB* cb, void* userData);
00341
00342
00343
00347 void loadTexture();
00348
00349 private:
00350 virtual void doAction(SoAction *action);
00351 virtual void GLRender(SoGLRenderAction *action);
00352 virtual void write(SoWriteAction* action);
00353
00354 private:
00355
00356 static void initClass();
00357 static void exitClass();
00358
00359
00360 SoSFTime sysTime;
00361
00362
00363 virtual void fieldHasChanged( SoField *field );
00364
00365 virtual void copyContents(const SoFieldContainer *fromFC,
00366 SbBool copyConnections);
00367
00368 private:
00369
00370
00371 virtual SbBool readInstance(SoInput *in, unsigned short flags);
00372
00373 virtual ~SoExtTexture2();
00374
00375
00376 };
00377
00378 #ifdef _MSC_VER
00379 #pragma warning( pop )
00380 #endif
00381
00382 #endif
00383
00384