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_TRANSFORM_
00026 #define _SO_VOLUME_TRANSFORM_
00027
00028 #include <VolumeViz/nodes/SoVolumeRendering.h>
00029 #include <LDM/SoLDMTileID.h>
00030
00031
00032 #include <Inventor/nodes/SoNode.h>
00033 #include <Inventor/fields/SoSFShort.h>
00034 #include <Inventor/fields/SoSFInt32.h>
00035
00036 #include <Inventor/STL/vector>
00037 #include <Inventor/STL/list>
00038 #include <Inventor/STL/map>
00039
00040 class SoVolumeData;
00041 class SoGLRenderAction;
00042 class SoCallbackAction;
00043 class SoWriteAction;
00044 class SoState;
00045 class SoPerfCounter;
00046
00047 #ifdef _WIN32
00048 #pragma warning( push )
00049 #pragma warning(disable:4251)
00050 #endif
00051
00135 class SoVolumeTransform : public SoNode
00136 {
00137 SO_NODE_ABSTRACT_HEADER( SoVolumeTransform );
00138
00139 public:
00148 SoSFShort volumeTransformId;
00149
00156 SoSFInt32 cacheSize;
00157
00161 SoVolumeTransform();
00162
00208 virtual void apply(SoState *state, const SoLDM::DataSetIdPair& p, SoBufferObject *bufferObject , const SoLDMTileID &id) = 0;
00209
00221 virtual SbBool isValid(SoState *state, const SoLDM::DataSetIdPair& p, SoBufferObject *bufferObject , const SoLDMTileID &id);
00222
00227 virtual inline void getTransformedMinMax(double &min, double &max);
00228
00237 SoBufferObject* getFromCache(const SoLDMTileID &tileID);
00238
00246 void addInCache(const SoLDMTileID &tileID, SoBufferObject *bufferObject);
00247
00248
00249
00250 private:
00251 virtual void doAction( SoAction *action );
00252 virtual void callback( SoCallbackAction *action );
00253 virtual void GLRender( SoGLRenderAction *action );
00254 virtual void pick(SoPickAction *action) ;
00255 virtual void write(SoWriteAction *action);
00256
00257
00258
00259 private:
00260
00264 static SoBufferObject* applyListFunc(std::vector<SoVolumeTransform*> volumeTransformList, SoState *state, const SoLDM::DataSetIdPair& p, SoBufferObject *bufferObject , const SoLDMTileID &id);
00265
00267 static void initClass();
00268
00270 static void exitClass();
00271
00273 SB_THREAD_TLS_HEADER();
00274
00275 private:
00279 virtual ~SoVolumeTransform();
00280
00282 virtual void notify(SoNotList * list);
00283
00287 struct MTstruct {
00288 SoBufferObject *tmpBuffer;
00289 };
00290
00291 private:
00293 static SoPerfCounter *m_volumeTransformTimeCounter;
00294 static SoPerfCounter *m_volumeTransformDataCounter;
00295
00297 SbThreadMutex *m_cacheMutex;
00298 void resizeCache(const int newSize);
00299
00300 typedef std::pair<SoLDMTileID,SoBufferObject*> TTransformedTileCacheEntry;
00301 typedef std::list<TTransformedTileCacheEntry> TTransformedTileCache;
00302 TTransformedTileCache transformedTileCache;
00303 };
00304
00305
00306 void SoVolumeTransform::getTransformedMinMax(double & , double &)
00307 {
00308
00309 }
00310
00311 #if defined(_WIN32)
00312 #pragma warning( pop )
00313 #pragma warning(disable:4251)
00314 #endif
00315
00316 #endif // _SO_VOLUME_TRANSFORM_
00317
00318
00319