1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Lines private header file
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _OGL_LINESP_H_
13 #define _OGL_LINESP_H_
16 class WXDLLIMPEXP_OGL wxLineShape
;
17 class WXDLLIMPEXP_OGL wxLineControlPoint
: public wxControlPoint
19 DECLARE_DYNAMIC_CLASS(wxLineControlPoint
)
20 friend class WXDLLIMPEXP_OGL wxLineShape
;
23 wxLineControlPoint(wxShapeCanvas
*the_canvas
= NULL
, wxShape
*object
= NULL
, double size
= 0.0,
24 double x
= 0.0, double y
= 0.0, int the_type
= 0);
25 ~wxLineControlPoint();
27 void OnDraw(wxDC
& dc
);
28 void OnDragLeft(bool draw
, double x
, double y
, int keys
=0, int attachment
= 0);
29 void OnBeginDragLeft(double x
, double y
, int keys
=0, int attachment
= 0);
30 void OnEndDragLeft(double x
, double y
, int keys
=0, int attachment
= 0);
32 // Obsolete (left-dragging now moves attachment point to new relative position OR new
35 void OnDragRight(bool draw
, double x
, double y
, int keys
=0, int attachment
= 0);
36 void OnBeginDragRight(double x
, double y
, int keys
=0, int attachment
= 0);
37 void OnEndDragRight(double x
, double y
, int keys
=0, int attachment
= 0);
43 wxRealPoint
* m_point
; // Line point
44 wxRealPoint m_originalPos
;
49 * Temporary arc label object
52 class WXDLLIMPEXP_OGL wxLabelShape
: public wxRectangleShape
54 DECLARE_DYNAMIC_CLASS(wxLabelShape
)
57 wxLabelShape(wxLineShape
*parent
= NULL
, wxShapeRegion
*region
= NULL
, double w
= 0.0, double h
= 0.0);
60 void OnDraw(wxDC
& dc
);
61 void OnDrawContents(wxDC
& dc
);
62 void OnLeftClick(double x
, double y
, int keys
= 0, int attachment
= 0);
63 void OnRightClick(double x
, double y
, int keys
= 0, int attachment
= 0);
64 void OnDragLeft(bool draw
, double x
, double y
, int keys
=0, int attachment
= 0);
65 void OnBeginDragLeft(double x
, double y
, int keys
=0, int attachment
= 0);
66 void OnEndDragLeft(double x
, double y
, int keys
=0, int attachment
= 0);
67 bool OnMovePre(wxDC
& dc
, double x
, double y
, double old_x
, double old_y
, bool display
= true);
70 wxLineShape
* m_lineShape
;
71 wxShapeRegion
* m_shapeRegion
;
76 * Get the point on the given line (x1, y1) (x2, y2)
77 * distance 'length' along from the end,
78 * returned values in x and y
81 void GetPointOnLine(double x1
, double y1
, double x2
, double y2
,
82 double length
, double *x
, double *y
);