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-2019 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : David Beilloin (Sep 2013) 00022 **=======================================================================*/ 00023 #ifndef _SO_IMAGEVIZ_ENGINE_H_ 00024 #define _SO_IMAGEVIZ_ENGINE_H_ 00025 00026 #include <ImageViz/SoImageViz.h> 00027 00028 #include <Inventor/engines/SoEngine.h> 00029 #include <Inventor/engines/SoSubEngine.h> 00030 #include <Inventor/SbEventHandler.h> 00031 #include <Inventor/SbEventArg.h> 00032 00033 class SoImageVizEngineImpl; 00034 00045 class SoImageVizEngine : public SoEngine 00046 { 00047 SO_ENGINE_ABSTRACT_HEADER(SoImageVizEngine); 00048 00049 public: 00053 enum ComputeMode{ 00057 MODE_2D = 0, 00061 MODE_3D = 1, 00066 MODE_AUTO = 2 00067 }; 00068 00070 enum Neighborhood3d{ 00072 CONNECTIVITY_6 = 0, 00074 CONNECTIVITY_18 = 1, 00076 CONNECTIVITY_26 = 2 00077 }; 00078 00084 struct EventArg : public SbEventArg 00085 { 00086 #if 1 SoDEPRECATED 00089 SoImageVizEngine* getEngine() const 00090 { 00091 return m_engine; 00092 } 00093 #endif 00096 SoImageVizEngine* getSource() const { return m_engine; } 00097 00099 float getProgress() const { return m_progress; } 00100 00102 EventArg( SoImageVizEngine* engine, float progress ) 00103 : m_engine( engine ), m_progress( progress ) 00104 { } 00105 00107 ~EventArg() { } 00108 00109 private: 00111 SoImageVizEngine* m_engine; 00112 00114 float m_progress; 00115 }; 00116 00120 SbEventHandler<EventArg&> onBegin; 00121 00127 SbEventHandler<EventArg&> onEnd; 00128 00134 SbEventHandler<EventArg&> onProgress; 00135 00140 virtual void startEvaluate(); 00141 00145 virtual void waitEvaluate(); 00146 00150 virtual void abortEvaluate(); 00151 00155 virtual bool isEvaluating(); 00156 00157 private: 00159 static void initClass(); 00161 static void exitClass(); 00162 00164 SoImageVizEngineImpl* getImpl() const 00165 { return m_impl; } 00166 00167 private: 00169 virtual void evaluate(); 00170 00172 virtual void inputChanged(SoField *); 00173 00175 SoImageVizEngine(SoImageVizEngineImpl* impl); 00176 00178 virtual ~SoImageVizEngine(); 00179 00180 private: 00182 SoImageVizEngine() {}; 00183 00184 SoImageVizEngineImpl* m_impl; 00185 }; 00186 00187 #endif