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 : Benjamin GRANGE (Aug 2005) 00022 **=======================================================================*/ 00023 00024 00025 #ifndef _SO_ISOSURFACE_H_ 00026 #define _SO_ISOSURFACE_H_ 00027 00028 00029 #include <Inventor/SbBasic.h> 00030 #include <Inventor/nodes/SoNode.h> 00031 #include <Inventor/nodes/SoSubNode.h> 00032 #include <Inventor/fields/SoMFNode.h> 00033 #include <VolumeViz/nodes/SoVolumeData.h> 00034 #include <VolumeViz/nodes/SoVolumeShader.h> 00035 00036 00037 /*----------------------------------------------------------------------------*/ 00038 00039 class SoMaterial; 00040 class SoGLLazyElement; 00041 class SoDataRange; 00042 class SoIsosurfaceTexture; 00043 class SoMaterial; 00044 class SoVolumeDataDrawStyle; 00045 00124 class SoVolumeIsosurface : public SoVolumeShader { 00125 00126 SO_NODE_HEADER(SoVolumeIsosurface); 00127 00128 public: 00132 SoVolumeIsosurface(); 00133 00137 SoMFFloat isovalues; 00138 00139 #ifndef HIDDEN_FROM_DOC 00140 private: 00141 virtual void notify(SoNotList* list); 00142 00143 virtual void GLRender(SoGLRenderAction *action); 00144 00145 // Initializes the classes. 00146 static void initClass() ; 00147 static void exitClass() ; 00148 00149 //Install special textures needed for isosurface rendering 00150 void installTextures(SoState *state); 00151 //Generate textures if needed according to current state 00152 void generateTextures(SoState *state); 00153 00155 void installTextures(SoState *state, SoVolumeData* vd, SoMaterial* mat); 00156 00158 bool isFakeDrawStyleOnState(SoState* state) const; 00159 00161 virtual void allocateTextureUnit(SoGLRenderAction *action) const; 00162 00163 private: 00164 virtual void rayPick(SoRayPickAction *action); 00165 00166 private: 00167 virtual ~SoVolumeIsosurface(); 00168 00170 virtual SoShaderProgram* generateShadowShader() const; 00171 00177 virtual SbString getRenderingModeFragmentName(SoState* state); 00178 00179 #endif // HIDDEN_FROM_DOC 00180 00181 private: 00185 void handleVolumeRenderingQuality(SoState* state); 00186 00188 void updateShadowShaderIsoValue(); 00189 00190 //Used to switch the vertex program when the camera projection type 00191 //changes 00192 SoVertexShader *m_vpCameraPersp; 00193 00194 SoGLLazyElement *m_lazyInCache; 00195 SoCache *m_cache; //Dependency on SoDataRangeElement 00196 void addCacheDependencies(SoCache *cache, SoState *state); 00197 00199 SoVolumeDataDrawStyle* m_volumeDataDrawStyle; 00200 00201 bool m_needUpdate; 00202 }; 00203 /*----------------------------------------------------------------------------*/ 00204 00205 #endif /*_SO_ISOSURFACE_H_*/ 00206 00207 00208