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