Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:25

0001 // Created on: 1992-05-22
0002 // Created by: Jean Claude VAUTHIER
0003 // Copyright (c) 1992-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 _DrawTrSurf_BezierCurve2d_HeaderFile
0018 #define _DrawTrSurf_BezierCurve2d_HeaderFile
0019 
0020 #include <Draw_Color.hxx>
0021 #include <DrawTrSurf_Curve2d.hxx>
0022 
0023 class Geom2d_BezierCurve;
0024 
0025 DEFINE_STANDARD_HANDLE(DrawTrSurf_BezierCurve2d, DrawTrSurf_Curve2d)
0026 
0027 class DrawTrSurf_BezierCurve2d : public DrawTrSurf_Curve2d
0028 {
0029   DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BezierCurve2d, DrawTrSurf_Curve2d)
0030   Draw_Drawable3D_FACTORY
0031 public:
0032 
0033   //! creates a drawable Bezier curve from a Bezier curve of package Geom2d.
0034   Standard_EXPORT DrawTrSurf_BezierCurve2d (const Handle(Geom2d_BezierCurve)& C);
0035 
0036   Standard_EXPORT DrawTrSurf_BezierCurve2d (const Handle(Geom2d_BezierCurve)& C,
0037                                             const Draw_Color& CurvColor, const Draw_Color& PolesColor, const Standard_Boolean ShowPoles, const Standard_Integer Discret);
0038 
0039   Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
0040 
0041   void ShowPoles() { drawPoles = Standard_True; }
0042 
0043   void ClearPoles() { drawPoles = Standard_False; }
0044 
0045   //! Returns in <Index> the index of the first pole  of the
0046   //! curve projected by the Display <D> at a distance lower
0047   //! than <Prec> from <X,Y>. If no pole  is found  index is
0048   //! set to 0, else index is always  greater than the input
0049   //! value of index.
0050   Standard_EXPORT void FindPole (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& Index) const;
0051 
0052   void SetPolesColor (const Draw_Color& theColor) { polesLook = theColor; }
0053 
0054   Draw_Color PolesColor() const { return polesLook; }
0055 
0056   //! For variable copy.
0057   Standard_EXPORT virtual Handle(Draw_Drawable3D) Copy() const Standard_OVERRIDE;
0058 
0059 private:
0060 
0061   Standard_Boolean drawPoles;
0062   Draw_Color polesLook;
0063 
0064 };
0065 
0066 #endif // _DrawTrSurf_BezierCurve2d_HeaderFile