0020716: Eliminate usage of "config.h" header file
[occt.git] / src / BRepTest / BRepTest_CheckCommands.cxx
... / ...
CommitLineData
1// Created on: 1996-02-23
2// Created by: Jacques GOUSSARD
3// Copyright (c) 1996-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#include <BRepTest.hxx>
18#include <BRepAlgo.hxx>
19#include <BRepCheck_Analyzer.hxx>
20#include <BRepCheck_Result.hxx>
21#include <BRepCheck_ListIteratorOfListOfStatus.hxx>
22#include <TopoDS_Iterator.hxx>
23#include <TopExp_Explorer.hxx>
24#include <TopTools_DataMapOfShapeListOfShape.hxx>
25#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
26#include <TopTools_DataMapIteratorOfDataMapOfIntegerListOfShape.hxx>
27#include <TopTools_ListOfShape.hxx>
28#include <TopTools_ListIteratorOfListOfShape.hxx>
29#include <DBRep_DrawableShape.hxx>
30#include <Draw_SequenceOfDrawable3D.hxx>
31#include <BRepCheck.hxx>
32#include <BRepCheck_Edge.hxx>
33#include <Draw_Interpretor.hxx>
34#include <Draw_Appli.hxx>
35#include <Draw.hxx>
36#include <DBRep.hxx>
37#include <BRepTest.hxx>
38#include <GeometryTest.hxx>
39#include <Precision.hxx>
40#include <LocalAnalysis.hxx>
41#include <LocalAnalysis_SurfaceContinuity.hxx>
42#include <Geom_Surface.hxx>
43#include <Geom_Curve.hxx>
44#include <Geom2d_TrimmedCurve.hxx>
45#include <Geom2d_Curve.hxx>
46#include <DrawTrSurf.hxx>
47#include <GeomAbs_Shape.hxx>
48#include <TopoDS.hxx>
49#include <TopExp.hxx>
50#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
51#include <TopTools_MapOfShape.hxx>
52#include <TopTools_MapIteratorOfMapOfShape.hxx>
53#include <TopoDS_Shape.hxx>
54#include <TopoDS_Edge.hxx>
55#include <TopoDS_Face.hxx>
56#include <BRep_Tool.hxx>
57
58#include <TopOpeBRepTool_PurgeInternalEdges.hxx>
59//#include <TopOpeBRepTool_FuseEdges.hxx>
60#include <BRepLib_FuseEdges.hxx>
61
62#include <TopTools_HSequenceOfShape.hxx>
63#include <BRep_Builder.hxx>
64#include <TopoDS_Compound.hxx>
65#include <TColStd_HArray1OfInteger.hxx>
66
67#include <Standard_ErrorHandler.hxx>
68#include <Standard_Failure.hxx>
69
70#include <stdio.h>
71
72static char* checkfaultyname = NULL;
73Standard_EXPORT void BRepTest_CheckCommands_SetFaultyName(const char* name)
74{
75 if (checkfaultyname != NULL) {
76 free(checkfaultyname);
77 checkfaultyname = NULL;
78 }
79 if (name == NULL) {
80 checkfaultyname = (char*)malloc(strlen("faulty_")+1);
81 strcpy(checkfaultyname,"faulty_");
82 }
83 else {
84 checkfaultyname = (char*)malloc(strlen(name)+1);
85 strcpy(checkfaultyname,name);
86 }
87}
88
89
90static TopTools_DataMapOfShapeListOfShape theMap;
91static Standard_Integer nbfaulty = 0;
92static Draw_SequenceOfDrawable3D lfaulty;
93
94Standard_IMPORT Standard_Integer BRepCheck_Trace(const Standard_Integer phase);
95
96//=======================================================================
97//function : FindNamed
98//=======================================================================
99static Standard_Boolean FindNamed(const TopoDS_Shape& S,
100 char*& Name)
101{
102 for (Standard_Integer i = 1 ;i <= lfaulty.Length(); i++) {
103 Handle(DBRep_DrawableShape) DS =
104 Handle(DBRep_DrawableShape)::DownCast(lfaulty(i));
105 if (DS->Shape().IsSame(S)) {
106 Name = (char*)DS->Name();
107 return Standard_True;
108 }
109 }
110 return Standard_False;
111}
112
113
114//=======================================================================
115//function : Contains
116//=======================================================================
117static Standard_Boolean Contains(const TopTools_ListOfShape& L,
118 const TopoDS_Shape& S)
119{
120 TopTools_ListIteratorOfListOfShape it;
121 for (it.Initialize(L); it.More(); it.Next()) {
122 if (it.Value().IsSame(S)) {
123 return Standard_True;
124 }
125 }
126 return Standard_False;
127}
128
129
130
131//=======================================================================
132//function : PrintSub
133//=======================================================================
134static void PrintSub(Standard_OStream& OS,
135 const BRepCheck_Analyzer& Ana,
136 const TopoDS_Shape& S,
137 const TopAbs_ShapeEnum Subtype)
138
139{
140 char* Name;
141 BRepCheck_ListIteratorOfListOfStatus itl;
142 TopExp_Explorer exp;
143 for (exp.Init(S,Subtype); exp.More(); exp.Next()) {
144 const Handle(BRepCheck_Result)& res = Ana.Result(exp.Current());
145 const TopoDS_Shape& sub = exp.Current();
146 for (res->InitContextIterator();
147 res->MoreShapeInContext();
148 res->NextShapeInContext()) {
149 if (res->ContextualShape().IsSame(S) &&
150 !Contains(theMap(sub),S)) {
151 theMap(sub).Append(S);
152 itl.Initialize(res->StatusOnShape());
153 if (itl.Value() != BRepCheck_NoError) {
154 if (!FindNamed(sub,Name)) {
155 nbfaulty++;
156 Name = (char*)malloc(18*sizeof(char));
157 Sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
158 DBRep::Set(Name,sub);
159 lfaulty.Append(Draw::Get((Standard_CString&)Name));
160 }
161 OS << "Shape " << Name << " ";
162 if (!FindNamed(S,Name)) {
163 nbfaulty++;
164 Name = (char*)malloc(18*sizeof(char));
165 Sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
166 DBRep::Set(Name,S);
167 lfaulty.Append(Draw::Get((Standard_CString&)Name));
168 }
169 OS << " on shape " << Name << " :\n";
170 for (;itl.More(); itl.Next()) {
171 BRepCheck::Print(itl.Value(),OS);
172 }
173 }
174 break;
175 }
176 }
177 }
178}
179
180
181//=======================================================================
182//function : Print
183//=======================================================================
184static void Print(Standard_OStream& OS,
185 const BRepCheck_Analyzer& Ana,
186 const TopoDS_Shape& S)
187{
188 for (TopoDS_Iterator iter(S); iter.More(); iter.Next()) {
189 Print(OS,Ana,iter.Value());
190 }
191
192 char* Name;
193 TopAbs_ShapeEnum styp = S.ShapeType();
194 BRepCheck_ListIteratorOfListOfStatus itl;
195 if (!Ana.Result(S).IsNull() && !theMap.IsBound(S)) {
196 itl.Initialize(Ana.Result(S)->Status());
197 if (itl.Value() != BRepCheck_NoError) {
198 if (!FindNamed(S,Name)) {
199 nbfaulty++;
200 Name = (char*)malloc(18*sizeof(char));
201 Sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
202 DBRep::Set(Name,S);
203 lfaulty.Append(Draw::Get((Standard_CString&)Name));
204 }
205 OS << "On Shape " << Name << " :\n";
206
207 for (;itl.More(); itl.Next()) {
208 BRepCheck::Print(itl.Value(),OS);
209 }
210 }
211 }
212 if (!theMap.IsBound(S)) {
213 TopTools_ListOfShape thelist;
214 theMap.Bind(S, thelist);
215 }
216
217 switch (styp) {
218 case TopAbs_EDGE:
219 PrintSub(OS,Ana,S,TopAbs_VERTEX);
220 break;
221 case TopAbs_FACE:
222 PrintSub(OS,Ana,S,TopAbs_WIRE);
223 PrintSub(OS,Ana,S,TopAbs_EDGE);
224 PrintSub(OS,Ana,S,TopAbs_VERTEX);
225 break;
226 case TopAbs_SHELL:
227// PrintSub(OS,Ana,S,TopAbs_FACE);
228 break;
229 case TopAbs_SOLID:
230// PrintSub(OS,Ana,S,TopAbs_EDGE);
231 PrintSub(OS,Ana,S,TopAbs_SHELL);
232 break;
233 default:
234 break;
235 }
236
237}
238
239//=======================================================================
240//function : computetolerance
241//purpose :
242//=======================================================================
243static Standard_Integer computetolerance(Draw_Interpretor& di,
244 Standard_Integer narg, const char** a)
245{
246 if (narg < 2) {
247 //cout << "Usage: computetolerance shape" << endl;
248 di << "Usage: computetolerance shape" << "\n";
249 return 1;
250 }
251 TopoDS_Shape S = DBRep::Get(a[1]);
252 Standard_Real tol;
253 if (S.ShapeType() == TopAbs_EDGE) {
254 BRepCheck_Edge bce(TopoDS::Edge(S));
255 tol=bce.Tolerance();
256 //cout<< "Tolerance de " << (void*) &(*S.TShape()) << " : " << tol << endl;
257 Standard_SStream aSStream1;
258 aSStream1<< "Tolerance de " << (void*) &(*S.TShape()) << " : " << tol << "\n";
259 di << aSStream1;
260 }
261 else {
262 TopTools_MapOfShape theEdges;
263 TopExp_Explorer exp;
264 for (exp.Init(S, TopAbs_EDGE); exp.More(); exp.Next()) {
265 if (theEdges.Add(exp.Current())) {
266 BRepCheck_Edge bce(TopoDS::Edge(exp.Current()));
267 tol=bce.Tolerance();
268 //cout<< "Tolerance de " << (void*) &(*exp.Current().TShape()) << " : " << tol << "\n";
269 Standard_SStream aSStream2;
270 aSStream2<< "Tolerance de " << (void*) &(*exp.Current().TShape()) << " : " << tol << "\n";
271 di << aSStream2;
272 }
273 }
274 //cout << endl;
275 di << "\n";
276 }
277 return 0;
278}
279
280//=======================================================================
281//function : checksection
282//purpose : Checks the closure of a section line
283//=======================================================================
284static Standard_Integer checksection(Draw_Interpretor& di,
285 Standard_Integer narg, const char** a)
286{
287 if (narg < 2) {
288 return 1;
289 }
290 TopoDS_Shape S = DBRep::Get(a[1]);
291 TopTools_MapOfShape theVertices;
292 TopExp_Explorer exp;
293 for (exp.Init(S, TopAbs_VERTEX); exp.More(); exp.Next()) {
294 if (!theVertices.Add(exp.Current()))
295 theVertices.Remove(exp.Current());
296 }
297 //cout << " nb alone Vertices : " << theVertices.Extent() << endl;
298 di << " nb alone Vertices : " << theVertices.Extent() << "\n";
299 char Name[32];
300 Standard_Integer ipp=0;
301 TopTools_MapIteratorOfMapOfShape itvx;
302 for (itvx.Initialize(theVertices); itvx.More(); itvx.Next()) {
303 ipp++;
304 Sprintf(Name,"alone_%d",ipp);
305 DBRep::Set(Name, itvx.Key());
306 //cout << Name << " " ;
307 di << Name << " " ;
308 }
309 //cout << endl;
310 di << "\n";
311 return 0;
312}
313//=======================================================================
314
315//=======================================================================
316//function : checkdiff
317//purpose : Checks the differences beetween a result and his arguments
318//=======================================================================
319static Standard_Integer checkdiff(Draw_Interpretor& di,
320 Standard_Integer narg, const char** a)
321{
322 const char* syntaxe = "checkdiff arg1 [arg2..argn] result [closedSolid (0/1)] [geomCtrl (1/0)]";
323 if (narg < 3) {
324 if (narg==2) {
325 Standard_Integer bcrtrace=Draw::Atoi(a[narg-1]);
326 bcrtrace=BRepCheck_Trace(bcrtrace);
327 //cout << "BRepCheck_Trace : " << bcrtrace << endl;
328 di << "BRepCheck_Trace : " << bcrtrace << "\n";
329 //cout << syntaxe << endl;
330 di << syntaxe << "\n";
331 return 0;
332 }
333 //cout << syntaxe << endl;
334 di << syntaxe << "\n";
335 return 1;
336 }
337
338 Standard_Integer lastArg=narg-2;
339 Standard_Boolean closedSolid = Standard_False;
340 Standard_Boolean geomCtrl = Standard_True;
341 TopoDS_Shape resu = DBRep::Get(a[narg-1]);
342 if (resu.IsNull()) {
343 if (narg < 4) {
344 //cout << syntaxe << endl;
345 di << syntaxe << "\n";
346 return 1;
347 }
348 closedSolid=Draw::Atoi(a[narg-1]);
349 resu = DBRep::Get(a[narg-2]);
350 lastArg=narg-3;
351 if (resu.IsNull()) {
352 if (narg < 5) {
353 //cout << syntaxe << endl;
354 di << syntaxe << "\n";
355 return 1;
356 }
357 geomCtrl=closedSolid;
358 closedSolid=Draw::Atoi(a[narg-2]);
359 resu = DBRep::Get(a[narg-3]);
360 lastArg=narg-4;
361 if (resu.IsNull()) {
362 //cout << syntaxe << endl;
363 di << syntaxe << "\n";
364 return 1;
365 }
366 }
367 }
368
369 TopTools_ListOfShape lesArgs;
370 for (Standard_Integer id=1; id <=lastArg; id++) {
371 lesArgs.Append(DBRep::Get(a[id]));
372 }
373
374 if (BRepAlgo::IsValid(lesArgs, resu, closedSolid, geomCtrl)) {
375 //cout << "Difference is Valid." << endl;
376 di << "Difference is Valid." << "\n";
377 } else {
378 //cout << "error : Difference is Not Valid !" << endl;
379 di << "error : Difference is Not Valid !" << "\n";
380 }
381
382 return 0;
383}
384//=======================================================================
385
386// Modified by skv - Tue Apr 27 13:38:44 2004 Begin
387//=======================================================================
388//function : CHK
389//purpose : Checks a shape
390//=======================================================================
391
392// static Standard_Integer CHK(Draw_Interpretor& theCommands,
393// Standard_Integer narg, const char** a)
394// {
395// if (narg < 2) {
396// return 1;
397// }
398
399// Standard_Boolean doprint = Standard_True;
400// if (narg == 3) { if (!strcmp(a[2],"-short")) doprint = Standard_False; }
401
402// TopoDS_Shape S = DBRep::Get(a[1]);
403// if (S.IsNull()) {
404// cout<<"not a topological shape"<<endl;
405// return 1;
406// }
407
408// Standard_Boolean GeomCtrl = Standard_True;
409// if (!strcasecmp(a[0],"CHECKTOPSHAPE")) {
410// GeomCtrl = Standard_False;
411// }
412
413// BRepCheck_Analyzer ana(S,GeomCtrl);
414// if (ana.IsValid()) {
415// theCommands<<"This shape seems to be valid";
416// }
417// else {
418// theMap.Clear();
419// nbfaulty = 0;
420// lfaulty.Clear();
421// theMap.Clear();
422// if (doprint) {
423// Print(cout,ana,S);
424// cout<<"\n";
425// theMap.Clear();
426// if (nbfaulty !=0)
427// cout<<"Faulty shapes in variables "<<checkfaultyname<<"1 to "<<checkfaultyname<<nbfaulty<<" \n";
428// cout<<endl;
429// }
430// else {
431// theCommands<<"This shape has faulty shapes";
432// }
433// }
434// return 0;
435// }
436
437//=======================================================================
438//function : ContextualDump
439//purpose : Contextual (modeling) style of output.
440//=======================================================================
441
442//void ContextualDump(const BRepCheck_Analyzer &theAna,
443// const TopoDS_Shape &theShape)
444void ContextualDump(Draw_Interpretor& theCommands,
445 const BRepCheck_Analyzer &theAna,
446 const TopoDS_Shape &theShape)
447{
448 theMap.Clear();
449 nbfaulty = 0;
450 lfaulty.Clear();
451
452 //Print(cout, theAna, theShape);
453 Standard_SStream aSStream;
454 Print(aSStream, theAna, theShape);
455 theCommands << aSStream;
456 //cout<<"\n";
457 theCommands<<"\n";
458 theMap.Clear();
459
460 if (nbfaulty !=0)
461 theCommands<<"Faulty shapes in variables "<<checkfaultyname<<"1 to "<<checkfaultyname<<nbfaulty<<" \n";
462 //cout<<"Faulty shapes in variables "<<checkfaultyname<<"1 to "<<checkfaultyname<<nbfaulty<<" \n";
463
464 //cout<<endl;
465 theCommands<<"\n";
466}
467
468
469//=======================================================================
470//function : FillProblems
471// purpose : auxilary for StructuralDump
472//=======================================================================
473static void FillProblems(const BRepCheck_Status stat,
474 Handle(TColStd_HArray1OfInteger)& NbProblems)
475{
476 switch (stat) {
477 case BRepCheck_InvalidPointOnCurve:
478 NbProblems->SetValue(1,NbProblems->Value(1)+1); break;
479 case BRepCheck_InvalidPointOnCurveOnSurface:
480 NbProblems->SetValue(2,NbProblems->Value(2)+1); break;
481 case BRepCheck_InvalidPointOnSurface:
482 NbProblems->SetValue(3,NbProblems->Value(3)+1); break;
483 case BRepCheck_No3DCurve:
484 NbProblems->SetValue(4,NbProblems->Value(4)+1); break;
485 case BRepCheck_Multiple3DCurve:
486 NbProblems->SetValue(5,NbProblems->Value(5)+1); break;
487 case BRepCheck_Invalid3DCurve:
488 NbProblems->SetValue(6,NbProblems->Value(6)+1); break;
489 case BRepCheck_NoCurveOnSurface:
490 NbProblems->SetValue(7,NbProblems->Value(7)+1); break;
491 case BRepCheck_InvalidCurveOnSurface:
492 NbProblems->SetValue(8,NbProblems->Value(8)+1); break;
493 case BRepCheck_InvalidCurveOnClosedSurface:
494 NbProblems->SetValue(9,NbProblems->Value(9)+1); break;
495 case BRepCheck_InvalidSameRangeFlag:
496 NbProblems->SetValue(10,NbProblems->Value(10)+1); break;
497 case BRepCheck_InvalidSameParameterFlag:
498 NbProblems->SetValue(11,NbProblems->Value(11)+1); break;
499 case BRepCheck_InvalidDegeneratedFlag:
500 NbProblems->SetValue(12,NbProblems->Value(12)+1); break;
501 case BRepCheck_FreeEdge:
502 NbProblems->SetValue(13,NbProblems->Value(13)+1); break;
503 case BRepCheck_InvalidMultiConnexity:
504 NbProblems->SetValue(14,NbProblems->Value(14)+1); break;
505 case BRepCheck_InvalidRange:
506 NbProblems->SetValue(15,NbProblems->Value(15)+1); break;
507 case BRepCheck_EmptyWire:
508 NbProblems->SetValue(16,NbProblems->Value(16)+1); break;
509 case BRepCheck_RedundantEdge:
510 NbProblems->SetValue(17,NbProblems->Value(17)+1); break;
511 case BRepCheck_SelfIntersectingWire:
512 NbProblems->SetValue(18,NbProblems->Value(18)+1); break;
513 case BRepCheck_NoSurface:
514 NbProblems->SetValue(19,NbProblems->Value(19)+1); break;
515 case BRepCheck_InvalidWire:
516 NbProblems->SetValue(20,NbProblems->Value(20)+1); break;
517 case BRepCheck_RedundantWire:
518 NbProblems->SetValue(21,NbProblems->Value(21)+1); break;
519 case BRepCheck_IntersectingWires:
520 NbProblems->SetValue(22,NbProblems->Value(22)+1); break;
521 case BRepCheck_InvalidImbricationOfWires:
522 NbProblems->SetValue(23,NbProblems->Value(23)+1); break;
523 case BRepCheck_EmptyShell:
524 NbProblems->SetValue(24,NbProblems->Value(24)+1); break;
525 case BRepCheck_RedundantFace:
526 NbProblems->SetValue(25,NbProblems->Value(25)+1); break;
527 case BRepCheck_UnorientableShape:
528 NbProblems->SetValue(26,NbProblems->Value(26)+1); break;
529 case BRepCheck_NotClosed:
530 NbProblems->SetValue(27,NbProblems->Value(27)+1); break;
531 case BRepCheck_NotConnected:
532 NbProblems->SetValue(28,NbProblems->Value(28)+1); break;
533 case BRepCheck_SubshapeNotInShape:
534 NbProblems->SetValue(29,NbProblems->Value(29)+1); break;
535 case BRepCheck_BadOrientation:
536 NbProblems->SetValue(30,NbProblems->Value(30)+1); break;
537 case BRepCheck_BadOrientationOfSubshape:
538 NbProblems->SetValue(31,NbProblems->Value(31)+1); break;
539 case BRepCheck_CheckFail:
540 NbProblems->SetValue(32,NbProblems->Value(32)+1); break;
541 default:
542 break;
543 }
544}
545
546
547//=======================================================================
548//function : GetProblemSub
549// purpose : auxilary for StructuralDump
550//=======================================================================
551static void GetProblemSub(const BRepCheck_Analyzer& Ana,
552 const TopoDS_Shape& Shape,
553 Handle(TopTools_HSequenceOfShape)& sl,
554 Handle(TColStd_HArray1OfInteger)& NbProblems,
555 const TopAbs_ShapeEnum Subtype)
556{
557 BRepCheck_ListIteratorOfListOfStatus itl;
558 TopExp_Explorer exp;
559 for (exp.Init(Shape,Subtype); exp.More(); exp.Next()) {
560 const Handle(BRepCheck_Result)& res = Ana.Result(exp.Current());
561
562 const TopoDS_Shape& sub = exp.Current();
563 for (res->InitContextIterator();
564 res->MoreShapeInContext();
565 res->NextShapeInContext()) {
566 if (res->ContextualShape().IsSame(Shape) &&
567 !Contains(theMap(sub),Shape)) {
568 theMap(sub).Append(Shape);
569 itl.Initialize(res->StatusOnShape());
570
571 if (itl.Value() != BRepCheck_NoError) {
572 Standard_Integer ii = 0;
573
574 for(ii=1; ii<=sl->Length(); ii++)
575 if(sl->Value(ii).IsSame(sub)) break;
576
577 if(ii>sl->Length()) {
578 sl->Append(sub);
579 FillProblems(itl.Value(),NbProblems);
580 }
581 for(ii=1; ii<=sl->Length(); ii++)
582 if(sl->Value(ii).IsSame(Shape)) break;
583 if(ii>sl->Length()) {
584 sl->Append(Shape);
585 FillProblems(itl.Value(),NbProblems);
586 }
587 }
588 break;
589 }
590 }
591 }
592}
593
594
595//=======================================================================
596//function : GetProblemShapes
597// purpose : auxilary for StructuralDump
598//=======================================================================
599static void GetProblemShapes(const BRepCheck_Analyzer& Ana,
600 const TopoDS_Shape& Shape,
601 Handle(TopTools_HSequenceOfShape)& sl,
602 Handle(TColStd_HArray1OfInteger)& NbProblems)
603{
604 for (TopoDS_Iterator iter(Shape); iter.More(); iter.Next()) {
605 GetProblemShapes(Ana,iter.Value(),sl, NbProblems);
606 }
607 TopAbs_ShapeEnum styp = Shape.ShapeType();
608 BRepCheck_ListIteratorOfListOfStatus itl;
609 if (!Ana.Result(Shape).IsNull() && !theMap.IsBound(Shape)) {
610 itl.Initialize(Ana.Result(Shape)->Status());
611
612 if (itl.Value() != BRepCheck_NoError) {
613 sl->Append(Shape);
614 FillProblems(itl.Value(),NbProblems);
615 }
616 }
617 if (!theMap.IsBound(Shape)) {
618 TopTools_ListOfShape thelist;
619 theMap.Bind(Shape, thelist);
620 }
621
622 switch (styp) {
623 case TopAbs_EDGE:
624 GetProblemSub(Ana, Shape, sl, NbProblems, TopAbs_VERTEX);
625 break;
626 case TopAbs_FACE:
627 GetProblemSub(Ana, Shape, sl, NbProblems, TopAbs_WIRE);
628 GetProblemSub(Ana, Shape, sl, NbProblems, TopAbs_EDGE);
629 GetProblemSub(Ana, Shape, sl, NbProblems, TopAbs_VERTEX);
630 break;
631 case TopAbs_SHELL:
632 break;
633 case TopAbs_SOLID:
634 GetProblemSub(Ana, Shape, sl, NbProblems, TopAbs_SHELL);
635 break;
636 default:
637 break;
638 }
639
640}
641
642//=======================================================================
643//function : StructuralDump
644//purpose : Structural (data exchange) style of output.
645//=======================================================================
646
647//void StructuralDump(const BRepCheck_Analyzer &theAna,
648// const Standard_CString ShName,
649// const Standard_CString Pref,
650// const TopoDS_Shape &theShape)
651void StructuralDump(Draw_Interpretor& theCommands,
652 const BRepCheck_Analyzer &theAna,
653 const Standard_CString ShName,
654 const Standard_CString Pref,
655 const TopoDS_Shape &theShape)
656{
657 Standard_Integer i;
658 //cout << "StructuralDump" << endl;
659 //cout << " -- The Shape " << ShName << " has problems :"<<endl;
660 //cout<<" Check Count"<<endl;
661 //cout<<" ------------------------------------------------"<<endl;
662 theCommands << " -- The Shape " << ShName << " has problems :"<<"\n";
663 theCommands<<" Check Count"<<"\n";
664 theCommands<<" ------------------------------------------------"<<"\n";
665
666 Handle(TColStd_HArray1OfInteger) NbProblems = new TColStd_HArray1OfInteger(1,32);
667 for(i=1; i<=32; i++) NbProblems->SetValue(i,0);
668 Handle(TopTools_HSequenceOfShape) sl,slv,sle,slw,slf,sls,slo;
669 sl = new TopTools_HSequenceOfShape();
670 theMap.Clear();
671 GetProblemShapes(theAna, theShape, sl, NbProblems);
672 theMap.Clear();
673
674 if(NbProblems->Value(1)>0)
675 theCommands<<" Invalid Point on Curve ................... "<<NbProblems->Value(1)<<"\n";
676 //cout<<" Invalid Point on Curve ................... "<<NbProblems->Value(1)<<endl;
677 if(NbProblems->Value(2)>0)
678 theCommands<<" Invalid Point on CurveOnSurface .......... "<<NbProblems->Value(2)<<"\n";
679 //cout<<" Invalid Point on CurveOnSurface .......... "<<NbProblems->Value(2)<<endl;
680 if(NbProblems->Value(3)>0)
681 theCommands<<" Invalid Point on Surface ................. "<<NbProblems->Value(3)<<"\n";
682 //cout<<" Invalid Point on Surface ................. "<<NbProblems->Value(3)<<endl;
683 if(NbProblems->Value(4)>0)
684 theCommands<<" No 3D Curve .............................. "<<NbProblems->Value(4)<<"\n";
685 //cout<<" No 3D Curve .............................. "<<NbProblems->Value(4)<<endl;
686 if(NbProblems->Value(5)>0)
687 theCommands<<" Multiple 3D Curve ........................ "<<NbProblems->Value(5)<<"\n";
688 //cout<<" Multiple 3D Curve ........................ "<<NbProblems->Value(5)<<endl;
689 if(NbProblems->Value(6)>0)
690 theCommands<<" Invalid 3D Curve ......................... "<<NbProblems->Value(6)<<"\n";
691 //cout<<" Invalid 3D Curve ......................... "<<NbProblems->Value(6)<<endl;
692 if(NbProblems->Value(7)>0)
693 theCommands<<" No Curve on Surface ...................... "<<NbProblems->Value(7)<<"\n";
694 //cout<<" No Curve on Surface ...................... "<<NbProblems->Value(7)<<endl;
695 if(NbProblems->Value(8)>0)
696 theCommands<<" Invalid Curve on Surface ................. "<<NbProblems->Value(8)<<"\n";
697 //cout<<" Invalid Curve on Surface ................. "<<NbProblems->Value(8)<<endl;
698 if(NbProblems->Value(9)>0)
699 theCommands<<" Invalid Curve on closed Surface .......... "<<NbProblems->Value(9)<<"\n";
700 //cout<<" Invalid Curve on closed Surface .......... "<<NbProblems->Value(9)<<endl;
701 if(NbProblems->Value(10)>0)
702 theCommands<<" Invalid SameRange Flag ................... "<<NbProblems->Value(10)<<"\n";
703 //cout<<" Invalid SameRange Flag ................... "<<NbProblems->Value(10)<<endl;
704 if(NbProblems->Value(11)>0)
705 theCommands<<" Invalid SameParameter Flag ............... "<<NbProblems->Value(11)<<"\n";
706 //cout<<" Invalid SameParameter Flag ............... "<<NbProblems->Value(11)<<endl;
707 if(NbProblems->Value(12)>0)
708 theCommands<<" Invalid Degenerated Flag ................. "<<NbProblems->Value(12)<<"\n";
709 //cout<<" Invalid Degenerated Flag ................. "<<NbProblems->Value(12)<<endl;
710 if(NbProblems->Value(13)>0)
711 theCommands<<" Free Edge ................................ "<<NbProblems->Value(13)<<"\n";
712 //cout<<" Free Edge ................................ "<<NbProblems->Value(13)<<endl;
713 if(NbProblems->Value(14)>0)
714 theCommands<<" Invalid MultiConnexity ................... "<<NbProblems->Value(14)<<"\n";
715 //cout<<" Invalid MultiConnexity ................... "<<NbProblems->Value(14)<<endl;
716 if(NbProblems->Value(15)>0)
717 theCommands<<" Invalid Range ............................ "<<NbProblems->Value(15)<<"\n";
718 //cout<<" Invalid Range ............................ "<<NbProblems->Value(15)<<endl;
719 if(NbProblems->Value(16)>0)
720 theCommands<<" Empty Wire ............................... "<<NbProblems->Value(16)<<"\n";
721 //cout<<" Empty Wire ............................... "<<NbProblems->Value(16)<<endl;
722 if(NbProblems->Value(17)>0)
723 theCommands<<" Redundant Edge ........................... "<<NbProblems->Value(17)<<"\n";
724 //cout<<" Redundant Edge ........................... "<<NbProblems->Value(17)<<endl;
725 if(NbProblems->Value(18)>0)
726 theCommands<<" Self Intersecting Wire ................... "<<NbProblems->Value(18)<<"\n";
727 //cout<<" Self Intersecting Wire ................... "<<NbProblems->Value(18)<<endl;
728 if(NbProblems->Value(19)>0)
729 theCommands<<" No Surface ............................... "<<NbProblems->Value(19)<<"\n";
730 //cout<<" No Surface ............................... "<<NbProblems->Value(19)<<endl;
731 if(NbProblems->Value(20)>0)
732 theCommands<<" Invalid Wire ............................. "<<NbProblems->Value(20)<<"\n";
733 //cout<<" Invalid Wire ............................. "<<NbProblems->Value(20)<<endl;
734 if(NbProblems->Value(21)>0)
735 theCommands<<" Redundant Wire ........................... "<<NbProblems->Value(21)<<"\n";
736 //cout<<" Redundant Wire ........................... "<<NbProblems->Value(21)<<endl;
737 if(NbProblems->Value(22)>0)
738 theCommands<<" Intersecting Wires ....................... "<<NbProblems->Value(22)<<"\n";
739 //cout<<" Intersecting Wires ....................... "<<NbProblems->Value(22)<<endl;
740 if(NbProblems->Value(23)>0)
741 theCommands<<" Invalid Imbrication of Wires ............. "<<NbProblems->Value(23)<<"\n";
742 //cout<<" Invalid Imbrication of Wires ............. "<<NbProblems->Value(23)<<endl;
743 if(NbProblems->Value(24)>0)
744 theCommands<<" Empty Shell .............................. "<<NbProblems->Value(24)<<"\n";
745 //cout<<" Empty Shell .............................. "<<NbProblems->Value(24)<<endl;
746 if(NbProblems->Value(25)>0)
747 theCommands<<" Redundant Face ........................... "<<NbProblems->Value(25)<<"\n";
748 //cout<<" Redundant Face ........................... "<<NbProblems->Value(25)<<endl;
749 if(NbProblems->Value(26)>0)
750 theCommands<<" Unorientable Shape ....................... "<<NbProblems->Value(26)<<"\n";
751 //cout<<" Unorientable Shape ....................... "<<NbProblems->Value(26)<<endl;
752 if(NbProblems->Value(27)>0)
753 theCommands<<" Not Closed ............................... "<<NbProblems->Value(27)<<"\n";
754 //cout<<" Not Closed ............................... "<<NbProblems->Value(27)<<endl;
755 if(NbProblems->Value(28)>0)
756 theCommands<<" Not Connected ............................ "<<NbProblems->Value(28)<<"\n";
757 //cout<<" Not Connected ............................ "<<NbProblems->Value(28)<<endl;
758 if(NbProblems->Value(29)>0)
759 theCommands<<" Subshape not in Shape .................... "<<NbProblems->Value(29)<<"\n";
760 //cout<<" Subshape not in Shape .................... "<<NbProblems->Value(29)<<endl;
761 if(NbProblems->Value(30)>0)
762 theCommands<<" Bad Orientation .......................... "<<NbProblems->Value(30)<<"\n";
763 //cout<<" Bad Orientation .......................... "<<NbProblems->Value(30)<<endl;
764 if(NbProblems->Value(31)>0)
765 theCommands<<" Bad Orientation of Subshape .............. "<<NbProblems->Value(31)<<"\n";
766 //cout<<" Bad Orientation of Subshape .............. "<<NbProblems->Value(31)<<endl;
767 if(NbProblems->Value(32)>0)
768 theCommands<<" checkshape failure......... .............. "<<NbProblems->Value(32)<<"\n";
769 //cout<<" checkshape failure......... .............. "<<NbProblems->Value(32)<<endl;
770
771 //cout<<" ------------------------------------------------"<<endl;
772 //cout<<"*** Shapes with problems : "<<sl->Length()<<endl;
773 //cout<<endl;
774 theCommands<<" ------------------------------------------------"<<"\n";
775 theCommands<<"*** Shapes with problems : "<<sl->Length()<<"\n";
776
777 slv = new TopTools_HSequenceOfShape();
778 sle = new TopTools_HSequenceOfShape();
779 slw = new TopTools_HSequenceOfShape();
780 slf = new TopTools_HSequenceOfShape();
781 sls = new TopTools_HSequenceOfShape();
782 slo = new TopTools_HSequenceOfShape();
783
784 for(i=1; i<=sl->Length(); i++) {
785 TopoDS_Shape shi = sl->Value(i);
786 TopAbs_ShapeEnum sti = shi.ShapeType();
787 switch (sti) {
788 case TopAbs_VERTEX : slv->Append (shi); break;
789 case TopAbs_EDGE : sle->Append (shi); break;
790 case TopAbs_WIRE : slw->Append (shi); break;
791 case TopAbs_FACE : slf->Append (shi); break;
792 case TopAbs_SHELL : sls->Append (shi); break;
793 case TopAbs_SOLID : slo->Append (shi); break;
794 default : break;
795 }
796 }
797
798 BRep_Builder B;
799 if(slv->Length()>0) {
800 TopoDS_Compound comp;
801 B.MakeCompound(comp);
802 Standard_Integer nb = slv->Length();
803 for(i=1; i<=nb; i++)
804 B.Add(comp,slv->Value(i));
805 char aName[20];
806 Sprintf(aName,"%s_v",Pref);
807 DBRep::Set(aName,comp);
808 //cout<<"VERTEX"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
809 if (nb > 9)
810 theCommands<<"VERTEX"<<" : "<<""<<nb<<" Items -> compound named "<<aName<<"\n";
811 else
812 theCommands<<"VERTEX"<<" : "<<" "<<nb<<" Items -> compound named "<<aName<<"\n";
813 }
814 if(sle->Length()>0) {
815 TopoDS_Compound comp;
816 B.MakeCompound(comp);
817 Standard_Integer nb = sle->Length();
818 for(i=1; i<=nb; i++)
819 B.Add(comp,sle->Value(i));
820 char aName[20];
821 Sprintf(aName,"%s_e",Pref);
822 DBRep::Set(aName,comp);
823 //cout<<"EDGE"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
824 if (nb > 9)
825 theCommands<<"EDGE"<<" : "<<""<<nb<<" Items -> compound named "<<aName<<"\n";
826 else
827 theCommands<<"EDGE"<<" : "<<" "<<nb<<" Items -> compound named "<<aName<<"\n";
828 }
829 if(slw->Length()>0) {
830 TopoDS_Compound comp;
831 B.MakeCompound(comp);
832 Standard_Integer nb = slw->Length();
833 for(i=1; i<=nb; i++)
834 B.Add(comp,slw->Value(i));
835 char aName[20];
836 Sprintf(aName,"%s_w",Pref);
837 DBRep::Set(aName,comp);
838 //cout<<"WIRE"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
839 if (nb > 9)
840 theCommands<<"WIRE"<<" : "<<""<<nb<<" Items -> compound named "<<aName<<"\n";
841 else
842 theCommands<<"WIRE"<<" : "<<" "<<nb<<" Items -> compound named "<<aName<<"\n";
843 }
844 if(slf->Length()>0) {
845 TopoDS_Compound comp;
846 B.MakeCompound(comp);
847 Standard_Integer nb = slf->Length();
848 for(i=1; i<=nb; i++)
849 B.Add(comp,slf->Value(i));
850 char aName[20];
851 Sprintf(aName,"%s_f",Pref);
852 DBRep::Set(aName,comp);
853 //cout<<"FACE"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
854 if (nb > 9)
855 theCommands<<"FACE"<<" : "<<""<<nb<<" Items -> compound named "<<aName<<"\n";
856 else
857 theCommands<<"FACE"<<" : "<<" "<<nb<<" Items -> compound named "<<aName<<"\n";
858 }
859 if(sls->Length()>0) {
860 TopoDS_Compound comp;
861 B.MakeCompound(comp);
862 Standard_Integer nb = sls->Length();
863 for(i=1; i<=nb; i++)
864 B.Add(comp,sls->Value(i));
865 char aName[20];
866 Sprintf(aName,"%s_s",Pref);
867 DBRep::Set(aName,comp);
868 //cout<<"SHELL"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
869 if (nb > 9)
870 theCommands<<"SHELL"<<" : "<<""<<nb<<" Items -> compound named "<<aName<<"\n";
871 else
872 theCommands<<"SHELL"<<" : "<<" "<<nb<<" Items -> compound named "<<aName<<"\n";
873 }
874 if(slo->Length()>0) {
875 TopoDS_Compound comp;
876 B.MakeCompound(comp);
877 Standard_Integer nb = slo->Length();
878 for(i=1; i<=nb; i++)
879 B.Add(comp,slo->Value(i));
880 char aName[20];
881 Sprintf(aName,"%s_o",Pref);
882 DBRep::Set(aName,comp);
883 //cout<<"SOLID"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
884 if (nb > 9)
885 theCommands<<"SOLID"<<" : "<<""<<nb<<" Items -> compound named "<<aName<<"\n";
886 else
887 theCommands<<"SOLID"<<" : "<<" "<<nb<<" Items -> compound named "<<aName<<"\n";
888 }
889}
890
891//=======================================================================
892//function : checkshape
893//purpose : Checks a shape
894//=======================================================================
895
896static Standard_Integer checkshape(Draw_Interpretor& theCommands,
897 Standard_Integer narg, const char** a)
898{
899 if (narg == 1) {
900 //cout << endl;
901 //cout << "Usage : checkshape [-top] shape [result] [-short]" << endl;
902 //cout << endl;
903 //cout << "Where :" << endl;
904 //cout << " -top - check topology only." << endl;
905 //cout << " shape - the name of the shape to test." << endl;
906 //cout << " result - the prefix of the output shape names. If it is used, structural" << endl;
907 //cout << " output style will be used. Otherwise - contextual one." << endl;
908 //cout << " -short - short description of check." << endl;
909 theCommands << "\n";
910 theCommands << "Usage : checkshape [-top] shape [result] [-short]" << "\n";
911 theCommands << "\n";
912 theCommands << "Where :" << "\n";
913 theCommands << " -top - check topology only." << "\n";
914 theCommands << " shape - the name of the shape to test." << "\n";
915 theCommands << " result - the prefix of the output shape names. If it is used, structural" << "\n";
916 theCommands << " output style will be used. Otherwise - contextual one." << "\n";
917 theCommands << " -short - short description of check." << "\n";
918
919 return 0;
920 }
921
922 if (narg > 5) {
923 //cout << "Invalid number of args!!!" << endl;
924 //cout << "No args to have help." << endl;
925 theCommands << "Invalid number of args!!!" << "\n";
926 theCommands << "No args to have help." << "\n";
927
928 return 1;
929 }
930
931 Standard_Boolean aGeomCtrl = Standard_True;
932 Standard_Integer aCurInd = 1;
933
934 if (!strcmp(a[1],"-top")) {
935 aGeomCtrl = Standard_False;
936 aCurInd++;
937 }
938
939 if (aCurInd > narg - 1) {
940 //cout << "Invalid number of args!!!" << endl;
941 //cout << "No args to have help." << endl;
942 theCommands << "Invalid number of args!!!" << "\n";
943 theCommands << "No args to have help." << "\n";
944
945 return 1;
946 }
947
948 Standard_CString aShapeName = a[aCurInd];
949 TopoDS_Shape aShape = DBRep::Get(aShapeName);
950
951 if (aShape.IsNull()) {
952 //cout << a[aCurInd] << " is not a topological shape!!!" << endl;
953 theCommands << a[aCurInd] << " is not a topological shape!!!" << "\n";
954
955 return 1;
956 }
957
958 Standard_Boolean IsShortDump = Standard_False;
959 Standard_Boolean IsContextDump = Standard_True;
960 Standard_Integer aBackInd = narg - 1;
961
962 if (aCurInd < aBackInd) {
963 if (!strcmp(a[aBackInd],"-short")) {
964 IsShortDump = Standard_True;
965 aBackInd--;
966 }
967 }
968
969 if (aCurInd < aBackInd - 1) {
970 //cout << "Invalid number of args!!!" << endl;
971 //cout << "No args to have help." << endl;
972 theCommands << "Invalid number of args!!!" << "\n";
973 theCommands << "No args to have help." << "\n";
974
975 return 1;
976 } else if (aCurInd < aBackInd) {
977 IsContextDump = Standard_False;
978 }
979
980 try {
981 OCC_CATCH_SIGNALS
982 BRepCheck_Analyzer anAna(aShape,aGeomCtrl);
983 Standard_Boolean isValid = anAna.IsValid();
984
985 if (isValid) {
986 if (IsContextDump) {
987 theCommands << "This shape seems to be valid";
988 } else {
989 theCommands << " -- The Shape " << aShapeName << " looks OK";
990 }
991 } else {
992 if (IsShortDump) {
993 theCommands<<"This shape has faulty shapes";
994 } else {
995 if (IsContextDump) {
996 //ContextualDump(anAna, aShape);
997 ContextualDump(theCommands, anAna, aShape);
998 } else {
999 Standard_CString aPref = a[aCurInd+1];
1000 //StructuralDump(anAna, aShapeName, aPref, aShape);
1001 StructuralDump(theCommands, anAna, aShapeName, aPref, aShape);
1002 }
1003 }
1004 }
1005 }
1006 catch(Standard_Failure) {
1007 theCommands<<"checkshape exception : ";
1008 theCommands << Standard_Failure::Caught()->GetMessageString();
1009 theCommands<<"\n";
1010 return 1;
1011 }
1012
1013 return 0;
1014}
1015// Modified by skv - Tue Apr 27 13:38:24 2004 End
1016/***************************************************************/
1017static void InitEpsSurf(Standard_Real& epsnl,Standard_Real& epsdis, Standard_Real& epsangk1,
1018 Standard_Real& epsangk2, Standard_Real& epsangn1,
1019 Standard_Real& perce,Standard_Real& maxlen )
1020{
1021 epsnl = 0.001;
1022 epsdis = 0.001;
1023 epsangk1 = 0.001 ;
1024 epsangk2 = 0.001;
1025 epsangn1 = 0.001 ;
1026 perce = 0.01;
1027 maxlen = 10000 ;
1028}
1029
1030static Standard_Integer shapeG1continuity (Draw_Interpretor& di, Standard_Integer n, const char** a)
1031
1032{ Standard_Real epsnl,epsC0, epsC1, epsC2, epsG1,percent,maxlen;
1033 Standard_Integer nbeval;
1034 InitEpsSurf(epsnl,epsC0, epsC1, epsC2, epsG1,percent,maxlen);
1035 Standard_Boolean ISG1=Standard_True;
1036 if (n<4) return 1;
1037 TopoDS_Face face1,face2;
1038 Standard_Real f1,f2,l1,l2;
1039 TopoDS_Shape shape = DBRep::Get(a[1],TopAbs_SHAPE);
1040 if (shape.IsNull()) return 1;
1041 TopoDS_Shape edge = DBRep::Get(a[2],TopAbs_EDGE);
1042 if (edge.IsNull()) return 1;
1043// calcul des deux faces
1044 TopTools_IndexedDataMapOfShapeListOfShape lface;
1045 TopExp::MapShapesAndAncestors(shape,TopAbs_EDGE,TopAbs_FACE,lface);
1046 const TopTools_ListOfShape& lfac = lface.FindFromKey(edge);
1047
1048 Standard_Integer nelem= lfac.Extent();
1049 if(nelem!=2) return 1;
1050 TopTools_ListIteratorOfListOfShape It;
1051 It.Initialize(lfac);
1052 face1=TopoDS::Face(It.Value());
1053 It.Next();
1054 face2=TopoDS::Face(It.Value());
1055
1056// calcul des deux pcurves
1057 const Handle(Geom2d_Curve) c1 = BRep_Tool::CurveOnSurface
1058 (TopoDS::Edge(edge),face1,f1,l1);
1059 if (c1.IsNull()) return 1;
1060 const Handle(Geom2d_Curve) c2 = BRep_Tool::CurveOnSurface
1061 (TopoDS::Edge(edge),face2,f2,l2);
1062 if (c2.IsNull()) return 1;
1063
1064 Handle(Geom2d_Curve) curv1= new Geom2d_TrimmedCurve(c1,f1,l1);
1065
1066 Handle(Geom2d_Curve) curv2= new Geom2d_TrimmedCurve(c2,f2,l2);
1067
1068// calcul dees deux surfaces
1069 TopLoc_Location L1,L2;
1070 TopoDS_Face aLocalFace = face1;
1071 const Handle(Geom_Surface)& s1 = BRep_Tool::Surface(aLocalFace,L1);
1072// const Handle(Geom_Surface)& s1 =
1073// BRep_Tool::Surface(TopoDS::Face(face1),L1);
1074 if (s1.IsNull()) return 1;
1075 aLocalFace = face2;
1076 const Handle(Geom_Surface)& s2 = BRep_Tool::Surface(aLocalFace,L2);
1077// const Handle(Geom_Surface)& s2 =
1078// BRep_Tool::Surface(TopoDS::Face(face2),L2);
1079 if (s2.IsNull()) return 1;
1080
1081
1082 Handle(Geom_Surface) surf1 = Handle(Geom_Surface)::
1083 DownCast(s1->Transformed(L1.Transformation()));
1084 if (surf1.IsNull()) return 1;
1085 Handle(Geom_Surface) surf2 = Handle(Geom_Surface)::
1086 DownCast(s2->Transformed(L2.Transformation()));
1087 if (surf2.IsNull()) return 1;
1088
1089
1090
1091 nbeval = (Standard_Integer ) Draw::Atof( a[3]);
1092
1093 switch(n)
1094 { case 7 : epsG1 = Draw::Atof(a[6]);
1095 case 6 : epsC0 = Draw::Atof(a[5]);
1096 case 5 : epsnl = Draw::Atof(a[4]);
1097 case 4 : {} break;
1098 default : return 1;
1099 }
1100
1101
1102 Standard_Real pard1, parf1, U, Uf, deltaU, nb = 0;
1103 Standard_Boolean isconti = Standard_True;
1104 Standard_Boolean isdone = Standard_True;
1105 pard1 = curv1->FirstParameter();
1106 parf1 = curv1->LastParameter();
1107 Standard_Real MaxG0Value=0, MaxG1Angle=0;
1108 U = Min( pard1,parf1);
1109 Uf = Max (pard1,parf1);
1110
1111 deltaU = Abs(parf1- pard1)/nbeval;
1112
1113 do
1114 { if ( nb == nbeval)
1115 { LocalAnalysis_SurfaceContinuity res(curv1, curv2, Uf,surf1, surf2, GeomAbs_G1, epsnl,epsC0, epsC1, epsC2, epsG1,percent,maxlen );
1116 isdone = res.IsDone();
1117 if ( isdone) { isconti = res.IsG1();
1118 if (isconti)
1119 {if (res.C0Value()>MaxG0Value) MaxG0Value = res.C0Value();
1120 if (res.G1Angle ()>MaxG1Angle) MaxG1Angle = res.G1Angle();}}
1121 else isconti = Standard_False;}
1122
1123 else {LocalAnalysis_SurfaceContinuity res (curv1, curv2, (U+nb*deltaU ), surf1,surf2, GeomAbs_G1,epsnl,epsC0, epsC1, epsC2, epsG1,
1124 percent,maxlen);
1125 isdone = res.IsDone();
1126 if ( isdone) { isconti = res.IsG1();
1127 if ( nb == 0) { MaxG0Value = res.C0Value();
1128 MaxG1Angle = res.G1Angle();}
1129 if (res.C0Value()> MaxG0Value) MaxG0Value = res.C0Value();
1130 if (res.G1Angle()> MaxG1Angle) MaxG1Angle= res.G1Angle();;}
1131
1132 else isconti = Standard_False;}
1133 if (!isconti) ISG1=Standard_False;
1134 nb++;
1135
1136 }
1137 while ((nb<nbeval)&& isdone );
1138
1139 //if (!isdone) { cout<<" Problem in computation "<<endl; return 1;}
1140 //if (ISG1)
1141 // {cout<<" the continuity is G1 "<<endl;}
1142 //else { cout<<" the continuity is not G1 "<<endl;}
1143 //cout<<"MaxG0Value :"<< MaxG0Value << endl;
1144 //cout<<"MaxG1Angle:"<< MaxG1Angle << endl;
1145 if (!isdone) { di<<" Problem in computation "<<"\n"; return 1;}
1146 if (ISG1)
1147 {di<<" the continuity is G1 "<<"\n";}
1148 else { di<<" the continuity is not G1 "<<"\n";}
1149 di<<"MaxG0Value :"<< MaxG0Value << "\n";
1150 di<<"MaxG1Angle:"<< MaxG1Angle << "\n";
1151 return 0;
1152}
1153/*****************************************************************************/
1154static Standard_Integer shapeG0continuity (Draw_Interpretor& di, Standard_Integer n, const char** a)
1155
1156{ Standard_Real epsnl,epsC0, epsC1, epsC2, epsG1,percent,maxlen;
1157 Standard_Integer nbeval;
1158 Standard_Boolean ISG0;
1159 InitEpsSurf(epsnl,epsC0, epsC1, epsC2, epsG1,percent,maxlen );
1160
1161 if (n<4) return 1;
1162 TopoDS_Face face1,face2;
1163 Standard_Real f1,f2,l1,l2;
1164 TopoDS_Shape shape = DBRep::Get(a[1],TopAbs_SHAPE);
1165 if (shape.IsNull()) return 1;
1166 TopoDS_Shape edge = DBRep::Get(a[2],TopAbs_EDGE);
1167 if (edge.IsNull()) return 1;
1168// calcul des deux faces
1169 TopTools_IndexedDataMapOfShapeListOfShape lface;
1170 TopExp::MapShapesAndAncestors(shape,TopAbs_EDGE,TopAbs_FACE,lface);
1171 const TopTools_ListOfShape& lfac = lface.FindFromKey(edge);
1172
1173 Standard_Integer nelem= lfac.Extent();
1174 if(nelem!=2) return 1;
1175 TopTools_ListIteratorOfListOfShape It;
1176 It.Initialize(lfac);
1177 face1=TopoDS::Face(It.Value());
1178 It.Next();
1179 face2=TopoDS::Face(It.Value());
1180
1181// calcul des deux pcurves
1182 const Handle(Geom2d_Curve) c1 = BRep_Tool::CurveOnSurface
1183 (TopoDS::Edge(edge),face1,f1,l1);
1184 if (c1.IsNull()) return 1;
1185 const Handle(Geom2d_Curve) c2 = BRep_Tool::CurveOnSurface
1186 (TopoDS::Edge(edge),face2,f2,l2);
1187 if (c2.IsNull()) return 1;
1188
1189 Handle(Geom2d_Curve) curv1= new Geom2d_TrimmedCurve(c1,f1,l1);
1190
1191 Handle(Geom2d_Curve) curv2= new Geom2d_TrimmedCurve(c2,f2,l2);
1192
1193// calcul des deux surfaces
1194 TopLoc_Location L1,L2;
1195 TopoDS_Face aLocalFace = face1;
1196 const Handle(Geom_Surface)& s1 = BRep_Tool::Surface(aLocalFace,L1);
1197// const Handle(Geom_Surface)& s1 =
1198// BRep_Tool::Surface(TopoDS::Face(face1),L1);
1199 if (s1.IsNull()) return 1;
1200 aLocalFace = face2;
1201 const Handle(Geom_Surface)& s2 = BRep_Tool::Surface(aLocalFace,L2);
1202// const Handle(Geom_Surface)& s2 =
1203// BRep_Tool::Surface(TopoDS::Face(face2),L2);
1204 if (s2.IsNull()) return 1;
1205
1206
1207 Handle(Geom_Surface) surf1 = Handle(Geom_Surface)::
1208 DownCast(s1->Transformed(L1.Transformation()));
1209 if (surf1.IsNull()) return 1;
1210 Handle(Geom_Surface) surf2 = Handle(Geom_Surface)::
1211 DownCast(s2->Transformed(L2.Transformation()));
1212 if (surf2.IsNull()) return 1;
1213
1214
1215
1216 nbeval = (Standard_Integer ) Draw::Atof( a[3]);
1217
1218 switch(n)
1219 { case 6 : epsC0 = Draw::Atof(a[5]);
1220 case 5 : epsnl = Draw::Atof(a[4]);
1221 case 4 : {} break;
1222 default : return 1;
1223 }
1224
1225
1226 Standard_Real pard1, parf1, U, Uf, deltaU, nb = 0;
1227 Standard_Boolean isconti = Standard_True;
1228 Standard_Boolean isdone = Standard_True;
1229 pard1 = curv1->FirstParameter();
1230 parf1 = curv1->LastParameter();
1231 Standard_Real MaxG0Value=0;
1232 U = Min( pard1,parf1);
1233 Uf = Max (pard1,parf1);
1234
1235 deltaU = Abs(parf1- pard1)/nbeval;
1236 ISG0=Standard_True;
1237 do
1238 { if ( nb == nbeval)
1239 { LocalAnalysis_SurfaceContinuity res (curv1, curv2, Uf,surf1, surf2, GeomAbs_C0,epsnl,epsC0, epsC1, epsC2, epsG1,percent,maxlen );
1240 isdone = res.IsDone();
1241 if ( isdone) { isconti = res.IsC0( );
1242 if (isconti)
1243 if (res.C0Value()>MaxG0Value) MaxG0Value= res.C0Value();}
1244 else isconti = Standard_False;}
1245
1246 else {LocalAnalysis_SurfaceContinuity res (curv1, curv2, (U+nb*deltaU), surf1, surf2, GeomAbs_C0,epsnl,epsC0, epsC1, epsC2, epsG1, percent,maxlen );
1247 isdone = res.IsDone();
1248 if ( isdone) { isconti = res.IsC0() ;
1249 if ( nb == 0) { MaxG0Value = res.C0Value();}
1250 if (res.C0Value()> MaxG0Value) MaxG0Value = res.C0Value();}
1251
1252 else isconti = Standard_False;}
1253
1254 nb++;
1255 if (!isconti) ISG0=Standard_False;
1256
1257 }
1258 while ((nb<nbeval)&& isdone );
1259
1260 //f (!isdone) { cout<<" Problem in computation "<<endl; return 1;}
1261 //if (ISG0)
1262 // {cout<<" the continuity is G0 "<<endl;}
1263
1264 //else { cout<<" the continuity is not G0 "<<endl;}
1265 //cout<<"MaxG0Value :"<< MaxG0Value << endl;
1266 if (!isdone) { di<<" Problem in computation "<<"\n"; return 1;}
1267 if (ISG0)
1268 {di<<" the continuity is G0 "<<"\n";}
1269
1270 else { di<<" the continuity is not G0 "<<"\n";}
1271 di<<"MaxG0Value :"<< MaxG0Value << "\n";
1272 return 0;
1273}
1274/*****************************************************************************************/
1275static Standard_Integer shapeG2continuity (Draw_Interpretor& di, Standard_Integer n, const char** a)
1276
1277{ Standard_Real epsnl,epsC0, epsC1, epsC2, epsG1, percent,maxlen;
1278 Standard_Boolean ISG2=Standard_True;
1279 Standard_Integer nbeval;
1280 Standard_Real MaxG0Value=0,MaxG1Angle=0,MaxG2Curvature=0;
1281 InitEpsSurf(epsnl,epsC0, epsC1, epsC2, epsG1,percent,maxlen );
1282
1283 if (n<4) return 1;
1284 TopoDS_Face face1,face2;
1285 Standard_Real f1,f2,l1,l2;
1286 TopoDS_Shape shape = DBRep::Get(a[1],TopAbs_SHAPE);
1287 if (shape.IsNull()) return 1;
1288 TopoDS_Shape edge = DBRep::Get(a[2],TopAbs_EDGE);
1289 if (edge.IsNull()) return 1;
1290// calcul des deux faces
1291 TopTools_IndexedDataMapOfShapeListOfShape lface;
1292 TopExp::MapShapesAndAncestors(shape,TopAbs_EDGE,TopAbs_FACE,lface);
1293 const TopTools_ListOfShape& lfac = lface.FindFromKey(edge);
1294
1295 Standard_Integer nelem= lfac.Extent();
1296 if(nelem!=2) return 1;
1297 TopTools_ListIteratorOfListOfShape It;
1298 It.Initialize(lfac);
1299 face1=TopoDS::Face(It.Value());
1300 It.Next();
1301 face2=TopoDS::Face(It.Value());
1302// calcul des deux pcurves
1303 const Handle(Geom2d_Curve) c1 = BRep_Tool::CurveOnSurface
1304 (TopoDS::Edge(edge),face1,f1,l1);
1305 if (c1.IsNull()) return 1;
1306 const Handle(Geom2d_Curve) c2 = BRep_Tool::CurveOnSurface
1307 (TopoDS::Edge(edge),face2,f2,l2);
1308 if (c2.IsNull()) return 1;
1309
1310 Handle(Geom2d_Curve) curv1= new Geom2d_TrimmedCurve(c1,f1,l1);
1311
1312 Handle(Geom2d_Curve) curv2= new Geom2d_TrimmedCurve(c2,f2,l2);
1313
1314// calcul des deux surfaces
1315 TopLoc_Location L1,L2;
1316 TopoDS_Face aLocalFace = face1;
1317 const Handle(Geom_Surface)& s1 = BRep_Tool::Surface(aLocalFace,L1);
1318// const Handle(Geom_Surface)& s1 =
1319// BRep_Tool::Surface(TopoDS::Face(face1),L1);
1320 if (s1.IsNull()) return 1;
1321 aLocalFace = face2;
1322 const Handle(Geom_Surface)& s2 = BRep_Tool::Surface(aLocalFace,L2);
1323// const Handle(Geom_Surface)& s2 =
1324// BRep_Tool::Surface(TopoDS::Face(face2),L2);
1325 if (s2.IsNull()) return 1;
1326
1327
1328 Handle(Geom_Surface) surf1 = Handle(Geom_Surface)::
1329 DownCast(s1->Transformed(L1.Transformation()));
1330 if (surf1.IsNull()) return 1;
1331 Handle(Geom_Surface) surf2 = Handle(Geom_Surface)::
1332 DownCast(s2->Transformed(L2.Transformation()));
1333 if (surf2.IsNull()) return 1;
1334
1335
1336
1337 nbeval = (Standard_Integer ) Draw::Atof( a[3]);
1338
1339 switch(n)
1340 {
1341 case 9 : maxlen = Draw::Atof(a[8]);
1342 case 8 : percent = Draw::Atof(a[7]);
1343 case 7 : epsG1 = Draw::Atof(a[6]);
1344 case 6 : epsC0 = Draw::Atof(a[5]);
1345 case 5 : epsnl = Draw::Atof(a[4]);
1346 case 4 : {} break;
1347 default : return 1;
1348 }
1349
1350
1351 Standard_Real pard1, parf1, U, Uf, deltaU, nb = 0;
1352 Standard_Boolean isconti = Standard_True;
1353 Standard_Boolean isdone = Standard_True;
1354 pard1 = curv1->FirstParameter();
1355 parf1 = curv1->LastParameter();
1356 U = Min( pard1,parf1);
1357 Uf = Max (pard1,parf1);
1358
1359 deltaU = Abs(parf1- pard1)/nbeval;
1360
1361 do
1362 { if ( nb == nbeval)
1363 { LocalAnalysis_SurfaceContinuity res (curv1, curv2, Uf,surf1, surf2, GeomAbs_G2,epsnl,epsC0, epsC1, epsC2, epsG1,percent,maxlen );
1364 isdone = res.IsDone();
1365 if (isdone){isconti = res.IsG2();
1366 if (isconti)
1367 {if(res.C0Value()>MaxG0Value) MaxG0Value=res.C0Value();
1368 if(res.G1Angle()>MaxG1Angle) MaxG1Angle=res.G1Angle();
1369 if(res.G2CurvatureGap()>MaxG2Curvature)
1370 MaxG2Curvature=res.G2CurvatureGap();
1371 }}
1372 else isconti = Standard_False;}
1373
1374 else { LocalAnalysis_SurfaceContinuity res (curv1, curv2, (U+nb*deltaU), surf1,surf2, GeomAbs_G2,epsnl,epsC0, epsC1, epsC2, epsG1,percent,maxlen );
1375 isdone = res.IsDone();
1376 if ( isdone) {isconti = res.IsG2();
1377 if (nb==0){MaxG0Value=res.C0Value();
1378 MaxG1Angle=res.G1Angle();
1379 MaxG2Curvature=res.G2CurvatureGap();}
1380 if(res.C0Value()>MaxG0Value)
1381 MaxG0Value=res.C0Value();
1382 if(res.G1Angle()>MaxG1Angle)
1383 MaxG1Angle=res.G1Angle();
1384 if(res.G2CurvatureGap()>MaxG2Curvature)
1385 MaxG2Curvature=res.G2CurvatureGap();}
1386 else isconti = Standard_False;}
1387
1388 nb++;
1389 if (!isconti) ISG2=Standard_False;
1390
1391 }
1392 while ((nb<nbeval)&& isdone );
1393
1394 //if (!isdone) { cout<<" Problem in computation "<<endl; return 1;}
1395 //if (ISG2)
1396 //cout<<" the continuity is G2 "<<endl;
1397 //else cout<<" the continuity is not G2 "<<endl;
1398 //cout<<"MaxG0Value :"<< MaxG0Value << endl;
1399 //cout<<"MaxG1Angle:"<< MaxG1Angle << endl;
1400 //cout<<"MaxG2Curvature:"<<MaxG2Curvature<<endl;
1401 if (!isdone) { di<<" Problem in computation "<<"\n"; return 1;}
1402 if (ISG2)
1403 di<<" the continuity is G2 "<<"\n";
1404 else di<<" the continuity is not G2 "<<"\n";
1405 di<<"MaxG0Value :"<< MaxG0Value << "\n";
1406 di<<"MaxG1Angle:"<< MaxG1Angle << "\n";
1407 di<<"MaxG2Curvature:"<<MaxG2Curvature<<"\n";
1408 return 0;
1409}
1410
1411
1412//=======================================================================
1413//function : clintedge
1414//purpose :
1415//=======================================================================
1416static Standard_Integer clintedge(Draw_Interpretor& di,
1417 Standard_Integer narg, const char** a)
1418{
1419 char newname[255];
1420
1421 if (narg < 2) {
1422 //cout << "Usage: clintedge shape" << endl;
1423 di << "Usage: clintedge shape" << "\n";
1424 return 1;
1425 }
1426 TopoDS_Shape S = DBRep::Get(a[1]);
1427
1428 TopTools_DataMapOfShapeListOfShape mymap;
1429 TopOpeBRepTool_PurgeInternalEdges mypurgealgo(S);
1430 Standard_Integer nbedges = mypurgealgo.NbEdges();
1431 if (nbedges > 0)
1432 {
1433 //cout<<nbedges<<" internal (or external) edges to be removed"<<endl;
1434 di<<nbedges<<" internal (or external) edges to be removed"<<"\n";
1435
1436 Standard_Integer i = 1;
1437 char* temp = newname;
1438
1439 Sprintf(newname,"%s_%d",a[1],i);
1440 DBRep::Set(temp,mypurgealgo.Shape());
1441 //cout<<newname<<" ";
1442 di<<newname<<" ";
1443
1444 //cout<<endl;
1445 di<<"\n";
1446 }
1447 else
1448 di << "no internal (or external) edges"<<"\n";
1449 //cout << "no internal (or external) edges"<<endl;
1450
1451 return 0;
1452}
1453
1454
1455//=======================================================================
1456//function : facintedge
1457//purpose :
1458//=======================================================================
1459static Standard_Integer facintedge(Draw_Interpretor& di,
1460 Standard_Integer narg, const char** a)
1461{
1462 char newname[255];
1463
1464 if (narg < 2) {
1465 //cout << "Usage: facintedge shape" << endl;
1466 di << "Usage: facintedge shape" << "\n";
1467 return 1;
1468 }
1469 TopoDS_Shape S = DBRep::Get(a[1]);
1470
1471 TopTools_DataMapOfShapeListOfShape mymap;
1472 TopOpeBRepTool_PurgeInternalEdges mypurgealgo(S);
1473 mypurgealgo.Faces(mymap);
1474
1475 Standard_Integer i = 1;
1476 char* temp = newname;
1477
1478 TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itFacEdg;
1479 for (itFacEdg.Initialize(mymap); itFacEdg.More(); itFacEdg.Next()) {
1480 Sprintf(newname,"%s_%d",a[1],i);
1481 DBRep::Set(temp,itFacEdg.Key());
1482 //cout<<newname<<" ";
1483 di<<newname<<" ";
1484 i++;
1485 }
1486
1487 //cout<<endl;
1488 di<<"\n";
1489
1490 return 0;
1491}
1492
1493//=======================================================================
1494//function : fuseedge
1495//purpose :
1496//=======================================================================
1497static Standard_Integer fuseedge(Draw_Interpretor& di,
1498 Standard_Integer narg, const char** a)
1499{
1500 char newname[255];
1501
1502 if (narg < 2) {
1503 //cout << "Usage: fuseedge shape" << endl;
1504 di << "Usage: fuseedge shape" << "\n";
1505 return 1;
1506 }
1507 TopoDS_Shape S = DBRep::Get(a[1]);
1508
1509 TopTools_DataMapOfIntegerListOfShape mymap;
1510 //TopOpeBRepTool_FuseEdges myfusealgo(S);
1511 BRepLib_FuseEdges myfusealgo(S);
1512 myfusealgo.SetConcatBSpl();
1513 Standard_Integer nbvertices;
1514 nbvertices = myfusealgo.NbVertices();
1515
1516 if (nbvertices > 0) {
1517
1518 //cout<<nbvertices<<" vertices to be removed"<<endl;
1519 di<<nbvertices<<" vertices to be removed"<<"\n";
1520
1521 Standard_Integer i = 1;
1522 char* temp = newname;
1523
1524 Sprintf(newname,"%s_%d",a[1],i);
1525 DBRep::Set(temp,myfusealgo.Shape());
1526 //cout<<newname<<" ";
1527 di<<newname<<" ";
1528
1529 //cout<<endl;
1530 di<<"\n";
1531 }
1532 else
1533 di << "no vertices to remove"<<"\n";
1534 //cout << "no vertices to remove"<<endl;
1535
1536 return 0;
1537}
1538
1539
1540//=======================================================================
1541//function : listfuseedge
1542//purpose :
1543//=======================================================================
1544static Standard_Integer listfuseedge(Draw_Interpretor& di,
1545 Standard_Integer narg, const char** a)
1546{
1547 char newname[255];
1548
1549 if (narg < 2) {
1550 //cout << "Usage: listfuseedge shape" << endl;
1551 di << "Usage: listfuseedge shape" << "\n";
1552 return 1;
1553 }
1554 TopoDS_Shape S = DBRep::Get(a[1]);
1555
1556 TopTools_DataMapOfIntegerListOfShape mymap;
1557 BRepLib_FuseEdges myfusealgo(S);
1558 myfusealgo.Edges(mymap);
1559
1560 Standard_Integer i;
1561 char* temp = newname;
1562
1563 TopTools_DataMapIteratorOfDataMapOfIntegerListOfShape itLstEdg;
1564 for (itLstEdg.Initialize(mymap); itLstEdg.More(); itLstEdg.Next()) {
1565 const Standard_Integer& iLst = itLstEdg.Key();
1566 const TopTools_ListOfShape& LmapEdg = mymap.Find(iLst);
1567 TopTools_ListIteratorOfListOfShape itEdg;
1568 i = 1;
1569 for (itEdg.Initialize(LmapEdg); itEdg.More(); itEdg.Next()) {
1570 Sprintf(newname,"%s_%d_%d",a[1],iLst,i);
1571 DBRep::Set(temp,itEdg.Value());
1572 //cout<<newname<<" ";
1573 di<<newname<<" ";
1574 i++;
1575 }
1576
1577 }
1578
1579 //cout<<endl;
1580 di<<"\n";
1581
1582 return 0;
1583}
1584
1585
1586
1587//=======================================================================
1588//function : CheckCommands
1589//purpose :
1590//=======================================================================
1591
1592void BRepTest::CheckCommands(Draw_Interpretor& theCommands)
1593{
1594 static Standard_Boolean done = Standard_False;
1595 if (done) return;
1596 done = Standard_True;
1597
1598 BRepTest_CheckCommands_SetFaultyName("faulty_");
1599 DBRep::BasicCommands(theCommands);
1600
1601 const char* g = "TOPOLOGY Check commands";
1602
1603// Modified by skv - Tue Apr 27 13:35:35 2004 Begin
1604 theCommands.Add("checkshape",
1605 "checkshape : no args to have help",
1606 __FILE__,
1607 checkshape,
1608 g);
1609// theCommands.Add("checkshape",
1610// "checks the validity of a shape : checkshape name,\n short description of check : checkshape name -short",
1611// __FILE__,
1612// CHK,
1613// g);
1614// theCommands.Add("checktopshape",
1615// "checks the topological validity of a shape : checktopshape name",
1616// __FILE__,
1617// CHK,
1618// g);
1619// Modified by skv - Tue Apr 27 13:35:39 2004 End
1620
1621 theCommands.Add("checksection",
1622 "checks the closure of a section : checksection name",
1623 __FILE__,
1624 checksection,
1625 g);
1626
1627 theCommands.Add("checkdiff",
1628 "checks the validity of the diff beetween the shapes arg1..argn and result :\n checkdiff arg1 [arg2..argn] result [closedSolid (1/0)] [geomCtrl (1/0)]",
1629 __FILE__,
1630 checkdiff,
1631 g);
1632
1633g = "TOPOLOGY Analysis of shapes ";
1634
1635theCommands.Add("shapeG0continuity",
1636 "shapeG0continuity shape edge nbeval [epsnul [epsG0]]",
1637 __FILE__,
1638 shapeG0continuity, g);
1639
1640theCommands.Add("shapeG1continuity",
1641 "shapeG1continuity shape edge nbeval [epsnul [epsG0 [epsG1]]]",
1642 __FILE__,
1643 shapeG1continuity ,g);
1644theCommands.Add("shapeG2continuity",
1645 "shapeG2continuity shape edge nbeval [epsnul [epsG0 [epsG1 [maxlen [perce]]]]]",
1646 __FILE__,
1647 shapeG2continuity,g);
1648
1649theCommands.Add("computetolerance",
1650 "computetolerance shape",
1651 __FILE__,
1652 computetolerance,g);
1653
1654theCommands.Add("clintedge",
1655 "clintedge shape",
1656 __FILE__,
1657 clintedge,g);
1658
1659theCommands.Add("facintedge",
1660 "facintedge shape",
1661 __FILE__,
1662 facintedge,g);
1663
1664theCommands.Add("fuseedge",
1665 "fuseedge shape",
1666 __FILE__,
1667 fuseedge,g);
1668
1669theCommands.Add("listfuseedge",
1670 "listfuseedge shape",
1671 __FILE__,
1672 listfuseedge,g);
1673}
1674