00001 00002 // 00003 // This class is part of the Open Inventor Medical 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_GNOMON_H 00015 #define _MEDICAL_GNOMON_H 00016 00017 #include <Medical/InventorMedical.h> 00018 00019 #include <Inventor/fields/SoSFFloat.h> 00020 #include <Inventor/fields/SoSFInt32.h> 00021 #include <Inventor/fields/SoSFVec2i32.h> 00022 00023 #include <Inventor/nodes/SoAnnotation.h> 00024 #include <Inventor/nodes/SoCallback.h> 00025 #include <Inventor/nodes/SoOrthographicCamera.h> 00026 #include <Inventor/nodes/SoScale.h> 00027 #include <Inventor/nodes/SoSwitch.h> 00028 00059 class INVENTORMEDICAL_API Gnomon : public SoAnnotation { 00060 00061 SO_NODE_HEADER(Gnomon); 00062 00063 public: 00064 00066 SoSFBool isDisplayed; 00067 00069 SoSFVec2i32 position; 00070 00072 SoSFInt32 width; 00073 00075 SoSFInt32 height; 00076 00078 Gnomon(); 00079 00081 static void initClass(); 00082 00084 static void exitClass(); 00085 00087 void setScale( SbVec3f scale ) { m_gnomonScale->scaleFactor.setValue( scale ); }; 00088 00092 void setGeometry( SoNode* geometrySceneGraph ); 00093 00094 private: 00095 00098 SoSFFloat cameraDistance; 00099 00101 SoOrthographicCamera* getCamera(); 00102 00106 virtual void notify(SoNotList *list); 00107 00108 private: 00109 virtual ~Gnomon(); 00110 00111 void commonConstructor(); 00112 00114 void buildGnomon(); 00115 00116 // Managed isDisplayed Field 00117 void updateGnomonVisibility(); 00118 00119 SoRef<SoCallback> m_callback; 00120 SoRef<SoOrthographicCamera> m_camera; 00121 SoRef<SoSwitch> m_displaySwitch; 00122 SoRef<SoScale> m_gnomonScale; 00123 SoRef<SoSeparator> m_geometry; 00124 }; 00125 00126 #endif 00127