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 : Benjamin GRANGE (Aug 2005) 00022 **=======================================================================*/ 00023 00024 00025 #ifndef _SO_VOLUME_QUALITY_H_ 00026 #define _SO_VOLUME_QUALITY_H_ 00027 00028 00029 #include <Inventor/SbBasic.h> 00030 #include <Inventor/fields/SoMFNode.h> 00031 #include <Inventor/fields/SoSFBitMask.h> 00032 #include <Inventor/fields/SoSFColor.h> 00033 #include <Inventor/fields/SoSFFloat.h> 00034 #include <Inventor/nodes/SoNode.h> 00035 #include <Inventor/nodes/SoSubNode.h> 00036 #include <Inventor/nodes/SoGroup.h> 00037 #include <VolumeViz/nodes/SoVolumeShader.h> 00038 00039 /*----------------------------------------------------------------------------*/ 00040 class SoFragmentShader; 00041 class SoVertexShader; 00042 class SoTransferFunction; 00043 class SoVolumeShader; 00044 class SoNodeDependencies; 00045 00318 class SoVolumeRenderingQuality : public SoVolumeShader { 00319 00320 SO_NODE_HEADER(SoVolumeRenderingQuality); 00321 00322 public: 00324 enum GradientQuality 00325 { 00331 LOW = 0, 00332 00338 MEDIUM, 00339 00345 HIGH, 00346 #ifndef HIDDEN_FROM_DOC 00347 LAST_GRADIENT_QUALITY 00348 #endif 00349 }; 00350 00356 enum EdgeDetect2DMethod { 00358 LUMINANCE = 1, 00359 00361 DEPTH = 1 << 1, 00362 00366 GRADIENT = 1 << 2 00367 }; 00368 00372 SoVolumeRenderingQuality(); 00373 00402 SoSFBool lighting; 00403 00422 SoSFBool preIntegrated; 00423 00436 SoSFBool jittering; 00437 00446 SoSFFloat gradientThreshold; 00447 00459 SoSFBool edgeColoring; 00460 00467 SoSFColor edgeColor; 00468 00477 SoSFFloat edgeThreshold; 00478 00490 SoSFBool boundaryOpacity; 00491 00498 SoSFFloat boundaryOpacityIntensity; 00499 00507 SoSFFloat boundaryOpacityThreshold; 00508 00516 SoSFBool edgeDetect2D; 00517 00525 SoSFFloat edgeDetect2DInnerThreshold; 00526 00534 SoSFFloat edgeDetect2DOuterThreshold; 00535 00546 SoSFBitMask edgeDetect2DMethod; 00547 00556 SoSFEnum gradientQuality; 00557 00571 SoSFBool colorInterpolation; 00572 00583 SoSFFloat surfaceScalarExponent; 00584 00598 SoSFFloat unnormalizedGradientExponent; 00599 00605 SoSFBool segmentedInterpolation; 00606 00613 SoSFFloat segmentedInterpolationThreshold; 00614 00625 SoSFBool voxelizedRendering; 00626 00642 SoSFBool voxelOutline; 00643 00652 SoSFFloat voxelOutlineThreshold; 00653 00660 SoSFFloat voxelOutlineWidth; 00661 00668 SoSFColor voxelOutlineColor; 00669 00686 SoSFBool ambientOcclusion; 00687 00730 SoSFBool deferredLighting; 00731 00732 #if 1 SoDEPRECATED 00742 SoSFBool cubicInterpolation; 00743 00744 #endif 00746 #if 1 SoDEPRECATED enum LightingModel 00750 { 00751 OIV6, 00752 OPENGL 00753 }; 00754 SoDEPRECATED 00764 SoSFEnum lightingModel; 00765 00766 #endif 00768 #ifndef HIDDEN_FROM_DOC 00769 private: 00770 00772 SoSFFloat AORadius; 00774 SoSFFloat AONumSample; 00776 SoSFFloat AOKernelSize; 00778 SoSFBool AOUseNormal; 00780 SoSFBool AOShowAO; 00782 SoSFBool AOShowNormal; 00783 00784 void GLRender(SoGLRenderAction *action); 00785 virtual void doAction(SoAction *action); 00786 virtual void notify(SoNotList* list); 00787 00788 // Initializes the classes. 00789 static void initClass(); 00790 static void exitClass(); 00791 00793 GradientQuality getGradientMethod(SoState* state) const; 00794 00796 SbBool hasEdgeDetect2d(SoState* state) const; 00797 00799 SbBool hasAmbientOcclusion(SoState* state) const; 00800 00802 SbBool hasDeferredLighting(SoState* state) const; 00803 00805 SbBool hasCubicInterpolation(SoState* state) const; 00806 00808 SbBool hasBoundaryOpacity(SoState* state) const; 00809 00811 virtual void installTextures(SoGLRenderAction* action); 00812 00814 virtual SbBool isRaycastingEnabled(SoState* state) const; 00815 00817 virtual void allocateTextureUnit(SoGLRenderAction *action) const; 00818 00820 SbBool isVoxelizedRenderingEnabled(SoState* state) const; 00821 00823 virtual bool isInterpolationActive(SoGLRenderAction* action); 00824 00826 virtual bool isColorInterpolationEnabled(SoState* state); 00827 00829 bool isPreintegratedEnabled(SoState* state) const; 00830 00832 void setRemovePhysicalQuality( bool removePhysicalQuality ); 00833 00835 void setRenderMode( SoVolumeRender::RenderMode renderMode ) { m_renderMode = renderMode; } 00836 private: 00837 00838 virtual ~SoVolumeRenderingQuality(); 00839 00840 #endif 00841 00842 private: 00843 00844 static const float DEFAULT_INNER_EDGE_THRESHOLD; 00845 static const float DEFAULT_OUTTER_EDGE_THRESHOLD; 00846 00848 void checkAndUpdateEdge2DSupport(SoGLRenderAction* action); 00849 00851 SbBool hasEdgeColoring(SoState* state) const; 00852 00857 void clampEdgeDetect2dFields(); 00858 00859 SoNodeDependencies* m_transferFunctionCache; 00860 00864 SoRef<SoGroup> m_preIntegratedScene; 00865 SoGroup* m_preIntegratedTexPlaceHolder; 00866 SoTextureUnit* m_preIntegratedTexUnit; 00867 00869 bool m_removePhysicalQuality; 00870 00872 SoVolumeRender::RenderMode m_renderMode; 00873 }; 00874 /*----------------------------------------------------------------------------*/ 00875 00876 #endif /*_SO_VOLUME_QUALITY_H_*/ 00877 00878 00879