Integration of OCCT 6.5.0 from SVN
[occt.git] / src / BRepCheck / BRepCheck.cxx
CommitLineData
7fd59977 1// File: BRepCheck.cxx
2// Created: Fri Dec 8 15:03:28 1995
3// Author: Jacques GOUSSARD
4// <jag@bravox>
5
6
7#include <BRepCheck.ixx>
8
9#include <BRepCheck_ListIteratorOfListOfStatus.hxx>
10#include <BRepCheck_Wire.hxx>
11
12#include <BRep_Tool.hxx>
13
14#include <TopoDS_Iterator.hxx>
15#include <TopoDS.hxx>
16
17
18//=======================================================================
19//function : Add
20//purpose :
21//=======================================================================
22
23void BRepCheck::Add(BRepCheck_ListOfStatus& lst, const BRepCheck_Status stat)
24{
25 BRepCheck_ListIteratorOfListOfStatus it(lst);
26 while (it.More()) {
27 if (it.Value() == BRepCheck_NoError && stat != BRepCheck_NoError) {
28 lst.Remove(it);
29 }
30 else {
31 if (it.Value() == stat) {
32 return;
33 }
34 it.Next();
35 }
36 }
37 lst.Append(stat);
38}
39
40
41
42//=======================================================================
43//function : SelfIntersection
44//purpose :
45//=======================================================================
46
47Standard_Boolean BRepCheck::SelfIntersection(const TopoDS_Wire& W,
48 const TopoDS_Face& myFace,
49 TopoDS_Edge& RetE1,
50 TopoDS_Edge& RetE2)
51{
52
53 Handle(BRepCheck_Wire) chkw = new BRepCheck_Wire(W);
54 BRepCheck_Status stat = chkw->SelfIntersect(myFace,RetE1,RetE2);
55 return (stat == BRepCheck_SelfIntersectingWire);
56}
57
58
59//=======================================================================
60//function : Print
61//purpose :
62//=======================================================================
63
64void BRepCheck::Print(const BRepCheck_Status stat,
65 Standard_OStream& OS)
66{
67
68 switch (stat) {
69 case BRepCheck_NoError:
70 OS << "BRepCheck_NoError\n";
71 break;
72 case BRepCheck_InvalidPointOnCurve:
73 OS << "BRepCheck_InvalidPointOnCurve\n";
74 break;
75 case BRepCheck_InvalidPointOnCurveOnSurface:
76 OS << "BRepCheck_InvalidPointOnCurveOnSurface\n";
77 break;
78 case BRepCheck_InvalidPointOnSurface:
79 OS << "BRepCheck_InvalidPointOnSurface\n";
80 break;
81 case BRepCheck_No3DCurve:
82 OS << "BRepCheck_No3DCurve\n";
83 break;
84 case BRepCheck_Multiple3DCurve:
85 OS << "BRepCheck_Multiple3DCurve\n";
86 break;
87 case BRepCheck_Invalid3DCurve:
88 OS << "BRepCheck_Invalid3DCurve\n";
89 break;
90 case BRepCheck_NoCurveOnSurface:
91 OS << "BRepCheck_NoCurveOnSurface\n";
92 break;
93 case BRepCheck_InvalidCurveOnSurface:
94 OS << "BRepCheck_InvalidCurveOnSurface\n";
95 break;
96 case BRepCheck_InvalidCurveOnClosedSurface:
97 OS << "BRepCheck_InvalidCurveOnClosedSurface\n";
98 break;
99 case BRepCheck_InvalidSameRangeFlag:
100 OS << "BRepCheck_InvalidSameRangeFlag\n";
101 break;
102 case BRepCheck_InvalidSameParameterFlag:
103 OS << "BRepCheck_InvalidSameParameterFlag\n";
104 break;
105 case BRepCheck_InvalidDegeneratedFlag:
106 OS << "BRepCheck_InvalidDegeneratedFlag\n";
107 break;
108 case BRepCheck_FreeEdge:
109 OS << "BRepCheck_FreeEdge\n";
110 break;
111 case BRepCheck_InvalidMultiConnexity:
112 OS << "BRepCheck_InvalidMultiConnexity\n";
113 break;
114 case BRepCheck_InvalidRange:
115 OS << "BRepCheck_InvalidRange\n";
116 break;
117 case BRepCheck_EmptyWire:
118 OS << "BRepCheck_EmptyWire\n";
119 break;
120 case BRepCheck_RedundantEdge:
121 OS << "BRepCheck_RedundantEdge\n";
122 break;
123 case BRepCheck_SelfIntersectingWire:
124 OS << "BRepCheck_SelfIntersectingWire\n";
125 break;
126 case BRepCheck_NoSurface:
127 OS << "BRepCheck_NoSurface\n";
128 break;
129 case BRepCheck_InvalidWire:
130 OS << "BRepCheck_InvalidWire\n";
131 break;
132 case BRepCheck_RedundantWire:
133 OS << "BRepCheck_RedundantWire\n";
134 break;
135 case BRepCheck_IntersectingWires:
136 OS << "BRepCheck_IntersectingWires\n";
137 break;
138 case BRepCheck_InvalidImbricationOfWires:
139 OS << "BRepCheck_InvalidImbricationOfWires\n";
140 break;
141 case BRepCheck_EmptyShell:
142 OS << "BRepCheck_EmptyShell\n";
143 break;
144 case BRepCheck_RedundantFace:
145 OS << "BRepCheck_RedundantFace\n";
146 break;
147 case BRepCheck_UnorientableShape:
148 OS << "BRepCheck_UnorientableShape\n";
149 break;
150 case BRepCheck_NotClosed:
151 OS << "BRepCheck_NotClosed\n";
152 break;
153 case BRepCheck_NotConnected:
154 OS << "BRepCheck_NotConnected\n";
155 break;
156 case BRepCheck_SubshapeNotInShape:
157 OS << "BRepCheck_SubshapeNotInShape\n";
158 break;
159 case BRepCheck_BadOrientation:
160 OS << "BRepCheck_BadOrientation\n";
161 break;
162 case BRepCheck_BadOrientationOfSubshape:
163 OS << "BRepCheck_BadOrientationOfSubshape\n";
164 break;
165 case BRepCheck_CheckFail:
166 OS << "BRepCheck_CheckFail\n";
167 break;
168#ifndef DEB
169 default:
170 break;
171#endif
172 }
173}
174
175