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