Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoVolumeGeometry.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2023 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24#ifndef SO_VOLUME_GEOMETRY_H
25#define SO_VOLUME_GEOMETRY_H
26
27#ifdef _MSC_VER
28#pragma warning(push)
29#pragma warning(disable:4251)
30#endif
31
32#include <Inventor/SbBox.h>
33#include <Inventor/STL/vector>
34
35#include <VolumeViz/nodes/SoVolumeShape.h>
36#include <VolumeViz/nodes/SoSlice.h>
37
38#include <LDM/actions/SoLdmValuationActionInterface.h>
39#include <LDM/SoLDMTileID.h>
40#include <LDM/actions/SoLdmValuationActionInterface.h>
41
42class SoVertexShape;
43class SoVolumeGeometryVbo;
45class SoAction;
46class SoState;
47class SoBoundingBoxCache;
49class SoLdmValuationAction;
50
52
58class SoVolumeGeometry : public SoLdmValuationActionInterface
59{
60public:
61
64
67
71 virtual void setRenderProgress(SoProgressIndicator* ps) { m_renderProgress = ps; }
72
73
74private:
75
81 float intersectGeometry(const SoLDMTileID& tile) const;
82
84 virtual void triangleCB(SoAction* action,
85 const SoPrimitiveVertex *v0,
86 const SoPrimitiveVertex *v1,
87 const SoPrimitiveVertex *v2 ) const ;
88
90 virtual void lineCB( SoAction* action,
91 const SoPrimitiveVertex *v0,
92 const SoPrimitiveVertex *v1 ) const ;
93
95 virtual void pointCB( SoAction* action, const SoPrimitiveVertex *v ) const ;
96
112 inline void setEnableBumMapping(bool flag);
113
115 inline bool isBumpMappingEnabled();
116
118 inline void setBumpScale(float scale);
119
121 inline float getBumScale();
122
124 inline void setAlphaUse (SoSlice::AlphaUse alphaUse);
125
127 inline SoSlice::AlphaUse getAlphaUse();
128
130 inline void setUseRGBA(bool flag);
131
133 inline bool isUsingRGBA();
134
135#if 1 SoDEPRECATED
143 virtual SoVolumeShape::Interpolation getInteractiveInterpolationValue(SoState* state) const = 0;
144#endif
146 SoVolumeState* getVolumeState() const;
147
148private:
149
151 inline void setClipGeometry(bool flag);
152
154 virtual void GLRenderBoundingBox(SoGLRenderAction* action) = 0;
155
157 virtual void shapeRender(SoGLRenderAction* action) = 0;
158
160 virtual void shapeGeneratePrimitives(SoAction* action) = 0;
161
163 void createRenderInterfaces(SoShape* bindedShape);
164
166 virtual void getBBox(SoAction *action, SbBox3f &box, SbVec3f &center) = 0;
167
169 virtual void getBBox(SoAction *action, SbXfBox3d &box, SbVec3d &center) = 0;
170
172 void doRendering(SoGLRenderAction* action, float offset);
173
175 void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center);
176
178 void computeBBox(SoAction *action, SbXfBox3d &box, SbVec3d &center);
179
182 virtual int getNumVertices(SoState* state) = 0;
183
185 virtual int getIndexCoord(int index) const = 0;
186
190 void invalidateBboxCache();
191
193 SoVolumeGeometryVbo* m_volVbo;
194
196 bool m_clipGeometry;
197
201 friend class SoFenceSlice;
202
207 SoSlice::AlphaUse m_alphaUse;
208
220 bool m_enableBumpMapping;
221
228 float m_bumpScale;
229
230
242 bool m_useRGBA;
243
244 SoProgressIndicator* m_renderProgress;
245
246SoINTERNAL private:
248 virtual void ldmAction(SoLdmValuationAction* action);
249
250private:
251
253 void renderVbo(SoGLRenderAction *action);
254
260 SoBoundingBoxCache* m_bboxCache[2];
261
262
263
264};
265
266/*******************************************************************************/
267void
268SoVolumeGeometry::setClipGeometry(bool flag)
269{
270 m_clipGeometry = flag;
271}
272
273bool
274SoVolumeGeometry::isBumpMappingEnabled()
275{
276 return m_enableBumpMapping;
277}
278
279float
280SoVolumeGeometry::getBumScale()
281{
282 return m_bumpScale;
283}
284
286SoVolumeGeometry::getAlphaUse()
287{
288 return m_alphaUse;
289}
290
291void
292SoVolumeGeometry::setEnableBumMapping(bool flag)
293{
294 m_enableBumpMapping = flag;
295}
296
297
298void
299SoVolumeGeometry::setBumpScale(float scale)
300{
301 m_bumpScale = scale;
302}
303
304void
305SoVolumeGeometry::setAlphaUse (SoSlice::AlphaUse alphaUse)
306{
307 m_alphaUse = alphaUse;
308}
309
310bool
311SoVolumeGeometry::isUsingRGBA()
312{
313 return m_useRGBA;
314}
315
316void
317SoVolumeGeometry::setUseRGBA(bool flag)
318{
319 m_useRGBA = flag;
320}
322
323#ifdef _MSC_VER
324#pragma warning(pop)
325#endif
326
327#endif
328
329
3D box class.
Definition SbBox.h:649
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D vector class ...
Definition SbVec.h:1214
3D vector class.
Definition SbVec.h:932
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box with an a...
Definition SbBox.h:1513
Abstract base class for all actions.
Definition SoAction.h:132
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> Fence slice shape nod...
Renders a scene graph using Open Inventor's Render Engine.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Tile ID
Definition SoLDMTileID.h:63
Represents a vertex of a generated primitive.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Class for report...
Abstract base class for all shape nodes.
Definition SoShape.h:116
AlphaUse
Alpha component usage mode Used in the alphaUse field.
Definition SoSlice.h:109
SoSFEnum alphaUse
Specifies how to use the alpha component of each voxel's RGBA value.
Definition SoSlice.h:143
Traversal state.
Definition SoState.h:74
Abstract base class for all vertex-based shape nodes.
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> LDM valuation interfa...
SoVolumeGeometry()
Constructor.
virtual ~SoVolumeGeometry()
Destructor.
friend class SoVolumeGeometryVbo
virtual void setRenderProgress(SoProgressIndicator *ps)
Set an application defined SoProgressIndicator object which will raise an event before and after the ...
friend class SoVolumeStateGeometry
friend class SoLdmValuationAction
Interpolation
Interpolation mode.