Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-29 09:18:37

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