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