1 // Created on: 1992-05-22
2 // Created by: Jean Claude VAUTHIER
3 // Copyright (c) 1992-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 _DrawTrSurf_BSplineSurface_HeaderFile
18 #define _DrawTrSurf_BSplineSurface_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Boolean.hxx>
24 #include <Draw_MarkerShape.hxx>
25 #include <Draw_Color.hxx>
26 #include <Standard_Integer.hxx>
27 #include <DrawTrSurf_Surface.hxx>
28 #include <Standard_Real.hxx>
29 class Geom_BSplineSurface;
32 class Draw_Drawable3D;
35 class DrawTrSurf_BSplineSurface;
36 DEFINE_STANDARD_HANDLE(DrawTrSurf_BSplineSurface, DrawTrSurf_Surface)
39 //! This class defines a drawable BSplineSurface.
40 //! With this class you can draw the control points and the knots
42 //! You can use the general class Surface from DrawTrSurf too,
43 //! if you just want to sea boundaries and isoparametric curves.
44 class DrawTrSurf_BSplineSurface : public DrawTrSurf_Surface
50 //! default drawing mode.
51 //! The isoparametric curves corresponding to the knots values are
53 //! The control points and the knots points are drawn.
54 //! The boundaries are yellow, the isoparametric curves are blues.
55 //! For the discretisation 50 points are computed in each parametric
57 Standard_EXPORT DrawTrSurf_BSplineSurface(const Handle(Geom_BSplineSurface)& S);
60 //! The isoparametric curves corresponding to the knots values are
62 Standard_EXPORT DrawTrSurf_BSplineSurface(const Handle(Geom_BSplineSurface)& S, const Draw_Color& BoundsColor, const Draw_Color& IsosColor, const Draw_Color& PolesColor, const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots, const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
64 //! Parametric equidistant iso curves are drawn.
65 Standard_EXPORT DrawTrSurf_BSplineSurface(const Handle(Geom_BSplineSurface)& S, const Standard_Integer NbUIsos, const Standard_Integer NbVIsos, const Draw_Color& BoundsColor, const Draw_Color& IsosColor, const Draw_Color& PolesColor, const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots, const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
67 Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
69 Standard_EXPORT void ShowPoles();
71 Standard_EXPORT void ShowKnots();
73 //! change the number of isoparametric curves to be drawn.
74 Standard_EXPORT virtual void ShowIsos (const Standard_Integer Nu, const Standard_Integer Nv) Standard_OVERRIDE;
76 //! change the number of isoparametric curves to be drawn.
77 Standard_EXPORT void ShowKnotsIsos();
79 //! rub out all the isoparametric curves.
80 Standard_EXPORT virtual void ClearIsos() Standard_OVERRIDE;
82 Standard_EXPORT void ClearPoles();
84 Standard_EXPORT void ClearKnots();
86 Standard_EXPORT void FindPole (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& UIndex, Standard_Integer& VIndex) const;
88 Standard_EXPORT void FindUKnot (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& UIndex) const;
90 Standard_EXPORT void FindVKnot (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& VIndex) const;
92 void SetPolesColor (const Draw_Color& aColor);
94 void SetKnotsColor (const Draw_Color& aColor);
96 void SetKnotsShape (const Draw_MarkerShape Shape);
98 Draw_MarkerShape KnotsShape() const;
100 Draw_Color KnotsColor() const;
102 Draw_Color PolesColor() const;
104 //! For variable copy.
105 Standard_EXPORT virtual Handle(Draw_Drawable3D) Copy() const Standard_OVERRIDE;
110 DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BSplineSurface,DrawTrSurf_Surface)
120 Standard_Boolean drawPoles;
121 Standard_Boolean drawKnots;
122 Standard_Boolean knotsIsos;
123 Draw_MarkerShape knotsForm;
124 Draw_Color knotsLook;
125 Standard_Integer knotsDim;
126 Draw_Color polesLook;
132 #include <DrawTrSurf_BSplineSurface.lxx>
138 #endif // _DrawTrSurf_BSplineSurface_HeaderFile