Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-13 08:25:56

0001 // Created on: 1991-07-16
0002 // Created by: Christophe MARION
0003 // Copyright (c) 1991-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_Drawable_HeaderFile
0018 #define _DrawTrSurf_Drawable_HeaderFile
0019 
0020 #include <Draw_Drawable3D.hxx>
0021 #include <GeomAbs_IsoType.hxx>
0022 
0023 class Adaptor2d_Curve2d;
0024 class Adaptor3d_Curve;
0025 class Adaptor3d_IsoCurve;
0026 
0027 DEFINE_STANDARD_HANDLE(DrawTrSurf_Drawable, Draw_Drawable3D)
0028 
0029 //! this  class adds   to   the Drawable3D methods  to
0030 //! display Curves and Curves on Surface.
0031 //!
0032 //! The discretisation,  number  of points on a Curve,
0033 //! is stored in this class.
0034 class DrawTrSurf_Drawable : public Draw_Drawable3D
0035 {
0036   DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Drawable, Draw_Drawable3D)
0037 public:
0038   //! Draw a polygon of the curve on the Display
0039   Standard_EXPORT void DrawCurve2dOn(Adaptor2d_Curve2d& C, Draw_Display& D) const;
0040 
0041   //! Draw a polygon of the curve on the Display
0042   Standard_EXPORT void DrawCurveOn(Adaptor3d_Curve& C, Draw_Display& D) const;
0043 
0044   //! Load C  with the specified iso  and Draw a polygon
0045   //! of the curve on the Display
0046   Standard_EXPORT void DrawIsoCurveOn(Adaptor3d_IsoCurve&   C,
0047                                       const GeomAbs_IsoType T,
0048                                       const Standard_Real   P,
0049                                       const Standard_Real   F,
0050                                       const Standard_Real   L,
0051                                       Draw_Display&         D) const;
0052 
0053   //! this is defined only to tell C++ not to complain
0054   //! about inheriting a pure virtual method.
0055   Standard_EXPORT virtual void DrawOn(Draw_Display& dis) const Standard_OVERRIDE = 0;
0056 
0057   void SetDiscretisation(const Standard_Integer theDiscret) { myDiscret = theDiscret; }
0058 
0059   Standard_Integer GetDiscretisation() const { return myDiscret; }
0060 
0061   void SetDeflection(const Standard_Real theDeflection) { myDeflection = theDeflection; }
0062 
0063   Standard_Real GetDeflection() const { return myDeflection; }
0064 
0065   void SetDrawMode(const Standard_Integer theDrawMode) { myDrawMode = theDrawMode; }
0066 
0067   Standard_Integer GetDrawMode() const { return myDrawMode; }
0068 
0069 protected:
0070   //! set the number of points on a curve at creation.
0071   Standard_EXPORT DrawTrSurf_Drawable(const Standard_Integer discret,
0072                                       const Standard_Real    deflection = 0.01,
0073                                       const Standard_Integer DrawMode   = 0);
0074 
0075 private:
0076   Standard_Integer myDrawMode;
0077   Standard_Integer myDiscret;
0078   Standard_Real    myDeflection;
0079 };
0080 
0081 #endif // _DrawTrSurf_Drawable_HeaderFile