Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-25 09:13:33

0001 // Created on: 1991-07-15
0002 // Created by: Arnaud BOUZY
0003 // Copyright (c) 1991-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Draw_Display_HeaderFile
0018 #define _Draw_Display_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <Draw_MarkerShape.hxx>
0025 class Draw_Color;
0026 class gp_Pnt;
0027 class gp_Pnt2d;
0028 class gp_Circ;
0029 class gp_Circ2d;
0030 
0031 //! Use to  draw in a 3d or a 2d view.
0032 //!
0033 //! * The  3d methods draw in the 3d  system,  in a 2d
0034 //! view the drawing is projected on X,Y.
0035 //!
0036 //! * The 2d methods draw in the projection plane.
0037 //!
0038 //! * To draw in screen coordinates the length must be
0039 //! divided by the zoom.
0040 class Draw_Display
0041 {
0042 public:
0043   DEFINE_STANDARD_ALLOC
0044 
0045   Standard_EXPORT Draw_Display();
0046 
0047   //! Following drawings will use this color.
0048   Standard_EXPORT void SetColor(const Draw_Color& col) const;
0049 
0050   //! Set the drawing mode, 3 = copy, 6 = xor
0051   Standard_EXPORT void SetMode(const Standard_Integer M) const;
0052 
0053   Standard_EXPORT void Flush() const;
0054 
0055   Standard_EXPORT void MoveTo(const gp_Pnt& pt);
0056 
0057   Standard_EXPORT void DrawTo(const gp_Pnt& pt);
0058 
0059   Standard_EXPORT void MoveTo(const gp_Pnt2d& pt);
0060 
0061   Standard_EXPORT void DrawTo(const gp_Pnt2d& pt);
0062 
0063   Standard_EXPORT void Draw(const gp_Pnt& p1, const gp_Pnt& p2);
0064 
0065   Standard_EXPORT void Draw(const gp_Pnt2d& p1, const gp_Pnt2d& p2);
0066 
0067   //! Draw  a  circle   <C> from  angle <A1>   to  <A2>
0068   //! (Radians). if ModifyWithZoom  = 0,  then
0069   //! rayon of circle is convert to Integer.
0070   Standard_EXPORT void Draw(const gp_Circ&         C,
0071                             const Standard_Real    A1,
0072                             const Standard_Real    A2,
0073                             const Standard_Boolean ModifyWithZoom = Standard_True);
0074 
0075   //! Draw  a 2D circle  <C>  from angle   <A1> to <A2>
0076   //! (Radians). if ModifyWithZoom  = 0,  then
0077   //! rayon of circle is convert to Integer.
0078   Standard_EXPORT void Draw(const gp_Circ2d&       C,
0079                             const Standard_Real    A1,
0080                             const Standard_Real    A2,
0081                             const Standard_Boolean ModifyWithZoom = Standard_True);
0082 
0083   Standard_EXPORT void DrawMarker(const gp_Pnt&          pt,
0084                                   const Draw_MarkerShape S,
0085                                   const Standard_Integer Size = 5);
0086 
0087   Standard_EXPORT void DrawMarker(const gp_Pnt2d&        pt,
0088                                   const Draw_MarkerShape S,
0089                                   const Standard_Integer Size = 5);
0090 
0091   Standard_EXPORT void DrawMarker(const gp_Pnt&          pt,
0092                                   const Draw_MarkerShape S,
0093                                   const Standard_Real    Size);
0094 
0095   Standard_EXPORT void DrawMarker(const gp_Pnt2d&        pt,
0096                                   const Draw_MarkerShape S,
0097                                   const Standard_Real    Size);
0098 
0099   Standard_EXPORT void DrawString(const gp_Pnt& pt, const Standard_CString S);
0100 
0101   Standard_EXPORT void DrawString(const gp_Pnt2d& pt, const Standard_CString S);
0102 
0103   Standard_EXPORT void DrawString(const gp_Pnt&          pt,
0104                                   const Standard_CString S,
0105                                   const Standard_Real    moveX,
0106                                   const Standard_Real    moveY);
0107 
0108   Standard_EXPORT void DrawString(const gp_Pnt2d&        pt,
0109                                   const Standard_CString S,
0110                                   const Standard_Real    moveX,
0111                                   const Standard_Real    moveY);
0112 
0113   //! Returns the 2D projection of a 3D point.
0114   Standard_EXPORT gp_Pnt2d Project(const gp_Pnt& pt) const;
0115 
0116   //! Returns the 2D projection of a 3D point.
0117   Standard_EXPORT void Project(const gp_Pnt& pt, gp_Pnt2d& pt2d) const;
0118 
0119   //! Returns the current Zoom value.
0120   Standard_EXPORT Standard_Real Zoom() const;
0121 
0122   //! Returns the   identifier  of the  view   where the
0123   //! display is drawing.
0124   Standard_EXPORT Standard_Integer ViewId() const;
0125 
0126   //! Returns  True  if  the  last   drawing   operations
0127   //! generated  a pick hit.  When HasPicked is True the
0128   //! Drawing should be resumed.
0129   //!
0130   //! This function is used to shorten the  drawing when
0131   //! picking and to save the picked sub-parts.
0132   Standard_EXPORT Standard_Boolean HasPicked() const;
0133 
0134 protected:
0135 private:
0136 };
0137 
0138 #endif // _Draw_Display_HeaderFile