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 : David Beilloin (Dec 2010) 00022 **=======================================================================*/ 00023 #if !defined _SO_UNIFORM_GRID_PROJECTION_CLIPPING_H_ 00024 #define _SO_UNIFORM_GRID_PROJECTION_CLIPPING_H_ 00025 00026 #include <VolumeViz/nodes/SoUniformGridClipping.h> 00027 #include <Inventor/fields/SoSFNode.h> 00028 #include <Inventor/SbViewportRegion.h> 00029 00030 class SoCamera; 00031 class SoOrthographicCamera; 00032 00096 class SoUniformGridProjectionClipping : public SoUniformGridClipping 00097 { 00098 00099 SO_NODE_HEADER(SoUniformGridProjectionClipping); 00100 00101 public: 00103 SoUniformGridProjectionClipping(); 00104 00109 SoSFNode sceneGraph; 00110 00111 private: 00113 static void initClass(); 00114 00116 static void exitClass(); 00117 00119 virtual void notify(SoNotList *list); 00120 00122 virtual SbBool isCulled(const SbBox3f &box); 00123 00125 virtual void setClipParamUniforms(SoGLRenderAction* action, SoShaderProgram* prog, const std::vector<SoUniformGridClipping *> &grids); 00126 00127 private: 00128 00130 virtual ~SoUniformGridProjectionClipping(); 00131 00132 virtual void getMinMax(float &min, float &max); 00133 00134 private: 00135 // used to setup an orthographic camera correctly for RTT property 00136 void adjustCameraClippingPlanes(SoCamera* camera, const SbViewportRegion& viewport, SoNode* sceneRoot, SoNode* cameraSceneGraph=NULL); 00137 00138 // generate the scenegraph responsible for clipping 00139 void generateClippingSceneGraph(); 00140 void updateClippingSceneGraph(); 00141 00142 // internal node used to do the correct clipping representation 00143 SoOrthographicCamera* m_camOrtho; 00144 SoSeparator* m_separatorSG; 00145 SoSeparator* m_RTTMain; 00146 }; 00147 00148 #endif // _SO_UNIFORM_GRID_PROJECTION_CLIPPING_H_ 00149 00150 00151