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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Draw_Display_HeaderFile
18 #define _Draw_Display_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
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>
36 //! Use to draw in a 3d or a 2d view.
38 //! * The 3d methods draw in the 3d system, in a 2d
39 //! view the drawing is projected on X,Y.
41 //! * The 2d methods draw in the projection plane.
43 //! * To draw in screen coordinates the length must be
44 //! divided by the zoom.
52 Standard_EXPORT Draw_Display();
54 //! Following drawings will use this color.
55 Standard_EXPORT void SetColor (const Draw_Color& col) const;
57 //! Set the drawing mode, 3 = copy, 6 = xor
58 Standard_EXPORT void SetMode (const Standard_Integer M) const;
60 Standard_EXPORT void Flush() const;
62 Standard_EXPORT void MoveTo (const gp_Pnt& pt);
64 Standard_EXPORT void DrawTo (const gp_Pnt& pt);
66 Standard_EXPORT void MoveTo (const gp_Pnt2d& pt);
68 Standard_EXPORT void DrawTo (const gp_Pnt2d& pt);
70 Standard_EXPORT void Draw (const gp_Pnt& p1, const gp_Pnt& p2);
72 Standard_EXPORT void Draw (const gp_Pnt2d& p1, const gp_Pnt2d& p2);
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);
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);
84 Standard_EXPORT void DrawMarker (const gp_Pnt& pt, const Draw_MarkerShape S, const Standard_Integer Size = 5);
86 Standard_EXPORT void DrawMarker (const gp_Pnt2d& pt, const Draw_MarkerShape S, const Standard_Integer Size = 5);
88 Standard_EXPORT void DrawMarker (const gp_Pnt& pt, const Draw_MarkerShape S, const Standard_Real Size);
90 Standard_EXPORT void DrawMarker (const gp_Pnt2d& pt, const Draw_MarkerShape S, const Standard_Real Size);
92 Standard_EXPORT void DrawString (const gp_Pnt& pt, const Standard_CString S);
94 Standard_EXPORT void DrawString (const gp_Pnt2d& pt, const Standard_CString S);
96 Standard_EXPORT void DrawString (const gp_Pnt& pt, const Standard_CString S, const Standard_Real moveX, const Standard_Real moveY);
98 Standard_EXPORT void DrawString (const gp_Pnt2d& pt, const Standard_CString S, const Standard_Real moveX, const Standard_Real moveY);
100 //! Returns the 2D projection of a 3D point.
101 Standard_EXPORT gp_Pnt2d Project (const gp_Pnt& pt) const;
103 //! Returns the 2D projection of a 3D point.
104 Standard_EXPORT void Project (const gp_Pnt& pt, gp_Pnt2d& pt2d) const;
106 //! Returns the current Zoom value.
107 Standard_EXPORT Standard_Real Zoom() const;
109 //! Returns the identifier of the view where the
110 //! display is drawing.
111 Standard_EXPORT Standard_Integer ViewId() const;
113 //! Returs True if the last drawing operations
114 //! generated a pick hit. When HasPicked is True the
115 //! Drawing should be resumed.
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;
144 #endif // _Draw_Display_HeaderFile