00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef SOVOLUMEMASK_H
00024 #define SOVOLUMEMASK_H
00025
00026 #include <VolumeViz/nodes/SoVolumeData.h>
00027 #include <Inventor/fields/SoSFBitMask.h>
00028 #include <Inventor/fields/SoSFVec4f.h>
00029 #include <Inventor/fields/SoMFVec4f.h>
00030
00031
00032 class SoVolumeMaskReader;
00033 class SoCpuBufferUniform;
00034 class SoCpuBufferBasicProperty;
00035
00159 class SoVolumeMask : public SoVolumeData
00160 {
00161 SO_NODE_HEADER(SoVolumeMask);
00162 public:
00166 SoVolumeMask();
00167
00180 virtual int editSubVolume( const SbBox3i32& subVolume, SoBufferObject* userData );
00181
00192 virtual int editSubVolume( const SbBox3i32& subVolume, const double& value );
00193
00205 virtual int editSurfaceShape( const SoNode* surfaceShape, const float& thickness, const double& newValue );
00206
00228 virtual int editSolidShape( const SoNode* solidShape, const double& value );
00229
00234 bool saveEditing(SbString filename, bool recomputeLowerResolution = TRUE, const std::vector<char*> = std::vector<char*>(), SaveEditingCB callback = NULL);
00235
00239 void setDefaultValue( const bool defValue );
00240
00244 bool getDefaultValue() const;
00245
00246 private:
00247 static void initClass();
00248 static void exitClass();
00249
00250 SB_THREAD_TLS_HEADER();
00251
00252 SoLDMReader* getAppropriateLDMReader(const SbString& pathname);
00254 virtual SoBufferObject* getTransformedTile(const SoLDMTileID& tile, const SoLDM::DataSetIdPair& pair,
00255 SoState * state = NULL, const bool useExtendedData=false);
00256
00257 private:
00258 virtual void GLRender(SoGLRenderAction* action);
00259
00260 inline virtual void setIsReadChar(bool flag);
00261
00262
00263 virtual SoVolumeData* getVolumeData();
00264
00265
00266 virtual void setProperties( SbVec3i32 dimension, SbVec3i32 tileSize, int border );
00267
00268 private:
00269 ~SoVolumeMask();
00270 void readerChanged();
00271
00273 virtual SbBool doSaveEditing( SoVolumeWriter* writer, std::vector<SbBox3i32>& savedRegion, SaveEditingCB callback = NULL );
00274
00275 private:
00276 struct MTStruct
00277 {
00278 SoCpuBufferBasicProperty* m_tileBufferObjFinal;
00279 SoCpuBufferUniform* m_tileBufferUniformObjFinal;
00280 };
00281
00285 bool m_needCreateFile;
00286 };
00287
00288 void
00289 SoVolumeMask::setIsReadChar(bool flag)
00290 {
00291 m_dataCharRead = flag;
00292 }
00293
00294 #endif
00295
00296
00297