Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-02 09:11:57

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_Curve2d_HeaderFile
0018 #define _DrawTrSurf_Curve2d_HeaderFile
0019 
0020 #include <Draw_Color.hxx>
0021 #include <DrawTrSurf_Drawable.hxx>
0022 #include <Draw_Interpretor.hxx>
0023 
0024 class Geom2d_Curve;
0025 
0026 //! This class defines a drawable curve in 2d space.
0027 //! The curve is drawn in the plane XOY.
0028 class DrawTrSurf_Curve2d : public DrawTrSurf_Drawable
0029 {
0030   DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Curve2d, DrawTrSurf_Drawable)
0031   Draw_Drawable3D_FACTORY
0032 public:
0033   //! creates a drawable curve from a curve of package Geom2d.
0034   Standard_EXPORT DrawTrSurf_Curve2d(const occ::handle<Geom2d_Curve>& C,
0035                                      const bool                       DispOrigin = true);
0036 
0037   Standard_EXPORT DrawTrSurf_Curve2d(const occ::handle<Geom2d_Curve>& C,
0038                                      const Draw_Color&                aColor,
0039                                      const int                        Discret,
0040                                      const bool                       DispOrigin     = true,
0041                                      const bool                       DispCurvRadius = false,
0042                                      const double                     RadiusMax      = 1.0e3,
0043                                      const double                     RatioOfRadius  = 0.1);
0044 
0045   Standard_EXPORT void DrawOn(Draw_Display& dis) const override;
0046 
0047   occ::handle<Geom2d_Curve> GetCurve() const { return curv; }
0048 
0049   void SetColor(const Draw_Color& theColor) { look = theColor; }
0050 
0051   void ShowCurvature() { dispcurvradius = true; }
0052 
0053   void ClearCurvature() { dispcurvradius = false; }
0054 
0055   void SetRadiusMax(const double theRadius) { radiusmax = theRadius; }
0056 
0057   void SetRadiusRatio(const double theRatio) { radiusratio = theRatio; }
0058 
0059   Draw_Color Color() const { return look; }
0060 
0061   double RadiusMax() const { return radiusmax; }
0062 
0063   double RadiusRatio() const { return radiusratio; }
0064 
0065   //! For variable copy.
0066   Standard_EXPORT occ::handle<Draw_Drawable3D> Copy() const override;
0067 
0068   //! For variable dump.
0069   Standard_EXPORT void Dump(Standard_OStream& S) const override;
0070 
0071   //! Save drawable into stream.
0072   Standard_EXPORT void Save(Standard_OStream& theStream) const override;
0073 
0074   //! Returns False.
0075   Standard_EXPORT bool Is3D() const override;
0076 
0077   //! For variable whatis command. Set as a result the type of the variable.
0078   Standard_EXPORT void Whatis(Draw_Interpretor& I) const override;
0079 
0080 protected:
0081   occ::handle<Geom2d_Curve> curv;
0082   Draw_Color                look;
0083   bool                      disporigin;
0084   bool                      dispcurvradius;
0085   double                    radiusmax;
0086   double                    radiusratio;
0087 };
0088 
0089 #endif // _DrawTrSurf_Curve2d_HeaderFile