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-2020 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 00130 ISOSURFACE = 1 << 2 00131 }; 00132 00147 SoSFBitMask style; 00148 00152 SoSFMaterial boundaryMaterial; 00153 00157 SoMFFloat isovalues; 00158 00163 SoSFMaterial isosurfacesMaterial; 00164 00165 private: 00166 virtual void doAction(SoAction *action); 00167 virtual void GLRender(SoGLRenderAction *action); 00168 virtual void callback(SoCallbackAction *action); 00169 virtual void pick(SoPickAction *action); 00170 00171 private: 00172 typedef std::map<SoLDM::DataSetIdPair, SoVolumeDataDrawStyle::DrawStyle> MaskDrawStyleValueMap; 00173 typedef std::vector<float> IsovalueVec; 00174 typedef std::map<unsigned short, IsovalueVec> IsovalueMap; 00175 00176 static void initClass(); 00177 static void exitClass(); 00178 00180 static void ldmAction(SoAction *action, SoNode* node); 00181 00183 static const SoLDM::DataSetIdPair S_INTERSECTION_KEY; 00184 00185 private: 00186 ~SoVolumeDataDrawStyle(); 00187 }; 00188 00189 #ifdef _WIN32 00190 #pragma warning( pop ) 00191 #endif 00192 00193 #endif 00194 00195 00196