00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __mitkAngleWidgetModel3D_h
00012 #define __mitkAngleWidgetModel3D_h
00013
00014 #include "mitkWidgetModel3D.h"
00015
00023 class MITK_VISUALIZATION_API mitkAngleWidgetModel3D : public mitkWidgetModel3D
00024 {
00025 public:
00026 MITK_TYPE(mitkAngleWidgetModel3D, mitkWidgetModel3D)
00027
00028 virtual void PrintSelf(ostream &os);
00029
00042 mitkAngleWidgetModel3D(float startPoint[3], float endPoint0[3], float endPoint1[3]);
00043
00050 virtual int Render(mitkScene *scene);
00051
00057 virtual void Pick(const WidgetNames &names);
00058
00062 virtual void Release();
00063
00070 void SetUnits(float ux, float uy, float uz);
00071
00078 void SetUnits(float units[3]);
00079
00084 float GetAngleInDegree();
00085
00090 float GetAngleInRadian();
00091
00095 virtual void Update();
00096
00097 protected:
00098 virtual ~mitkAngleWidgetModel3D();
00099
00108 virtual void _onMouseDown(int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos);
00109
00118 virtual void _onMouseUp(int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos);
00119
00129 virtual void _onMouseMove(bool ctrlDown, bool shiftDown, int xPos, int yPos, int deltaX, int deltaY);
00130
00131 virtual float* _getBounds();
00132
00133
00134 void _init();
00135
00136
00137 enum
00138 {
00139 unknown,
00140 ball,
00141 arrow0,
00142 arrow1,
00143 line
00144 };
00145
00146 mitkVector *m_Points;
00147 mitkVector *m_ScreenPoints;
00148 mitkMatrix *m_TransformMatrix;
00149
00150 float m_UnitsPerPixel[3];
00151 float m_ArrowLength;
00152
00153 float m_ArrowColor[4];
00154 float m_BallColor[4];
00155 float m_LineColor[4];
00156 float m_PickedArrowColor[4];
00157 float m_PickedBallColor[4];
00158 float m_PickedLineColor[4];
00159
00160
00161 private:
00162 mitkAngleWidgetModel3D(const mitkAngleWidgetModel3D&);
00163 void operator = (const mitkAngleWidgetModel3D&);
00164 };
00165
00166 inline void mitkAngleWidgetModel3D::SetUnits(float ux, float uy, float uz)
00167 {
00168 m_UnitsPerPixel[0] = ux;
00169 m_UnitsPerPixel[1] = uy;
00170 m_UnitsPerPixel[2] = uz;
00171 }
00172
00173 inline void mitkAngleWidgetModel3D::SetUnits(float units[3])
00174 {
00175 SetUnits(units[0], units[1], units[2]);
00176 }
00177
00178
00179
00180
00181
00182
00183 #endif
00184