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_BSplineSurface_HeaderFile
0018 #define _DrawTrSurf_BSplineSurface_HeaderFile
0019 
0020 #include <Draw_MarkerShape.hxx>
0021 #include <Draw_Color.hxx>
0022 #include <DrawTrSurf_Surface.hxx>
0023 
0024 class Geom_BSplineSurface;
0025 
0026 DEFINE_STANDARD_HANDLE(DrawTrSurf_BSplineSurface, DrawTrSurf_Surface)
0027 
0028 //! This class defines a drawable BSplineSurface.
0029 //! With this class you can draw the control points and the knots
0030 //! of the surface.
0031 //! You can use the general class Surface from DrawTrSurf too,
0032 //! if you just want to sea boundaries and isoparametric curves.
0033 class DrawTrSurf_BSplineSurface : public DrawTrSurf_Surface
0034 {
0035   DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BSplineSurface, DrawTrSurf_Surface)
0036   Draw_Drawable3D_FACTORY
0037 public:
0038   
0039   //! default drawing mode.
0040   //! The isoparametric curves corresponding to the knots values are drawn.
0041   //! The control points and the knots points are drawn.
0042   //! The boundaries are yellow, the isoparametric curves are blues.
0043   //! For the discretisation 50 points are computed in each parametric direction.
0044   Standard_EXPORT DrawTrSurf_BSplineSurface (const Handle(Geom_BSplineSurface)& S);
0045 
0046   //! The isoparametric curves corresponding to the knots values are drawn.
0047   Standard_EXPORT DrawTrSurf_BSplineSurface (const Handle(Geom_BSplineSurface)& S,
0048                                              const Draw_Color& BoundsColor, const Draw_Color& IsosColor, const Draw_Color& PolesColor,
0049                                              const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize,
0050                                              const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots,
0051                                              const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
0052 
0053   //! Parametric equidistant iso curves are drawn.
0054   Standard_EXPORT DrawTrSurf_BSplineSurface (const Handle(Geom_BSplineSurface)& S,
0055                                              const Standard_Integer NbUIsos, const Standard_Integer NbVIsos,
0056                                              const Draw_Color& BoundsColor, const Draw_Color& IsosColor, const Draw_Color& PolesColor,
0057                                              const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize,
0058                                              const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots,
0059                                              const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
0060 
0061   Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
0062 
0063   void ShowPoles() { drawPoles = Standard_True; }
0064 
0065   void ShowKnots() { drawKnots = Standard_True; }
0066 
0067   //! change the number of isoparametric curves to be drawn.
0068   Standard_EXPORT virtual void ShowIsos (const Standard_Integer Nu, const Standard_Integer Nv) Standard_OVERRIDE;
0069 
0070   //! change the number of isoparametric curves to be drawn.
0071   Standard_EXPORT void ShowKnotsIsos();
0072 
0073   //! rub out all the isoparametric curves.
0074   Standard_EXPORT virtual void ClearIsos() Standard_OVERRIDE;
0075 
0076   void ClearPoles() { drawPoles = Standard_False; }
0077 
0078   void ClearKnots() { drawKnots = Standard_False; }
0079   
0080   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;
0081   
0082   Standard_EXPORT void FindUKnot (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& UIndex) const;
0083   
0084   Standard_EXPORT void FindVKnot (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& VIndex) const;
0085 
0086   void SetPolesColor (const Draw_Color& theColor) { polesLook = theColor; }
0087 
0088   void SetKnotsColor (const Draw_Color& theColor) { knotsLook = theColor; }
0089 
0090   void SetKnotsShape (const Draw_MarkerShape theShape) { knotsForm = theShape; }
0091 
0092   Draw_MarkerShape KnotsShape() const { return knotsForm; }
0093 
0094   Draw_Color KnotsColor() const { return knotsLook; }
0095 
0096   Draw_Color PolesColor() const { return polesLook; }
0097 
0098   //! For variable copy.
0099   Standard_EXPORT virtual Handle(Draw_Drawable3D) Copy() const Standard_OVERRIDE;
0100 
0101 private:
0102 
0103   Standard_Boolean drawPoles;
0104   Standard_Boolean drawKnots;
0105   Standard_Boolean knotsIsos;
0106   Draw_MarkerShape knotsForm;
0107   Draw_Color knotsLook;
0108   Standard_Integer knotsDim;
0109   Draw_Color polesLook;
0110 
0111 };
0112 
0113 #endif // _DrawTrSurf_BSplineSurface_HeaderFile