0024428: Implementation of LGPL license
[occt.git] / src / BOPAlgo / BOPAlgo_WireSplitter.lxx
CommitLineData
4e57c75e 1// Created by: Peter KURNEV
973c2be1 2// Copyright (c) 1999-2014 OPEN CASCADE SAS
4e57c75e 3//
973c2be1 4// This file is part of Open CASCADE Technology software library.
4e57c75e 5//
973c2be1 6// This library is free software; you can redistribute it and / or modify it
7// under the terms of the GNU Lesser General Public version 2.1 as published
8// by the Free Software Foundation, with special exception defined in the file
9// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10// distribution for complete text of the license and disclaimer of any warranty.
4e57c75e 11//
973c2be1 12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
4e57c75e 14
15#include <BRep_Builder.hxx>
16
17#include <TopoDS_Edge.hxx>
18
19//=======================================================================
20//function : BOPAlgo_EdgeInfo
21//purpose :
22//=======================================================================
23class BOPAlgo_EdgeInfo {
24 public:
25 //
26 BOPAlgo_EdgeInfo() :
27 myPassed(Standard_False),
28 myInFlag(Standard_False),
29 myAngle (-1.) {
30 };
31 //
32 void SetEdge(const TopoDS_Edge& theE) {
33 myEdge=theE;
34 };
35 //
36 const TopoDS_Edge& Edge() const{
37 return myEdge;
38 };
39 //
40 void SetPassed(const Standard_Boolean theFlag) {
41 myPassed=theFlag;
42 };
43 //
44 Standard_Boolean Passed()const {
45 return myPassed;
46 };
47 //
48 void SetInFlag(const Standard_Boolean theFlag) {
49 myInFlag=theFlag;
50 };
51 //
52 Standard_Boolean IsIn()const {
53 return myInFlag;
54 };
55 //
56 void SetAngle(const Standard_Real theAngle) {
57 myAngle=theAngle;
58 };
59 //
60 Standard_Real Angle()const {
61 return myAngle;
62 };
63 //
64 protected:
65 TopoDS_Edge myEdge;
66 Standard_Boolean myPassed;
67 Standard_Boolean myInFlag;
68 Standard_Real myAngle;
69};
70
71
72#include <NCollection_List.hxx>
73typedef NCollection_List<BOPAlgo_EdgeInfo> BOPAlgo_ListOfEdgeInfo;
74typedef BOPAlgo_ListOfEdgeInfo::Iterator BOPAlgo_ListIteratorOfListOfEdgeInfo;
75
76#define _NCollection_MapHasher
77#include <NCollection_IndexedDataMap.hxx>
78#include <TopTools_ShapeMapHasher.hxx>
79
80typedef NCollection_IndexedDataMap<TopoDS_Shape, \
81 BOPAlgo_ListOfEdgeInfo, \
82 TopTools_ShapeMapHasher> BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo;
83#undef _NCollection_MapHasher
84
85
86//=======================================================================
87//function : MakeWire
88//purpose :
89//=======================================================================
90 inline void BOPAlgo_WireSplitter::MakeWire(BOPCol_ListOfShape& aLE,
91 TopoDS_Wire& aWire)
92{
93 BRep_Builder aBB;
94 aBB.MakeWire(aWire);
95 //
96 BOPCol_ListIteratorOfListOfShape aIt(aLE);
97 for (; aIt.More(); aIt.Next()){
98 aBB.Add(aWire, aIt.Value());
99 }
100}