1 // Created on: 1995-05-05
2 // Created by: Jing Cheng MEI
3 // Copyright (c) 1995-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 <BRepBuilderAPI_Sewing.hxx>
19 #include <BRepOffsetAPI_FindContigousEdges.hxx>
20 #include <Standard_NoSuchObject.hxx>
21 #include <Standard_OutOfRange.hxx>
22 #include <TopoDS_Edge.hxx>
23 #include <TopoDS_Shape.hxx>
25 //=======================================================================
26 //function : Constructor
28 //=======================================================================
29 BRepOffsetAPI_FindContigousEdges::BRepOffsetAPI_FindContigousEdges(const Standard_Real tolerance,
30 const Standard_Boolean option)
32 mySewing = new BRepBuilderAPI_Sewing;
33 Init(tolerance, option);
36 //=======================================================================
39 //=======================================================================
41 void BRepOffsetAPI_FindContigousEdges::Init(const Standard_Real tolerance,
42 const Standard_Boolean option)
44 mySewing->Init(tolerance, option, Standard_False,Standard_True);
47 //=======================================================================
50 //=======================================================================
52 void BRepOffsetAPI_FindContigousEdges::Add(const TopoDS_Shape& aShape)
54 mySewing->Add(aShape);
57 //=======================================================================
60 //=======================================================================
62 void BRepOffsetAPI_FindContigousEdges::Perform()
68 //=======================================================================
69 //function : NbContigousEdges
71 //=======================================================================
73 Standard_Integer BRepOffsetAPI_FindContigousEdges::NbContigousEdges() const
75 return mySewing->NbContigousEdges();
78 //=======================================================================
79 //function : ContigousEdge
81 //=======================================================================
83 const TopoDS_Edge& BRepOffsetAPI_FindContigousEdges::ContigousEdge(const Standard_Integer index) const
85 Standard_OutOfRange_Raise_if(index < 0 || index > NbContigousEdges(), "BRepOffsetAPI_FindContigousEdges::ContigousEdge");
86 return mySewing->ContigousEdge(index);
88 //=======================================================================
89 //function : ContigousEdgeCouple
91 //=======================================================================
93 const TopTools_ListOfShape& BRepOffsetAPI_FindContigousEdges::ContigousEdgeCouple(const Standard_Integer index) const
95 Standard_OutOfRange_Raise_if(index < 0 || index > NbContigousEdges(), "BRepOffsetAPI_FindContigousEdges::ContigousEdgeCouple");
96 return mySewing->ContigousEdgeCouple(index);
99 //=======================================================================
100 //function : SectionToBoundary
102 //=======================================================================
104 const TopoDS_Edge& BRepOffsetAPI_FindContigousEdges::SectionToBoundary(const TopoDS_Edge& section) const
106 Standard_NoSuchObject_Raise_if(!mySewing->IsSectionBound(section), "BRepOffsetAPI_FindContigousEdges::SectionToBoundary");
107 return mySewing->SectionToBoundary(section);
110 //=======================================================================
111 //function : NbDegeneratedShapes
113 //=======================================================================
115 Standard_Integer BRepOffsetAPI_FindContigousEdges::NbDegeneratedShapes() const
117 return mySewing->NbDegeneratedShapes();
120 //=======================================================================
121 //function : DegeneratedShape
123 //=======================================================================
125 const TopoDS_Shape& BRepOffsetAPI_FindContigousEdges::DegeneratedShape(const Standard_Integer index) const
127 Standard_OutOfRange_Raise_if(index < 0 || index > NbDegeneratedShapes(), "BRepOffsetAPI_FindContigousEdges::DegereratedShape");
128 return mySewing->DegeneratedShape(index);
131 //=======================================================================
132 //function : IsDegenerated
134 //=======================================================================
136 Standard_Boolean BRepOffsetAPI_FindContigousEdges::IsDegenerated(const TopoDS_Shape& aShape) const
138 return mySewing->IsDegenerated(aShape);
141 //=======================================================================
142 //function : IsModified
144 //=======================================================================
146 Standard_Boolean BRepOffsetAPI_FindContigousEdges::IsModified(const TopoDS_Shape& aShape) const
148 return mySewing->IsModified(aShape);
151 //=======================================================================
152 //function : Modified
154 //=======================================================================
156 const TopoDS_Shape& BRepOffsetAPI_FindContigousEdges::Modified(const TopoDS_Shape& aShape) const
158 Standard_NoSuchObject_Raise_if(!IsModified(aShape),"BRepOffsetAPI_FindContigousEdges::Modified");
159 return mySewing->Modified(aShape);
164 //=======================================================================
167 //=======================================================================
169 void BRepOffsetAPI_FindContigousEdges::Dump() const