0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / ShapeBuild / ShapeBuild_Edge.hxx
CommitLineData
42cf5bc1 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
5//
6// This file is part of Open CASCADE Technology software library.
7//
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _ShapeBuild_Edge_HeaderFile
18#define _ShapeBuild_Edge_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <Standard_Real.hxx>
25#include <Standard_Boolean.hxx>
26class TopoDS_Edge;
27class TopoDS_Vertex;
28class TopoDS_Face;
29class Geom_Surface;
30class TopLoc_Location;
31class Geom2d_Curve;
32class gp_Trsf2d;
33class Geom_Curve;
34
35
36//! This class provides low-level operators for building an edge
37//! 3d curve, copying edge with replaced vertices etc.
38class ShapeBuild_Edge
39{
40public:
41
42 DEFINE_STANDARD_ALLOC
43
44
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;
50
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;
54
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;
57
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
61 //! copied.
62 Standard_EXPORT void CopyPCurves (const TopoDS_Edge& toedge, const TopoDS_Edge& fromedge) const;
63
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;
69
70 //! Removes the PCurve(s) which could be recorded in an Edge for
71 //! the given Face
72 Standard_EXPORT void RemovePCurve (const TopoDS_Edge& edge, const TopoDS_Face& face) const;
73
74 //! Removes the PCurve(s) which could be recorded in an Edge for
75 //! the given Surface
76 Standard_EXPORT void RemovePCurve (const TopoDS_Edge& edge, const Handle(Geom_Surface)& surf) const;
77
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;
81
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
85 //! replaced
86 Standard_EXPORT void ReplacePCurve (const TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const TopoDS_Face& face) const;
87
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;
94
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;
97
98 //! Removes the Curve3D recorded in an Edge
99 Standard_EXPORT void RemoveCurve3d (const TopoDS_Edge& edge) const;
100
101 //! Calls BRepTools::BuildCurve3D
102 Standard_EXPORT Standard_Boolean BuildCurve3d (const TopoDS_Edge& edge) const;
103
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;
106
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;
109
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;
112
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;
115
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;
118
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;
121
122
123
124
125protected:
126
127
128
129
130
131private:
132
133
134
135
136
137};
138
139
140
141
142
143
144
145#endif // _ShapeBuild_Edge_HeaderFile