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 *** MERIGNAC, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : David Beilloin (Dec 2008) 00022 **=======================================================================*/ 00023 00024 00025 00026 #ifndef _SO_ORTHOSLICE_DRAGGER_H_ 00027 #define _SO_ORTHOSLICE_DRAGGER_H_ 00028 00029 #include <Inventor/draggers/SoTranslate1Dragger.h> 00030 #include <Inventor/fields/SoSFPath.h> 00031 #include <Inventor/fields/SoSFVec3i32.h> 00032 #include <Inventor/fields/SoSFBox3f.h> 00033 00034 class SoOrthoSlice; 00035 class SoSensor; 00036 class SoNodeSensor; 00037 00162 class SoOrthoSliceDragger : public SoTranslate1Dragger 00163 { 00164 SO_KIT_HEADER(SoOrthoSliceDragger); 00165 00166 public: 00170 SoOrthoSliceDragger(); 00171 00176 SoSFPath orthoSlicePath; 00177 00182 SoSFVec3i32 volumeDimension; 00183 00188 SoSFBox3f volumeExtent; 00189 00190 private: 00194 static void initClass(); 00198 static void exitClass(); 00199 00200 private: 00204 virtual void grabEventsSetup(); 00205 00206 private: 00210 virtual ~SoOrthoSliceDragger(); 00211 00215 virtual void notify(SoNotList *list); 00216 00217 private: 00221 static void valueChangedCB( void *data, SoDragger *dragger); 00222 00228 void initialize( const SoPath *pathToSlice); 00229 00233 void synchronize(); 00234 00238 void setDraggerDirection(); 00239 00240 private: 00241 // current handled orthoSlice. 00242 SoOrthoSlice* m_orthoSlice; 00243 int m_sliceAxis; 00244 int m_sliceNumber; 00245 00246 // Enables/disables axis switch when camera faces the dragger 00247 // ( see m_isOrthoSliceInSamePlaneThanViewer ) 00248 static bool s_enableAxisSwitch; 00249 00250 // Detect if orthoSlice is in the same plane than the viewer 00251 // If true then draggerDirection is changed to be able to move the slices. 00252 bool m_isOrthoSliceInSamePlaneThanViewer; 00253 00254 // Track changes to SoOrthoSlice node 00255 SoNodeSensor* m_sliceChangedSensor; 00256 static void sliceChangedSensorCB( void *, SoSensor * ); 00257 static void sliceDeletedSensorCB( void *, SoSensor * ); 00258 00259 // Used to avoid recursive notification. 00260 static bool m_isNotifying; 00261 }; 00262 00263 #endif //_SO_ORTHOSLICE_DRAGGER_H_ 00264 00265 00266