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 : P. ESTRADE (Mar 2000) 00022 **=======================================================================*/ 00023 #ifndef _SO_OBLIQUE_SLICE_ 00024 #define _SO_OBLIQUE_SLICE_ 00025 00026 #ifdef _MSC_VER 00027 #pragma warning( push ) 00028 #pragma warning(disable:4251) 00029 #endif 00030 00031 #include <Inventor/nodes/SoShape.h> 00032 #include <Inventor/fields/SoSFBool.h> 00033 #include <Inventor/fields/SoSFFloat.h> 00034 #include <Inventor/fields/SoSFEnum.h> 00035 #include <Inventor/fields/SoSFPlane.h> 00036 #include <Inventor/fields/SoSFNode.h> 00037 #include <Inventor/fields/SoSFInt32.h> 00038 #include <Inventor/STL/vector> 00039 #include <VolumeViz/nodes/SoVolumeRendering.h> 00040 #include <VolumeViz/nodes/SoSlice.h> 00041 #include <LDM/SoLDM.h> 00042 00043 class SoVolumeData; 00044 class SoCache; 00045 class SoLDMObliqueSliceGeom; 00046 00047 class SoObliqueSliceLdm; 00048 class SoObliqueSliceInterface; 00049 class SoObliqueSlicePaging; 00050 class SoVolumeStateObliqueSlice; 00051 class SoGetBoundingBoxAction; 00052 class SoCallback; 00053 00414 class SoObliqueSlice : public SoSlice { 00415 SO_NODE_HEADER( SoObliqueSlice ); 00416 00417 public: 00418 00430 SoSFInt32 dataSetId; 00431 00435 SoSFPlane plane; 00436 00440 SoObliqueSlice(); 00441 00442 private: 00446 void computeBBox(SoAction *, SbBox3f &box, SbVec3f ¢er); 00447 00452 virtual void write(SoWriteAction *action); 00453 00460 virtual SoNode* getAlternateRep( SoAction* action ); 00461 00462 virtual void GLRender( SoGLRenderAction* action ); 00463 00464 private: 00468 void setupSliceInterface(); 00469 00473 void generatePrimitives(SoAction *action); 00474 00478 SoDetail *createTriangleDetail( SoRayPickAction *, 00479 const SoPrimitiveVertex *v1, 00480 const SoPrimitiveVertex *, 00481 const SoPrimitiveVertex *, 00482 SoPickedPoint *); 00483 00487 void doRendering(SoGLRenderAction *action); 00488 00493 virtual SbBool readInstance(SoInput *in, unsigned short flags); 00494 00495 private: 00499 static void initClass(); 00500 static void exitClass(); 00501 00508 virtual SoNode* createAlternateRep( SoAction *action ); 00509 00513 virtual void notify(SoNotList *list); 00514 00515 bool m_backFace; 00516 00517 private: 00518 00522 virtual ~SoObliqueSlice(); 00523 00527 SbBool m_altRepCreatedHere; 00528 00529 SoObliqueSliceInterface* m_sliceInterface; 00530 SoObliqueSliceLdm* m_sliceLdm; 00531 00532 SoVolumeStateObliqueSlice* m_vs; 00533 00534 private: 00535 SoCallback* m_preEltsCBNode; 00536 SoCallback* m_postEltsCBNode; 00537 int m_savedVertexOrdering; 00538 int m_savedShapeType; 00539 SoLDM::DataSetIdPair m_savedMasterIdPair; 00540 }; 00541 00542 #ifdef _MSC_VER 00543 #pragma warning( pop ) 00544 #endif 00545 00546 #endif // _SO_OBLIQUE_SLICE_ 00547 00548