00001 00002 // 00003 // This class is part of the Open Inventor Medical Edition utility library. 00004 // 00005 // The medical utility classes are provided as a prebuilt library named 00006 // "fei.inventor.Medical", that can be used directly in an Open Inventor 00007 // application. The classes in the prebuilt library are documented and 00008 // supported by FEI. These classes are also provided as source code. 00009 // 00010 // Please see $OIVHOME/include/Medical/InventorMedical.h for the full text. 00011 // 00013 00014 #ifndef _MEDICAL_RULER_H 00015 #define _MEDICAL_RULER_H 00016 00017 #include <Medical/InventorMedical.h> 00018 #include <Inventor/nodes/SoSeparator.h> 00019 00020 #include <Inventor/fields/SoSFFloat.h> 00021 #include <Inventor/fields/SoSFInt32.h> 00022 #include <Inventor/fields/SoSFString.h> 00023 00024 class SoCone; 00025 class SoFont; 00026 class SoText2; 00027 class SoText3; 00028 class SoLineSet; 00029 class SoDrawStyle; 00030 class SoTransform; 00031 class SoTranslation; 00032 class SoEventCallback; 00033 class SoVertexProperty; 00034 class SoOrthoSliceDetail; 00035 00068 class INVENTORMEDICAL_API Ruler : public SoSeparator { 00069 00070 SO_NODE_HEADER(Ruler); 00071 00072 public: 00073 00077 SoSFFloat globalFactor; 00078 00082 SoSFString label; 00083 00089 bool manageMouseMove(bool firstClick, const SoOrthoSliceDetail* detail); 00090 00094 SoFont* getFontNode() const; 00095 00097 Ruler(); 00098 00100 static void initClass(); 00101 00103 static void exitClass(); 00104 00105 private: 00109 virtual void notify(SoNotList *list); 00110 00111 private: 00112 virtual ~Ruler(); 00113 00114 private: 00115 00119 void buildRuler(); 00120 void updateGlobalFactor(); 00121 00122 bool m_text3D; 00123 SbVec3f m_initPos; 00124 00125 SoDrawStyle* m_dStyle; 00126 SoTransform* m_leftConeTransform; 00127 SoTransform* m_rightConeTransform; 00128 SoTranslation* m_initialLeftTranslation; 00129 SoTranslation* m_initialRightTranslation; 00130 SoCone* m_leftCone; 00131 SoCone* m_rightCone; 00132 00133 SoVertexProperty* m_rulerVertexProp; 00134 SoLineSet* m_ruler; 00135 00136 SoFont* m_annotationFont; 00137 SoTransform* m_annotationTransform; 00138 SoText3* m_rulerAnnotation3D; 00139 SoText2* m_rulerAnnotation2D; 00140 }; 00141 #endif 00142