Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:25

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