Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-06 08:35:41

0001 // Created on: 1993-07-06
0002 // Created by: Remi LEQUETTE
0003 // Copyright (c) 1993-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 _BRepLib_MakeEdge_HeaderFile
0018 #define _BRepLib_MakeEdge_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <BRepLib_EdgeError.hxx>
0025 #include <TopoDS_Vertex.hxx>
0026 #include <BRepLib_MakeShape.hxx>
0027 class gp_Pnt;
0028 class gp_Lin;
0029 class gp_Circ;
0030 class gp_Elips;
0031 class gp_Hypr;
0032 class gp_Parab;
0033 class Geom_Curve;
0034 class Geom2d_Curve;
0035 class Geom_Surface;
0036 class TopoDS_Edge;
0037 
0038 //! Provides methods to build edges.
0039 //!
0040 //! The   methods have  the  following   syntax, where
0041 //! TheCurve is one of Lin, Circ, ...
0042 //!
0043 //! Create(C : TheCurve)
0044 //!
0045 //! Makes an edge on  the whole curve.  Add vertices
0046 //! on finite curves.
0047 //!
0048 //! Create(C : TheCurve; p1,p2 : Real)
0049 //!
0050 //! Make an edge  on the curve between parameters p1
0051 //! and p2. if p2 < p1 the edge will be REVERSED. If
0052 //! p1  or p2 is infinite the  curve will be open in
0053 //! that  direction. Vertices are created for finite
0054 //! values of p1 and p2.
0055 //!
0056 //! Create(C : TheCurve; P1, P2 : Pnt from gp)
0057 //!
0058 //! Make an edge on the curve  between the points P1
0059 //! and P2. The  points are projected on   the curve
0060 //! and the   previous method is  used. An  error is
0061 //! raised if the points are not on the curve.
0062 //!
0063 //! Create(C : TheCurve; V1, V2 : Vertex from TopoDS)
0064 //!
0065 //! Make an edge  on the curve  between the vertices
0066 //! V1 and V2. Same as the  previous but no vertices
0067 //! are created. If a vertex is  Null the curve will
0068 //! be open in this direction.
0069 class BRepLib_MakeEdge : public BRepLib_MakeShape
0070 {
0071 public:
0072   DEFINE_STANDARD_ALLOC
0073 
0074   Standard_EXPORT BRepLib_MakeEdge();
0075 
0076   Standard_EXPORT BRepLib_MakeEdge(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
0077 
0078   Standard_EXPORT BRepLib_MakeEdge(const gp_Pnt& P1, const gp_Pnt& P2);
0079 
0080   Standard_EXPORT BRepLib_MakeEdge(const gp_Lin& L);
0081 
0082   Standard_EXPORT BRepLib_MakeEdge(const gp_Lin& L, const Standard_Real p1, const Standard_Real p2);
0083 
0084   Standard_EXPORT BRepLib_MakeEdge(const gp_Lin& L, const gp_Pnt& P1, const gp_Pnt& P2);
0085 
0086   Standard_EXPORT BRepLib_MakeEdge(const gp_Lin&        L,
0087                                    const TopoDS_Vertex& V1,
0088                                    const TopoDS_Vertex& V2);
0089 
0090   Standard_EXPORT BRepLib_MakeEdge(const gp_Circ& L);
0091 
0092   Standard_EXPORT BRepLib_MakeEdge(const gp_Circ&      L,
0093                                    const Standard_Real p1,
0094                                    const Standard_Real p2);
0095 
0096   Standard_EXPORT BRepLib_MakeEdge(const gp_Circ& L, const gp_Pnt& P1, const gp_Pnt& P2);
0097 
0098   Standard_EXPORT BRepLib_MakeEdge(const gp_Circ&       L,
0099                                    const TopoDS_Vertex& V1,
0100                                    const TopoDS_Vertex& V2);
0101 
0102   Standard_EXPORT BRepLib_MakeEdge(const gp_Elips& L);
0103 
0104   Standard_EXPORT BRepLib_MakeEdge(const gp_Elips&     L,
0105                                    const Standard_Real p1,
0106                                    const Standard_Real p2);
0107 
0108   Standard_EXPORT BRepLib_MakeEdge(const gp_Elips& L, const gp_Pnt& P1, const gp_Pnt& P2);
0109 
0110   Standard_EXPORT BRepLib_MakeEdge(const gp_Elips&      L,
0111                                    const TopoDS_Vertex& V1,
0112                                    const TopoDS_Vertex& V2);
0113 
0114   Standard_EXPORT BRepLib_MakeEdge(const gp_Hypr& L);
0115 
0116   Standard_EXPORT BRepLib_MakeEdge(const gp_Hypr&      L,
0117                                    const Standard_Real p1,
0118                                    const Standard_Real p2);
0119 
0120   Standard_EXPORT BRepLib_MakeEdge(const gp_Hypr& L, const gp_Pnt& P1, const gp_Pnt& P2);
0121 
0122   Standard_EXPORT BRepLib_MakeEdge(const gp_Hypr&       L,
0123                                    const TopoDS_Vertex& V1,
0124                                    const TopoDS_Vertex& V2);
0125 
0126   Standard_EXPORT BRepLib_MakeEdge(const gp_Parab& L);
0127 
0128   Standard_EXPORT BRepLib_MakeEdge(const gp_Parab&     L,
0129                                    const Standard_Real p1,
0130                                    const Standard_Real p2);
0131 
0132   Standard_EXPORT BRepLib_MakeEdge(const gp_Parab& L, const gp_Pnt& P1, const gp_Pnt& P2);
0133 
0134   Standard_EXPORT BRepLib_MakeEdge(const gp_Parab&      L,
0135                                    const TopoDS_Vertex& V1,
0136                                    const TopoDS_Vertex& V2);
0137 
0138   Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L);
0139 
0140   Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L,
0141                                    const Standard_Real       p1,
0142                                    const Standard_Real       p2);
0143 
0144   Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L, const gp_Pnt& P1, const gp_Pnt& P2);
0145 
0146   Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L,
0147                                    const TopoDS_Vertex&      V1,
0148                                    const TopoDS_Vertex&      V2);
0149 
0150   Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L,
0151                                    const gp_Pnt&             P1,
0152                                    const gp_Pnt&             P2,
0153                                    const Standard_Real       p1,
0154                                    const Standard_Real       p2);
0155 
0156   Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L,
0157                                    const TopoDS_Vertex&      V1,
0158                                    const TopoDS_Vertex&      V2,
0159                                    const Standard_Real       p1,
0160                                    const Standard_Real       p2);
0161 
0162   Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S);
0163 
0164   Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L,
0165                                    const Handle(Geom_Surface)& S,
0166                                    const Standard_Real         p1,
0167                                    const Standard_Real         p2);
0168 
0169   Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L,
0170                                    const Handle(Geom_Surface)& S,
0171                                    const gp_Pnt&               P1,
0172                                    const gp_Pnt&               P2);
0173 
0174   Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L,
0175                                    const Handle(Geom_Surface)& S,
0176                                    const TopoDS_Vertex&        V1,
0177                                    const TopoDS_Vertex&        V2);
0178 
0179   Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L,
0180                                    const Handle(Geom_Surface)& S,
0181                                    const gp_Pnt&               P1,
0182                                    const gp_Pnt&               P2,
0183                                    const Standard_Real         p1,
0184                                    const Standard_Real         p2);
0185 
0186   Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L,
0187                                    const Handle(Geom_Surface)& S,
0188                                    const TopoDS_Vertex&        V1,
0189                                    const TopoDS_Vertex&        V2,
0190                                    const Standard_Real         p1,
0191                                    const Standard_Real         p2);
0192 
0193   Standard_EXPORT void Init(const Handle(Geom_Curve)& C);
0194 
0195   Standard_EXPORT void Init(const Handle(Geom_Curve)& C,
0196                             const Standard_Real       p1,
0197                             const Standard_Real       p2);
0198 
0199   Standard_EXPORT void Init(const Handle(Geom_Curve)& C, const gp_Pnt& P1, const gp_Pnt& P2);
0200 
0201   Standard_EXPORT void Init(const Handle(Geom_Curve)& C,
0202                             const TopoDS_Vertex&      V1,
0203                             const TopoDS_Vertex&      V2);
0204 
0205   Standard_EXPORT void Init(const Handle(Geom_Curve)& C,
0206                             const gp_Pnt&             P1,
0207                             const gp_Pnt&             P2,
0208                             const Standard_Real       p1,
0209                             const Standard_Real       p2);
0210 
0211   Standard_EXPORT void Init(const Handle(Geom_Curve)& C,
0212                             const TopoDS_Vertex&      V1,
0213                             const TopoDS_Vertex&      V2,
0214                             const Standard_Real       p1,
0215                             const Standard_Real       p2);
0216 
0217   Standard_EXPORT void Init(const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S);
0218 
0219   Standard_EXPORT void Init(const Handle(Geom2d_Curve)& C,
0220                             const Handle(Geom_Surface)& S,
0221                             const Standard_Real         p1,
0222                             const Standard_Real         p2);
0223 
0224   Standard_EXPORT void Init(const Handle(Geom2d_Curve)& C,
0225                             const Handle(Geom_Surface)& S,
0226                             const gp_Pnt&               P1,
0227                             const gp_Pnt&               P2);
0228 
0229   Standard_EXPORT void Init(const Handle(Geom2d_Curve)& C,
0230                             const Handle(Geom_Surface)& S,
0231                             const TopoDS_Vertex&        V1,
0232                             const TopoDS_Vertex&        V2);
0233 
0234   Standard_EXPORT void Init(const Handle(Geom2d_Curve)& C,
0235                             const Handle(Geom_Surface)& S,
0236                             const gp_Pnt&               P1,
0237                             const gp_Pnt&               P2,
0238                             const Standard_Real         p1,
0239                             const Standard_Real         p2);
0240 
0241   Standard_EXPORT void Init(const Handle(Geom2d_Curve)& C,
0242                             const Handle(Geom_Surface)& S,
0243                             const TopoDS_Vertex&        V1,
0244                             const TopoDS_Vertex&        V2,
0245                             const Standard_Real         p1,
0246                             const Standard_Real         p2);
0247 
0248   //! Returns the error description when NotDone.
0249   Standard_EXPORT BRepLib_EdgeError Error() const;
0250 
0251   Standard_EXPORT const TopoDS_Edge& Edge();
0252   Standard_EXPORT                    operator TopoDS_Edge();
0253 
0254   //! Returns the first vertex of the edge. May be Null.
0255   Standard_EXPORT const TopoDS_Vertex& Vertex1() const;
0256 
0257   //! Returns the second vertex of the edge. May be Null.
0258   Standard_EXPORT const TopoDS_Vertex& Vertex2() const;
0259 
0260 protected:
0261 private:
0262   BRepLib_EdgeError myError;
0263   TopoDS_Vertex     myVertex1;
0264   TopoDS_Vertex     myVertex2;
0265 };
0266 
0267 #endif // _BRepLib_MakeEdge_HeaderFile