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 SOVOLUMEMASKGROUP_H 00024 #define SOVOLUMEMASKGROUP_H 00025 00026 #include <VolumeViz/nodes/SoVolumeRendering.h> 00027 #include <Inventor/nodes/SoGroup.h> 00028 00029 class SoGLTexture; 00030 class SbVec4ub; 00031 class SoVolumeDataDrawStyle; 00032 class SoTransferFunction; 00033 class SoCache; 00034 00076 class SoVolumeMaskGroup : public SoGroup 00077 { 00078 SO_NODE_HEADER(SoVolumeMaskGroup); 00079 public: 00083 SoVolumeMaskGroup(); 00084 00089 static short TRANSFERFUNCTION_INTERSECTION_ID; 00090 00091 private: 00092 virtual void GLRender(SoGLRenderAction *action); 00093 virtual void doAction(SoAction *action); 00094 virtual void pick(SoPickAction *action); 00095 00096 static void initClass(); 00097 static void exitClass(); 00098 00099 static int getInfoTextureUnit(SoGLRenderAction *action); 00100 00110 SoSFBool isosurfaceCompliance; 00111 00112 private: 00114 void updateCache(SoState *state); 00115 00116 ~SoVolumeMaskGroup(); 00117 00118 private: 00119 struct BoundaryPalette 00120 { 00122 BoundaryPalette(); 00123 unsigned char renderStyle; 00124 unsigned char padRenderStyle[3]; 00125 unsigned char diffuse[4]; 00126 unsigned char specular[3]; 00127 unsigned char shininess; 00128 }; 00129 00131 void setupIntersectionDrawStyle(SoAction* state); 00132 00137 SoVolumeDataDrawStyle* getVolumeDataDrawStyle(SoState* state); 00138 00140 void initVmTexture(SoState* state); 00141 00143 void generateMaterialTexture(SoState* state, const SoLDM::DataSetIdPairList& dsList); 00144 00146 void generateBoundaryTexture(SoState* state, const SoLDM::DataSetIdPairList& dsList); 00147 00149 void bindVmTexture(SoState* state, const SoLDM::DataSetIdPairList& dsList); 00150 00156 static bool isSupported(SoState* state); 00157 00159 void invalidateVolumeMaskTextures(SoState* state); 00160 00162 SoGLTexture* m_vmTex; 00163 00165 SoCache* m_cacheData; 00166 00168 SoCache* m_cacheStyle; 00169 00171 SoVolumeDataDrawStyle* m_defaultIntersectionDrawStyle; 00172 00174 SoTransferFunction* m_defaultIntersectionTf; 00175 00176 friend struct SetBoundsColorsAndStyles; 00177 }; 00178 00179 #endif 00180 00181 00182