42cf5bc1 |
1 | // Created on: 1991-07-15 |
2 | // Created by: Arnaud BOUZY |
3 | // Copyright (c) 1991-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _Draw_Display_HeaderFile |
18 | #define _Draw_Display_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Integer.hxx> |
25 | #include <Standard_Real.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | #include <Draw_MarkerShape.hxx> |
28 | #include <Standard_CString.hxx> |
29 | class Draw_Color; |
30 | class gp_Pnt; |
31 | class gp_Pnt2d; |
32 | class gp_Circ; |
33 | class gp_Circ2d; |
34 | |
35 | |
36 | //! Use to draw in a 3d or a 2d view. |
37 | //! |
38 | //! * The 3d methods draw in the 3d system, in a 2d |
39 | //! view the drawing is projected on X,Y. |
40 | //! |
41 | //! * The 2d methods draw in the projection plane. |
42 | //! |
43 | //! * To draw in screen coordinates the length must be |
44 | //! divided by the zoom. |
45 | class Draw_Display |
46 | { |
47 | public: |
48 | |
49 | DEFINE_STANDARD_ALLOC |
50 | |
51 | |
52 | Standard_EXPORT Draw_Display(); |
53 | |
54 | //! Following drawings will use this color. |
55 | Standard_EXPORT void SetColor (const Draw_Color& col) const; |
56 | |
57 | //! Set the drawing mode, 3 = copy, 6 = xor |
58 | Standard_EXPORT void SetMode (const Standard_Integer M) const; |
59 | |
60 | Standard_EXPORT void Flush() const; |
61 | |
62 | Standard_EXPORT void MoveTo (const gp_Pnt& pt); |
63 | |
64 | Standard_EXPORT void DrawTo (const gp_Pnt& pt); |
65 | |
66 | Standard_EXPORT void MoveTo (const gp_Pnt2d& pt); |
67 | |
68 | Standard_EXPORT void DrawTo (const gp_Pnt2d& pt); |
69 | |
70 | Standard_EXPORT void Draw (const gp_Pnt& p1, const gp_Pnt& p2); |
71 | |
72 | Standard_EXPORT void Draw (const gp_Pnt2d& p1, const gp_Pnt2d& p2); |
73 | |
74 | //! Draw a circle <C> from angle <A1> to <A2> |
75 | //! (Radians). if ModifyWithZoom = 0, then |
76 | //! rayon of circle is convert to Integer. |
77 | Standard_EXPORT void Draw (const gp_Circ& C, const Standard_Real A1, const Standard_Real A2, const Standard_Boolean ModifyWithZoom = Standard_True); |
78 | |
79 | //! Draw a 2D circle <C> from angle <A1> to <A2> |
80 | //! (Radians). if ModifyWithZoom = 0, then |
81 | //! rayon of circle is convert to Integer. |
82 | Standard_EXPORT void Draw (const gp_Circ2d& C, const Standard_Real A1, const Standard_Real A2, const Standard_Boolean ModifyWithZoom = Standard_True); |
83 | |
84 | Standard_EXPORT void DrawMarker (const gp_Pnt& pt, const Draw_MarkerShape S, const Standard_Integer Size = 5); |
85 | |
86 | Standard_EXPORT void DrawMarker (const gp_Pnt2d& pt, const Draw_MarkerShape S, const Standard_Integer Size = 5); |
87 | |
88 | Standard_EXPORT void DrawMarker (const gp_Pnt& pt, const Draw_MarkerShape S, const Standard_Real Size); |
89 | |
90 | Standard_EXPORT void DrawMarker (const gp_Pnt2d& pt, const Draw_MarkerShape S, const Standard_Real Size); |
91 | |
92 | Standard_EXPORT void DrawString (const gp_Pnt& pt, const Standard_CString S); |
93 | |
94 | Standard_EXPORT void DrawString (const gp_Pnt2d& pt, const Standard_CString S); |
95 | |
96 | Standard_EXPORT void DrawString (const gp_Pnt& pt, const Standard_CString S, const Standard_Real moveX, const Standard_Real moveY); |
97 | |
98 | Standard_EXPORT void DrawString (const gp_Pnt2d& pt, const Standard_CString S, const Standard_Real moveX, const Standard_Real moveY); |
99 | |
100 | //! Returns the 2D projection of a 3D point. |
101 | Standard_EXPORT gp_Pnt2d Project (const gp_Pnt& pt) const; |
102 | |
103 | //! Returns the 2D projection of a 3D point. |
104 | Standard_EXPORT void Project (const gp_Pnt& pt, gp_Pnt2d& pt2d) const; |
105 | |
106 | //! Returns the current Zoom value. |
107 | Standard_EXPORT Standard_Real Zoom() const; |
108 | |
109 | //! Returns the identifier of the view where the |
110 | //! display is drawing. |
111 | Standard_EXPORT Standard_Integer ViewId() const; |
112 | |
113 | //! Returs True if the last drawing operations |
114 | //! generated a pick hit. When HasPicked is True the |
115 | //! Drawing should be resumed. |
116 | //! |
117 | //! This function is used to shorten the drawing when |
118 | //! picking and to save the picked sub-parts. |
119 | Standard_EXPORT Standard_Boolean HasPicked() const; |
120 | |
121 | |
122 | |
123 | |
124 | protected: |
125 | |
126 | |
127 | |
128 | |
129 | |
130 | private: |
131 | |
132 | |
133 | |
134 | |
135 | |
136 | }; |
137 | |
138 | |
139 | |
140 | |
141 | |
142 | |
143 | |
144 | #endif // _Draw_Display_HeaderFile |