00001
00030 #ifndef INC_MGUI_TOOLARC_H
00031 #define INC_MGUI_TOOLARC_H
00032
00033 #ifndef INC_MGUI_TOOLBASE_H
00034 #include <mgui/toolbase.h>
00035 #endif
00036
00037 namespace MGUI {
00038
00039
00040
00042 class TOOL_ARC : public TOOL_BASE {
00043 public:
00044
00045 enum CLOSURE {
00046 CLOSURE_None,
00047 CLOSURE_Chord,
00048 CLOSURE_Wedge
00049 };
00050
00052 explicit TOOL_ARC (
00053 TOOLCANVAS *canvas
00054 );
00055
00057 virtual ~TOOL_ARC ();
00058
00060 const DPOINT2D& GetCenter (
00061 ) const { return (m_center); }
00062
00064 CLOSURE GetClosure (
00065 ) const { return (m_closure); }
00066
00068 double GetRadius (
00069 ) const { return (m_radius); }
00070
00073 double GetStartAngle (
00074 ) const { return (m_StartAngle); }
00075
00078 double GetSweepAngle (
00079 ) const { return (m_SweepAngle); }
00080
00082 void SetCenter (
00083 const DPOINT2D& newcenter
00084 );
00085
00087 void SetClosure (
00088 CLOSURE closure
00089 );
00090
00093 void SetMarker (
00094 MARKER marker,
00095 UINT16 size = 0
00096 );
00097
00098 void SetRadius (
00099 double newradius
00100 );
00101
00102 void SetRadiusRange (
00103 double newminradius,
00104 double newmaxradius
00105 );
00106
00108 void SetStartAngle (
00109 double startangle
00110 );
00111
00113 void SetSweepAngle (
00114 double sweepangle
00115 );
00116
00117 private:
00118 #ifndef GENERATING_DOXYGEN_OUTPUT
00120 enum ZONE {
00121 ZONE_NoFunction = 0,
00122 ZONE_Outside,
00123 ZONE_Inside,
00124 ZONE_Perimeter,
00125 ZONE_SetCenter,
00126 ZONE_Start,
00127 ZONE_End
00128 };
00130 MARKER m_marker;
00131 UINT16 m_markersize;
00132 double m_minradius;
00133 double m_maxradius;
00134 CLOSURE m_closure;
00136 DPOINT2D m_center;
00137 double m_radius;
00138 double m_StartAngle;
00139 double m_SweepAngle;
00141 ZONE m_CursorZone;
00142 DPOINT2D m_prevpt;
00143
00145 class MANUAL_ARC;
00146
00148 void AdjustTool (const DPOINT2D&, bool firsttime=false);
00149 void ComputeCursorZone (const DPOINT2D&);
00150 void StartTool (const DPOINT2D&);
00151 void UpdateCursor (const DPOINT2D&) const;
00152
00154 virtual MANUAL_BASE* v_CreateManualBase ();
00155 virtual void v_DoDraw ();
00156 virtual void v_DoMove (double dx, double dy, ADJUSTFLAGS flags);
00157 virtual int v_GenerateRegion (REGION2D& region) const;
00158 virtual bool v_OnPointerButtonDown (MGUI::POINT point, POINTERBUTTON button, KEYSTATE keystate);
00159 virtual void v_OnPointerMove (MGUI::POINT point, POINTERBUTTON button, KEYSTATE keystate);
00160 #endif // GENERATING_DOXYGEN_OUTPUT
00161 };
00162
00163
00164
00165 }
00166
00167 #endif // INC_MGUI_TOOLARC_H