Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-24 09:15:33

0001 // Created on: 1991-06-24
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_HeaderFile
0018 #define _DrawTrSurf_HeaderFile
0019 
0020 #include <Draw_Interpretor.hxx>
0021 #include <Geom_Geometry.hxx>
0022 #include <Geom_Surface.hxx>
0023 #include <Geom2d_Curve.hxx>
0024 
0025 class Geom_BezierCurve;
0026 class Geom_BezierSurface;
0027 class Geom_BSplineCurve;
0028 class Geom_BSplineSurface;
0029 class Geom2d_BezierCurve;
0030 class Geom2d_BSplineCurve;
0031 class Poly_Polygon2D;
0032 class Poly_Polygon3D;
0033 class Poly_Triangulation;
0034 struct DrawTrSurf_Params;
0035 
0036 //! This package supports the display of parametric curves and surfaces.
0037 //!
0038 //! The Drawable deferred classes is inherited from
0039 //! the Drawable3D class from the package Draw, it
0040 //! adds methods to draw 3D Curves and Curves on 3D
0041 //! Surfaces.
0042 //!
0043 //! The classes Curve Curve2d and Surface are drawable
0044 //! and can be used to draw a single curve from
0045 //! packages Geom or Geom2d or a surface from Geom.
0046 //!
0047 //! The Triangulation and Polygon from the package Poly are also supported.
0048 class DrawTrSurf
0049 {
0050 public:
0051   DEFINE_STANDARD_ALLOC
0052 
0053   //! Sets <G> in the variable <Name>. Overwrite the
0054   //! variable if already set.
0055   Standard_EXPORT static void Set(const char* const Name, const gp_Pnt& G);
0056 
0057   //! Sets <G> in the variable <Name>. Overwrite the
0058   //! variable if already set.
0059   Standard_EXPORT static void Set(const char* const Name, const gp_Pnt2d& G);
0060 
0061   //! Sets <G> in the variable <Name>. Overwrite the
0062   //! variable if already set.
0063   //! isSenseMarker indicates whether to render the
0064   //! sense glyph (arrow) for curves or not
0065   Standard_EXPORT static void Set(const char* const                 Name,
0066                                   const occ::handle<Geom_Geometry>& G,
0067                                   const bool                        isSenseMarker = true);
0068 
0069   template <class T>
0070   static void Set(const char* const     Name,
0071                   const occ::handle<T>& Arg,
0072                   typename opencascade::std::enable_if<
0073                     opencascade::std::is_base_of<Geom_Geometry, T>::value>::type* = nullptr)
0074   {
0075     Set(Name, (const occ::handle<Geom_Geometry>&)Arg);
0076   }
0077 
0078   //! Sets <C> in the variable <Name>. Overwrite the
0079   //! variable if already set.
0080   //! isSenseMarker indicates whether to render the
0081   //! sense glyph (arrow) for curves or not
0082   Standard_EXPORT static void Set(const char* const                Name,
0083                                   const occ::handle<Geom2d_Curve>& C,
0084                                   const bool                       isSenseMarker = true);
0085 
0086   template <class T>
0087   static void Set(const char* const     Name,
0088                   const occ::handle<T>& Arg,
0089                   typename opencascade::std::enable_if<
0090                     opencascade::std::is_base_of<Geom2d_Curve, T>::value>::type* = nullptr)
0091   {
0092     Set(Name, (const occ::handle<Geom2d_Curve>&)Arg);
0093   }
0094 
0095   //! Sets <T> in the variable <Name>. Overwrite the
0096   //! variable if already set.
0097   Standard_EXPORT static void Set(const char* const Name, const occ::handle<Poly_Triangulation>& T);
0098 
0099   //! Sets <P> in the variable <Name>. Overwrite the
0100   //! variable if already set.
0101   Standard_EXPORT static void Set(const char* const Name, const occ::handle<Poly_Polygon3D>& P);
0102 
0103   //! Sets <P> in the variable <Name>. Overwrite the
0104   //! variable if already set.
0105   Standard_EXPORT static void Set(const char* const Name, const occ::handle<Poly_Polygon2D>& P);
0106   //! Getthe variable <S>. Returns a null handle if
0107   //!  none, and print a warning message.
0108   Standard_EXPORT static occ::handle<Geom_Geometry> Get(const char*& Name);
0109 
0110   //! Gets the variable. Returns False if none and print
0111   //! a warning message.
0112   Standard_EXPORT static bool GetPoint(const char*& Name, gp_Pnt& P);
0113 
0114   //! Gets the variable. Returns False if none and print
0115   //! a warning message.
0116   Standard_EXPORT static bool GetPoint2d(const char*& Name, gp_Pnt2d& P);
0117 
0118   //! Get the variable <S>. Returns a null handle if
0119   //! none, and print a warning message.
0120   Standard_EXPORT static occ::handle<Geom_Curve> GetCurve(const char*& Name);
0121 
0122   //! Get the variable <S>. Returns a null handle if
0123   //! none, and print a warning message.
0124   Standard_EXPORT static occ::handle<Geom_BezierCurve> GetBezierCurve(const char*& Name);
0125 
0126   //! Get the variable <S>. Returns a null handle if
0127   //! none, and print a warning message.
0128   Standard_EXPORT static occ::handle<Geom_BSplineCurve> GetBSplineCurve(const char*& Name);
0129 
0130   //! Get the variable <S>. Returns a null handle if
0131   //! none, and print a warning message.
0132   Standard_EXPORT static occ::handle<Geom2d_Curve> GetCurve2d(const char*& Name);
0133 
0134   //! Get the variable <S>. Returns a null handle if
0135   //! none, and print a warning message.
0136   Standard_EXPORT static occ::handle<Geom2d_BezierCurve> GetBezierCurve2d(const char*& Name);
0137 
0138   //! Get the variable <S>. Returns a null handle if
0139   //! none, and print a warning message.
0140   Standard_EXPORT static occ::handle<Geom2d_BSplineCurve> GetBSplineCurve2d(const char*& Name);
0141 
0142   //! Get the variable <S>. Returns a null handle if
0143   //! none, and print a warning message.
0144   Standard_EXPORT static occ::handle<Geom_Surface> GetSurface(const char*& Name);
0145 
0146   //! Get the variable <S>. Returns a null handle if
0147   //! none, and print a warning message.
0148   Standard_EXPORT static occ::handle<Geom_BezierSurface> GetBezierSurface(const char*& Name);
0149 
0150   //! Get the variable <S>. Returns a null handle if
0151   //! none, and print a warning message.
0152   Standard_EXPORT static occ::handle<Geom_BSplineSurface> GetBSplineSurface(const char*& Name);
0153 
0154   //! Get the variable <S>. Returns a null handle if
0155   //! none, and print a warning message.
0156   Standard_EXPORT static occ::handle<Poly_Triangulation> GetTriangulation(const char*& Name);
0157 
0158   //! Get the variable <S>. Returns a null handle if
0159   //! none, and print a warning message.
0160   Standard_EXPORT static occ::handle<Poly_Polygon3D> GetPolygon3D(const char*& Name);
0161 
0162   //! Get the variable <S>. Returns a null handle if
0163   //! none, and print a warning message.
0164   Standard_EXPORT static occ::handle<Poly_Polygon2D> GetPolygon2D(const char*& Name);
0165 
0166   //! Return package global parameters.
0167   Standard_EXPORT static DrawTrSurf_Params& Parameters();
0168 
0169   //! defines display commands.
0170   Standard_EXPORT static void BasicCommands(Draw_Interpretor& I);
0171 };
0172 
0173 #endif // _DrawTrSurf_HeaderFile