0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / BRepOffsetAPI / BRepOffsetAPI_FindContigousEdges.cxx
CommitLineData
b311480e 1// Created on: 1995-05-05
2// Created by: Jing Cheng MEI
3// Copyright (c) 1995-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
7fd59977 17
42cf5bc1 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>
7fd59977 24
25//=======================================================================
26//function : Constructor
27//purpose :
28//=======================================================================
7fd59977 29BRepOffsetAPI_FindContigousEdges::BRepOffsetAPI_FindContigousEdges(const Standard_Real tolerance,
30 const Standard_Boolean option)
31{
32 mySewing = new BRepBuilderAPI_Sewing;
33 Init(tolerance, option);
34}
35
36//=======================================================================
37//function : Init
38//purpose :
39//=======================================================================
40
41void BRepOffsetAPI_FindContigousEdges::Init(const Standard_Real tolerance,
42 const Standard_Boolean option)
43{
44 mySewing->Init(tolerance, option, Standard_False,Standard_True);
45}
46
47//=======================================================================
48//function : Add
49//purpose :
50//=======================================================================
51
52void BRepOffsetAPI_FindContigousEdges::Add(const TopoDS_Shape& aShape)
53{
54 mySewing->Add(aShape);
55}
56
57//=======================================================================
58//function : Perform
59//purpose :
60//=======================================================================
61
62void BRepOffsetAPI_FindContigousEdges::Perform()
63{
64 mySewing->Perform();
65}
66
67
68//=======================================================================
69//function : NbContigousEdges
70//purpose :
71//=======================================================================
72
73Standard_Integer BRepOffsetAPI_FindContigousEdges::NbContigousEdges() const
74{
75 return mySewing->NbContigousEdges();
76}
77
78//=======================================================================
79//function : ContigousEdge
80//purpose :
81//=======================================================================
82
83const TopoDS_Edge& BRepOffsetAPI_FindContigousEdges::ContigousEdge(const Standard_Integer index) const
84{
85 Standard_OutOfRange_Raise_if(index < 0 || index > NbContigousEdges(), "BRepOffsetAPI_FindContigousEdges::ContigousEdge");
86 return mySewing->ContigousEdge(index);
87}
88//=======================================================================
89//function : ContigousEdgeCouple
90//purpose :
91//=======================================================================
92
93const TopTools_ListOfShape& BRepOffsetAPI_FindContigousEdges::ContigousEdgeCouple(const Standard_Integer index) const
94{
95 Standard_OutOfRange_Raise_if(index < 0 || index > NbContigousEdges(), "BRepOffsetAPI_FindContigousEdges::ContigousEdgeCouple");
96 return mySewing->ContigousEdgeCouple(index);
97}
98
99//=======================================================================
100//function : SectionToBoundary
101//purpose :
102//=======================================================================
103
104const TopoDS_Edge& BRepOffsetAPI_FindContigousEdges::SectionToBoundary(const TopoDS_Edge& section) const
105{
106 Standard_NoSuchObject_Raise_if(!mySewing->IsSectionBound(section), "BRepOffsetAPI_FindContigousEdges::SectionToBoundary");
107 return mySewing->SectionToBoundary(section);
108}
109
110//=======================================================================
111//function : NbDegeneratedShapes
112//purpose :
113//=======================================================================
114
115Standard_Integer BRepOffsetAPI_FindContigousEdges::NbDegeneratedShapes() const
116{
117 return mySewing->NbDegeneratedShapes();
118}
119
120//=======================================================================
121//function : DegeneratedShape
122//purpose :
123//=======================================================================
124
125const TopoDS_Shape& BRepOffsetAPI_FindContigousEdges::DegeneratedShape(const Standard_Integer index) const
126{
127 Standard_OutOfRange_Raise_if(index < 0 || index > NbDegeneratedShapes(), "BRepOffsetAPI_FindContigousEdges::DegereratedShape");
128 return mySewing->DegeneratedShape(index);
129}
130
131//=======================================================================
132//function : IsDegenerated
133//purpose :
134//=======================================================================
135
136Standard_Boolean BRepOffsetAPI_FindContigousEdges::IsDegenerated(const TopoDS_Shape& aShape) const
137{
138 return mySewing->IsDegenerated(aShape);
139}
140
141//=======================================================================
142//function : IsModified
143//purpose :
144//=======================================================================
145
146Standard_Boolean BRepOffsetAPI_FindContigousEdges::IsModified(const TopoDS_Shape& aShape) const
147{
148 return mySewing->IsModified(aShape);
149}
150
151//=======================================================================
152//function : Modified
153//purpose :
154//=======================================================================
155
156const TopoDS_Shape& BRepOffsetAPI_FindContigousEdges::Modified(const TopoDS_Shape& aShape) const
157{
158 Standard_NoSuchObject_Raise_if(!IsModified(aShape),"BRepOffsetAPI_FindContigousEdges::Modified");
159 return mySewing->Modified(aShape);
160}
161
162
163
164//=======================================================================
165//function : Dump
166//purpose :
167//=======================================================================
168
169void BRepOffsetAPI_FindContigousEdges::Dump() const
170{
171 mySewing->Dump();
172}
173