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
00134 class SoVolumeTransform : public SoNode
00135 {
00136 SO_NODE_ABSTRACT_HEADER( SoVolumeTransform );
00137
00138 public:
00147 SoSFShort volumeTransformId;
00148
00155 SoSFInt32 cacheSize;
00156
00160 SoVolumeTransform();
00161
00207 virtual void apply(SoState *state, const SoLDM::DataSetIdPair& p, SoBufferObject *bufferObject , const SoLDMTileID &id) = 0;
00208
00220 virtual SbBool isValid(SoState *state, const SoLDM::DataSetIdPair& p, SoBufferObject *bufferObject , const SoLDMTileID &id);
00221
00226 virtual inline void getTransformedMinMax(double &min, double &max);
00227
00236 SoBufferObject* getFromCache(const SoLDMTileID &tileID);
00237
00245 void addInCache(const SoLDMTileID &tileID, SoBufferObject *bufferObject);
00246
00247
00248
00249 private:
00250 virtual void doAction( SoAction *action );
00251 virtual void callback( SoCallbackAction *action );
00252 virtual void GLRender( SoGLRenderAction *action );
00253 virtual void pick(SoPickAction *action) ;
00254 virtual void write(SoWriteAction *action);
00255
00256
00257
00258 private:
00259
00263 static SoBufferObject* applyListFunc(std::vector<SoVolumeTransform*> volumeTransformList, SoState *state, const SoLDM::DataSetIdPair& p, SoBufferObject *bufferObject , const SoLDMTileID &id);
00264
00266 static void initClass();
00267
00269 static void exitClass();
00270
00272 SB_THREAD_TLS_HEADER();
00273
00275 virtual void notify(SoNotList * list);
00276
00277 private:
00281 virtual ~SoVolumeTransform();
00282
00286 struct MTstruct {
00287 SoBufferObject *tmpBuffer;
00288 };
00289
00290 private:
00292 static SoPerfCounter *m_volumeTransformTimeCounter;
00293 static SoPerfCounter *m_volumeTransformDataCounter;
00294
00296 SbThreadMutex *m_cacheMutex;
00297 void resizeCache(const int newSize);
00298
00299 typedef std::pair<SoLDMTileID,SoBufferObject*> TTransformedTileCacheEntry;
00300 typedef std::list<TTransformedTileCacheEntry> TTransformedTileCache;
00301 TTransformedTileCache transformedTileCache;
00302 };
00303
00304
00305 void SoVolumeTransform::getTransformedMinMax(double & , double &)
00306 {
00307
00308 }
00309
00310 #if defined(_WIN32)
00311 #pragma warning( pop )
00312 #pragma warning(disable:4251)
00313 #endif
00314
00315 #endif // _SO_VOLUME_TRANSFORM_
00316
00317
00318