0023533: Unitialized variables used, IntTools_TopolTool.cxx
[occt.git] / src / QABugs / QABugs_3.cxx
CommitLineData
b311480e 1// Created on: 2002-06-17
2// Created by: QA Admin
3// Copyright (c) 2002-2012 OPEN CASCADE SAS
4//
5// The content of this file is subject to the Open CASCADE Technology Public
6// License Version 6.5 (the "License"). You may not use the content of this file
7// except in compliance with the License. Please obtain a copy of the License
8// at http://www.opencascade.org and read it completely before using this file.
9//
10// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12//
13// The Original Code and all software distributed under the License is
14// distributed on an "AS IS" basis, without warranty of any kind, and the
15// Initial Developer hereby disclaims all such warranties, including without
16// limitation, any warranties of merchantability, fitness for a particular
17// purpose or non-infringement. Please see the License for the specific terms
18// and conditions governing the rights and limitations under the License.
19
7fd59977 20
1cd84fee 21#include <QABugs.hxx>
7fd59977 22#ifdef HAVE_CONFIG_H
23#include <config.h>
24#endif
91322f44 25#include <Draw.hxx>
26#include <Draw_Interpretor.hxx>
27#include <TopLoc_Location.hxx>
28#include <TopoDS_Face.hxx>
29#include <TopoDS.hxx>
30#include <DBRep.hxx>
31#include <Geom_Surface.hxx>
32#include <BRep_Tool.hxx>
33#include <GeomInt_IntSS.hxx>
34#include <BRepBuilderAPI_MakeEdge.hxx>
7fd59977 35#include <Standard_ErrorHandler.hxx>
91322f44 36#include <tcl.h>
7fd59977 37
38static int BUC60623(Draw_Interpretor& di, Standard_Integer argc, const char ** a)
39{
40 if(argc!=4)
41 {
42 di << "Usage : " << a[0] << " result Shape1 Shape2" << "\n";
43 return -1;
44 }
45
46 TopLoc_Location L1;
47 TopLoc_Location L2;
48 TopoDS_Face F1 = TopoDS::Face(DBRep::Get(a[2],TopAbs_FACE));
49 TopoDS_Face F2 = TopoDS::Face(DBRep::Get(a[3],TopAbs_FACE));
50 Handle(Geom_Surface) GSF1 = BRep_Tool::Surface(F1, L1);
51 Handle(Geom_Surface) GSF2 = BRep_Tool::Surface(F2, L2);
52 GeomInt_IntSS Inter;
53 Inter.Perform(GSF1,GSF2, BRep_Tool::Tolerance(F1));
54 if (!Inter.IsDone()) {
55 di << "Intersection not done" << "\n";
56 return 1;
57 }
58 Standard_Integer nbsol = Inter.NbLines();
59 if(!nbsol) {
60 di << "The number of solutions is zero!" << "\n";
61 return 0;
62 }
63 Handle(Geom_Curve) Sol = Inter.Line(1);
64 if(!Sol.IsNull()) {
65 DBRep::Set(a[1], BRepBuilderAPI_MakeEdge(Sol));
66 return 0;
67 } else di << "The first solution is Null!" << "\n";
68
69 di << "fini" << "\n";
70 return 0;
71}
72
73#include<ViewerTest.hxx>
74#include<AIS_InteractiveContext.hxx>
75#include<AIS_Shape.hxx>
76
77static int BUC60569(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
78{
79 if(argc!=2)
80 {
81 di << "Usage : " << argv[0] << " shape" << "\n";
82 return -1;
83 }
84
85 Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
86 if(myAISContext.IsNull()) {
87 di << "use 'vinit' command before " << argv[0] << "\n";
88 return -1;
89 }
90
91 TopoDS_Shape theShape = DBRep::Get(argv[1]);
92
93 Handle(AIS_Shape) anAISShape = new AIS_Shape( theShape );
94 myAISContext->Display( anAISShape, Standard_True );
95 myAISContext->OpenLocalContext();
96 myAISContext->ActivateStandardMode(TopAbs_FACE);
97 return 0;
98}
99
100static int BUC60614(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
101{
102 if(argc!=2)
103 {
104 di << "Usage : "<< argv[0] << " shape" << "\n";
105 return -1;
106 }
107
108 // di.Eval("vinit");
109
110 TopoDS_Shape theShape = DBRep::Get(argv[1]);
111
112// ViewerTest::GetAISContext();
113 Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
114 if(myAISContext.IsNull()) {
115 di << "use 'vinit' command before " << argv[0] << "\n";
116 return -1;
117 }
118 Handle(AIS_Shape) anAISShape = new AIS_Shape( theShape );
119 myAISContext->Display( anAISShape, Standard_True );
120 myAISContext->OpenLocalContext();
121 myAISContext->ActivateStandardMode(TopAbs_COMPOUND);
122// myAISContext->ActivateStandardMode(TopAbs_SOLID);
123// di.Eval("vfit");
124// cout << "vfini" << endl;
125 return 0;
126}
127
128#include<BRep_Builder.hxx>
129#include<BRepTools_ShapeSet.hxx>
130#include<BRepTools.hxx>
131#include<BRepAdaptor_HSurface.hxx>
132#include<TopOpeBRep_PointClassifier.hxx>
133#include<Precision.hxx>
134#ifdef WNT
135#include<stdio.h>
136#endif
137
138static int BUC60609(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
7fd59977 139 gp_Pnt2d uvSurf;
7fd59977 140 TopAbs_State state;
141
ceeaafcb 142 if (argc == 3) {
143 // BUC60609 shape name
144 } else if ( argc == 5 ) {
145 // BUC60609 shape name U V
146 } else {
147 di << "Usage : "<< argv[0] << " shape name [U V]" << "\n";
7fd59977 148 return(-1);
149 }
7fd59977 150
f1e162f2 151 TCollection_AsciiString aFilePath(argv[1]);
7fd59977 152
153 filebuf fic;
154 istream in(&fic);
f1e162f2 155 if (!fic.open(aFilePath.ToCString(),ios::in)) {
156 di << "Cannot open file for reading : " << aFilePath << "\n";
7fd59977 157 return(-1);
158 }
159
160 TopoDS_Shape theShape;
161 char typ[255];
162 in >> typ;
163 if (!in.fail()) {
164 if( !strcmp(typ, "DBRep_DrawableShape") ){
165 BRep_Builder B;
166 BRepTools_ShapeSet S(B);
167 S.Read(in);
168 S.Read(theShape,in);
169 }else{
f1e162f2 170 di << "Wrong entity type in " << aFilePath << "\n";
7fd59977 171 return(-1);
172 }
173 }
174
175 const TopoDS_Face &face = TopoDS::Face (theShape);
176
177 if(argc > 2){
178 DBRep::Set(argv[2],face);
179 }
180
7fd59977 181 Standard_Real faceUMin,faceUMax,faceVMin,faceVMax;
182
183 BRepTools::UVBounds (face, faceUMin,faceUMax,faceVMin,faceVMax);
184
185 di << "The bounds of the trimmed face:" << "\n";
186 di << faceUMin << " <= U <= " << faceUMax << "\n";
187 di << faceVMin << " <= V <= " << faceVMax << "\n";
188
189 Handle(BRepAdaptor_HSurface) hsurfa = new BRepAdaptor_HSurface(face);
190
191 TopOpeBRep_PointClassifier PClass;
192
193 di << "Now test the point classifier by inputting U,V values" << "\n";
194 di << "inside or outside the bounds displayed above" << "\n";
195 di << "Type stop to exit" << "\n";
196
197 // Please register this:
198 // ***********************************************
199 // Note also that for periodic surfaces such as nimpod_1.topo,
200 // the U/V values may be +- 2pi compared to the actual face bounds
201 // (because U,V is probably coming from a Geom package routine).
202 // Hence IT WOULD BE USEFUL IF TopOpeBRep_PointClassifier COULD
203 // COPE WITH PERIODIC SURFACES, i.e. U,V +-Period giving same result.
204 // *************************************************
7fd59977 205
ceeaafcb 206 if (argc == 3) {
207 uvSurf = gp_Pnt2d(0.14,5.1);
208 state = PClass.Classify(face,uvSurf,Precision::PConfusion());
209 if(state == TopAbs_IN || state == TopAbs_ON){
210 di << "U=" << 0.14 << " V=" << 5.1 << " classified INSIDE" << "\n";
211 }else{
212 di << "U=" << 0.14 << " V=" << 5.1 << " classified OUTSIDE" << "\n";
213 }
214
215 uvSurf = gp_Pnt2d(1.28,5.1);
216 state = PClass.Classify(face,uvSurf,Precision::PConfusion());
217 if(state == TopAbs_IN || state == TopAbs_ON){
218 di << "U=" << 1.28 << " V=" << 5.1 << " classified INSIDE" << "\n";
219 }else{
220 di << "U=" << 1.28 << " V=" << 5.1 << " classified OUTSIDE" << "\n";
221 }
222 } else {
91322f44 223 uvSurf = gp_Pnt2d(Draw::Atof(argv[3]),Draw::Atof(argv[4]));
ceeaafcb 224 state = PClass.Classify(face,uvSurf,Precision::PConfusion());
225 if(state == TopAbs_IN || state == TopAbs_ON){
91322f44 226 di << "U=" << Draw::Atof(argv[3]) << " V=" << Draw::Atof(argv[4]) << " classified INSIDE" << "\n";
ceeaafcb 227 }else{
91322f44 228 di << "U=" << Draw::Atof(argv[3]) << " V=" << Draw::Atof(argv[4]) << " classified OUTSIDE" << "\n";
7fd59977 229 }
230 }
231 return 0;
232}
233
ceeaafcb 234
7fd59977 235#if ! defined(WNT)
236void stringerror(int state)
237{
238 printf("%s",((state&ios::eofbit) !=0)? " [eof]": "");
239 printf("%s",((state&ios::failbit)!=0)? " [fail]":"");
240 printf("%s",((state&ios::badbit) !=0)? " [bad]": "");
241 printf("%s\n",(state==ios::goodbit)? " [ok]": "");
242}
243
244
245//#if defined(LIN)
246//#include <strstream>
247//#else
248//#include <strstream.h>
249//#endif
250#ifdef HAVE_IOSTREAM
251#include <iostream>
252#include <sstream>
253using namespace std;
254#elif defined (HAVE_IOSTREAM_H)
255#include <iostream.h>
256#include <strstream.h>
257#else
258#error "check config.h file or compilation options: either HAVE_IOSTREAM or HAVE_IOSTREAM_H should be defined"
259#endif
260static int UKI61075(Draw_Interpretor& /*di*/, Standard_Integer /*argc*/, const char ** /*argv*/) {
261 double da,db;
262 char buffer1[128];
263#ifndef USE_STL_STREAM
264 ostrstream stringout1(buffer1,sizeof(buffer1));
265 istrstream stringin1(buffer1,sizeof(buffer1));
266#else
267 ostringstream stringout1(buffer1);
268 istringstream stringin1(buffer1);
269#endif
270 char buffer2[128];
271#ifndef USE_STL_STREAM
272 ostrstream stringout2(buffer2,sizeof(buffer2));
273 istrstream stringin2(buffer2,sizeof(buffer2));
274#else
275 ostringstream stringout2(buffer1);
276 istringstream stringin2(buffer1);
277#endif
278
279 stringout1.precision(17);
280 stringout2.precision(17);
281
282 da=-(DBL_MAX);
283 db=DBL_MAX;
284 printf("Valeurs originales :\n\t%.17lg %.17lg\n",da,db);
285
286 stringout1<<da<<' '<<db<<"\n";
287#ifndef USE_STL_STREAM
288 buffer1[stringout1.pcount()]='\0';
289#else
290 buffer1[stringout1.str().length()]= '\0' ;
291#endif
292
293 printf("Valeurs ecrites dans le fichier :\n\t%s",buffer1);
294
295 da=db=0.;
296 stringin1>>da>>db;
297 printf("Valeurs relues :\n\t%.17lg %.17lg",da,db);
298 stringerror(stringin1.rdstate());
299
300 stringout2<<da<<' '<<db<<"\n";
301#ifndef USE_STL_STREAM
302 buffer2[stringout2.pcount()]='\0';
303#else
304 buffer2[stringout2.str().length()]='\0';
305#endif
306
307 printf("Valeurs reecrites :\n\t%s",buffer2);
308
309 da=db=0.;
310 stringin2>>da>>db;
311 printf("Valeurs relues a nouveau :\n\t%.17lg %.17lg",da,db);
312 stringerror(stringin2.rdstate());
313
314 return(0);
315}
316#endif
317
318#include<BRepAlgoAPI_Section.hxx>
319#include<BRepAlgo_Section.hxx>
320
321#include<Geom_Plane.hxx>
322#include<DrawTrSurf.hxx>
323
324//static Standard_CString St = " \"trimsphere\"/\"sphere\" [result] [name] [plane]";
325static Standard_CString St = " \"trimsphere\"/\"sphere\" [result] [name] [plane] [BRepAlgoAPI/BRepAlgo = 1/0]";
326
327static int BUC60585(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
328
329 //if(argc<2) {
330 // cerr << "Usage : " << argv[0] << St << endl;
331 // return -1;
332 //}
333 if(argc < 2 || argc > 6) {
334 di << "Usage : " << argv[0] << " shape1 shape2 shape3 shape4 shape5 shape6 [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
335 return 1;
336 }
337 Standard_Boolean IsBRepAlgoAPI = Standard_True;
338 if (argc == 6) {
91322f44 339 Standard_Integer IsB = Draw::Atoi(argv[5]);
7fd59977 340 if (IsB != 1) {
341 IsBRepAlgoAPI = Standard_False;
342#if ! defined(BRepAlgo_def04)
343// di << "Error: There is not BRepAlgo_Section class" << "\n";
344// return 1;
345#endif
346 }
347 }
348
349
350 gp_Dir N;
351 if(!strcmp(argv[1],"trimsphere")) {
352//////////////////////////////////////////
353// Uncomment for trimmed sphere bug:
354// filename = "trimsphere.topo";
355 N=gp_Dir( 0.0, -1.0, 0.0 );
356//////////////////////////////////////////
357 } else if(!strcmp(argv[1],"sphere")) {
358
359//////////////////////////////////////////
360// Uncomment for untrimmed sphere bug:
361
362// filename="sphere.topo";
363 N=gp_Dir( 0.0, -0.75103523489975432, -0.66026212668838646 );
364
365//////////////////////////////////////////
366 } else {
367 di << "Usage : " << argv[0] << St << "\n";
368 return -1;
369 }
370
371 // MKV 30.03.05
372#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
373 const Standard_Character *DD = Tcl_GetVar(di.Interp(),"Draw_DataDir",TCL_GLOBAL_ONLY);
374#else
375 Standard_Character *DD = Tcl_GetVar(di.Interp(),"Draw_DataDir",TCL_GLOBAL_ONLY);
376#endif
377
378 Standard_Character *filename = new Standard_Character [strlen(DD)+17];
91322f44 379 Sprintf(filename,"%s/%s.topo",DD,argv[1]);
7fd59977 380
381 filebuf fic;
382 istream in(&fic);
383 if (!fic.open(filename,ios::in)) {
384 di << "Cannot open file for reading : " << filename << "\n";
f1e162f2 385 delete [] filename;
7fd59977 386 return -1;
387 }
388
389 // Read in the shape
390
391 BRep_Builder B;
392 BRepTools_ShapeSet S(B);
393 S.Read(in);
394 TopoDS_Shape theShape;
395 S.Read(theShape,in);
396
397 // Create the plane
398
399 gp_Pnt O( 2036.25, -97.5, -1460.499755859375 );
400 gp_Dir A( 1.0, 0.0, 0.0 );
401
402 gp_Ax3 PLA( O, N, A );
403 gp_Pln Pl(PLA);
404
405 // Perform the section
406
407//#if ! defined(BRepAlgoAPI_def01)
408// BRepAlgoAPI_Section Sec( theShape, Pl, Standard_False);
409//#else
410// BRepAlgo_Section Sec( theShape, Pl, Standard_False);
411//#endif
412
413 TopoDS_Shape res;
414
415 try{
416 OCC_CATCH_SIGNALS
417// Sec.Approximation(Standard_True);
418
419 //Sec.Build();
420 //if(!Sec.IsDone()){
421 // cout << "Error performing intersection: not done." << endl;
422 // delete filename;
423 // return -1;
424 //}
425 //res = Sec.Shape();
426
427 if (IsBRepAlgoAPI) {
428 di << "BRepAlgoAPI_Section Sec( theShape, Pl, Standard_False)" <<"\n";
429 BRepAlgoAPI_Section Sec( theShape, Pl, Standard_False);
430 Sec.Build();
431 if(!Sec.IsDone()){
432 di << "Error performing intersection: not done." << "\n";
f1e162f2 433 delete [] filename;
7fd59977 434 return -1;
435 }
436 res = Sec.Shape();
437 } else {
438 di << "BRepAlgo_Section Sec( theShape, Pl, Standard_False)" <<"\n";
439 BRepAlgo_Section Sec( theShape, Pl, Standard_False);
440 Sec.Build();
441 if(!Sec.IsDone()){
442 di << "Error performing intersection: not done." << "\n";
f1e162f2 443 delete [] filename;
7fd59977 444 return -1;
445 }
446 res = Sec.Shape();
447 }
448
449 }catch(Standard_Failure){
450 Handle(Standard_Failure) error = Standard_Failure::Caught();
451 di << "Error performing intersection: not done." << "\n";
f1e162f2 452 delete [] filename;
7fd59977 453 return -1;
454 }
455
456 if(argc>3) DBRep::Set(argv[3],theShape);
457
458 if(argc>2) DBRep::Set(argv[2],res);
459
460 if(argc>4) {
461 Handle(Geom_Geometry) result;
462 Handle(Geom_Plane) C = new Geom_Plane(Pl);
463 result=C;
464 DrawTrSurf::Set(argv[4],result);
465 }
466
467 di << "Done" << "\n";
468
f1e162f2 469 delete [] filename;
7fd59977 470
471 return 0;
472}
473
474#include<TopoDS_Compound.hxx>
475
476static int BUC60547(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
477 if(argc!=2) {
478 di << "Usage : " << argv[0] << " name" << "\n";
479 return -1;
480 }
481
482 Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
483 if(myAISContext.IsNull()) {
484 di << "use 'vinit' command before " << argv[0] << "\n";
485 return -1;
486 }
487
488 // MKV 30.03.05
489#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
490 const Standard_Character *DD = Tcl_GetVar(di.Interp(),"Draw_DataDir",TCL_GLOBAL_ONLY);
491#else
492 Standard_Character *DD = Tcl_GetVar(di.Interp(),"Draw_DataDir",TCL_GLOBAL_ONLY);
493#endif
494
495 Standard_Character *Ch = new Standard_Character[strlen(argv[1])+3];
496
497 Standard_Character *FileName = new Standard_Character[strlen(DD)+13];
498
499 TopoDS_Shape free_1,free_2,free_3,free_4;
500 BRep_Builder B;
91322f44 501 Sprintf(FileName,"%s/%s",DD,"buc60547a.brep");
7fd59977 502 BRepTools::Read(free_1,FileName,B);
91322f44 503 Sprintf(FileName,"%s/%s",DD,"buc60547b.brep");
7fd59977 504 BRepTools::Read(free_2,FileName,B);
91322f44 505 Sprintf(FileName,"%s/%s",DD,"buc60547c.brep");
7fd59977 506 BRepTools::Read(free_3,FileName,B);
91322f44 507 Sprintf(FileName,"%s/%s",DD,"buc60547d.brep");
7fd59977 508 BRepTools::Read(free_4,FileName,B);
91322f44 509 Sprintf(Ch,"%s_%i",argv[1],1);
7fd59977 510 DBRep::Set(Ch,free_1);
511 di << Ch << " ";
91322f44 512 Sprintf(Ch,"%s_%i",argv[1],2);
7fd59977 513 DBRep::Set(Ch,free_2);
514 di << Ch << " ";
91322f44 515 Sprintf(Ch,"%s_%i",argv[1],3);
7fd59977 516 DBRep::Set(Ch,free_3);
517 di << Ch << " ";
91322f44 518 Sprintf(Ch,"%s_%i",argv[1],4);
7fd59977 519 DBRep::Set(Ch,free_4);
520 di << Ch << " ";
521
522// Handle(AIS_Shape) S1 = new AIS_Shape(free_1);
523// Handle(AIS_Shape) S2 = new AIS_Shape(free_2);
524// Handle(AIS_Shape) S3 = new AIS_Shape(free_3);
525// Handle(AIS_Shape) S4 = new AIS_Shape(free_4);
526
527// Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
528
529// myAISContext->Display(S1);
530// myAISContext->Display(S2);
531// myAISContext->Display(S3);
532// myAISContext->Display(S4);
533
534// di.Eval("vfit");
535
536 TopoDS_Compound Com;
537 BRep_Builder bui;
538 bui.MakeCompound(Com);
539 bui.Add(Com,free_1);
540 bui.Add(Com,free_2);
541 bui.Add(Com,free_3);
542 bui.Add(Com,free_4);
543
91322f44 544 Sprintf(Ch,"%s_%c",argv[1],'c');
7fd59977 545 DBRep::Set(Ch,Com);
546 di << Ch << " ";
547
548 Handle(AIS_Shape) SC = new AIS_Shape(Com);
549 myAISContext->Display(SC); // nothing on the screen If I save the compound :
550
91322f44 551 Sprintf(FileName,"%s/%s",DD,"free.brep");
7fd59977 552
553 BRepTools::Write(Com,FileName);
554
f1e162f2 555 delete [] Ch;
556 delete [] FileName;
7fd59977 557
558 return 0;
559}
560
561#include<BRepBuilderAPI_MakeVertex.hxx>
562#include<TCollection_ExtendedString.hxx>
563#include<AIS_LengthDimension.hxx>
564
565static Standard_Integer BUC60632(Draw_Interpretor& di, Standard_Integer /*n*/, const char ** a)
566{
567
568 Handle(AIS_InteractiveContext) myAIScontext = ViewerTest::GetAISContext();
569 if(myAIScontext.IsNull()) {
570 di << "use 'vinit' command before " << a[0] << "\n";
571 return -1;
572 }
573 myAIScontext->EraseAll();
574
575 TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(0,0,0));
576 TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(10,10,0));
577
578 Handle(AIS_Shape) Ve1 = new AIS_Shape(V1);
579 Handle(AIS_Shape) Ve2 = new AIS_Shape(V2);
580
581 myAIScontext->Display(Ve1);
582 myAIScontext->Display(Ve2);
583
584 Handle(Geom_Plane) Plane1 = new Geom_Plane(gp_Pnt(0,0,0),gp_Dir(0,0,1));
585 TCollection_ExtendedString Ext1("Dim1");
91322f44 586 Handle(AIS_LengthDimension) Dim1 = new AIS_LengthDimension(V1,V2,Plane1,Draw::Atof(a[2]),Ext1);
7fd59977 587
91322f44 588 myAIScontext->SetDisplayMode(Dim1, Draw::Atoi(a[1]));
7fd59977 589 myAIScontext->Display(Dim1);
590 return 0;
591}
592
593#include<TopoDS_Wire.hxx>
594
595static Standard_Integer BUC60652(Draw_Interpretor& di, Standard_Integer argc, const char ** argv )
596{
597 if(argc!=2) {
598 di << "Usage : BUC60652 fase" << "\n";
599 return 1;
600 }
601 TopoDS_Shape shape = DBRep::Get( argv[1] );
602 TopoDS_Face face = TopoDS::Face( shape );
603 TopoDS_Wire ow = BRepTools::OuterWire( face );
604 DBRep::Set( "w", ow );
605 return 0;
606}
607
608#include <BRepAlgo_BooleanOperations.hxx>
609
610static Standard_Integer defNbPntMax = 30;
611static Standard_Real defTol3d = 1.e-7;
612static Standard_Real defTol2d = 1.e-7;
613static Standard_Boolean defRelativeTol=Standard_True;
614Standard_Integer NbPntMax = defNbPntMax;
615Standard_Real Toler3d =defTol3d;
616Standard_Real Toler2d = defTol2d;
617Standard_Boolean RelativeTol= defRelativeTol;
618// //== // ksection : operateur section appelant BRepAlgo_BooleanOperation
619//== // ksection : operateur section appelant BRepAlgo_BooleanOperations
620//=======================================================================
621Standard_Integer ksection(Draw_Interpretor& di, Standard_Integer n, const char ** a) {
622 if (n < 8) {
623 di << "Usage : " << a[0] << " resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol" << "\n";
624 return -1;
625 }
626 // a[1]= resultat
627 // a[2]= shell1
628 // a[3]= shell2
629 // a[4]= NbPntMax
630 // a[5]= Toler3d
631 // a[6]= Toler2d
632 // a[7]= RelativeTol
633 TopoDS_Shape s1 = DBRep::Get(a[2],TopAbs_SHELL);
634 TopoDS_Shape s2 = DBRep::Get(a[3],TopAbs_SHELL);
635 if (s1.IsNull() || s2.IsNull()) return 1;
91322f44 636 NbPntMax=Draw::Atoi(a[4]);
637 Toler3d=Draw::Atof(a[5]);
638 Toler2d=Draw::Atof(a[6]);
639 RelativeTol=Draw::Atoi(a[7]);
7fd59977 640
641 di << "BRepAlgo_BooleanOperations myalgo" << "\n";
642 BRepAlgo_BooleanOperations myalgo;
643
644 myalgo.Shapes(s1, s2);
645 myalgo.SetApproxParameters(NbPntMax,Toler3d,Toler2d,RelativeTol);
646 TopoDS_Shape res; res = myalgo.Section();
647 DBRep::Set(a[1],res);
648 return 0;
649}
650
651#include <Geom_Axis2Placement.hxx>
652#include <AIS_Trihedron.hxx>
653
654static Standard_Integer BUC60574(Draw_Interpretor& di, Standard_Integer /*n*/, const char ** a)
655{
656
657 Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
658 if(myAISContext.IsNull()) {
659 di << "use 'vinit' command before " << a[0] << "\n";
660 return -1;
661 }
662
663 Handle(Geom_Axis2Placement) atrihedronAxis = new Geom_Axis2Placement(gp::XOY());
664 Handle(AIS_Trihedron) atri = new AIS_Trihedron(atrihedronAxis);
665 gp_Trsf aTrsf;
666 gp_Vec trans(5,5,5);
667 aTrsf.SetTranslation(trans);
668 TopLoc_Location aLoc(aTrsf);
669 myAISContext->SetLocation(atri,aLoc);
670 myAISContext->Display(atri,0,-1,Standard_True, Standard_True);
671 myAISContext->OpenLocalContext(Standard_False,
672 Standard_True,Standard_False,Standard_False);
673 myAISContext->Load(atri,3,Standard_True);
674
675 return 0;
676}
677
678#include <TopoDS_Solid.hxx>
679#include <BRepPrimAPI_MakeBox.hxx>
680#include <BRepPrimAPI_MakeSphere.hxx>
681
682#include <BRepAlgoAPI_Fuse.hxx>
683#include <BRepAlgo_Fuse.hxx>
684
685#include <V3d_Plane.hxx>
686#include <V3d_View.hxx>
687#include <gce_MakePln.hxx>
688
689static Standard_Integer BUC60698(Draw_Interpretor& di, Standard_Integer argc, const char ** a)
690{
691 if(argc > 2) {
692 di << "Usage : " << a[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
693 return 1;
694 }
695 Standard_Boolean IsBRepAlgoAPI = Standard_True;
696 if (argc == 2) {
91322f44 697 Standard_Integer IsB = Draw::Atoi(a[1]);
7fd59977 698 if (IsB != 1) {
699 IsBRepAlgoAPI = Standard_False;
700#if ! defined(BRepAlgo_def01)
701// di << "Error: There is not BRepAlgo_Fuse class" << "\n";
702// return 1;
703#endif
704 }
705 }
706
707 Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
708 if(myAISContext.IsNull()) {
709 di << "use 'vinit' command before " << a[0] << "\n";
710 return -1;
711 }
712 TopoDS_Solid box = BRepPrimAPI_MakeBox(1,1,1).Solid();
713 TopoDS_Shape sphere = BRepPrimAPI_MakeSphere(gp_Pnt(0.5,0.5,0.5),0.6).Shape();
714
715//#if ! defined(BRepAlgoAPI_def01)
716// TopoDS_Shape fuse = BRepAlgoAPI_Fuse(box,sphere).Shape();
717//#else
718// TopoDS_Shape fuse = BRepAlgo_Fuse(box,sphere).Shape();
719//#endif
720
721 TopoDS_Shape fuse;
722 if (IsBRepAlgoAPI) {
723 di << "fuse = BRepAlgoAPI_Fuse(box,sphere).Shape()" <<"\n";
724 fuse = BRepAlgoAPI_Fuse(box,sphere).Shape();
725 } else {
726 di << "fuse = BRepAlgo_Fuse(box,sphere).Shape()" <<"\n";
727 fuse = BRepAlgo_Fuse(box,sphere).Shape();
728 }
729
730 Handle_AIS_Shape theAISShape = new AIS_Shape(fuse);
731 myAISContext->Display(theAISShape);
732 di.Eval("vfit");
733 gp_Pln thegpPln = gce_MakePln(gp_Pnt(0.5,0.5,0.5),gp_Dir(0,0,1));
734 Standard_Real A,B,C,D;
735 thegpPln.Coefficients(A,B,C,D);
4952a30a 736 Handle_V3d_Plane thePlane = new V3d_Plane(A,B,C,D);
737 myAISContext->CurrentViewer()->AddPlane (thePlane); // add to defined planes list
7fd59977 738 for (myAISContext->CurrentViewer()->InitActiveViews();
739 myAISContext->CurrentViewer()->MoreActiveViews ();
740 myAISContext->CurrentViewer()->NextActiveViews ()) {
741 try {
742 OCC_CATCH_SIGNALS
743 myAISContext->CurrentViewer()->ActiveView()->SetPlaneOn(thePlane);
744 }
745 catch(Standard_Failure) {
746 di << "SetPlaneOn catched 1" << "\n";
747 }
748#ifdef WNT
749 catch(...) {
750 di << "SetPlaneOn catched 1" << "\n";
751 }
752#endif
753 }//ActiveView loop
754 for (myAISContext->CurrentViewer()->InitDefinedViews();
755 myAISContext->CurrentViewer()->MoreDefinedViews ();
756 myAISContext->CurrentViewer()->NextDefinedViews ()) {
757 try {
758 OCC_CATCH_SIGNALS
759 myAISContext->CurrentViewer()->DefinedView()->SetPlaneOn(thePlane);
760 }
761 catch(Standard_Failure) {
762 di << "SetPlaneOn catched 1" << "\n";
763 }
764#ifdef WNT
765 catch(...) {
766 di << "SetPlaneOn catched 2" << "\n";
767 }
768#endif
769 }//DefinedView loop
770 myAISContext->UpdateCurrentViewer();
771 myAISContext->OpenLocalContext();
772 myAISContext->ActivateStandardMode(TopAbs_FACE);
773 return 0;
774}
775
776static Standard_Integer BUC60699(Draw_Interpretor& di, Standard_Integer /*n*/, const char ** a)
777{
778
779 Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
780 if(myAISContext.IsNull()) {
781 di << "use 'vinit' command before " << a[0] << "\n";
782 return -1;
783 }
784 TopoDS_Solid B1 = BRepPrimAPI_MakeBox (1,1,1).Solid();
785 TopAbs_ShapeEnum theType = B1.ShapeType();
786 if ( theType == TopAbs_SOLID ) {
787 di << "It is a solid." << "\n";
788 } else {
789 di << "It is not solid." << "\n";
790 }
791 myAISContext->Display(new AIS_Shape(B1));
792 myAISContext->OpenLocalContext();
793 TopAbs_ShapeEnum amode = TopAbs_SOLID;
794 myAISContext->ActivateStandardMode(amode);
795 di.Eval("vfit");
796 di.Eval("QAMoveTo 200 200");
797 di.Eval("QASelect 200 200");
798 myAISContext->InitSelected() ;
799 if ( myAISContext->MoreSelected() ) {
800 if (myAISContext->HasSelectedShape() ) {
801 di << "has selected shape : OK" << "\n";
802 } else {
803 di << "has selected shape : bugged - Faulty " << "\n";
804 }
805 }
806 return 0;
807}
808
809static Standard_Integer GER61394(Draw_Interpretor& di, Standard_Integer argc, const char ** argv )
810{
811 if(argc > 2) {
812 di << "Usage : " << argv[0] << " [1/0]" << "\n";
813 return -1;
814 }
815
816 Handle(AIS_InteractiveContext) myAIScontext = ViewerTest::GetAISContext();
817 if(myAIScontext.IsNull()) {
818 di << "use 'vinit' command before " << argv[0] << "\n";
819 return -1;
820 }
821 Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
822
91322f44 823 if((argc == 2) && (Draw::Atof(argv[1]) == 0))
7fd59977 824 myV3dView->SetAntialiasingOff();
825 else
826 myV3dView->SetAntialiasingOn();
827 myV3dView->Update();
828 return 0;
829}
830
831
832#define DEFAULT_COLOR Quantity_NOC_GOLDENROD
833
834//=======================================================================
835//function : GetColorFromName
836//purpose : get the Quantity_NameOfColor from a string
837//=======================================================================
838
839static Quantity_NameOfColor GetColorFromName( const char *name )
840{
841 Quantity_NameOfColor ret = DEFAULT_COLOR;
842
843 Standard_Boolean Found = Standard_False;
844 Standard_CString colstring;
845 for(Standard_Integer i=0;i<=514 && !Found;i++)
846 {
847 colstring = Quantity_Color::StringName(Quantity_NameOfColor(i));
848 if (!strcasecmp(name,colstring)) {
849 ret = (Quantity_NameOfColor)i;
850 Found = Standard_True;
851 }
852 }
853
854 return ret;
855}
856
857static Standard_Integer setcolor (Draw_Interpretor& di,Standard_Integer argc, const char ** argv )
858{
859
860Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
861if(myAISContext.IsNull()) {
862 di << "use 'vinit' command before " << argv[0] << "\n";
863 return -1;
864 }
865
866Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
867
868switch (argc){
869
870 case 2:
871 {
872 di <<"case 2 : This command will change the background color to " << argv[1]<< "\n";
873// setcolor <name>
874// Change the background color of the view with a predefined name Graphic3d_NOC_<name>
875
876 myV3dView -> SetBackgroundColor(GetColorFromName(argv[1]));
877 myV3dView -> Redraw();
878 break;
879 }
880
881 case 3:
882 {
883 di <<"case 3 : This command will change the color of the objects to "<< argv[2]<< "\n";
884// setcolor <object> <name>
885// Change the object color with a predefined name
886
887 TopoDS_Shape aShape = DBRep::Get(argv[1]);
888 Handle(AIS_InteractiveObject) myShape = new AIS_Shape (aShape);
889 myAISContext->SetColor(myShape,GetColorFromName(argv[2]),Standard_True);
890 myAISContext->Display(myShape,Standard_True);
891 myAISContext->UpdateCurrentViewer();
892// return 0;
893 break;
894 }
895 case 4:
896 {
897 di <<"case 4 : This command will change the background color to <r> <g> <b> :"<< argv[1] << argv[2] << argv[3] << "\n";
898
899// setcolor <r> <g> <b>
900// Change the background color of the view with the color values <r>,<g>,<b>
901// A color value must be defined in the space [0.,1.]
902
91322f44 903 Standard_Real QuantityOfRed = Draw::Atoi(argv[1]);
904 Standard_Real QuantityOfGreen = Draw::Atoi(argv[2]);
905 Standard_Real QuantityOfBlue = Draw::Atoi(argv[3]);
7fd59977 906 myV3dView->SetBackgroundColor(Quantity_TOC_RGB,QuantityOfRed,QuantityOfGreen,QuantityOfBlue);
907 myV3dView->Redraw();
908 break;
909 }
910
911 case 5:
912 {
913 di <<"case 5 : This command will change the color of the objects to <r> <g> <b> : "<<argv[2]<< argv[3]<< argv[4]<< "\n";
914
915// setcolor <object> <r> <g> <b>
916// change the object color with RGB values.
917
918
91322f44 919 Standard_Real QuantityOfRed = Draw::Atof(argv[2]);
920 Standard_Real QuantityOfGreen = Draw::Atof(argv[3]);
921 Standard_Real QuantityOfBlue = Draw::Atof(argv[4]);
7fd59977 922
923 TopoDS_Shape aShape = DBRep::Get(argv[1]);
924 Handle(AIS_InteractiveObject) myShape = new AIS_Shape (aShape);
925 myAISContext->SetColor(myShape,Quantity_Color(QuantityOfRed,QuantityOfGreen,QuantityOfBlue,Quantity_TOC_RGB),Standard_True);
926 myAISContext->Display(myShape,Standard_True);
927 myAISContext->UpdateCurrentViewer();
928// myShape->SetColor(Quantity_Color(QuantityOfRed,QuantityOfGreen,QuantityOfBlue,Quantity_TOC_RGB));
929// myShape->Redisplay();
930 break;
931 }
932 }
933return 0;
934}
935
936static Standard_Integer BUC60726 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv )
937{
938 Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
939 if(myAISContext.IsNull()) {
940 di << "use 'vinit' command before " << argv[0] << "\n";
941 return -1;
942 }
943
944 if(argc != 2) {
945 di << "Usage : " << argv[0] << " 0/1" << "\n";
946 }
947
91322f44 948 if(Draw::Atoi(argv[1]) == 0) {
7fd59977 949 myAISContext->CloseAllContexts();
950 BRepPrimAPI_MakeBox B(gp_Pnt(-400.,-400.,-100.),200.,150.,100.);
951 Handle(AIS_Shape) aBox = new AIS_Shape(B.Shape());
952 myAISContext->Display(aBox);
91322f44 953 } else if(Draw::Atoi(argv[1]) == 1) {
7fd59977 954 myAISContext->CloseAllContexts();
955 myAISContext->OpenLocalContext();
956 myAISContext->ActivateStandardMode(TopAbs_EDGE);
91322f44 957 } else if(Draw::Atoi(argv[1]) == 2) {
7fd59977 958 myAISContext->CloseAllContexts();
959 myAISContext->OpenLocalContext();
960 myAISContext->ActivateStandardMode(TopAbs_FACE);
961 } else {
962 di << "Usage : " << argv[0] << " 0/1" << "\n";
963 return -1;
964 }
965
966 return 0;
967}
968
969#include <BRepBndLib.hxx>
970#include <Bnd_HArray1OfBox.hxx>
971
972static Standard_Integer BUC60729 (Draw_Interpretor& di,Standard_Integer /*argc*/, const char ** /*argv*/ )
973{
974 Bnd_Box aMainBox;
975 TopoDS_Shape aShape = BRepPrimAPI_MakeBox(1,1,1).Solid();
976
977 BRepBndLib::Add(aShape , aMainBox );
978
979 Standard_Integer siMaxNbrBox = 6;
980 Bnd_BoundSortBox m_BoundSortBox;
981 m_BoundSortBox.Initialize( aMainBox, siMaxNbrBox );
982 TopExp_Explorer aExplorer(aShape,TopAbs_FACE);
983 Standard_Integer i;
984
985
986// Bnd_Box __emptyBox; // Box is void !
987// Handle_Bnd_HArray1OfBox __aSetOfBox = new Bnd_HArray1OfBox( 1, siMaxNbrBox, __emptyBox );
988
989 for (i=1,aExplorer.ReInit(); aExplorer.More(); aExplorer.Next(),i++ )
990 {
991 const TopoDS_Shape& aFace = aExplorer.Current();
992 Bnd_Box aBox;
993 BRepBndLib::Add( aFace, aBox );
994 m_BoundSortBox.Add( aBox, i );
995// __aSetOfBox->SetValue( i, aBox );
996 }
997// m_BoundSortBox.Initialize( aMainBox, siMaxNbrBox );
998
999 return 0;
1000}
1001
1002static Standard_Integer BUC60724(Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** /*argv*/ )
1003{
1004 TCollection_AsciiString as1("");
1005 TCollection_AsciiString as2('\0');
5cbfdb41 1006 if(as1.ToCString() == NULL || as1.Length() != 0 || as1.ToCString()[0] != '\0')
1007 di << "Error : the first string is not zero string : " << as1.ToCString() << "\n";
7fd59977 1008
5cbfdb41 1009 if(as2.ToCString() == NULL || as2.Length() != 0 || as2.ToCString()[0] != '\0')
1010 di << "Error : the second string is not zero string : " << as2.ToCString() << "\n";
7fd59977 1011
1012 return 0;
1013}
1014
1015#include <UnitsAPI.hxx>
1016
1017static Standard_Integer BUC60727(Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** /*argv*/ )
1018{
1019di <<"Program Test" << "\n";
1020UnitsAPI::SetLocalSystem(UnitsAPI_MDTV); //length is mm
1021di <<"AnyToLS (3,mm) = " << UnitsAPI::AnyToLS(3.,"mm") << "\n"; // result was WRONG.
1022
1023 return 0;
1024}
1025
1026#include <gp_Circ.hxx>
1027#include <Geom_Circle.hxx>
1028#include <GeomAPI.hxx>
1029#include <Geom2d_CartesianPoint.hxx>
1030#include <Geom2dGcc_QualifiedCurve.hxx>
1031#include <Geom2dGcc_Circ2d2TanRad.hxx>
1032#include <Geom2d_Circle.hxx>
1033#include <ProjLib.hxx>
1034
1035static Standard_Integer BUC60792(Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv )
1036{
1037 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1038 if(aContext.IsNull()) {
1039 di << "use 'vinit' command before " << argv[0] << "\n";
1040 return -1;
1041 }
1042
1043 gp_Pnt pt3d(0, 20, 150);
1044 gp_Ax2 anAx2(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0), gp_Dir(0, 0, 1));
1045 gp_Circ circ(anAx2, 50.0);
1046 Handle_Geom_Circle gcir = new Geom_Circle(circ);
1047 Handle_Geom_Plane pln = new Geom_Plane(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)));
1048 Handle_Geom2d_Curve gcir1 = GeomAPI::To2d(gcir, pln->Pln());
1049 TopoDS_Shape sh1 = BRepBuilderAPI_MakeEdge(gcir1, pln).Shape();
1050 Handle_AIS_Shape ais1 = new AIS_Shape(sh1);
1051 aContext->SetColor(ais1, Quantity_NOC_INDIANRED);
1052 aContext->Display(ais1);
1053 DBRep::Set("sh0",sh1);
1054 gp_Pnt2d thepoint;
1055// local_get_2Dpointfrom3Dpoint(pt3d, pln->Pln(), thepoint);
1056 thepoint = ProjLib::Project(pln->Pln(),pt3d);
1057 Handle_Geom2d_CartesianPoint ThePoint = new Geom2d_CartesianPoint(thepoint);
1058 Geom2dAdaptor_Curve acur1(gcir1) ;
1059 Geom2dGcc_QualifiedCurve qcur1(acur1, GccEnt_outside) ;
1060 Geom2dGcc_Circ2d2TanRad cirtanrad(qcur1, ThePoint, 200.0, 0.0001);
1061 printf("\n No. of solutions = %d\n", cirtanrad.NbSolutions());
1062 Handle_Geom2d_Circle gccc;
1063 if( cirtanrad.NbSolutions() ) {
1064 for( int i = 1; i<=cirtanrad.NbSolutions(); i++) {
1065 gp_Circ2d ccc = cirtanrad.ThisSolution(i);
1066 gccc = new Geom2d_Circle(ccc);
1067 TopoDS_Shape sh = BRepBuilderAPI_MakeEdge(gccc, pln).Shape();
1068 Standard_Character aStr[5];
91322f44 1069 Sprintf(aStr,"sh%d",i);
7fd59977 1070 DBRep::Set(aStr,sh);
1071 Handle_AIS_Shape ais = new AIS_Shape(sh);
1072 if( i ==1 )
1073 aContext->SetColor(ais, Quantity_NOC_GREEN);
1074 if( i == 2)
1075 aContext->SetColor(ais, Quantity_NOC_HOTPINK);
1076 aContext->Display(ais);
1077 Standard_Real ParSol1, ParSol2, ParArg1, ParArg2;
1078 gp_Pnt2d PntSol1, PntSol2;
1079 cirtanrad.Tangency1(i, ParSol1, ParArg1, PntSol1);
1080 printf("%f\t%f\t\t%f\t%f\n",ParSol1, ParArg1,PntSol1.X(),PntSol1.Y());
1081 cirtanrad.Tangency2(i, ParSol2, ParArg2, PntSol2);
1082 printf("%f\t%f\t\t%f\t%f\n",ParSol2, ParArg2,PntSol2.X(),PntSol2.Y());
1083 }
1084 }
1085 return 0;
1086}
1087
1088#include <TColgp_Array2OfPnt.hxx>
1089#include <Geom_BezierSurface.hxx>
1090#include <BRepBuilderAPI_MakeFace.hxx>
1091#include <BRepBuilderAPI_MakeWire.hxx>
1092#include <Geom_OffsetSurface.hxx>
1093#include <BRepFilletAPI_MakeFillet2d.hxx>
1094#include <GeomProjLib.hxx>
1095#include <Geom_TrimmedCurve.hxx>
1096
1097static Standard_Integer BUC60811(Draw_Interpretor& di, Standard_Integer argc, const char ** argv )
1098{
1099 if(argc == 4) {
1100 TopLoc_Location L1;
1101 TopoDS_Edge aEdge = TopoDS::Edge(DBRep::Get(argv[2],TopAbs_EDGE));
1102 TopoDS_Face aFace = TopoDS::Face(DBRep::Get(argv[3],TopAbs_FACE));
1103 Standard_Real f = 0.0, l = 0.0;
1104 Handle(Geom_Curve) GC = BRep_Tool::Curve(aEdge,f,l);
1105 Handle(Geom_Surface) GS = BRep_Tool::Surface(aFace, L1);
1106 GC = new Geom_TrimmedCurve(GC, f, l);
1107 Handle(Geom_Curve) projCurve = GeomProjLib::Project(GC,GS);
1108 BRepBuilderAPI_MakeWire *myWire;
1109 myWire = new BRepBuilderAPI_MakeWire();
1110 myWire->Add((BRepBuilderAPI_MakeEdge(projCurve)).Edge());
1111 DBRep::Set(argv[1],myWire->Wire());
1112 return 0;
1113 }
1114
1115 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1116 if(aContext.IsNull()) {
1117 di << "use 'vinit' command before " << argv[0] << "\n";
1118 return -1;
1119 }
1120
1121//step 1. creating a Bezier Surface and a patch
1122 TopoDS_Face FP;
1123 TopoDS_Shape FP1;
1124 TopoDS_Solid solid;
1125 Handle(AIS_Shape) ais1;
1126 Handle_AIS_Shape ais2;
1127 Handle(Geom_BezierSurface) BZ1;
1128 TColgp_Array2OfPnt array1(1,3,1,3);
1129 array1.SetValue(1,1,gp_Pnt(0,100,0));
1130 array1.SetValue(1,2,gp_Pnt(200,100,0));
1131 array1.SetValue(1,3,gp_Pnt(400,100,0));
1132 array1.SetValue(2,1,gp_Pnt(0,200,100));
1133 array1.SetValue(2,2,gp_Pnt(200,200,100));
1134 array1.SetValue(2,3,gp_Pnt(400,200,100));
1135 array1.SetValue(3,1,gp_Pnt(0,300,0));
1136 array1.SetValue(3,2,gp_Pnt(200,300,0));
1137 array1.SetValue(3,3,gp_Pnt(400,300,0));
1138 BZ1 = new Geom_BezierSurface(array1);
1c72dff6 1139 BRepBuilderAPI_MakeFace bzf1( BZ1, Precision::Confusion() );
7fd59977 1140 TopoDS_Face F1= bzf1.Face();
1141 ais1 = new AIS_Shape(F1);
1142 DBRep::Set("F1",F1);
1143 aContext->SetMaterial(ais1,Graphic3d_NOM_ALUMINIUM,Standard_False);
1144 aContext->Display(ais1);
1145 BRep_Builder B;
1146 TopoDS_Shell shell;
1147 B.MakeShell(shell);
1148 B.Add(shell, bzf1);
1149 B.MakeSolid(solid);
1150 B.Add(solid,shell);
1151 gp_Dir D(0, 0, 1.0f);
1152 BRepBuilderAPI_MakeWire mkw;
1153 gp_Pnt p1 = gp_Pnt(150., 150.0, 260.);
1154 gp_Pnt p2 = gp_Pnt(350., 150., 260.);
1155 BRepBuilderAPI_MakeEdge* E1 = new BRepBuilderAPI_MakeEdge(p1,p2);
1156 mkw.Add(*E1);
1157 p1 = gp_Pnt(350., 150., 260.);
1158 p2 = gp_Pnt(350., 250., 260.);
1159 BRepBuilderAPI_MakeEdge* E2 = new BRepBuilderAPI_MakeEdge(p1,p2);
1160 mkw.Add(*E2);
1161 p1 = gp_Pnt(350., 250., 260.);
1162 p2 = gp_Pnt(300., 250.0, 260.);
1163 BRepBuilderAPI_MakeEdge* E3 = new BRepBuilderAPI_MakeEdge(p1,p2);
1164 mkw.Add(*E3);
1165 p1 = gp_Pnt(300., 250.0, 260.);
1166 p2 = gp_Pnt(200., 200.0, 260.);
1167 BRepBuilderAPI_MakeEdge* E4 = new BRepBuilderAPI_MakeEdge(p1,p2);
1168 mkw.Add(*E4);
1169 p1 = gp_Pnt(200., 200.0, 260.);
1170 p2 = gp_Pnt(150., 200.0, 260.);
1171 BRepBuilderAPI_MakeEdge* E5 = new BRepBuilderAPI_MakeEdge(p1,p2);
1172 mkw.Add(*E5);
1173 p1 = gp_Pnt(150., 200.0, 260.);
1174 p2 = gp_Pnt(150., 150.0, 260.);
1175 BRepBuilderAPI_MakeEdge* E6 = new BRepBuilderAPI_MakeEdge(p1,p2);
1176 mkw.Add(*E6);
1177 FP = BRepBuilderAPI_MakeFace(mkw.Wire());
1178 ais2 = new AIS_Shape( FP );
1179 aContext->SetMaterial(ais2,Graphic3d_NOM_ALUMINIUM,Standard_False);
1180 aContext->Display( ais2 );
1181
1182 DBRep::Set("FP",FP);
1183
1184//step 2. offseting the surface.
1185 Handle_Geom_OffsetSurface offsurf;
1186 offsurf = new Geom_OffsetSurface(BZ1, -100);
1c72dff6 1187 BRepBuilderAPI_MakeFace bzf2( offsurf, Precision::Confusion() );
7fd59977 1188 TopoDS_Face F2= bzf2.Face();
1189 Handle_AIS_Shape ais22 = new AIS_Shape(F2);
1190 aContext->Display(ais22);
1191 DBRep::Set("F2",F2);
1192
1193//step 3. filleting the patch.
1194//( I want to project wire of this patch on offseted surface above)
1195 BRepFilletAPI_MakeFillet2d fillet( FP );
1196 TopExp_Explorer Ex;
1197 Ex.Init(FP, TopAbs_VERTEX);
1198 TopoDS_Vertex v1 = TopoDS::Vertex(Ex.Current());
1199 fillet.AddFillet(v1, 20);
c281a4a4 1200 di << "\n" << "Error is " << fillet.Status() << "\n";
1201// printf("\nError is %d ", fillet.Status());
7fd59977 1202 Ex.Next();
1203 TopoDS_Vertex V2 = TopoDS::Vertex(Ex.Current());
1204 fillet.AddFillet(V2, 20);
c281a4a4 1205 di << "\n" << "Error is " << fillet.Status() << "\n";
1206// printf("\nError is %d ", fillet.Status());
7fd59977 1207 fillet.Build();
1208 FP1 = fillet.Shape();
1209 ais2 = new AIS_Shape( FP1 );
1210 aContext->SetMaterial(ais2,Graphic3d_NOM_ALUMINIUM,Standard_False);
1211 aContext->Display( ais2 );
1212
1213 DBRep::Set("FP1",FP1);
1214
1215//step 4. Projecting the wire of this patch on offsetted surface.
1216// TopExp_Explorer Ex;
1217 BRepBuilderAPI_MakeWire *myWire;
1218 myWire = new BRepBuilderAPI_MakeWire();
1219 for (Ex.Init( FP1, TopAbs_EDGE); Ex.More(); Ex.Next())
1220 {
1221 TopoDS_Edge e1 = TopoDS::Edge(Ex.Current());
1222 Standard_Real f = 0.0, l = 0.0;
1223 Handle_Geom_Curve newBSplin = BRep_Tool::Curve(e1, f, l);
1224 newBSplin = new Geom_TrimmedCurve(newBSplin, f, l);
1225 Handle(Geom_Curve) projCurve = GeomProjLib::Project(newBSplin,offsurf);
1226 myWire->Add((BRepBuilderAPI_MakeEdge(projCurve)).Edge());
1227 }
1228 Handle_AIS_Shape ais33 = new AIS_Shape( myWire->Wire() );
1229 aContext->Display(ais33);
1230
1231 DBRep::Set("Wire",myWire->Wire());
1232
1233 return 0;
1234}
1235
1236#include<GeomAPI_ExtremaCurveCurve.hxx>
1237
1238static int BUC60825(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1239
1240{
1241 if(argc < 3){
1242 printf("Usage: %s edge1 edge2",argv[0]);
1243 return(-1);
1244 }
1245
1246 TopoDS_Edge E1 = TopoDS::Edge(DBRep::Get(argv[1])),
1247 E2 = TopoDS::Edge(DBRep::Get(argv[2]));
1248
1249 Standard_Real fp , lp;
1250
1251 Handle(Geom_Curve) C1 = BRep_Tool::Curve(E1 , fp , lp),
1252 C2 = BRep_Tool::Curve(E2 , fp , lp);
1253
1254 GeomAPI_ExtremaCurveCurve aExt(C1 , C2);
1255
1256 di << "NB RESULTS : " << aExt.NbExtrema() << "\n";
1257
1258 return 0;
1259}
1260
1261#include <BRepBuilderAPI_MakePolygon.hxx>
1262#include <BRepOffsetAPI_ThruSections.hxx>
1263
1264static int OCC10006(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1265{
1266 if(argc > 2) {
1267 di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
1268 return 1;
1269 }
1270 Standard_Boolean IsBRepAlgoAPI = Standard_True;
1271 if (argc == 2) {
91322f44 1272 Standard_Integer IsB = Draw::Atoi(argv[1]);
7fd59977 1273 if (IsB != 1) {
1274 IsBRepAlgoAPI = Standard_False;
1275#if ! defined(BRepAlgo_def01)
1276// di << "Error: There is not BRepAlgo_Fuse class" << "\n";
1277// return 1;
1278#endif
1279 }
1280 }
1281
1282 double bottompoints1[12] = { 10, -10, 0, 100, -10, 0, 100, -100, 0, 10, -100, 0};
1283 double toppoints1[12] = { 0, 0, 10, 100, 0, 10, 100, -100, 10, 0, -100, 10};
1284 double bottompoints2[12] = { 0, 0, 10.00, 100, 0, 10.00, 100, -100, 10.00, 0, -100, 10.00};
1285 double toppoints2[12] = { 0, 0, 250, 100, 0, 250, 100, -100, 250, 0, -100, 250};
1286 BRepBuilderAPI_MakePolygon bottompolygon1, toppolygon1, bottompolygon2, toppolygon2;
1287 gp_Pnt tmppnt;
1288 for (int i=0;i<4;i++) {
1289 tmppnt.SetCoord(bottompoints1[3*i], bottompoints1[3*i+1], bottompoints1[3*i+2]);
1290 bottompolygon1.Add(tmppnt);
1291 tmppnt.SetCoord(toppoints1[3*i], toppoints1[3*i+1], toppoints1[3*i+2]);
1292 toppolygon1.Add(tmppnt);
1293 tmppnt.SetCoord(bottompoints2[3*i], bottompoints2[3*i+1], bottompoints2[3*i+2]);
1294 bottompolygon2.Add(tmppnt);
1295 tmppnt.SetCoord(toppoints2[3*i], toppoints2[3*i+1], toppoints2[3*i+2]);
1296 toppolygon2.Add(tmppnt);
1297 }
1298 bottompolygon1.Close();
1299 DBRep::Set("B1",bottompolygon1.Shape());
1300 toppolygon1.Close();
1301 DBRep::Set("T1",toppolygon1.Shape());
1302 bottompolygon2.Close();
1303 DBRep::Set("B2",bottompolygon2.Shape());
1304 toppolygon2.Close();
1305 DBRep::Set("T2",toppolygon2.Shape());
1306 BRepOffsetAPI_ThruSections loft1(Standard_True, Standard_True);
1307 loft1.AddWire(bottompolygon1.Wire());
1308 loft1.AddWire(toppolygon1.Wire());
1309 loft1.Build();
1310 BRepOffsetAPI_ThruSections loft2(Standard_True, Standard_True);
1311 loft2.AddWire(bottompolygon2.Wire());
1312 loft2.AddWire(toppolygon2.Wire());
1313 loft2.Build();
1314 if (loft1.Shape().IsNull() || loft2.Shape().IsNull())
1315 return 1;
1316 DBRep::Set("TS1",loft1.Shape());
1317 DBRep::Set("TS2",loft2.Shape());
1318
1319//#if ! defined(BRepAlgoAPI_def01)
1320// BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape());
1321//#else
1322// BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape());
1323//#endif
1324 if (IsBRepAlgoAPI) {
1325 di << "BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape())" <<"\n";
1326 BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape());
1327 DBRep::Set("F",result.Shape());
1328 } else {
1329 di << "BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape())" <<"\n";
1330 BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape());
1331 DBRep::Set("F",result.Shape());
1332 }
1333
1334// DBRep::Set("F",result.Shape());
1335 return 0;
1336}
1337
1338#include <Geom_RectangularTrimmedSurface.hxx>
1339#include <GC_MakeTrimmedCone.hxx>
1340
1341static Standard_Integer BUC60856(Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv )
1342{
1343 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1344 if(aContext.IsNull()) {
1345 di << "use 'vinit' command before " << argv[0] << "\n";
1346 return -1;
1347 }
1348
1349 gp_Ax2 Cone_Ax;
1350 double R1=8, R2=16, H1=20, H2=40, angle;
1351 gp_Pnt P0(0,0,0),
1352 P1(0,0,20), P2(0,0,45);
c6541a0c 1353 angle = 2*M_PI;
7fd59977 1354 Handle(Geom_RectangularTrimmedSurface) S = GC_MakeTrimmedCone (P1, P2, R1, R2).Value();
1c72dff6 1355 TopoDS_Shape myshape = BRepBuilderAPI_MakeFace(S, Precision::Confusion()).Shape();
7fd59977 1356 Handle(AIS_Shape) ais1 = new AIS_Shape(myshape);
1357 aContext->Display(ais1);
1358 aContext->SetColor(ais1, Quantity_NOC_BLUE1);
1359
1360 Handle(Geom_RectangularTrimmedSurface) S2 = GC_MakeTrimmedCone (P1, P2,R1, 0).Value();
1c72dff6 1361 TopoDS_Shape myshape2 = BRepBuilderAPI_MakeFace(S2, Precision::Confusion()).Shape();
7fd59977 1362 Handle(AIS_Shape) ais2 = new AIS_Shape(myshape2);
1363 aContext->Display(ais2);
1364 aContext->SetColor(ais2, Quantity_NOC_RED);
1365 return 0;
1366}
1367
7fd59977 1368//#include <fstream.h>
1369#ifdef HAVE_FSTREAM
1370# include <fstream>
1371#elif defined (HAVE_FSTREAM_H)
1372# include <fstream.h>
1373#endif
1374//#include <Standard_Stream.hxx>
1375//==========================================================================
1376//function : CoordLoad
1377// chargement d une face dans l explorer.
1378//==========================================================================
1379static Standard_Integer coordload (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1380{
1381 char line[256];
1382 char X[30], Y[30];
1383 int fr;
1384 TopoDS_Vertex V1,V2;
1385 TopoDS_Edge Edge;
1386 TopoDS_Wire Wire;
1387 TopoDS_Face Face;
1388
1389 if (argc < 3) return 1;
1390
1391 ifstream file(argv[2], ios::in);
1392 if(!file)
1393 {
1394 di<<"unable to open "<<argv[2]<<" for input"<<"\n";
1395 return 2;
1396 }
1397 BRepBuilderAPI_MakeWire WB;
1398
1399 file.getline(line,80);
1400 for(int i=0;i<30;i++) X[i]=Y[i]=0;
1401 fr = sscanf(line,"%20c%20c",&X,&Y);
91322f44 1402 V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(Draw::Atof(X),Draw::Atof(Y),0.0));
7fd59977 1403
1404 for(;;)
1405 {
1406 file.getline(line,80);
1407 if (!file) break;
1408 for(int i=0;i<30;i++) X[i]=Y[i]=0;
1409 fr = sscanf(line,"%20c%20c",&X,&Y);
91322f44 1410 V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(Draw::Atof(X),Draw::Atof(Y),0.0));
7fd59977 1411 Edge = BRepBuilderAPI_MakeEdge(V1,V2);
1412 WB.Add(Edge);
1413 V1=V2;
1414 }
1415
1416 file.close();
1417 if (WB.IsDone()) Wire = WB.Wire();
1418 Face = BRepBuilderAPI_MakeFace(Wire);
1419
1420 DBRep::Set (argv[1],Face);
1421 return 0;
1422}
7fd59977 1423
1424static Standard_Integer TestMem (Draw_Interpretor& /*di*/,
1425 Standard_Integer /*nb*/,
1426 const char ** /*arg*/)
1427{
1428 TCollection_ExtendedString aString(1024*1024, 'A');
1429 return 0;
1430}
1431
1432static Standard_Integer BUC60876_ (Draw_Interpretor& di,
1433 Standard_Integer argc,
1434 const char ** argv)
1435{
1436 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1437 if(aContext.IsNull()) {
1438 di << "use 'vinit' command before " << argv[0] << "\n";
1439 return -1;
1440 }
1441 if((argc != 2) && (argc != 3)) {
1442 di<< "usage : " << argv[0] << " shape [mode==1]" << "\n";
1443 return -1;
1444 }
1445 TopoDS_Shape aShape = DBRep::Get(argv[1]);
1446 Handle(AIS_InteractiveObject) anIO = new AIS_Shape(aShape);
1447// Handle(AIS_InteractiveObject) anIOa = ViewerTest::GetAISShapeFromName(argv[1]);
91322f44 1448 anIO->SetHilightMode((argc == 3) ? Draw::Atoi(argv[2]) : 1);
7fd59977 1449 aContext->Display(anIO);
1450 return 0;
1451}
1452
1453//=======================================================================
1454//function : buc60773
1455//purpose :
1456//=======================================================================
1457
1458#include<TCollection_HAsciiString.hxx>
1459
1460static Standard_Integer BUC60773 (Draw_Interpretor& /*di*/, Standard_Integer /*n*/, const char ** /*a*/)
1461{
1462 Handle(TCollection_HAsciiString) hAscii = new TCollection_HAsciiString();
1463 Standard_CString aStr = hAscii->ToCString();
1464 TCollection_AsciiString aAscii(aStr);
1465
1466 return 0;
1467}
1468
1469#include<BRepPrimAPI_MakeCylinder.hxx>
1470#include<BRepPrimAPI_MakeCone.hxx>
1471
1472static int TestCMD(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1473
1474{
1475 if(argc > 2) {
1476 di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
1477 return 1;
1478 }
1479 Standard_Boolean IsBRepAlgoAPI = Standard_True;
1480 if (argc == 2) {
91322f44 1481 Standard_Integer IsB = Draw::Atoi(argv[1]);
7fd59977 1482 if (IsB != 1) {
1483 IsBRepAlgoAPI = Standard_False;
1484#if ! defined(BRepAlgo_def01)
1485// di << "Error: There is not BRepAlgo_Fuse class" << "\n";
1486// return 1;
1487#endif
1488 }
1489 }
1490
1491 //Cylindre 36.085182 20.0 8.431413 88.04671 20.0 38.931416 10.0
1492
1493 Standard_Real x11 = 36.085182;
1494 Standard_Real y11 = 20.0;
1495 Standard_Real z11 = 8.431413;
1496 Standard_Real x12 = 88.04671;
1497 Standard_Real y12 = 20.0;
1498 Standard_Real z12 = 38.931416;
1499 Standard_Real radius = 10.0;
1500
1501 gp_Pnt base1(x11, y11, z11);
1502 gp_Dir vect1(x12-x11, y12-y11, z12-z11);
1503 gp_Ax2 axis1(base1, vect1);
1504 Standard_Real height1 = sqrt( ((x12-x11)*(x12-x11)) + ((y12-y11)*(y12-y11)) + ((z12-z11)*(z12-z11)) );
1505 BRepPrimAPI_MakeCylinder cylinder(axis1, radius, height1);
1506
1507 TopoDS_Shape SCyl = cylinder.Shape();
1508 DBRep::Set("cyl", SCyl);
1509
1510
1511 //Cone 70.7262 20.0 28.431412 105.36722 20.0 48.431416 6.0 3.0
1512 Standard_Real x21 = 70.7262;
1513 Standard_Real y21 = 20.0;
1514 Standard_Real z21 = 28.431412;
1515 Standard_Real x22 = 105.36722;
1516 Standard_Real y22 = 20.0;
1517 Standard_Real z22 = 48.431416;
1518 Standard_Real radius1 = 6.0;
1519 Standard_Real radius2 = 3.0;
1520
1521 gp_Pnt base2(x21, y21, z21);
1522 gp_Dir vect2(x22-x21, y22-y21, z22-z21);
1523 gp_Ax2 axis2(base2, vect2);
1524 Standard_Real height2 = sqrt( ((x22-x21)*(x22-x21)) + ((y22-y21)*(y22-y21)) + ((z22-z21)*(z22-z21)) );
1525 BRepPrimAPI_MakeCone cone(axis2, radius1, radius2, height2);
1526
1527 TopoDS_Shape SCon = cone.Shape();
1528 DBRep::Set("con", SCon);
1529
1530//#if ! defined(BRepAlgoAPI_def01)
1531// BRepAlgoAPI_Fuse SFuse(SCyl, SCon);
1532//#else
1533// BRepAlgo_Fuse SFuse(SCyl, SCon);
1534//#endif
1535//
1536// if(! SFuse.IsDone() )
1537// cout<<"Error: Boolean fuse operation failed !"<<endl;
1538//
1539// TopoDS_Shape fuse = SFuse.Shape();
1540
1541 TopoDS_Shape fuse;
1542 if (IsBRepAlgoAPI) {
1543 di << "BRepAlgoAPI_Fuse SFuse(SCyl, SCon)" <<"\n";
1544 BRepAlgoAPI_Fuse SFuse(SCyl, SCon);
1545 if(! SFuse.IsDone() )
1546 di<<"Error: Boolean fuse operation failed !"<<"\n";
1547 fuse = SFuse.Shape();
1548 } else {
1549 di << "BRepAlgo_Fuse SFuse(SCyl, SCon)" <<"\n";
1550 BRepAlgo_Fuse SFuse(SCyl, SCon);
1551 if(! SFuse.IsDone() )
1552 di<<"Error: Boolean fuse operation failed !"<<"\n";
1553 fuse = SFuse.Shape();
1554 }
1555
1556 DBRep::Set("fus", fuse);
1557
1558 return 0;
1559}
1560
1561#include <Dico_DictionaryOfInteger.hxx>
1562#include <TColStd_HSequenceOfAsciiString.hxx>
1563#include <TopExp.hxx>
1564#include <TopoDS_Iterator.hxx>
1565
1566//---------------------------------------------------------------------------------------
1567
1568static Standard_Integer statface (Draw_Interpretor& di,Standard_Integer /*argc*/, const char ** argv )
1569
1570{
1571 TopoDS_Shape aShape = DBRep::Get(argv[1]);
1572 if(aShape.IsNull())
1573 {
1574 di<<"Invalid input shape"<<"\n";
1575 return 1;
1576 }
1577 Handle(Dico_DictionaryOfInteger) aDico = new Dico_DictionaryOfInteger();
1578 Handle(TColStd_HSequenceOfAsciiString) aSequence = new TColStd_HSequenceOfAsciiString;
1579 Standard_CString aString;
1580 Standard_Integer i=1,j=1,k=1,l=1,aa=1;
1581 TopExp_Explorer expl;
1582 Standard_Real f3d,l3d;
1583 for(expl.Init(aShape,TopAbs_FACE);expl.More();expl.Next())
1584 {
1585 // SURFACES
1586 TopoDS_Face aFace = TopoDS::Face (expl.Current());
1587 Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace);
1588 aString = aSurface->DynamicType()->Name();
1589
1590 if(aDico->GetItem(aString,aa) != 0)
1591 {
1592 aDico->GetItem(aString,aa);
1593 aDico->SetItem(aString,aa+1);
1594 } else {
1595 aDico->SetItem(aString,1);
1596 aSequence->Append(aString);
1597 aa=1;
1598 i++;
1599 }
1600 }
1601 // PCURVES
1602 for(expl.Init(aShape,TopAbs_FACE);expl.More();expl.Next())
1603 {
1604 TopoDS_Face aFace = TopoDS::Face (expl.Current());
1605 TopoDS_Iterator anIt(aFace);
1606 TopoDS_Wire aWire = TopoDS::Wire (anIt.Value());
1607 TopoDS_Iterator it (aWire);
1608 for (; it.More(); it.Next()) {
1609 TopoDS_Edge Edge = TopoDS::Edge (it.Value());
1610 Handle(Geom2d_Curve) aCurve2d = BRep_Tool::CurveOnSurface(Edge,aFace,f3d,l3d);
1611 aString = aCurve2d->DynamicType()->Name();
1612 if(aDico->GetItem(aString,aa) != 0)
1613 {
1614 aDico->GetItem(aString,aa);
1615 aDico->SetItem(aString,aa+1);
1616 } else {
1617 aDico->SetItem(aString,1);
1618 aSequence->Append(aString);
1619 i++;
1620 aa=1;
1621 }
1622 }
1623 }
1624 // 3d CURVES
1625 TopExp_Explorer exp;
1626 for (exp.Init(aShape,TopAbs_EDGE); exp.More(); exp.Next())
1627 {
1628 TopoDS_Edge Edge = TopoDS::Edge (exp.Current());
1629 Handle(Geom_Curve) aCurve3d = BRep_Tool::Curve (Edge,f3d,l3d);
1630 if(aCurve3d.IsNull())
1631 {
1632 l++;
1633 goto aLabel;
1634 }
1635 aString = aCurve3d->DynamicType()->Name();
1636 if(aDico->GetItem(aString,aa) != 0)
1637 {
1638 aDico->GetItem(aString,aa);
1639 aDico->SetItem(aString,aa+1);
1640 } else {
1641 aDico->SetItem(aString,1);
1642 aSequence->Append(aString);
1643 i++;
1644 aa=1;
1645 }
1646 aLabel:;
1647 }
1648 // Output
1649 di<<"\n";
1650 for(j=1;j<i;j++)
1651 {
1652 aDico->GetItem(aSequence->Value(j),aa);
1653 di<<aa<<" -- "<<aSequence->Value(j).ToCString()<<"\n";
1654 }
1655
1656 di<<"\n";
1657 di<<"Degenerated edges :"<<"\n";
1658 di<<l<<" -- "<<"Degenerated edges "<<"\n";
1659
1660 return 0;
1661
1662}
1663
1664#include <BRepBuilderAPI_Transform.hxx>
1665
1666static Standard_Integer BUC60841(Draw_Interpretor& di, Standard_Integer argc, const char ** argv )
1667{
1668 if(argc > 2) {
1669 di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
1670 return 1;
1671 }
1672 Standard_Boolean IsBRepAlgoAPI = Standard_True;
1673 if (argc == 2) {
91322f44 1674 Standard_Integer IsB = Draw::Atoi(argv[1]);
7fd59977 1675 if (IsB != 1) {
1676 IsBRepAlgoAPI = Standard_False;
1677#if ! defined(BRepAlgo_def01)
1678// di << "Error: There is not BRepAlgo_Fuse class" << "\n";
1679// return 1;
1680#endif
1681 }
1682 }
1683
1684 gp_Ax2 Ax2 = gp_Ax2(gp_Pnt(0, 621, 78), gp_Dir(0, 1,0));
1685 BRepPrimAPI_MakeCylinder cyl(Ax2, 260, 150);
1686 //BRepPrimAPI_MakeCylinder cyl(gp_Ax2(gp_Pnt(0, 621, 78), gp_Dir(0, 1,0)), 260, 150);
1687
1688 TopoDS_Shape sh1 = cyl.Shape();
1689 DBRep::Set("sh1",sh1);
1690 gp_Trsf trsf1, trsf2;
1691 trsf1.SetTranslation(gp_Pnt(0.000000,700.000000,-170.000000),
1692 gp_Pnt(0.000000,700.000000,-95.000000));
1693 trsf2.SetRotation(gp_Ax1(gp_Pnt(0.000000,700.000000,-170.000000),
1694 gp_Dir(0.000000,0.000000,1.000000)), 0.436111);
1695 BRepBuilderAPI_Transform trans1(sh1, trsf1);
1696 TopoDS_Shape sh2 = trans1.Shape();
1697 DBRep::Set("sh2",sh2);
1698
1699//#if ! defined(BRepAlgoAPI_def01)
1700// BRepAlgoAPI_Fuse fuse1(sh1, sh2);
1701//#else
1702// BRepAlgo_Fuse fuse1(sh1, sh2);
1703//#endif
1704//
1705// TopoDS_Shape fsh1 = fuse1.Shape();
1706
1707 TopoDS_Shape fsh1;
1708 if (IsBRepAlgoAPI) {
1709 di << "BRepAlgoAPI_Fuse fuse1(sh1, sh2)" <<"\n";
1710 BRepAlgoAPI_Fuse fuse1(sh1, sh2);
1711 fsh1 = fuse1.Shape();
1712 } else {
1713 di << "BRepAlgo_Fuse fuse1(sh1, sh2)" <<"\n";
1714 BRepAlgo_Fuse fuse1(sh1, sh2);
1715 fsh1 = fuse1.Shape();
1716 }
1717
1718 DBRep::Set("fsh1",fsh1);
1719 BRepBuilderAPI_Transform trans2(fsh1, trsf2);
1720 TopoDS_Shape sh3 = trans2.Shape();
1721 DBRep::Set("sh3",sh3);
1722
1723//#if ! defined(BRepAlgoAPI_def01)
1724// BRepAlgoAPI_Fuse fuse2(fsh1,sh3);
1725//#else
1726// BRepAlgo_Fuse fuse2(fsh1,sh3);
1727//#endif
1728//
1729// TopoDS_Shape fsh2 = fuse2.Shape();
1730
1731 TopoDS_Shape fsh2;
1732 if (IsBRepAlgoAPI) {
1733 di << "BRepAlgoAPI_Fuse fuse2(fsh1,sh3)" <<"\n";
1734 BRepAlgoAPI_Fuse fuse2(fsh1,sh3);
1735 fsh2 = fuse2.Shape();
1736 } else {
1737 di << "BRepAlgo_Fuse fuse2(fsh1,sh3)" <<"\n";
1738 BRepAlgo_Fuse fuse2(fsh1,sh3);
1739 fsh2 = fuse2.Shape();
1740 }
1741
1742 DBRep::Set("fsh2",fsh2);
1743 Handle_AIS_Shape aisp1 = new AIS_Shape(fsh2);
1744// aContext->Display(aisp1);
1745 return 0;
1746}
1747
1748#include <ShapeBuild_Edge.hxx>
1749
1750static Standard_Integer BUC60874(Draw_Interpretor& /*di*/, Standard_Integer /*argc*/, const char ** argv )
1751{
1752 TopoDS_Edge e = TopoDS::Edge(DBRep::Get(argv[1],TopAbs_EDGE));
1753 ShapeBuild_Edge().BuildCurve3d(e);
1754 DBRep::Set("ED",e);
1755 return 0;
1756}
1757
1758
1759#include<TDF_Label.hxx>
1760#include<TDataStd_TreeNode.hxx>
1761
1762#include<DDocStd.hxx>
1763
1764#include<DDF.hxx>
1765
1766#include<TDocStd_Modified.hxx>
1767#include<TDF_ListIteratorOfDeltaList.hxx>
1768#include<TDocStd_Document.hxx>
1769#include<TDocStd_Application.hxx>
1770#include<TDF_Delta.hxx>
1771#include<TDataXtd_Constraint.hxx>
1772#include<TPrsStd_AISPresentation.hxx>
1773#include<TPrsStd_AISViewer.hxx>
1774#include<TNaming_Builder.hxx>
1775#include<TNaming_Naming.hxx>
1776#include<TNaming_NamedShape.hxx>
1777
1778static int BUC60817(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
1779 if(argc!=2) {
1780 di << "Usage : " << argv[0] << " D" << "\n";
1781 di<<1;
1782 return 0;
1783 }
1784
1785 Handle(TDF_Data) DF;
1786 if (!DDF::GetDF(argv[1],DF)) {di<<2;return 0;}
1787
1788 TDF_Label L1,L2;
1789 Handle(TDataStd_TreeNode) TN1,TN2;
1790
1791 DDF::AddLabel(DF,"0:2",L1);
1792 TN1 = TDataStd_TreeNode::Set(L1);
1793
1794 DDF::AddLabel(DF,"0:3",L2);
1795 TN2 = TDataStd_TreeNode::Set(L2);
1796
1797 TN1->Append(TN2);
1798 if(!(TN2->IsDescendant(TN1))) {di<<3;return 0;}
1799 if((TN1->IsDescendant(TN2))) {di<<4;return 0;}
1800
1801 di<<0;
1802 return 0;
1803}
1804
1805static int BUC60831_1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
1806 if(argc!=2) {
1807 di << "Usage : " << argv[0] << " D" << "\n";
1808 di<<-1;
1809 return 0;
1810 }
1811
1812 Handle(TDF_Data) DF;
1813 if (!DDF::GetDF(argv[1],DF)) {di<<-2;return 0;}
1814
1815 TDF_Label L;
1816 DDF::FindLabel(DF,"0:1",L,Standard_False);
1817 Handle(TDocStd_Modified) MDF;
1818 if (!L.Root().FindAttribute (TDocStd_Modified::GetID(), MDF)) {
1819 MDF = new TDocStd_Modified();
1820 L.Root().AddAttribute(MDF);
1821 }
1822
1823 di<<!MDF->IsEmpty();
1824 return 0;
1825}
1826
1827static int BUC60831_2(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
1828 if(argc!=3) {
1829 di << "Usage : " << argv[0] << " D Label" << "\n";
1830 di<<1;
1831 return 0;
1832 }
1833
1834 Handle(TDF_Data) DF;
1835 if (!DDF::GetDF(argv[1],DF)) {di<<2;return 0;}
1836
1837 TDF_Label L;
1838 DDF::FindLabel(DF,argv[2],L,Standard_False);
1839
1840 TDocStd_Modified::Add(L);
1841
1842 di<<0;
1843 return 0;
1844}
1845
1846static int BUC60836(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
1847 if(argc!=2) {
1848 di << "Usage : " << argv[0] << " D" << "\n";
1849 di<<1;
1850 return 0;
1851 }
1852
1853
1854 Handle(TDF_Data) aDF;
1855 if (!DDF::GetDF(argv[1],aDF)) {di<<2;return 0;}
1856
1857 Handle(TDocStd_Document) aDocument;
1858 if (!DDocStd::GetDocument(argv[1], aDocument)) {di<<3;return 0;}
1859
1860 TDF_Label L;
1861 Handle(TDataStd_TreeNode) TN;
1862
1863 aDocument->NewCommand();
1864 DDF::AddLabel(aDF,"0:2",L);
1865 TN = TDataStd_TreeNode::Set(L);
1866
1867 aDocument->NewCommand();
1868 DDF::AddLabel(aDF,"0:3",L);
1869 TN = TDataStd_TreeNode::Set(L);
1870
1871 aDocument->NewCommand();
1872 DDF::AddLabel(aDF,"0:4",L);
1873 TN = TDataStd_TreeNode::Set(L);
1874 aDocument->NewCommand();
1875
1876 TDF_DeltaList Us,Rs;
1877 Us = aDocument->GetUndos();
1878 Rs = aDocument->GetUndos();
1879
1880 Standard_Integer i;
1881 char Names[10][5]={"n1","n2","n3","n4","n5","n6","n7","n8","n9","n10"};
1882
1883 TDF_ListIteratorOfDeltaList IDL;
1884 for(IDL.Initialize(Us),i=1;IDL.More();IDL.Next(),i++){
1885 Handle(TDF_Delta) D = IDL.Value();
1886 TCollection_ExtendedString S(Names[i-1]);
1887 D->SetName(S);
1888// cout<<" U"<<i<<"="<<D->Name()<<endl;
1889 }
1890
1891 aDocument->Undo();
1892 aDocument->Undo();
1893
1894 Us = aDocument->GetUndos();
1895 Rs = aDocument->GetRedos();
1896
1897 for(IDL.Initialize(Us),i=1;IDL.More();IDL.Next(),i++){
1898 Handle(TDF_Delta) D = IDL.Value();
1899// cout<<" U"<<i<<"="<<D->Name()<<endl;
1900 }
1901
1902 TCollection_ExtendedString n2name ("n2");
1903 for(IDL.Initialize(Rs),i=1;IDL.More();IDL.Next(),i++){
1904 Handle(TDF_Delta) D = IDL.Value();
1905 if ( i == 1 && ! D->Name().IsEqual (n2name) )
1906 {
1907 di << 4;
1908 return 0;
1909 }
1910 }
1911
1912 di<<0;
1913 return 0;
1914}
1915
1916static int BUC60847(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
1917 if(argc!=3) {
1918 di << "Usage : " << argv[0] << " D Shape" << "\n";
1919 di<<1;
1920 return 0;
1921 }
1922
1923 Handle(TDF_Data) aDF;
1924 if (!DDF::GetDF(argv[1],aDF)) {di<<2;return 0;}
1925
1926 TopoDS_Shape s = DBRep::Get(argv[2]);
1927 if (s.IsNull()) { di <<"shape not found"<< "\n"; di<<3;return 0;}
1928 TDF_Label L;
1929 DDF::AddLabel(aDF, "0:2", L);
1930 TNaming_Builder SI (L);
1931 SI.Generated(s);
1932
1933 Handle(TNaming_NamedShape) NS = new TNaming_NamedShape;
1934
1935 TNaming_Naming aNN;
1936 NS=aNN.Name(L,s,s);
1937// if (!NS->IsEmpty()) {di<<3;return 0;}
1938 if (NS->IsEmpty()) {di<<4;return 0;}
1939 di<<0;
1940 return 0;
1941}
1942
1943static int BUC60862(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
1944 if(argc!=3) {
1945 di << "Usage : " << argv[0] << " D Shape" << "\n";
1946 di<<1;
1947 return 0;
1948 }
1949
1950 Handle(TDF_Data) aDF;
1951 if (!DDF::GetDF(argv[1],aDF)) {di<<2;return 0;}
1952
1953 TopoDS_Shape s = DBRep::Get(argv[2]);
1954 if (s.IsNull()) { di <<"shape not found"<< "\n"; di<<3;return 0;}
1955 TDF_Label L;
1956 DDF::AddLabel(aDF, "0:2", L);
1957 TNaming_Builder SI (L);
1958 SI.Generated(s);
1959
1960 Handle(TNaming_NamedShape) NS = new TNaming_NamedShape;
1961
1962 TNaming_Naming aNN;
1963 NS=aNN.Name(L,s,s);
1964 if (NS->IsEmpty()) {di<<4;return 0;}
1965 di<<0;
1966 return 0;
1967}
1968
1969static int BUC60867(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
1970 if (argc == 2) {
1971 TCollection_ExtendedString path (argv[1]);
1972 Handle(TDocStd_Application) A;
1973 if (!DDocStd::Find(A)) {di<<1;return 0;}
1974 Handle(TDocStd_Document) D;
1975 Standard_Integer insession = A->IsInSession(path);
1976 if (insession > 0) {
1977 di <<"document " << insession << " is already in session" << "\n";
1978 di<<2;
1979 return 0;
1980 }
15e8b082
M
1981 PCDM_ReaderStatus Result = A->Open(path,D);
1982 if(Result==PCDM_RS_OK){
7fd59977 1983 di<<0;
1984 return 0;
1985 }
1986 }
1987 di<<3;
1988 return 0;
1989}
1990
1991static int BUC60910(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
1992 if(argc!=2) {
1993 di << "Usage : " << argv[0] << " D" << "\n";
1994 di<<1;
1995 return 0;
1996 }
1997
1998 Handle(TDF_Data) aDF;
1999 if (!DDF::GetDF(argv[1],aDF)) {di<<2;return 0;}
2000
2001 TDF_Label L;
2002 DDF::AddLabel(aDF, "0:2", L);
2003
2004 Handle(TPrsStd_AISPresentation) AISP = new TPrsStd_AISPresentation;
2005
2006 AISP->Set(L,TDataXtd_Constraint::GetID());
2007
2008 if (AISP->HasOwnMode()) {di<<3;return 0;}
2009 AISP->SetMode(3);
2010 Standard_Integer Mode = AISP->Mode();
2011 if (Mode!=3) {di<<4;return 0;}
2012 if (!AISP->HasOwnMode()) {di<<5;return 0;}
2013 AISP->UnsetMode();
2014 if (AISP->HasOwnMode()) {di<<6;return 0;}
2015 di<<0;
2016 return 0;
2017}
2018
2019static int BUC60925(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
2020 if(argc!=2) {
2021 di << "Usage : " << argv[0] << " D" << "\n";
2022 di<<1;
2023 return 0;
2024 }
2025
2026 Handle(TDF_Data) aDF;
2027 if (!DDF::GetDF(argv[1],aDF)) {di<<2;return 0;}
2028
2029 TDF_Label L;
2030 DDF::AddLabel(aDF, "0:2", L);
2031 TDF_LabelMap LM;
2032 LM.Add(L);
2033
2034 Handle(TNaming_NamedShape) NS = new TNaming_NamedShape;
2035// Handle(TNaming_Name) NN = new TNaming_Name;
2036 TNaming_Name NN;
2037
2038 NN.Type(TNaming_IDENTITY);
2039 NN.Append(NS);
2040 Standard_Boolean Res = NN.Solve(L,LM);
2041
2042 if (Res!=Standard_False) {di<<3;return 0;}
2043 di<<0;
2044 return 0;
2045}
2046
2047static int BUC60932(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
2048 if(argc!=2) {
2049 di << "Usage : " << argv[0] << " D" << "\n";
2050 di<<1;
2051 return 0;
2052 }
2053
2054
2055 Handle(TDocStd_Document) aDocument;
2056 if (!DDocStd::GetDocument(argv[1], aDocument)) {di<<2;return 0;}
2057
2058 if(!aDocument->InitDeltaCompaction()) {di<<3;return 0;}
2059 if(!aDocument->PerformDeltaCompaction()) {di<<4;return 0;}
2060
2061 di<<0;
2062 return 0;
2063}
2064
2065//=======================================================================
2066//function : AISWidth
2067//purpose : AISWidth (DOC,entry,[width])
2068// abv: testing command for checking bug BUC60917 in TPrsStd_AISPresentation
2069//=======================================================================
2070
2071static int AISWidth(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
2072
2073 if (argc >= 3) {
2074 Handle(TDocStd_Document) D;
2075 if (!DDocStd::GetDocument(argv[1],D)) {di<<(-1);return 0;}
2076 TDF_Label L;
2077 if (!DDF::FindLabel(D->GetData(),argv[2],L)) {di<<(-2);return 0;}
2078
2079 Handle(TPrsStd_AISViewer) viewer;
2080 if( !TPrsStd_AISViewer::Find(L, viewer) ) {di<<(-3);return 0;}
2081
2082 Handle(TPrsStd_AISPresentation) prs;
2083 if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {
2084 if( argc == 4 ) {
91322f44 2085 prs->SetWidth(Draw::Atof(argv[3]));
7fd59977 2086 TPrsStd_AISViewer::Update(L);
2087 }
2088 else {
2089 if (prs->HasOwnWidth()){
2090// cout << "Width = " << prs->Width() << endl;
2091 di<<prs->Width();
2092 }
2093 else{
2094 di << "AISWidth: Warning : Width wasn't set" << "\n";
2095 di<<(-4);
2096 }
2097 }
2098 return 0;
2099 }
2100 }
2101 di << "AISWidth : Error" << "\n";
2102 di<<(-5);
2103 return 0;
2104}
2105
2106//=======================================================================
2107//function : BUC60921 ( & BUC60954 )
2108//purpose : Test memory allocation of OCAF in Undo/Redo operations
2109//=======================================================================
2110
2111static Standard_Integer BUC60921 (Draw_Interpretor& di,
2112 Standard_Integer nb,
2113 const char ** arg)
2114{
2115 if (nb >= 4) {
2116 Handle(TDocStd_Document) D;
2117 if (!DDocStd::GetDocument(arg[1],D)) {di<<1;return 0;}
2118 TDF_Label L;
2119 DDF::AddLabel(D->GetData(),arg[2],L);
2120
2121 BRep_Builder B;
2122 TopoDS_Shape S;
2123 BRepTools::Read ( S, arg[3], B );
2124
2125 TNaming_Builder tnBuild(L);
2126 tnBuild.Generated(S);
2127// di << "File " << arg[3] << " added";
2128 di<<0;
2129 return 0;
2130 }
2131 di << "BUC60921 Doc label brep_file: directly read brep file and put shape to the label" << "\n";
2132 di<<2;
2133 return 0;
2134}
2135
2136#include<IGESControl_Reader.hxx>
2137#include<BRepPrimAPI_MakeHalfSpace.hxx>
2138
2139static Standard_Integer BUC60951_(Draw_Interpretor& di, Standard_Integer argc, const char ** a)
2140{
2141 //if(argc!=2)
2142 // {
2143 // cerr << "Usage : " << a[0] << " file.igs" << endl;
2144 // return -1;
2145 // }
2146 if(argc < 2 || argc > 3) {
2147 di << "Usage : " << a[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
2148 return 1;
2149 }
2150 Standard_Boolean IsBRepAlgoAPI = Standard_True;
2151 if (argc == 3) {
91322f44 2152 Standard_Integer IsB = Draw::Atoi(a[2]);
7fd59977 2153 if (IsB != 1) {
2154 IsBRepAlgoAPI = Standard_False;
2155#if ! defined(BRepAlgo_def01)
2156// di << "Error: There is not BRepAlgo_Fuse class" << "\n";
2157// return 1;
2158#endif
2159 }
2160 }
2161
2162 Handle(AIS_InteractiveContext) myContext = ViewerTest::GetAISContext();
2163
2164 if(myContext.IsNull()) {
2165 di << "use 'vinit' command before " << a[0] << "\n";
2166 return -1;
2167 }
2168
2169// IGESControlStd_Reader reader;
2170 IGESControl_Reader reader;
2171 reader.ReadFile(a[1]);
2172 reader.TransferRoots();
2173 TopoDS_Shape shape = reader.OneShape();
2174 printf("\n iges1 shape type = %d", shape.ShapeType() );
2175 TopTools_IndexedMapOfShape list;
2176 TopExp::MapShapes(shape, TopAbs_FACE, list);
2177 printf("\n No. of faces = %d", list.Extent());
2178
2179 TopoDS_Shell shell;
2180 BRep_Builder builder;
2181 builder.MakeShell(shell);
2182 for(int i=1;i<=list.Extent(); i++) {
2183 TopoDS_Face face = TopoDS::Face(list.FindKey(i));
2184 builder.Add(shell, face);
2185 }
2186
2187 BRepPrimAPI_MakeHalfSpace half(shell, gp_Pnt(0, 0, 20));
2188 TopoDS_Solid sol = half.Solid();
2189 gp_Ax2 anAx2(gp_Pnt(-800.0, 0.0, 0), gp_Dir(0, 0, -1));
2190 BRepPrimAPI_MakeCylinder cyl(anAx2, 50, 300);
2191 TopoDS_Shape sh = cyl.Shape();
2192
2193//#if ! defined(BRepAlgoAPI_def01)
2194// BRepAlgoAPI_Fuse fuse(sol, sh);
2195//#else
2196// BRepAlgo_Fuse fuse(sol, sh);
2197//#endif
2198//
2199// sh = fuse.Shape();
2200
2201 if (IsBRepAlgoAPI) {
2202 di << "BRepAlgoAPI_Fuse fuse(sol, sh)" <<"\n";
2203 BRepAlgoAPI_Fuse fuse(sol, sh);
2204 sh = fuse.Shape();
2205 } else {
2206 di << "BRepAlgo_Fuse fuse(sol, sh)" <<"\n";
2207 BRepAlgo_Fuse fuse(sol, sh);
2208 sh = fuse.Shape();
2209 }
2210
2211 Handle(AIS_Shape) res = new AIS_Shape(sh);
2212 myContext->Display( res );
2213 return 0;
2214}
2215
1cd84fee 2216void QABugs::Commands_3(Draw_Interpretor& theCommands) {
2217 const char *group = "QABugs";
7fd59977 2218
2219 theCommands.Add("BUC60623","BUC60623 result Shape1 Shape2",__FILE__,BUC60623,group);
2220 theCommands.Add("BUC60569","BUC60569 shape",__FILE__,BUC60569,group);
2221 theCommands.Add("BUC60614","BUC60614 shape",__FILE__,BUC60614,group);
ceeaafcb 2222 theCommands.Add("BUC60609","BUC60609 shape name [U V]",__FILE__,BUC60609,group);
7fd59977 2223#if ! defined(WNT)
2224 theCommands.Add("UKI61075","UKI61075",__FILE__,UKI61075,group);
2225#endif
2226 theCommands.Add("BUC60585",St,__FILE__,BUC60585,group);
2227 theCommands.Add("BUC60547","BUC60547 name",__FILE__,BUC60547,group);
2228 theCommands.Add("BUC60632","BUC60632 mode length",__FILE__,BUC60632,group);
2229 theCommands.Add("BUC60652","BUC60652 face",__FILE__,BUC60652,group);
2230 theCommands.Add("ksection","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol",__FILE__,ksection,group);
2231 theCommands.Add("BUC60682","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol",__FILE__,ksection,group);
2232 theCommands.Add("BUC60669","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol",__FILE__,ksection,group);
2233 theCommands.Add("PRO19626","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol",__FILE__,ksection,group);
2234 theCommands.Add("BUC60574","BUC60574 ",__FILE__,BUC60574,group);
2235
2236 theCommands.Add("BUC60698","BUC60698 [BRepAlgoAPI/BRepAlgo = 1/0]",__FILE__,BUC60698,group);
2237
2238 theCommands.Add("BUC60699","BUC60699 ",__FILE__,BUC60699,group);
2239 theCommands.Add("GER61394","GER61394 [1/0]",__FILE__,GER61394,group);
2240 theCommands.Add("GER61351","GER61351 name/object name/r g b/object r g b",__FILE__,setcolor,group);
2241 theCommands.Add("setcolor","setcolor name/object name/r g b/object r g b",__FILE__,setcolor,group);
2242
2243 theCommands.Add("BUC60726","BUC60726 0/1",__FILE__,BUC60726,group);
2244 theCommands.Add("BUC60729","BUC60729",__FILE__,BUC60729,group);
2245 theCommands.Add("BUC60724","BUC60724",__FILE__,BUC60724,group);
2246 theCommands.Add("BUC60727","BUC60727",__FILE__,BUC60727,group);
2247 theCommands.Add("BUC60792","BUC60792",__FILE__,BUC60792,group);
2248 theCommands.Add("BUC60811","BUC60811",__FILE__,BUC60811,group);
2249
2250 theCommands.Add("BUC60825","BUC60825",__FILE__,BUC60825,group);
2251
2252 theCommands.Add("OCC10006","OCC10006 [BRepAlgoAPI/BRepAlgo = 1/0]",__FILE__,OCC10006,group);
2253
2254 theCommands.Add("BUC60856","BUC60856",__FILE__,BUC60856,group);
2255
7fd59977 2256 theCommands.Add("coordload","load coord from file",__FILE__,coordload);
7fd59977 2257
2258 theCommands.Add("TestMem","TestMem",__FILE__,TestMem,group);
2259 theCommands.Add("BUC60945","BUC60945",__FILE__,TestMem,group);
2260 theCommands.Add("BUC60876","BUC60876 shape",__FILE__,BUC60876_,group);
2261 theCommands.Add("BUC60773","BUC60773",__FILE__,BUC60773,group);
2262
2263 theCommands.Add("TestCMD","TestCMD [BRepAlgoAPI/BRepAlgo = 1/0]",__FILE__,TestCMD,group);
2264
2265 theCommands.Add("statface","statface face",__FILE__,statface,group);
2266
2267 theCommands.Add("BUC60841","BUC60841 [BRepAlgoAPI/BRepAlgo = 1/0]",__FILE__,BUC60841,group);
2268
2269 theCommands.Add("BUC60874","BUC60874",__FILE__,BUC60874,group);
2270
2271 theCommands.Add("BUC60817","BUC60817 D",__FILE__,BUC60817,group);
2272 theCommands.Add("BUC60831_1","BUC60831_1 D",__FILE__,BUC60831_1,group);
2273 theCommands.Add("BUC60831_2","BUC60831_2 D Label",__FILE__,BUC60831_2,group);
2274 theCommands.Add("BUC60836","BUC60836 D",__FILE__,BUC60836,group);
2275 theCommands.Add("BUC60847","BUC60847 D Shape",__FILE__,BUC60847,group);
2276 theCommands.Add("BUC60862","BUC60862 D Shape",__FILE__,BUC60862,group);
2277 theCommands.Add("BUC60867","BUC60867",__FILE__,BUC60867,group);
2278 theCommands.Add("BUC60910","BUC60910 D",__FILE__,BUC60910,group);
2279 theCommands.Add("BUC60925","BUC60925 D",__FILE__,BUC60925,group);
2280 theCommands.Add("BUC60932","BUC60932 D",__FILE__,BUC60932,group);
2281 theCommands.Add("AISWidth","AISWidth (DOC,entry,[width])",__FILE__,AISWidth,group);
2282 theCommands.Add("BUC60921","BUC60921 Doc label brep_file",__FILE__,BUC60921,group);
2283
2284 theCommands.Add("BUC60951","BUC60951 file.igs [BRepAlgoAPI/BRepAlgo = 1/0]",__FILE__,BUC60951_, group );
2285
2286}