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_VOLUME_SHAPE_H
00026 #define SO_VOLUME_SHAPE_H
00027
00028 #include <Inventor/nodes/SoShape.h>
00029
00030 #include <Inventor/fields/SoSFBool.h>
00031 #include <Inventor/fields/SoSFFloat.h>
00032 #include <Inventor/fields/SoSFEnum.h>
00033 #include <Inventor/fields/SoSFUInt32.h>
00034 #include <Inventor/fields/SoSFNode.h>
00035
00036 #include <Inventor/STL/vector>
00037
00038 #include <Inventor/sys/SoGLType.h>
00039
00040 #include <Inventor/SbViewportRegion.h>
00041
00042 #include <LDM/nodes/SoTransferFunction.h>
00043 #include <LDM/nodes/SoLdmShape.h>
00044
00045 class SoState;
00046 class SoVolumeData;
00047 class SoVolumeRenderingQuality;
00048 class SoVolumeShader;
00049 class SoVolumeShaderARB;
00050 class SoVolumeState;
00051
00052 #ifdef _WIN32
00053 #pragma warning( push )
00054 #pragma warning(disable:4251)
00055 #endif
00056
00057
00085 class SoVolumeShape : public SoLdmShape {
00086 SO_NODE_ABSTRACT_HEADER(SoVolumeShape);
00087
00088 public:
00089
00094 enum Interpolation {
00098 NEAREST,
00104 LINEAR,
00113 TRILINEAR,
00123 MULTISAMPLE_12,
00164 CUBIC
00165 };
00166
00173 SoSFEnum interpolation;
00174
00175 #if 1 SoDEPRECATED enum
00181 Composition {
00183 MAX_INTENSITY = 0,
00185 MIN_INTENSITY,
00187 SUM_INTENSITY,
00189 ALPHA_BLENDING,
00190 COMPOSITION_LAST
00191 };
00192 SoDEPRECATED
00219 SoSFEnum composition;
00220
00221 #endif
00223 private:
00224
00226 virtual void GLRender(SoGLRenderAction *action);
00227
00229 virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er);
00230
00232 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
00233
00234
00235
00236 virtual int32_t getRenderUnitID() const;
00237
00238 private:
00239
00241 static void initClass();
00242
00244 static void exitClass();
00245
00249 void setVVizUniforms( SoGLRenderAction* action,
00250 const float *sliceTangent, const float *sliceBinormal,
00251 float scale, float sliceSpacing,
00252 const SbVec3f& scaleFactor,
00253 const SbVec3f& lowResScaleFactor, SbBool doTexGen = TRUE,
00254 const SbMatrix* virtToPageTableMatrix = NULL, const SbMatrix* shapeToVirtMatrix = NULL);
00255
00259 void setVVizZAxis( SoGLRenderAction* action, const SbVec3f& zAxis );
00260
00266 virtual bool enableColorMap(SoState *state,
00267 SoTransferFunction::GLColorMapType colorMapInstalled,
00268 int &texType);
00269
00273 SoTransferFunction::GLColorMapType getInstalledColorMap() const;
00274
00278 int getGLInterpolation();
00279
00283 virtual void enableBlending(SoState *state);
00284
00288 virtual void onUserInteractionChange(SoState* state, bool stopMoving);
00289
00293 SoVolumeShape::Interpolation getInteractiveInterpolationValue(SoState* state) const;
00294
00295 SoVolumeState* getVolumeState() const
00296 {
00297 return m_volumeState;
00298 }
00299
00300 private:
00301 SoVolumeState* m_volumeState;
00302
00303 SoVolumeShape();
00304 virtual ~SoVolumeShape();
00305
00309 virtual bool isTransparent(SoState *state);
00310
00314 virtual void delayRendering( SoGLRenderAction* action );
00315
00319 bool isDelayed();
00320
00324 SoVolumeShader* getVolumeShader(SoState *state);
00325
00330 void useSeparateAlphaBlend(bool flag);
00331
00335 GLenum getDepthInternalFormat();
00336
00340 bool isMoving();
00341
00345 virtual void doRendering(SoGLRenderAction* action) = 0;
00346
00347 static void onUserInteractionChangeCb(SoState* state, SoNode* node, bool moving);
00348
00349 #ifndef HIDDEN_FROM_DOC
00350 friend class SoSliceInterface;
00351 friend class SoVolumeState;
00352 #endif
00353
00354 SoINTERNAL private:
00355
00357 virtual void ldmAction( SoLdmValuationAction* action );
00358 };
00359
00360 #if defined(_WIN32)
00361 #pragma warning( pop )
00362 #pragma warning(disable:4251)
00363 #endif
00364
00365 #endif
00366
00367
00368