1 // Created on: 1998-06-09
2 // Created by: data exchange team
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _ShapeBuild_Edge_HeaderFile
18 #define _ShapeBuild_Edge_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Real.hxx>
25 #include <Standard_Boolean.hxx>
30 class TopLoc_Location;
36 //! This class provides low-level operators for building an edge
37 //! 3d curve, copying edge with replaced vertices etc.
45 //! Copy edge and replace one or both its vertices to a given
46 //! one(s). Vertex V1 replaces FORWARD vertex, and V2 - REVERSED,
47 //! as they are found by TopoDS_Iterator.
48 //! If V1 or V2 is NULL, the original vertex is taken
49 Standard_EXPORT TopoDS_Edge CopyReplaceVertices (const TopoDS_Edge& edge, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2) const;
51 //! Copies ranges for curve3d and all common pcurves from
52 //! edge <fromedge> into edge <toedge>.
53 Standard_EXPORT void CopyRanges (const TopoDS_Edge& toedge, const TopoDS_Edge& fromedge, const Standard_Real alpha = 0, const Standard_Real beta = 1) const;
55 //! Sets range on 3d curve only.
56 Standard_EXPORT void SetRange3d (const TopoDS_Edge& edge, const Standard_Real first, const Standard_Real last) const;
58 //! Makes a copy of pcurves from edge <fromedge> into edge
59 //! <toedge>. Pcurves which are already present in <toedge>,
60 //! are replaced by copies, other are copied. Ranges are also
62 Standard_EXPORT void CopyPCurves (const TopoDS_Edge& toedge, const TopoDS_Edge& fromedge) const;
64 //! Make a copy of <edge> by call to CopyReplaceVertices()
65 //! (i.e. construct new TEdge with the same pcurves and vertices).
66 //! If <sharepcurves> is False, pcurves are also replaced by
67 //! their copies with help of method CopyPCurves
68 Standard_EXPORT TopoDS_Edge Copy (const TopoDS_Edge& edge, const Standard_Boolean sharepcurves = Standard_True) const;
70 //! Removes the PCurve(s) which could be recorded in an Edge for
72 Standard_EXPORT void RemovePCurve (const TopoDS_Edge& edge, const TopoDS_Face& face) const;
74 //! Removes the PCurve(s) which could be recorded in an Edge for
76 Standard_EXPORT void RemovePCurve (const TopoDS_Edge& edge, const Handle(Geom_Surface)& surf) const;
78 //! Removes the PCurve(s) which could be recorded in an Edge for
79 //! the given Surface, with given Location
80 Standard_EXPORT void RemovePCurve (const TopoDS_Edge& edge, const Handle(Geom_Surface)& surf, const TopLoc_Location& loc) const;
82 //! Replace the PCurve in an Edge for the given Face
83 //! In case if edge is seam, i.e. has 2 pcurves on that face,
84 //! only pcurve corresponding to the orientation of the edge is
86 Standard_EXPORT void ReplacePCurve (const TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const TopoDS_Face& face) const;
88 //! Reassign edge pcurve lying on face <old> to another face <sub>.
89 //! If edge has two pcurves on <old> face, only one of them will be
90 //! reassigned, and other will left alone. Similarly, if edge already
91 //! had a pcurve on face <sub>, it will have two pcurves on it.
92 //! Returns True if succeeded, False if no pcurve lying on <old> found.
93 Standard_EXPORT Standard_Boolean ReassignPCurve (const TopoDS_Edge& edge, const TopoDS_Face& old, const TopoDS_Face& sub) const;
95 //! Transforms the PCurve with given matrix and affinity U factor.
96 Standard_EXPORT Handle(Geom2d_Curve) TransformPCurve (const Handle(Geom2d_Curve)& pcurve, const gp_Trsf2d& trans, const Standard_Real uFact, Standard_Real& aFirst, Standard_Real& aLast) const;
98 //! Removes the Curve3D recorded in an Edge
99 Standard_EXPORT void RemoveCurve3d (const TopoDS_Edge& edge) const;
101 //! Calls BRepTools::BuildCurve3D
102 Standard_EXPORT Standard_Boolean BuildCurve3d (const TopoDS_Edge& edge) const;
104 //! Makes edge with curve and location
105 Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom_Curve)& curve, const TopLoc_Location& L) const;
107 //! Makes edge with curve, location and range [p1, p2]
108 Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom_Curve)& curve, const TopLoc_Location& L, const Standard_Real p1, const Standard_Real p2) const;
110 //! Makes edge with pcurve and face
111 Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const TopoDS_Face& face) const;
113 //! Makes edge with pcurve, face and range [p1, p2]
114 Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const TopoDS_Face& face, const Standard_Real p1, const Standard_Real p2) const;
116 //! Makes edge with pcurve, surface and location
117 Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const Handle(Geom_Surface)& S, const TopLoc_Location& L) const;
119 //! Makes edge with pcurve, surface, location and range [p1, p2]
120 Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const Handle(Geom_Surface)& S, const TopLoc_Location& L, const Standard_Real p1, const Standard_Real p2) const;
145 #endif // _ShapeBuild_Edge_HeaderFile