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