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_VOLUME_GEOMETRY_H
00025 #define SO_VOLUME_GEOMETRY_H
00026
00027 #ifdef _MSC_VER
00028 #pragma warning(push)
00029 #pragma warning(disable:4251)
00030 #endif
00031
00032 #include <Inventor/SbBox.h>
00033 #include <Inventor/STL/vector>
00034
00035 #include <VolumeViz/nodes/SoVolumeShape.h>
00036 #include <VolumeViz/nodes/SoSlice.h>
00037
00038 #include <LDM/actions/SoLdmValuationActionInterface.h>
00039 #include <LDM/SoLDMTileID.h>
00040 #include <LDM/actions/SoLdmValuationActionInterface.h>
00041
00042 class SoVertexShape;
00043 class SoVolumeGeometryVbo;
00044 class SoGLRenderAction;
00045 class SoAction;
00046 class SoState;
00047 class SoBoundingBoxCache;
00048 class SoPrimitiveVertex;
00049 class SoLdmValuationAction;
00050
00052
00058 class SoVolumeGeometry : public SoLdmValuationActionInterface
00059 {
00060 public:
00061
00063 SoVolumeGeometry();
00064
00066 virtual ~SoVolumeGeometry();
00067
00068 private:
00069
00075 float intersectGeometry(const SoLDMTileID& tile) const;
00076
00078 virtual void triangleCB(SoAction* action,
00079 const SoPrimitiveVertex *v0,
00080 const SoPrimitiveVertex *v1,
00081 const SoPrimitiveVertex *v2 ) const ;
00082
00084 virtual void lineCB( SoAction* action,
00085 const SoPrimitiveVertex *v0,
00086 const SoPrimitiveVertex *v1 ) const ;
00087
00089 virtual void pointCB( SoAction* action, const SoPrimitiveVertex *v ) const ;
00090
00106 inline void setEnableBumMapping(bool flag);
00107
00109 inline bool isBumpMappingEnabled();
00110
00112 inline void setBumpScale(float scale);
00113
00115 inline float getBumScale();
00116
00118 inline void setAlphaUse (SoSlice::AlphaUse alphaUse);
00119
00121 inline SoSlice::AlphaUse getAlphaUse();
00122
00124 inline void setUseRGBA(bool flag);
00125
00127 inline bool isUsingRGBA();
00128
00129 #if 1 SoDEPRECATED
00137 virtual SoVolumeShape::Interpolation getInteractiveInterpolationValue(SoState* state) const = 0;
00138 #endif
00140 private:
00141
00143 inline void setClipGeometry(bool flag);
00144
00146 virtual void GLRenderBoundingBox(SoGLRenderAction* action) = 0;
00147
00149 virtual void shapeRender(SoGLRenderAction* action) = 0;
00150
00152 virtual void shapeGeneratePrimitives(SoAction* action) = 0;
00153
00155 void createRenderInterfaces(SoShape* bindedShape);
00156
00158 virtual void getBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er) = 0;
00159
00161 virtual void getBBox(SoAction *action, SbXfBox3d &box, SbVec3d ¢er) = 0;
00162
00164 void doRendering(SoGLRenderAction* action, float offset);
00165
00167 void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er);
00168
00170 void computeBBox(SoAction *action, SbXfBox3d &box, SbVec3d ¢er);
00171
00174 virtual int getNumVertices(SoState* state) = 0;
00175
00177 virtual int getIndexCoord(int index) const = 0;
00178
00182 void invalidateBboxCache();
00183
00185 SoVolumeGeometryVbo* m_volVbo;
00186
00188 bool m_clipGeometry;
00189
00190 friend class SoLdmValuationAction;
00191 friend class SoVolumeGeometryVbo;
00192 friend class SoVolumeStateGeometry;
00193 friend class SoFenceSlice;
00194
00199 SoSlice::AlphaUse m_alphaUse;
00200
00212 bool m_enableBumpMapping;
00213
00220 float m_bumpScale;
00221
00222
00234 bool m_useRGBA;
00235
00236 SoINTERNAL private:
00238 virtual void ldmAction(SoLdmValuationAction* action);
00239
00240 private:
00241
00243 void renderVbo(SoGLRenderAction *action);
00244
00250 SoBoundingBoxCache* m_bboxCache[2];
00251
00252
00253
00254 };
00255
00256
00257 void
00258 SoVolumeGeometry::setClipGeometry(bool flag)
00259 {
00260 m_clipGeometry = flag;
00261 }
00262
00263 bool
00264 SoVolumeGeometry::isBumpMappingEnabled()
00265 {
00266 return m_enableBumpMapping;
00267 }
00268
00269 float
00270 SoVolumeGeometry::getBumScale()
00271 {
00272 return m_bumpScale;
00273 }
00274
00275 SoSlice::AlphaUse
00276 SoVolumeGeometry::getAlphaUse()
00277 {
00278 return m_alphaUse;
00279 }
00280
00281 void
00282 SoVolumeGeometry::setEnableBumMapping(bool flag)
00283 {
00284 m_enableBumpMapping = flag;
00285 }
00286
00287
00288 void
00289 SoVolumeGeometry::setBumpScale(float scale)
00290 {
00291 m_bumpScale = scale;
00292 }
00293
00294 void
00295 SoVolumeGeometry::setAlphaUse (SoSlice::AlphaUse alphaUse)
00296 {
00297 m_alphaUse = alphaUse;
00298 }
00299
00300 bool
00301 SoVolumeGeometry::isUsingRGBA()
00302 {
00303 return m_useRGBA;
00304 }
00305
00306 void
00307 SoVolumeGeometry::setUseRGBA(bool flag)
00308 {
00309 m_useRGBA = flag;
00310 }
00312
00313 #ifdef _MSC_VER
00314 #pragma warning(pop)
00315 #endif
00316
00317 #endif
00318
00319
00320