Warning, /include/opencascade/BOPAlgo_WireSplitter.lxx is written in an unsupported language. File is not indexed.
0001 // Created by: Peter KURNEV
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014
0015 #include <BRep_Builder.hxx>
0016 #include <BRep_Tool.hxx>
0017
0018 #include <TopoDS_Edge.hxx>
0019
0020 //=======================================================================
0021 //function : BOPAlgo_EdgeInfo
0022 //purpose :
0023 //=======================================================================
0024 class BOPAlgo_EdgeInfo {
0025 public:
0026 //
0027 BOPAlgo_EdgeInfo() :
0028 myPassed(Standard_False),
0029 myInFlag(Standard_False),
0030 myIsInside (Standard_False),
0031 myAngle (-1.)
0032 {
0033 };
0034 //
0035 void SetEdge(const TopoDS_Edge& theE) {
0036 myEdge=theE;
0037 };
0038 //
0039 const TopoDS_Edge& Edge() const{
0040 return myEdge;
0041 };
0042 //
0043 void SetPassed(const Standard_Boolean theFlag) {
0044 myPassed=theFlag;
0045 };
0046 //
0047 Standard_Boolean Passed()const {
0048 return myPassed;
0049 };
0050 //
0051 void SetInFlag(const Standard_Boolean theFlag) {
0052 myInFlag=theFlag;
0053 };
0054 //
0055 Standard_Boolean IsIn()const {
0056 return myInFlag;
0057 };
0058 //
0059 void SetAngle(const Standard_Real theAngle) {
0060 myAngle=theAngle;
0061 };
0062 //
0063 Standard_Real Angle()const {
0064 return myAngle;
0065 };
0066 //
0067 Standard_Boolean IsInside() const {
0068 return myIsInside;
0069 };
0070 //
0071 void SetIsInside (const Standard_Boolean theIsInside) {
0072 myIsInside = theIsInside;
0073 };
0074 //
0075 protected:
0076 TopoDS_Edge myEdge;
0077 Standard_Boolean myPassed;
0078 Standard_Boolean myInFlag;
0079 Standard_Boolean myIsInside;
0080 Standard_Real myAngle;
0081 };
0082
0083
0084 #include <NCollection_List.hxx>
0085 typedef NCollection_List<BOPAlgo_EdgeInfo> BOPAlgo_ListOfEdgeInfo;
0086 typedef BOPAlgo_ListOfEdgeInfo::Iterator BOPAlgo_ListIteratorOfListOfEdgeInfo;
0087
0088 #include <NCollection_IndexedDataMap.hxx>
0089 #include <TopTools_ShapeMapHasher.hxx>
0090
0091 typedef NCollection_IndexedDataMap<TopoDS_Shape, \
0092 BOPAlgo_ListOfEdgeInfo, \
0093 TopTools_ShapeMapHasher> BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo;
0094
0095 //=======================================================================
0096 //function : MakeWire
0097 //purpose :
0098 //=======================================================================
0099 inline void BOPAlgo_WireSplitter::MakeWire(TopTools_ListOfShape& aLE,
0100 TopoDS_Wire& aWire)
0101 {
0102 BRep_Builder aBB;
0103 aBB.MakeWire(aWire);
0104 //
0105 TopTools_ListIteratorOfListOfShape aIt(aLE);
0106 for (; aIt.More(); aIt.Next()){
0107 aBB.Add(aWire, aIt.Value());
0108 }
0109 aWire.Closed(BRep_Tool::IsClosed(aWire));
0110 }