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_DETAIL_
00026 #define _SO_VOLUME_DETAIL_
00027
00028 #include <Inventor/details/SoSubDetail.h>
00029 #include <Inventor/SbPImpl.h>
00030 #include <VolumeViz/nodes/SoVolumeDataDrawStyle.h>
00031 #include <LDM/elements/SoDataRangeElement.h>
00032
00033 class SoVolumeData;
00034 class SoROI;
00035 class SbLine;
00036 class SoTransferFunction;
00037
00038 SO_PIMPL_BASE_PUBLIC_DECLARATION(SoVolumeDetail)
00039
00040
00041
00042
00043
00044
00045
00047
00124 class SoVolumeDetail : public SoDetail {
00125
00126 SO_DETAIL_HEADER(SoVolumeDetail);
00127 SO_PIMPL_BASE_PUBLIC_HEADER(SoVolumeDetail);
00128
00129 public:
00133 SoVolumeDetail();
00137 virtual ~SoVolumeDetail();
00138
00145 void getProfileObjectPos(SbVec3f profile[2]) const;
00146
00158 int getProfileDataPos(SbVec3i32 profile[2]) const;
00159
00177 int64_t getProfileValue(int index, SbVec3i32& pos, SbVec3f* objPos = 0, SbBool realValue = FALSE) const;
00178
00196 double getProfileValueD(int index, SbVec3i32& pos, SbVec3f* objPos, SbBool realValue = FALSE) const;
00197
00211 virtual SbBool getFirstNonTransparentValue(int64_t& value, SbVec3i32& pos, SbVec3f* objPos = 0, SbBool realValue = FALSE) const;
00212
00226 virtual SbBool getFirstNonTransparentValue(double& value, SbVec3i32& pos, SbVec3f* objPos = 0, SbBool realValue = FALSE) const;
00227
00229 virtual SoDetail* copy() const;
00230
00232
00233
00234
00235 #if 1 SoDEPRECATED
00238 int getProfileDataPos(SbVec3s profile[2] = 0) const
00239 {
00240 SbVec3i32 profileI32[2];
00241 int rv = getProfileDataPos( profileI32 );
00242 if (profile) {
00243 profile[0].setValue( (short)profileI32[0][0], (short)profileI32[0][1], (short)profileI32[0][2] );
00244 profile[1].setValue( (short)profileI32[1][0], (short)profileI32[1][1], (short)profileI32[1][2] );
00245 }
00246 return rv;
00247 };
00248 SoDEPRECATED
00253 int64_t getProfileValue(int index, SbVec3s *pos = 0, SbVec3f *objPos = 0, SbBool realValue = FALSE) const
00254 {
00255 SbVec3i32 posI32;
00256 int64_t rv = getProfileValue( index, posI32, objPos, realValue );
00257 if (pos)
00258 pos->setValue( (short)posI32[0], (short)posI32[1], (short)posI32[2] );
00259 return rv;
00260 };
00261 SoDEPRECATED
00266 virtual SbBool getFirstNonTransparentValue(unsigned int *value, SbVec3s *pos = 0, SbVec3f *objPos = 0, SbBool flag = FALSE) const
00267 {
00268 int64_t valueI64;
00269 SbVec3i32 posI32;
00270 SbBool rc = getFirstNonTransparentValue( valueI64, posI32, objPos, flag );
00271 *value = (unsigned int)valueI64;
00272 if (pos)
00273 pos->setValue( (short)posI32[0], (short)posI32[1], (short)posI32[2] );
00274 return rc;
00275 };
00276
00277 #endif
00279 //
00280
00282
00283
00284
00285 private:
00286 void setDetails(SbLine line, SoVolumeData* vd, SoTransferFunction* tf, SoROI* r);
00287
00288 private:
00289 static void initClass();
00290 static void exitClass();
00291
00293 void setDataSetIdPairList(const SoLDM::DataSetIdPairList& dsPairList);
00294
00296 void setDrawStyleMap(const SoVolumeDataDrawStyle::MaskDrawStyleValueMap& styleMap);
00297
00299 void setTransferFunctionList(const std::vector<SoTransferFunction*>& tfList, int intersectionTfId);
00300
00302 void setIsovalueMap(const SoVolumeDataDrawStyle::IsovalueMap& isomap);
00303
00305 void setDataRangeMap(const SoDataRangeElement::DataRangeIdMap& dataRangeMap);
00306
00308 void setVolumeRenderTransparency(float transparency);
00309
00310 private:
00312 SoVolumeDetail(const SoVolumeDetail& detail);
00313 };
00314
00315 #endif
00316
00317
00318