Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoVolumeTransform.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-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : David Beilloin (Sep 2008)
22**=======================================================================*/
23
24
25#ifndef _SO_VOLUME_TRANSFORM_
26#define _SO_VOLUME_TRANSFORM_
27
28#include <VolumeViz/nodes/SoVolumeRendering.h>
29#include <LDM/SoLDMTileID.h>
30
31
32#include <Inventor/nodes/SoNode.h>
33#include <Inventor/fields/SoSFShort.h>
34#include <Inventor/fields/SoSFInt32.h>
35
36#include <Inventor/STL/vector>
37#include <Inventor/STL/list>
38#include <Inventor/STL/map>
39
40class SoVolumeData;
43class SoWriteAction;
44class SoState;
45class SoPerfCounter;
46
47#ifdef _WIN32
48#pragma warning( push )
49#pragma warning(disable:4251)
50#endif
51
135{
136 SO_NODE_ABSTRACT_HEADER( SoVolumeTransform );
137
138 public:
148
156
161
207 virtual void apply(SoState *state, const SoLDM::DataSetIdPair& p, SoBufferObject *bufferObject , const SoLDMTileID &id) = 0;
208
220 virtual SbBool isValid(SoState *state, const SoLDM::DataSetIdPair& p, SoBufferObject *bufferObject , const SoLDMTileID &id);
221
226 virtual inline void getTransformedMinMax(double &min, double &max);
227
237
245 void addInCache(const SoLDMTileID &tileID, SoBufferObject *bufferObject);
246
247 //------------------------------------------------------------------------------
248
249 private:
250 virtual void doAction( SoAction *action );
251 virtual void callback( SoCallbackAction *action );
252 virtual void GLRender( SoGLRenderAction *action );
253 virtual void pick(SoPickAction *action) ;
254 virtual void write(SoWriteAction *action);
255
256 //------------------------------------------------------------------------------
257
258 private:
259
263 static SoBufferObject* applyListFunc(std::vector<SoVolumeTransform*> volumeTransformList, SoState *state, const SoLDM::DataSetIdPair& p, SoBufferObject *bufferObject , const SoLDMTileID &id);
264
266 static void initClass();
267
269 static void exitClass();
270
272 SB_THREAD_TLS_HEADER();
273
275 virtual void notify(SoNotList * list);
276
277 private:
281 virtual ~SoVolumeTransform();
282
286 struct MTstruct {
287 SoBufferObject *tmpBuffer;
288 };
289
290 private:
292 static SoPerfCounter *m_volumeTransformTimeCounter;
293 static SoPerfCounter *m_volumeTransformDataCounter;
294
296 SbThreadMutex *m_cacheMutex;
297 void resizeCache(const int newSize);
298
299 typedef std::pair<SoLDMTileID,SoBufferObject*> TTransformedTileCacheEntry;
300 typedef std::list<TTransformedTileCacheEntry> TTransformedTileCache;
301 TTransformedTileCache transformedTileCache;
302};
303
304// Inline functions implementation
306{
307 // keep min and max unchanged by default.
308}
309
310#if defined(_WIN32)
311#pragma warning( pop )
312#pragma warning(disable:4251)
313#endif
314
315#endif // _SO_VOLUME_TRANSFORM_
316
317
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable mutex c...
Abstract base class for all actions.
Definition SoAction.h:132
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
Performs a generic traversal of a scene graph or path.
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
Abstract base class for all database nodes.
Definition SoNode.h:145
Abstract base class for Performance Counter.
Abstract base class for picking objects in a scene.
Field containing a int32_t integer.
Definition SoSFInt32.h:80
Field containing a short integer.
Definition SoSFShort.h:81
Traversal state.
Definition SoState.h:74
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> Volume data property ...
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> Transform data before...
virtual void apply(SoState *state, const SoLDM::DataSetIdPair &p, SoBufferObject *bufferObject, const SoLDMTileID &id)=0
Apply in-place transformation to the specified dataset tile.
void addInCache(const SoLDMTileID &tileID, SoBufferObject *bufferObject)
Add the transformed data for a specific tile to the cache.
SoVolumeTransform()
Constructor.
virtual void getTransformedMinMax(double &min, double &max)
Based on min max of the input data, this function should return the expected data range of the result...
virtual SbBool isValid(SoState *state, const SoLDM::DataSetIdPair &p, SoBufferObject *bufferObject, const SoLDMTileID &id)
Should return TRUE if the given parameters are valid for this compute function.
SoSFInt32 cacheSize
Size of the computed tile cache for this transform.
SoBufferObject * getFromCache(const SoLDMTileID &tileID)
Returns the previously transformed data for a specific tile.
SoSFShort volumeTransformId
Allows the transform to be applied to all or one specific data set.
Writes a scene graph to a file.
int SbBool
Boolean type.
Definition SbBase.h:87
std::pair< SoDataSet *, int > DataSetIdPair
Pair containing an SoDataset and its dataSetId.
Definition SoLDM.h:71