Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-05 09:21:53

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_BSplineCurve_HeaderFile
0018 #define _DrawTrSurf_BSplineCurve_HeaderFile
0019 
0020 #include <Draw_MarkerShape.hxx>
0021 #include <Draw_Color.hxx>
0022 #include <DrawTrSurf_Curve.hxx>
0023 
0024 class Geom_BSplineCurve;
0025 
0026 class DrawTrSurf_BSplineCurve : public DrawTrSurf_Curve
0027 {
0028   DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BSplineCurve, DrawTrSurf_Curve)
0029   Draw_Drawable3D_FACTORY
0030 public:
0031   //! creates a drawable BSpline curve from a BSpline curve of package Geom.
0032   Standard_EXPORT DrawTrSurf_BSplineCurve(const occ::handle<Geom_BSplineCurve>& C);
0033 
0034   //! creates a drawable BSpline curve from a BSpline curve of package Geom.
0035   Standard_EXPORT DrawTrSurf_BSplineCurve(const occ::handle<Geom_BSplineCurve>& C,
0036                                           const Draw_Color&                     CurvColor,
0037                                           const Draw_Color&                     PolesColor,
0038                                           const Draw_Color&                     KnotsColor,
0039                                           const Draw_MarkerShape                KnotsShape,
0040                                           const int                             KnotsSize,
0041                                           const bool                            ShowPoles,
0042                                           const bool                            ShowKnots,
0043                                           const int                             Discret,
0044                                           const double                          Deflection,
0045                                           const int                             DrawMode);
0046 
0047   Standard_EXPORT void DrawOn(Draw_Display& dis) const override;
0048 
0049   Standard_EXPORT void DrawOn(Draw_Display& dis, const bool ShowPoles, const bool ShowKnots) const;
0050 
0051   Standard_EXPORT void DrawOn(Draw_Display& dis,
0052                               const double  U1,
0053                               const double  U2,
0054                               const int     Pindex,
0055                               const bool    ShowPoles = true,
0056                               const bool    ShowKnots = true) const;
0057 
0058   void ShowPoles() { drawPoles = true; }
0059 
0060   void ShowKnots() { drawKnots = true; }
0061 
0062   void ClearPoles() { drawPoles = false; }
0063 
0064   void ClearKnots() { drawKnots = false; }
0065 
0066   //! Returns in <Index> the index of the first pole of the
0067   //! curve projected by the Display <D> at a distance lower
0068   //! than <Prec> from <X,Y>. If no pole is found index is
0069   //! set to 0, else index is always greater than the input
0070   //! value of index.
0071   Standard_EXPORT void FindPole(const double        X,
0072                                 const double        Y,
0073                                 const Draw_Display& D,
0074                                 const double        Prec,
0075                                 int&                Index) const;
0076 
0077   Standard_EXPORT void FindKnot(const double        X,
0078                                 const double        Y,
0079                                 const Draw_Display& D,
0080                                 const double        Prec,
0081                                 int&                Index) const;
0082 
0083   void SetPolesColor(const Draw_Color& theColor) { polesLook = theColor; }
0084 
0085   void SetKnotsColor(const Draw_Color& theColor) { knotsLook = theColor; }
0086 
0087   void SetKnotsShape(const Draw_MarkerShape theShape) { knotsForm = theShape; }
0088 
0089   Draw_MarkerShape KnotsShape() const { return knotsForm; }
0090 
0091   Draw_Color KnotsColor() const { return knotsLook; }
0092 
0093   Draw_Color PolesColor() const { return polesLook; }
0094 
0095   //! For variable copy.
0096   Standard_EXPORT occ::handle<Draw_Drawable3D> Copy() const override;
0097 
0098 private:
0099   bool             drawPoles;
0100   bool             drawKnots;
0101   Draw_MarkerShape knotsForm;
0102   Draw_Color       knotsLook;
0103   int              knotsDim;
0104   Draw_Color       polesLook;
0105 };
0106 
0107 #endif // _DrawTrSurf_BSplineCurve_HeaderFile