00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2022 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : VSG (MMM YYYY) 00022 **=======================================================================*/ 00023 #ifndef SOVOLUMEDATADRAWSTYLE_H 00024 #define SOVOLUMEDATADRAWSTYLE_H 00025 00026 #include <Inventor/nodes/SoNode.h> 00027 #include <Inventor/fields/SoMFFloat.h> 00028 #include <Inventor/fields/SoSFVec4f.h> 00029 #include <Inventor/fields/SoMFVec4f.h> 00030 #include <Inventor/fields/SoSFBitMask.h> 00031 #include <Inventor/fields/SoSFBool.h> 00032 #include <Inventor/fields/SoSFMaterial.h> 00033 00034 #include <LDM/SoLDM.h> 00035 00036 #ifdef _WIN32 00037 #pragma warning( push ) 00038 #pragma warning(disable:4251) 00039 #endif 00040 00098 class SoVolumeDataDrawStyle : public SoNode 00099 { 00100 SO_NODE_HEADER(SoVolumeDataDrawStyle); 00101 public: 00105 SoVolumeDataDrawStyle(); 00106 00107 #ifndef HIDDEN_FROM_DOC 00108 //WARNING: This enum must stay in sync with defines from shaders source 00109 #endif 00110 00113 enum DrawStyle { 00117 NONE = 0, 00121 VOLUME_RENDER = 1, 00125 MASK_BOUNDARY = 1 << 1, 00126 00133 ISOSURFACE = 1 << 2 00134 }; 00135 00150 SoSFBitMask style; 00151 00155 SoSFMaterial boundaryMaterial; 00156 00160 SoMFFloat isovalues; 00161 00166 SoSFMaterial isosurfacesMaterial; 00167 00168 private: 00169 virtual void doAction(SoAction *action); 00170 virtual void GLRender(SoGLRenderAction *action); 00171 virtual void callback(SoCallbackAction *action); 00172 virtual void pick(SoPickAction *action); 00173 00174 private: 00175 typedef std::map<SoLDM::DataSetIdPair, SoVolumeDataDrawStyle::DrawStyle> MaskDrawStyleValueMap; 00176 typedef std::vector<float> IsovalueVec; 00177 typedef std::map<SoLDM::DataSetIdPair, IsovalueVec> IsovalueMap; 00178 00179 static void initClass(); 00180 static void exitClass(); 00181 00183 static void ldmAction(SoAction *action, SoNode* node); 00184 00186 static const SoLDM::DataSetIdPair S_INTERSECTION_KEY; 00187 00188 private: 00189 ~SoVolumeDataDrawStyle(); 00190 }; 00191 00192 #ifdef _WIN32 00193 #pragma warning( pop ) 00194 #endif 00195 00196 #endif 00197 00198 00199