Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 09:17:21

0001 // Created on: 1992-05-21
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_Surface_HeaderFile
0018 #define _DrawTrSurf_Surface_HeaderFile
0019 
0020 #include <Draw_Color.hxx>
0021 #include <DrawTrSurf_Drawable.hxx>
0022 #include <Draw_Interpretor.hxx>
0023 
0024 class Geom_Surface;
0025 
0026 //! This class defines a drawable surface.
0027 //! With this class you can draw a general surface from package Geom.
0028 class DrawTrSurf_Surface : public DrawTrSurf_Drawable
0029 {
0030   DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Surface, DrawTrSurf_Drawable)
0031   Draw_Drawable3D_FACTORY
0032 public:
0033   //! default drawing mode
0034   //! Just the middle isoparametric curves are drawn.
0035   //! The boundaries are yellow, the isoparametric curves are blues.
0036   //! For the discretisation 50 points are computed in each parametric direction.
0037   Standard_EXPORT DrawTrSurf_Surface(const occ::handle<Geom_Surface>& S);
0038 
0039   Standard_EXPORT DrawTrSurf_Surface(const occ::handle<Geom_Surface>& S,
0040                                      const int                        Nu,
0041                                      const int                        Nv,
0042                                      const Draw_Color&                BoundsColor,
0043                                      const Draw_Color&                IsosColor,
0044                                      const int                        Discret,
0045                                      const double                     Deflection,
0046                                      const int                        DrawMode);
0047 
0048   Draw_Color BoundsColor() const { return boundsLook; }
0049 
0050   //! rub out all the isoparametric curves.
0051   Standard_EXPORT virtual void ClearIsos();
0052 
0053   Standard_EXPORT void DrawOn(Draw_Display& dis) const override;
0054 
0055   //! Iso = True : Draw the isos, the boundaries, the UVMarker.
0056   //! Iso = False: Only Draw the boundary and the UVMarker.
0057   Standard_EXPORT void DrawOn(Draw_Display& dis, const bool Iso) const;
0058 
0059   occ::handle<Geom_Surface> GetSurface() const { return surf; }
0060 
0061   Draw_Color IsosColor() const { return isosLook; }
0062 
0063   void NbIsos(int& theNU, int& theNV) const
0064   {
0065     theNU = nbUIsos;
0066     theNV = nbVIsos;
0067   }
0068 
0069   void SetBoundsColor(const Draw_Color& theColor) { boundsLook = theColor; }
0070 
0071   void SetIsosColor(const Draw_Color& theColor) { isosLook = theColor; }
0072 
0073   //! change the number of isoparametric curves to be drawn.
0074   virtual void ShowIsos(const int theNu, const int theNv)
0075   {
0076     nbUIsos = std::abs(theNu);
0077     nbVIsos = std::abs(theNv);
0078   }
0079 
0080   //! For variable copy.
0081   Standard_EXPORT occ::handle<Draw_Drawable3D> Copy() const override;
0082 
0083   //! For variable dump.
0084   Standard_EXPORT void Dump(Standard_OStream& S) const override;
0085 
0086   //! Save drawable into stream.
0087   Standard_EXPORT void Save(Standard_OStream& theStream) const override;
0088 
0089   //! For variable whatis command.
0090   Standard_EXPORT void Whatis(Draw_Interpretor& I) const override;
0091 
0092 protected:
0093   occ::handle<Geom_Surface> surf;
0094   Draw_Color                boundsLook;
0095   Draw_Color                isosLook;
0096   int                       nbUIsos;
0097   int                       nbVIsos;
0098 };
0099 
0100 #endif // _DrawTrSurf_Surface_HeaderFile