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_COLOR_MAP_
00025 #define _SO_COLOR_MAP_
00026
00027 #include <Inventor/nodes/SoNode.h>
00028 #include <Inventor/fields/SoSFFloat.h>
00029 #include <Inventor/fields/SoMFFloat.h>
00030 #include <Inventor/fields/SoSFEnum.h>
00031 #include <Inventor/SbPImpl.h>
00032
00033 #ifdef _MSC_VER
00034 #pragma warning( push )
00035 #pragma warning(disable:4251)
00036 #endif
00037
00038 SO_PIMPL_BASE_PUBLIC_DECLARATION(SoColorMap)
00039
00040
00141 class SoColorMap : public SoNode {
00142 SO_NODE_HEADER(SoColorMap) ;
00143
00144 SO_PIMPL_BASE_PUBLIC_HEADER(SoColorMap)
00145
00146 public:
00148 enum ColorMapFormat {
00150 LUMINANCE,
00152 ALPHA,
00153
00155 LUMINANCE_ALPHA,
00156
00158 RGB,
00159
00161 RGB_ALPHA
00162 } ;
00163
00165 enum PredefinedColorMap {
00167 NONE,
00169 GRAY,
00171 TEMPERATURE,
00173 PHYSICS,
00175 STANDARD,
00177 GLOW,
00179 BLUE_RED,
00181 SEISMIC,
00183 BLUE_WHITE_RED,
00185 INTENSITY,
00187 LABEL_256,
00189 VOLREN_RED,
00191 VOLREN_GREEN,
00193 AIRWAY,
00195 AIRWAY_SURFACES,
00197 INTENSITY_REVERSED
00198 } ;
00199
00218 SoSFFloat min ;
00219
00223 SoSFFloat max ;
00224
00252 SoSFEnum predefinedColorMap ;
00253
00274 SoSFEnum colorMapFormat ;
00275
00283 SoMFFloat colorMap ;
00284
00289 enum Interpolation
00290 {
00292 NEAREST,
00294 LINEAR
00295 };
00296
00305 SoSFEnum interpolation;
00306
00310 SoColorMap() ;
00311
00316 unsigned int getNumColor() const;
00317
00322 SbBool hasTransparency() const;
00323
00324 private:
00325 virtual void doAction(SoAction *action);
00326 virtual void GLRender(SoGLRenderAction *action) ;
00327 virtual void callback( SoCallbackAction* action );
00328
00329
00330
00331 private:
00332
00333 static void initClass();
00334 static void exitClass();
00335
00339 virtual void notify(SoNotList *list);
00340
00341
00342 void enableFragment(SoState* state, SbBool enable);
00343
00344 void installGLColorMap(SoState* state) ;
00345
00346
00347
00348
00349 void reMap(float minType, float maxType, SbBool forceUpdate = FALSE);
00350
00351
00352 unsigned int* getPackedColorMap() const;
00353
00358 virtual bool affectsPath() const;
00359
00360 private:
00361
00365 virtual ~SoColorMap();
00366
00367 private :
00368
00369
00370 void construct();
00371
00372 } ;
00373
00374
00375 #ifdef _MSC_VER
00376 #pragma warning( pop )
00377 #endif
00378
00379 #endif
00380
00381
00382