b311480e |
1 | // Created on: 1995-05-05 |
2 | // Created by: Jing Cheng MEI |
3 | // Copyright (c) 1995-1999 Matra Datavision |
4 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | // |
6 | // The content of this file is subject to the Open CASCADE Technology Public |
7 | // License Version 6.5 (the "License"). You may not use the content of this file |
8 | // except in compliance with the License. Please obtain a copy of the License |
9 | // at http://www.opencascade.org and read it completely before using this file. |
10 | // |
11 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | // |
14 | // The Original Code and all software distributed under the License is |
15 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | // Initial Developer hereby disclaims all such warranties, including without |
17 | // limitation, any warranties of merchantability, fitness for a particular |
18 | // purpose or non-infringement. Please see the License for the specific terms |
19 | // and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | #include <BRepOffsetAPI_FindContigousEdges.ixx> |
23 | |
24 | |
25 | //======================================================================= |
26 | //function : Constructor |
27 | //purpose : |
28 | //======================================================================= |
29 | |
30 | BRepOffsetAPI_FindContigousEdges::BRepOffsetAPI_FindContigousEdges(const Standard_Real tolerance, |
31 | const Standard_Boolean option) |
32 | { |
33 | mySewing = new BRepBuilderAPI_Sewing; |
34 | Init(tolerance, option); |
35 | } |
36 | |
37 | //======================================================================= |
38 | //function : Init |
39 | //purpose : |
40 | //======================================================================= |
41 | |
42 | void BRepOffsetAPI_FindContigousEdges::Init(const Standard_Real tolerance, |
43 | const Standard_Boolean option) |
44 | { |
45 | mySewing->Init(tolerance, option, Standard_False,Standard_True); |
46 | } |
47 | |
48 | //======================================================================= |
49 | //function : Add |
50 | //purpose : |
51 | //======================================================================= |
52 | |
53 | void BRepOffsetAPI_FindContigousEdges::Add(const TopoDS_Shape& aShape) |
54 | { |
55 | mySewing->Add(aShape); |
56 | } |
57 | |
58 | //======================================================================= |
59 | //function : Perform |
60 | //purpose : |
61 | //======================================================================= |
62 | |
63 | void BRepOffsetAPI_FindContigousEdges::Perform() |
64 | { |
65 | mySewing->Perform(); |
66 | } |
67 | |
68 | |
69 | //======================================================================= |
70 | //function : NbContigousEdges |
71 | //purpose : |
72 | //======================================================================= |
73 | |
74 | Standard_Integer BRepOffsetAPI_FindContigousEdges::NbContigousEdges() const |
75 | { |
76 | return mySewing->NbContigousEdges(); |
77 | } |
78 | |
79 | //======================================================================= |
80 | //function : ContigousEdge |
81 | //purpose : |
82 | //======================================================================= |
83 | |
84 | const TopoDS_Edge& BRepOffsetAPI_FindContigousEdges::ContigousEdge(const Standard_Integer index) const |
85 | { |
86 | Standard_OutOfRange_Raise_if(index < 0 || index > NbContigousEdges(), "BRepOffsetAPI_FindContigousEdges::ContigousEdge"); |
87 | return mySewing->ContigousEdge(index); |
88 | } |
89 | //======================================================================= |
90 | //function : ContigousEdgeCouple |
91 | //purpose : |
92 | //======================================================================= |
93 | |
94 | const TopTools_ListOfShape& BRepOffsetAPI_FindContigousEdges::ContigousEdgeCouple(const Standard_Integer index) const |
95 | { |
96 | Standard_OutOfRange_Raise_if(index < 0 || index > NbContigousEdges(), "BRepOffsetAPI_FindContigousEdges::ContigousEdgeCouple"); |
97 | return mySewing->ContigousEdgeCouple(index); |
98 | } |
99 | |
100 | //======================================================================= |
101 | //function : SectionToBoundary |
102 | //purpose : |
103 | //======================================================================= |
104 | |
105 | const TopoDS_Edge& BRepOffsetAPI_FindContigousEdges::SectionToBoundary(const TopoDS_Edge& section) const |
106 | { |
107 | Standard_NoSuchObject_Raise_if(!mySewing->IsSectionBound(section), "BRepOffsetAPI_FindContigousEdges::SectionToBoundary"); |
108 | return mySewing->SectionToBoundary(section); |
109 | } |
110 | |
111 | //======================================================================= |
112 | //function : NbDegeneratedShapes |
113 | //purpose : |
114 | //======================================================================= |
115 | |
116 | Standard_Integer BRepOffsetAPI_FindContigousEdges::NbDegeneratedShapes() const |
117 | { |
118 | return mySewing->NbDegeneratedShapes(); |
119 | } |
120 | |
121 | //======================================================================= |
122 | //function : DegeneratedShape |
123 | //purpose : |
124 | //======================================================================= |
125 | |
126 | const TopoDS_Shape& BRepOffsetAPI_FindContigousEdges::DegeneratedShape(const Standard_Integer index) const |
127 | { |
128 | Standard_OutOfRange_Raise_if(index < 0 || index > NbDegeneratedShapes(), "BRepOffsetAPI_FindContigousEdges::DegereratedShape"); |
129 | return mySewing->DegeneratedShape(index); |
130 | } |
131 | |
132 | //======================================================================= |
133 | //function : IsDegenerated |
134 | //purpose : |
135 | //======================================================================= |
136 | |
137 | Standard_Boolean BRepOffsetAPI_FindContigousEdges::IsDegenerated(const TopoDS_Shape& aShape) const |
138 | { |
139 | return mySewing->IsDegenerated(aShape); |
140 | } |
141 | |
142 | //======================================================================= |
143 | //function : IsModified |
144 | //purpose : |
145 | //======================================================================= |
146 | |
147 | Standard_Boolean BRepOffsetAPI_FindContigousEdges::IsModified(const TopoDS_Shape& aShape) const |
148 | { |
149 | return mySewing->IsModified(aShape); |
150 | } |
151 | |
152 | //======================================================================= |
153 | //function : Modified |
154 | //purpose : |
155 | //======================================================================= |
156 | |
157 | const TopoDS_Shape& BRepOffsetAPI_FindContigousEdges::Modified(const TopoDS_Shape& aShape) const |
158 | { |
159 | Standard_NoSuchObject_Raise_if(!IsModified(aShape),"BRepOffsetAPI_FindContigousEdges::Modified"); |
160 | return mySewing->Modified(aShape); |
161 | } |
162 | |
163 | |
164 | |
165 | //======================================================================= |
166 | //function : Dump |
167 | //purpose : |
168 | //======================================================================= |
169 | |
170 | void BRepOffsetAPI_FindContigousEdges::Dump() const |
171 | { |
172 | mySewing->Dump(); |
173 | } |
174 | |