1 // Created on: 1994-08-31
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1994-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.
18 #include <BRep_Tool.hxx>
19 #include <Draft_EdgeInfo.hxx>
20 #include <Geom2d_Curve.hxx>
21 #include <Geom_Curve.hxx>
23 #include <Standard_DomainError.hxx>
24 #include <TopoDS_Face.hxx>
26 //=======================================================================
27 //function : Draft_EdgeInfo
29 //=======================================================================
30 Draft_EdgeInfo::Draft_EdgeInfo():
31 myNewGeom(Standard_False),myTgt(Standard_False),myTol(0)
35 //=======================================================================
36 //function : Draft_EdgeInfo
38 //=======================================================================
40 Draft_EdgeInfo::Draft_EdgeInfo(const Standard_Boolean HasNewGeometry):
41 myNewGeom(HasNewGeometry),myTgt(Standard_False),myTol(0)
45 //=======================================================================
48 //=======================================================================
50 void Draft_EdgeInfo::Add(const TopoDS_Face& F)
52 if (myFirstF.IsNull()) {
55 else if (!myFirstF.IsSame(F) && mySeconF.IsNull()) {
58 myTol=Max(myTol, BRep_Tool::Tolerance(F));
61 //=======================================================================
64 //=======================================================================
66 void Draft_EdgeInfo::RootFace(const TopoDS_Face& F)
73 //=======================================================================
76 //=======================================================================
78 void Draft_EdgeInfo::Tangent(const gp_Pnt& P)
80 myTgt = Standard_True;
84 //=======================================================================
85 //function : IsTangent
87 //=======================================================================
89 Standard_Boolean Draft_EdgeInfo::IsTangent(gp_Pnt& P) const
95 //=======================================================================
96 //function : NewGeometry
98 //=======================================================================
100 Standard_Boolean Draft_EdgeInfo::NewGeometry() const
105 //=======================================================================
106 //function : SetNewGeometry
108 //=======================================================================
110 void Draft_EdgeInfo::SetNewGeometry( const Standard_Boolean NewGeom )
115 //=======================================================================
116 //function : Geometry
118 //=======================================================================
120 const Handle(Geom_Curve)& Draft_EdgeInfo::Geometry() const
126 //=======================================================================
127 //function : FirstFace
129 //=======================================================================
131 const TopoDS_Face& Draft_EdgeInfo::FirstFace () const
137 //=======================================================================
138 //function : SecondFace
140 //=======================================================================
142 const TopoDS_Face& Draft_EdgeInfo::SecondFace () const
148 //=======================================================================
149 //function : ChangeGeometry
151 //=======================================================================
153 Handle(Geom_Curve)& Draft_EdgeInfo::ChangeGeometry()
158 //=======================================================================
159 //function : Handle(Geom2d_Curve)&
161 //=======================================================================
163 const Handle(Geom2d_Curve)& Draft_EdgeInfo::FirstPC() const
169 //=======================================================================
170 //function : Handle(Geom2d_Curve)&
172 //=======================================================================
174 const Handle(Geom2d_Curve)& Draft_EdgeInfo::SecondPC() const
179 //=======================================================================
180 //function : ChangeFirstPC
182 //=======================================================================
184 Handle(Geom2d_Curve)& Draft_EdgeInfo::ChangeFirstPC()
190 //=======================================================================
191 //function : ChangeSecondPC
193 //=======================================================================
195 Handle(Geom2d_Curve)& Draft_EdgeInfo::ChangeSecondPC()
201 //=======================================================================
202 //function : RootFace
204 //=======================================================================
206 const TopoDS_Face & Draft_EdgeInfo::RootFace() const
211 //=======================================================================
212 //function : Tolerance
214 //=======================================================================
216 void Draft_EdgeInfo::Tolerance(const Standard_Real tol)
220 Standard_Real Draft_EdgeInfo::Tolerance() const