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 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 00163 class SoOrthoSliceDragger : public SoTranslate1Dragger 00164 { 00165 SO_KIT_HEADER(SoOrthoSliceDragger); 00166 00167 public: 00171 SoOrthoSliceDragger(); 00172 00177 SoSFPath orthoSlicePath; 00178 00183 SoSFVec3i32 volumeDimension; 00184 00189 SoSFBox3f volumeExtent; 00190 00191 private: 00195 static void initClass(); 00199 static void exitClass(); 00200 00201 private: 00205 virtual ~SoOrthoSliceDragger(); 00206 00210 virtual void notify(SoNotList *list); 00211 00212 private: 00216 static void valueChangedCB( void *data, SoDragger *dragger); 00217 00223 void initialize( const SoPath *pathToSlice); 00224 00228 void synchronize(); 00229 00233 void setDraggerDirection(); 00234 00235 private: 00236 // current handled orthoSlice. 00237 SoOrthoSlice* m_orthoSlice; 00238 00239 // Enables/disables axis switch when camera faces the dragger 00240 // ( see m_isOrthoSliceInSamePlaneThanViewer ) 00241 static bool s_enableAxisSwitch; 00242 00243 // Detect if orthoSlice is in the same plane than the viewer 00244 // If true then draggerDirection is changed to be able to move the slices. 00245 bool m_isOrthoSliceInSamePlaneThanViewer; 00246 00247 // Track changes to SoOrthoSlice node 00248 SoNodeSensor* m_sliceChangedSensor; 00249 static void sliceChangedSensorCB( void *, SoSensor * ); 00250 static void sliceDeletedSensorCB( void *, SoSensor * ); 00251 00252 // Used to avoid recursive notification. 00253 static bool m_isNotifying; 00254 }; 00255 00256 #endif //_SO_ORTHOSLICE_DRAGGER_H_ 00257 00258 00259