1 // Created on: 1992-11-19
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1992-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 
18 #include <BRepClass_Edge.hxx>
19 #include <NCollection_IndexedDataMap.hxx>
20 #include <Precision.hxx>
21 #include <TopoDS.hxx>
22 #include <TopoDS_Vertex.hxx>
23 #include <TopExp.hxx>
24 
25 //=======================================================================
26 //function : BRepClass_Edge
27 //purpose  :
28 //=======================================================================
BRepClass_Edge()29 BRepClass_Edge::BRepClass_Edge() : myMaxTolerance(Precision::Infinite()), myUseBndBox(Standard_False)
30 {
31 }
32 
33 //=======================================================================
34 //function : SetNextEdge
35 //purpose  :
36 //=======================================================================
SetNextEdge(const TopTools_IndexedDataMapOfShapeListOfShape & theMapVE)37 void BRepClass_Edge::SetNextEdge(const TopTools_IndexedDataMapOfShapeListOfShape& theMapVE)
38 {
39   if (theMapVE.IsEmpty() || myEdge.IsNull())
40   {
41     return;
42   }
43   TopoDS_Vertex aVF, aVL;
44   TopExp::Vertices(myEdge, aVF, aVL, Standard_True);
45 
46   if (aVL.IsNull() || aVL.IsSame(aVF))
47   {
48     return;
49   }
50   const TopTools_ListOfShape* aListE = theMapVE.Seek(aVL);
51   if (aListE->Extent() == 2)
52   {
53     for (TopTools_ListIteratorOfListOfShape anIt(*aListE); anIt.More(); anIt.Next())
54     {
55       if ((!anIt.Value().IsNull()) && (!anIt.Value().IsSame(myEdge)))
56       {
57         myNextEdge = TopoDS::Edge(anIt.Value());
58       }
59     }
60   }
61 }
62 
63 
64 //=======================================================================
65 //function : BRepClass_Edge
66 //purpose  :
67 //=======================================================================
68 
BRepClass_Edge(const TopoDS_Edge & E,const TopoDS_Face & F)69 BRepClass_Edge::BRepClass_Edge(const TopoDS_Edge& E,
70 			       const TopoDS_Face& F) :
71        myEdge(E),
72        myFace(F),
73        myMaxTolerance(Precision::Infinite()),
74        myUseBndBox(Standard_False)
75 {
76 }
77 
78