0031456: Visualization - move out Dimensions and Relations from package AIS to PrsDims
[occt.git] / src / QABugs / QABugs_17.cxx
CommitLineData
b311480e 1// Created on: 2002-03-18
2// Created by: QA Admin
973c2be1 3// Copyright (c) 2002-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
7fd59977 16#include <stdio.h>
17
1cd84fee 18#include <QABugs.hxx>
7fd59977 19
91322f44 20#include <Draw.hxx>
7fd59977 21#include <Draw_Interpretor.hxx>
22#include <DBRep.hxx>
23#include <DrawTrSurf.hxx>
24#include <AIS_InteractiveContext.hxx>
25#include <ViewerTest.hxx>
5e27df78 26#include <ViewerTest_EventManager.hxx>
7fd59977 27#include <AIS_Shape.hxx>
28#include <TopoDS_Shape.hxx>
29
30#include <Geom_Circle.hxx>
31#include <Geom_Ellipse.hxx>
32#include <Geom_Plane.hxx>
543a9964 33#include <Geom_BSplineSurface.hxx>
7fd59977 34#include <gp_Pln.hxx>
35#include <Geom2d_Curve.hxx>
36#include <GeomAPI.hxx>
37#include <Geom2dAdaptor_Curve.hxx>
38#include <Geom2dGcc_QualifiedCurve.hxx>
39#include <Geom2dGcc_Lin2d2Tan.hxx>
40#include <Geom2d_Line.hxx>
41#include <BRepBuilderAPI_MakeEdge.hxx>
42#include <TopoDS_Edge.hxx>
43#include <Precision.hxx>
44#include <Geom2d_Circle.hxx>
0b85f9a6 45#include <Geom2dGcc_QCurve.hxx>
7fd59977 46#include <GccEnt_QualifiedCirc.hxx>
54e37688 47#include <Geom2dGcc_Lin2d2TanIter.hxx>
7fd59977 48#include <BRepBuilderAPI_MakeWire.hxx>
49#include <TopExp_Explorer.hxx>
50#include <TopoDS.hxx>
51#include <TopoDS_Wire.hxx>
52#include <BRep_Tool.hxx>
53#include <gp_Circ.hxx>
54#include <BRepOffsetAPI_MakePipeShell.hxx>
55#include <AIS_Trihedron.hxx>
56#include <Geom_Axis2Placement.hxx>
57#include <V3d_View.hxx>
7fd59977 58#include <BRepBuilderAPI_MakeVertex.hxx>
787ff240 59#include <PrsDim_LengthDimension.hxx>
60#include <PrsDim_RadiusDimension.hxx>
7fd59977 61#include <BRepPrimAPI_MakeBox.hxx>
62#include <GeomAdaptor_Surface.hxx>
63#include <Extrema_ExtPS.hxx>
64#include <Geom_CartesianPoint.hxx>
65#include <Geom2d_CartesianPoint.hxx>
66#include <Geom2dGcc_Circ2d3Tan.hxx>
67#include <Aspect_Window.hxx>
68
69#include <TopoDS_Compound.hxx>
70#include <TopoDS_CompSolid.hxx>
71#include <StdSelect_ShapeTypeFilter.hxx>
7fd59977 72#include <HLRAlgo_Projector.hxx>
7fd59977 73#include <Standard_ErrorHandler.hxx>
aff395a3 74#include <Font_NameOfFont.hxx>
7fd59977 75
76static Standard_Integer BUC60842 (Draw_Interpretor& di, Standard_Integer /*argc*/,const char ** /*argv*/)
77{
78 Standard_Character abuf[16];
79 //Standard_Character * abuf = new Standard_Character[16];
80
81 Standard_CString st = abuf;
82
83 Handle(Geom_Circle) cir = new Geom_Circle (gp_Ax2 (gp_Pnt (823.687192, 502.366825, 478.960440), gp_Dir (0.173648, 0.984808, 0.000000), gp_Dir (-0.932169, 0.164367, -0.322560)), 50);
84 Handle(Geom_Ellipse) ell = new Geom_Ellipse (gp_Ax2 (gp_Pnt (1262.224429, 425.040878, 363.609716), gp_Dir (0.173648, 0.984808, 0.000000), gp_Dir (-0.932169, 0.164367, -0.322560)), 150, 100);
85 Handle(Geom_Plane) plne = new Geom_Plane (gp_Ax3 (gp_Ax2 (gp_Pnt (1262.224429, 425.040878, 363.609716), gp_Dir (0.173648, 0.984808, 0.000000), gp_Dir (-0.932169, 0.164367, -0.322560))));
86
87 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
88
89 gp_Pln pln = plne->Pln();
90 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d (ell, pln);
91322f44 91 Sprintf(abuf,"ell");
7fd59977 92 DrawTrSurf::Set(st,curve2d);
93 if(!aContext.IsNull()) {
94 Handle(AIS_Shape) aisp =
95 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
0577ae8c 96 aContext->Display (aisp, Standard_False);
7fd59977 97 }
98
99 Handle(Geom2d_Curve) fromcurve2d = GeomAPI::To2d (cir, pln);
91322f44 100 Sprintf(abuf,"cil");
7fd59977 101 DrawTrSurf::Set(st,fromcurve2d);
102 if(!aContext.IsNull()) {
103 Handle(AIS_Shape) aisp =
104 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(fromcurve2d, pln)).Edge());
0577ae8c 105 aContext->Display (aisp, Standard_False);
7fd59977 106 }
107
108 Geom2dAdaptor_Curve acur (curve2d), afromcur (fromcurve2d);
109 Geom2dGcc_QualifiedCurve qcur (acur, GccEnt_outside);
110 Geom2dGcc_QualifiedCurve qfromcur (afromcur, GccEnt_outside);
111 Geom2dGcc_Lin2d2Tan lintan (qcur, qfromcur, 0.1, 0.0, 0.0);
112 Standard_Integer i=0;
113 for(i=0;i<lintan.NbSolutions();i++) {
91322f44 114 Sprintf(abuf,"lintan_%d",i);
7fd59977 115 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
116 DrawTrSurf::Set(st,glin);
117 if(!aContext.IsNull()) {
118 Handle(AIS_Shape) aisp =
0577ae8c 119 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge());
120 aContext->Display (aisp, Standard_False);
7fd59977 121 }
122 }
0577ae8c 123 aContext->UpdateCurrentViewer();
7fd59977 124 di << " Is Done = \n" << (Standard_Integer) lintan.IsDone();
125 return 0;
126}
127
128static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
129{
130 if (argc != 4 && argc != 5 && argc != 6 && argc != 7) {
586db386 131 di << "Usage : " << argv[0] << "result_shape name_of_circle name_of_curve [ par1 [ tol ] ]\n";
7fd59977 132 return 1;
133 }
134
135 Standard_Real par1 = 0.0, par2 = 0.0;
136 Standard_Real tol = Precision::Angular();
137 if (argc >= 5)
91322f44 138 par1 = Draw::Atof(argv[4]);
7fd59977 139 if (argc == 6)
91322f44 140 par2 = Draw::Atof(argv[5]);
7fd59977 141 if (argc == 7)
91322f44 142 tol = Draw::Atof(argv[6]);
7fd59977 143 Handle(Geom2d_Curve) aCur2d1 = DrawTrSurf::GetCurve2d(argv[2]);
144 Handle(Geom2d_Curve) aCur2d2 = DrawTrSurf::GetCurve2d(argv[3]);
145 if (aCur2d1.IsNull() || aCur2d2.IsNull()) {
586db386 146 di << "Faulty : not curves\n";
7fd59977 147 return 1;
148 }
149 Standard_Boolean c1IsCircle = Standard_False;
150 Handle(Geom2d_Circle) aCir2d = Handle(Geom2d_Circle)::DownCast(aCur2d1);
151 if (!aCir2d.IsNull()) {
152 c1IsCircle = Standard_True;
91322f44 153 if (argc == 6) tol = Draw::Atof(argv[5]);
7fd59977 154 }
155 if(c1IsCircle) {
156 Geom2dAdaptor_Curve acur(aCur2d2);
0b85f9a6 157 Geom2dGcc_QCurve qcur(acur, GccEnt_unqualified);
7fd59977 158 GccEnt_QualifiedCirc qfromcur(aCir2d->Circ2d(), GccEnt_unqualified);
54e37688 159 Geom2dGcc_Lin2d2TanIter lintan(qfromcur, qcur , par1, tol);
7fd59977 160 if (lintan.IsDone()) {
161 gp_Lin2d lin = lintan.ThisSolution();
162 Handle(Geom2d_Line) glin = new Geom2d_Line(lin);
163 DrawTrSurf::Set(argv[1], glin);
164 } else {
586db386 165 di << "Faulty : tangent line is not done.\n";
7fd59977 166 }
167 }
168 else {
169 Geom2dAdaptor_Curve acur1(aCur2d1);
170 Geom2dAdaptor_Curve acur2(aCur2d2);
0b85f9a6 171 Geom2dGcc_QCurve qcur1(acur1, GccEnt_unqualified);
172 Geom2dGcc_QCurve qcur2(acur2, GccEnt_unqualified);
54e37688 173 Geom2dGcc_Lin2d2TanIter lintan(qcur1, qcur2 , par1, par2, tol);
7fd59977 174 if (lintan.IsDone()) {
175 gp_Lin2d lin = lintan.ThisSolution();
176 Handle(Geom2d_Line) glin = new Geom2d_Line(lin);
177 DrawTrSurf::Set(argv[1], glin);
178 } else {
586db386 179 di << "Faulty : tangent line is not done.\n";
7fd59977 180 }
181 }
182 return 0;
183}
184
185static Standard_Integer BUC60970 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
186{
187 if(argc!=3)
188 {
586db386 189 di << "Usage : " << argv[0] << " shape result\n";
7fd59977 190 return 1;
191 }
192
193 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
194 if(aContext.IsNull()) {
195 di << "use 'vinit' command before " << argv[0] << "\n";
196 return 1;
197 }
198
199 TopoDS_Shape aResult = DBRep::Get(argv[1]);
200
201 BRepBuilderAPI_MakeWire bRepSpineWire;
202 TopExp_Explorer exp_(aResult, TopAbs_WIRE);
203
204 Standard_Integer i = 0;
205 for(;exp_.More();exp_.Next()){
206 i++;
207 bRepSpineWire.Add(TopoDS::Wire(exp_.Current()));
208 }
209
210 //printf("total no of wires are ............. %d\n", i);
211 di << "total no of wires are ............. " << i << "\n";
212
213 TopoDS_Wire spineWire = bRepSpineWire.Wire();
0577ae8c 214 aContext->Display (new AIS_Shape(spineWire), Standard_False);
7fd59977 215
216 DBRep::Set("slineW",spineWire);
217
218 TopExp_Explorer spineWireExp(spineWire, TopAbs_EDGE);
219 Standard_Real first, last;
857ffd5e 220 Handle(Geom_Curve) curl_ = BRep_Tool::Curve(TopoDS::Edge(spineWireExp.Current()), first, last);
7fd59977 221 gp_Pnt firstPnt;
222 gp_Vec tanVec;
223 curl_->D1(first, firstPnt, tanVec);
224 tanVec.Normalize();
225 gp_Dir tanDir(tanVec.X(), tanVec.Y(), tanVec.Z());
226 gp_Ax2 gpAx2(firstPnt, tanDir);
227 gp_Circ gpCirc(gpAx2, 2.5);
228 BRepBuilderAPI_MakeWire aMWire(BRepBuilderAPI_MakeEdge(new Geom_Circle(gpCirc)).Edge());
229 TopoDS_Wire topoWire(aMWire);
0577ae8c 230 aContext->Display (new AIS_Shape(topoWire), Standard_False);
7fd59977 231
232 DBRep::Set("topoW",topoWire);
233
234 BRepOffsetAPI_MakePipeShell bRepPipe(spineWire);
235 bRepPipe.Add(topoWire);
236 bRepPipe.Build();
237
0577ae8c 238 aContext->Display (new AIS_Shape(bRepPipe.Shape()), Standard_True);
7fd59977 239
240 DBRep::Set(argv[2],bRepPipe.Shape());
241
242 return 0;
243}
244
60bf98ae 245static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
7fd59977 246{
247 if (argc > 1) {
586db386 248 di<<"Function don't has parameters\n";
7fd59977 249 return 1;
250 }
251
60bf98ae 252 if(ViewerTest::GetAISContext().IsNull())
253 {
254 di << "View was not created. Use 'vinit' command before "
255 << argv[0] << "\n";
256 return 1;
257 }
258 Handle(AIS_InteractiveContext) context = ViewerTest::GetAISContext();
7fd59977 259
260 //The following dimesion code has problems regarding arrow_size. The desired effect is not produced.
261 /***************************************/
262 //First view
263 /***************************************/
264 gp_Pnt p1 = gp_Pnt(602.51,50.,0.);
265 gp_Pnt p2 = gp_Pnt(602.51,200.,0.);
266 gp_Pnt p3 = gp_Pnt(102.51,200.,0.);
267 gp_Pnt p4 = gp_Pnt(102.51,170.,0.);
268 gp_Pnt p5 = gp_Pnt(502.51,170.,0.);
269 gp_Pnt p6 = gp_Pnt(502.51,80.,0.);
270 gp_Pnt p7 = gp_Pnt(102.51,80.,0.);
271 gp_Pnt p8 = gp_Pnt(102.51,50.,0.);
272 TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(p1);
273 TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(p2);
274 TopoDS_Vertex V3 = BRepBuilderAPI_MakeVertex(p3);
275 TopoDS_Vertex V4 = BRepBuilderAPI_MakeVertex(p4);
276 TopoDS_Vertex V5 = BRepBuilderAPI_MakeVertex(p5);
277 TopoDS_Vertex V6 = BRepBuilderAPI_MakeVertex(p6);
278 TopoDS_Vertex V7 = BRepBuilderAPI_MakeVertex(p7);
279 TopoDS_Vertex V8 = BRepBuilderAPI_MakeVertex(p8);
280 gp_Pnt plnpt(0, 0, 0);
281 gp_Dir plndir(0, 0, 1);
282 Handle(Geom_Plane) pln = new Geom_Plane(plnpt,plndir);
60bf98ae 283 Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
284 anAspect->MakeArrows3d (Standard_True);
285 anAspect->ArrowAspect()->SetAngle (M_PI/180.0 * 10.0);
7fd59977 286 /***************************************/
287 //dimension "L 502.51"
288 /***************************************/
787ff240 289 Handle(PrsDim_LengthDimension) len = new PrsDim_LengthDimension(V2, V3, pln->Pln());
60bf98ae 290 anAspect->ArrowAspect()->SetLength (30.0);
291 len->SetDimensionAspect (anAspect);
0577ae8c 292 context->Display (len, Standard_False);
7fd59977 293 /***************************************/
294 //dimension "L 90"
295 /***************************************/
787ff240 296 Handle(PrsDim_LengthDimension) len1 = new PrsDim_LengthDimension(V7, V4, pln->Pln());
60bf98ae 297 len1->SetDimensionAspect (anAspect);
298 len1->SetFlyout (30.0);
299 anAspect->ArrowAspect()->SetLength (100.0);
0577ae8c 300 context->Display (len1, Standard_False);
7fd59977 301 /***************************************/
302 //dimension "L 150"
303 /***************************************/
787ff240 304 Handle(PrsDim_LengthDimension) len2 = new PrsDim_LengthDimension(V1, V2, pln->Pln());
60bf98ae 305 len2->SetDimensionAspect (anAspect);
0577ae8c 306 context->Display (len2, Standard_False);
7fd59977 307 /***************************************/
308 //dimension "R 88.58"
309 /***************************************/
310 gp_Circ cir = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 88.58);
311 TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(cir,gp_Pnt(191.09,0,0.),gp_Pnt(191.09,-177.16,0.) );
787ff240 312 Handle(PrsDim_RadiusDimension) dim1 = new PrsDim_RadiusDimension(E1);
60bf98ae 313 dim1->SetDimensionAspect (anAspect);
0577ae8c 314 context->Display (dim1, Standard_False);
7fd59977 315 /***************************************/
316 //dimension "R 43.80"
317 /***************************************/
318 gp_Circ cir1 = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 43.80);
319 TopoDS_Edge E_cir1 = BRepBuilderAPI_MakeEdge(cir1);
787ff240 320 dim1 = new PrsDim_RadiusDimension(E_cir1);
60bf98ae 321 anAspect->ArrowAspect()->SetLength (60.0);
322 dim1->SetDimensionAspect (anAspect);
0577ae8c 323 context->Display (dim1, Standard_False);
7fd59977 324 /***************************************/
325 //dimension "R 17.86"
326 /***************************************/
327 gp_Circ cir2 = gp_Circ(gp_Ax2(gp_Pnt(566.11, -88.58, 0), gp_Dir(0, 0, -1)), 17.86);
328 TopoDS_Edge E_cir2 = BRepBuilderAPI_MakeEdge(cir2);
787ff240 329 dim1 = new PrsDim_RadiusDimension(E_cir2);
60bf98ae 330 anAspect->ArrowAspect()->SetLength (40.0);
331 dim1->SetDimensionAspect (anAspect);
0577ae8c 332 context->Display (dim1, Standard_True);
7fd59977 333
334 return 0;
335}
336
337static Standard_Integer OCC138 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
338{
339 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
340 if(aContext.IsNull()) {
341 di << "use 'vinit' command before " << argv[0] << "\n";
342 return 1;
343 }
344
345 BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
346 BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300,300));
347 BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500,500));
348
c3282ec1 349 Handle(AIS_InteractiveObject) ais1 = new AIS_Shape(box1.Shape());
350 Handle(AIS_InteractiveObject) ais2 = new AIS_Shape(box2.Shape());
351 Handle(AIS_InteractiveObject) ais3 = new AIS_Shape(box3.Shape());
7fd59977 352
0577ae8c 353 aContext->Display (ais1, Standard_False);
354 aContext->Display (ais2, Standard_False);
355 aContext->Display (ais3, Standard_False);
7fd59977 356
0577ae8c 357 aContext->AddOrRemoveSelected (ais1, Standard_False);
358 aContext->AddOrRemoveSelected (ais2, Standard_False);
359 aContext->AddOrRemoveSelected (ais3, Standard_False);
7fd59977 360
c3282ec1 361 di << "\n No of currents = " << aContext->NbSelected();
7fd59977 362
c3282ec1 363 aContext->InitSelected();
7fd59977 364
365 int count = 1;
c3282ec1 366 while(aContext->MoreSelected())
7fd59977 367 {
368 di << "\n count is = " << count++;
c3282ec1 369 Handle(AIS_InteractiveObject) ais = aContext->SelectedInteractive();
0577ae8c 370 aContext->AddOrRemoveSelected (ais, Standard_False);
c3282ec1 371 aContext->InitSelected();
7fd59977 372 }
373
0577ae8c 374 aContext->UpdateCurrentViewer();
375
7fd59977 376 return 0;
377}
378
7fd59977 379static int geom_get_2Dpt_from_3Dpt(const gp_Pnt& pnt3d, const gp_Pln& pln, gp_Pnt2d& pnt2d)
380{
381 int ret = 0;
857ffd5e 382 Handle(Geom_Plane) gpln = new Geom_Plane(pln);
7fd59977 383 GeomAdaptor_Surface adsur(gpln);
384 Extrema_ExtPS extps(pnt3d, adsur, 0.001, 0.001);
385 if( extps.IsDone() )
386 {
387 int index;
388 for(index=1; index<= extps.NbExt(); index++ )
389 {
390 Extrema_POnSurf pons = extps.Point(index);
391 Standard_Real U, V;
392 pons.Parameter(U, V);
393 pnt2d.SetCoord(U, V);
394 ret = 1;
395 }
396 }
397 return ret;
398}
399
400static Standard_Integer OCC353 (Draw_Interpretor& di, Standard_Integer , const char ** )
401{
402 gp_Ax2 ax21( gp_Pnt(100,0,0), gp_Dir(0,0,1) );
857ffd5e 403 Handle(Geom_Circle) h_cir1 = new Geom_Circle( ax21, 25 );
7fd59977 404
405 gp_Ax2 ax22( gp_Pnt(-100,0,0), gp_Dir(0,0,1) );
857ffd5e 406 Handle(Geom_Circle) h_cir2 = new Geom_Circle( ax22, 25 );
7fd59977 407
408 gp_Pln refpln( gp_Pnt(0,0,0), gp_Dir(0,0,1) );
857ffd5e 409 Handle(Geom2d_Curve) cir2d1 = GeomAPI::To2d(h_cir1, refpln);
410 Handle(Geom2d_Curve) cir2d2 = GeomAPI::To2d(h_cir2, refpln);
7fd59977 411
412 Geom2dAdaptor_Curve adop1(cir2d1);
413 Geom2dAdaptor_Curve adop2(cir2d2);
414
415 Geom2dGcc_QualifiedCurve qcur1(adop1, GccEnt_enclosing);
416 Geom2dGcc_QualifiedCurve qcur2(adop2, GccEnt_enclosing);
417
857ffd5e 418 Handle(Geom_CartesianPoint) h_carpt = new Geom_CartesianPoint(0,175,0);
7fd59977 419
420 gp_Pnt pt3d = h_carpt->Pnt();
421 gp_Pnt2d pt2d;
422 geom_get_2Dpt_from_3Dpt(pt3d, refpln, pt2d);
423
424 Standard_CString st;
425 st = "cir2d1";
426 DrawTrSurf::Set(st,cir2d1);
427 st = "cir2d2";
428 DrawTrSurf::Set(st,cir2d2);
429 st = "pt2d";
430 DrawTrSurf::Set(st,pt2d);
431
857ffd5e 432 Handle(Geom2d_CartesianPoint) pt = new Geom2d_CartesianPoint(pt2d);
7fd59977 433 Geom2dGcc_Circ2d3Tan sol( qcur1, qcur2, pt, 0.001, 0.0, 0.0);
434
435 int res = 0;
436 Standard_Character buf[10];
437 buf[0] = '\0';
438
439 if( sol.IsDone() ) {
440 res = sol.NbSolutions();
441 for(Standard_Integer i=1;i<=res;i++) {
442 Handle(Geom2d_Circle) aC = new Geom2d_Circle(sol.ThisSolution(i));
91322f44 443 Sprintf(buf,"Result_%d",i);
7fd59977 444 st = buf;
445 DrawTrSurf::Set(st,aC);
446 }
447 }
448 else
449 di << "\n Faulty: no solutions found ";
450 //printf("\n Faulty: no solutions found ");
451
452 //printf("\n Num of solutions are %d ", res );
453 di << "\n Num of solutions are " << res << " ";
454
455 return 0;
456}
457
458static Standard_Integer OCC280 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
459{
460 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
461 if(aContext.IsNull())
462 {
463 di << "use 'vinit' command before " << argv[0] << "\n";
464 return -1;
465 }
466 if ( argc != 3) {
586db386 467 di << "ERROR : Usage : " << argv[0] << " hlr=0/1 setsurfecedetail=0/1; set perspecrive view\n";
7fd59977 468 return 1;
469 }
470
91322f44 471 Standard_Integer HLR = Draw::Atoi(argv[1]);
7fd59977 472 if (HLR != 0) {
473 HLR = 1;
474 }
475
18d715bd 476 TCollection_AsciiString anOldName = ViewerTest::GetCurrentViewName();
7fd59977 477 Handle(V3d_Viewer) aViewer = ViewerTest::GetViewerFromContext();
5e27df78 478 aViewer->SetDefaultTypeOfView (V3d_PERSPECTIVE);
18d715bd 479 Handle(Aspect_Window) asp = ViewerTest::CurrentView()->Window();
7fd59977 480 Handle(V3d_View) aNewView = aViewer->CreateView();
5e27df78 481 ViewerTest::CurrentView (aNewView);
18d715bd 482 TCollection_AsciiString aNewName=anOldName + "_new";
483 ViewerTest::InitViewName(aNewName,ViewerTest::CurrentView());
5e27df78 484 aNewView->SetWindow (asp);
7fd59977 485 if (!asp->IsMapped()) asp->Map();
18d715bd 486 aNewView->Redraw();
487 ViewerTest::RemoveView(anOldName,false);
5e27df78 488 ViewerTest::UnsetEventManager();
489 ViewerTest::SetEventManager (new ViewerTest_EventManager (aNewView, ViewerTest::GetAISContext()));
490
de75ed09 491 if (HLR == 1)
492 {
493 di << "HLR\n";
18d715bd 494 ViewerTest::CurrentView()->SetComputedMode (Standard_True);
7fd59977 495 }
496
497 return 0;
498}
499
7fd59977 500static Standard_Integer OCC138LC (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
501{
502 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
503 if(aContext.IsNull()) {
504 di << "use 'vinit' command before " << argv[0] << "\n";
505 return 1;
506 }
507
508 BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
509 BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300,300));
510 BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500,500));
511
543a9964 512 Handle(AIS_InteractiveObject) ais1 = new AIS_Shape(box1.Shape());
513 Handle(AIS_InteractiveObject) ais2 = new AIS_Shape(box2.Shape());
514 Handle(AIS_InteractiveObject) ais3 = new AIS_Shape(box3.Shape());
7fd59977 515
0577ae8c 516 aContext->Display (ais1, Standard_False);
517 aContext->Display (ais2, Standard_False);
518 aContext->Display (ais3, Standard_False);
7fd59977 519
0577ae8c 520 aContext->AddOrRemoveSelected (ais1, Standard_False);
521 aContext->AddOrRemoveSelected (ais2, Standard_False);
522 aContext->AddOrRemoveSelected (ais3, Standard_False);
7fd59977 523
524 di << "\n No of selected = " << aContext->NbSelected();
525
526 aContext->InitSelected();
527
528 int count = 1;
529 while(aContext->MoreSelected())
530 {
531 di << "\n count is = %d" << count++;
857ffd5e 532 Handle(AIS_InteractiveObject) ais = aContext->SelectedInteractive();
0577ae8c 533 aContext->AddOrRemoveSelected (ais, Standard_False);
7fd59977 534 aContext->InitSelected();
535 }
536
0577ae8c 537 aContext->UpdateCurrentViewer();
538
7fd59977 539 return 0;
540}
541
7fd59977 542#include <BRepBndLib.hxx>
543#include <Draw.hxx>
544//=======================================================================
545//function : OCC566
546//purpose :
547//=======================================================================
548static Standard_Integer OCC566(Draw_Interpretor& di,Standard_Integer n,const char ** a)
549{
550 if (n < 2) {
586db386 551 di<<"Usage: " << a[0] << " shape [ xmin ymin zmin xmax ymax zmax]\n";
7fd59977 552 return 1;
553 }
554 TopoDS_Shape S = DBRep::Get(a[1]);
555 if (S.IsNull()) return 1;
556 Bnd_Box B;
557 BRepBndLib::AddClose(S,B);
558 Standard_Real axmin,aymin,azmin,axmax,aymax,azmax;
559 B.Get(axmin,aymin,azmin,axmax,aymax,azmax);
560 di << axmin<<" "<< aymin<<" "<< azmin<<" "<< axmax<<" "<< aymax<<" "<< azmax;
561 if (n >= 8) {
562 Draw::Set(a[2],axmin) ;
563 Draw::Set(a[3],aymin) ;
564 Draw::Set(a[4],azmin) ;
565 Draw::Set(a[5],axmax) ;
566 Draw::Set(a[6],aymax) ;
567 Draw::Set(a[7],azmax) ;
568 }
569 return 0;
570}
571
572#include <BRepFilletAPI_MakeFillet.hxx>
573//=======================================================================
574//function : OCC570
575//purpose :
576//=======================================================================
577static Standard_Integer OCC570 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
578{
579 if (argc < 2) {
586db386 580 di<<"Usage: " << argv[0] << " result\n";
7fd59977 581 return 1;
582 }
583
584 BRepPrimAPI_MakeBox mkBox(100.,100.,100.);
585 TopoDS_Shape aBox = mkBox.Shape();
586
587 TopExp_Explorer aExp;
588 aExp.Init(aBox,TopAbs_WIRE);
589 if (aExp.More())
590 {
591 TopoDS_Shape aWire = aExp.Current();
592
593 aExp.Init(aWire,TopAbs_EDGE);
594 TopoDS_Edge e1 = TopoDS::Edge(aExp.Current()); aExp.Next();
595 TopoDS_Edge e2 = TopoDS::Edge(aExp.Current()); aExp.Next();
596 TopoDS_Edge e3 = TopoDS::Edge(aExp.Current()); aExp.Next();
597 TopoDS_Edge e4 = TopoDS::Edge(aExp.Current());
598
599 try
600 {
601 OCC_CATCH_SIGNALS
602 BRepFilletAPI_MakeFillet mkFillet(aBox);
603 mkFillet.SetContinuity(GeomAbs_C1,.001);
604
605 // Setup variable fillet data
606 TColgp_Array1OfPnt2d t_pnt(1,4);
607 t_pnt.SetValue(1,gp_Pnt2d(0.0,5.0));
608 t_pnt.SetValue(2,gp_Pnt2d(0.3,15.0));
609 t_pnt.SetValue(3,gp_Pnt2d(0.7,15.0));
610 t_pnt.SetValue(4,gp_Pnt2d(1.0,5.0));
611
612 // HERE:
613 // It is impossible to build fillet if at least one edge
614 // with variable radius is added!!! If all are constant, everything is ok.
615 mkFillet.Add(t_pnt,e1);
616 mkFillet.Add(5.0,e2);
617 mkFillet.Add(t_pnt,e3);
618 mkFillet.Add(5.0,e4);
619
620 mkFillet.Build();
621 TopoDS_Shape aFinalShape = mkFillet.Shape();
622
623 DBRep::Set(argv[1],aFinalShape);
624 }
a738b534 625 catch(Standard_Failure const&)
7fd59977 626 {
586db386 627 di << argv[0] << ": Exception in fillet\n";
7fd59977 628 return 2;
629 }
630 }
631
632 return 0;
633}
634
635#include <Law_Interpol.hxx>
636
637static Standard_Real t3d = 1.e-4;
638static Standard_Real t2d = 1.e-5;
639static Standard_Real ta = 1.e-2;
640static Standard_Real fl = 1.e-3;
641static Standard_Real tapp_angle = 1.e-2;
642static GeomAbs_Shape blend_cont = GeomAbs_C1;
643
7fd59977 644static BRepFilletAPI_MakeFillet* Rake = 0;
645static char name[100];
646
647static void printtolblend(Draw_Interpretor& di)
648{
649 di<<"tolerance ang : "<<ta<<"\n";
650 di<<"tolerance 3d : "<<t3d<<"\n";
651 di<<"tolerance 2d : "<<t2d<<"\n";
652 di<<"fleche : "<<fl<<"\n";
653
654 di<<"tolblend "<<ta<<" "<<t3d<<" "<<t2d<<" "<<fl<<"\n";
655}
656
657static Standard_Integer MKEVOL(Draw_Interpretor& di,
658 Standard_Integer narg,
659 const char ** a)
660{
661 if(Rake != 0) {delete Rake; Rake = 0;}
662 printtolblend(di);
663 if (narg < 3) return 1;
664 TopoDS_Shape V = DBRep::Get(a[2]);
665 Rake = new BRepFilletAPI_MakeFillet(V);
666 Rake->SetParams(ta,t3d,t2d,t3d,t2d,fl);
667 Rake->SetContinuity(blend_cont, tapp_angle);
668 if (narg == 4) {
669 ChFi3d_FilletShape FSh = ChFi3d_Rational;
670 if (!strcasecmp(a[3], "Q")) {
671 FSh = ChFi3d_QuasiAngular;
672 }
673 else if (!strcasecmp(a[3], "P")) {
674 FSh = ChFi3d_Polynomial;
675 }
676 Rake->SetFilletShape(FSh);
677 }
678 strcpy(name, a[1]);
679 return 0;
680}
681
682static Standard_Integer UPDATEVOL(Draw_Interpretor& di,
683 Standard_Integer narg,
684 const char ** a)
685{
686 if(Rake == 0){
586db386 687 di << "MakeFillet non initialise\n";
7fd59977 688 return 1 ;
689 }
690 if(narg%2 != 0 || narg < 4) return 1;
691 TColgp_Array1OfPnt2d uandr(1,(narg/2)-1);
692 Standard_Real Rad, Par;
693 TopoDS_Shape aLocalEdge(DBRep::Get(a[1],TopAbs_EDGE));
694 TopoDS_Edge E = TopoDS::Edge(aLocalEdge);
695 for (Standard_Integer ii = 1; ii <= (narg/2)-1; ii++){
91322f44 696 Par = Draw::Atof(a[2*ii]);
697 Rad = Draw::Atof(a[2*ii + 1]);
7fd59977 698 uandr.ChangeValue(ii).SetCoord(Par,Rad);
699 }
700 //HELPDESK: Add law creation
701 const Standard_Boolean aLawMode = !strcmp(a[0],"OCC570evollaw");
702 if (aLawMode)
703 {
586db386 704 di<<"INFO: Using law to define variable fillet\n";
7fd59977 705 Handle(Law_Interpol) law = new Law_Interpol;
706 law->Set(uandr);
707 Rake->Add(law,E);
708 }
709 else
710 Rake->Add(uandr,E);
711
712 return 0;
713}
714
715static Standard_Integer BUILDEVOL(Draw_Interpretor& di,
716 Standard_Integer,
717 const char **)
718{
719 if(Rake == 0){
586db386 720 di << "MakeFillet non initialise\n";
7fd59977 721 return 1 ;
722 }
723 Rake->Build();
724 if(Rake->IsDone()){
725 TopoDS_Shape result = Rake->Shape();
726 DBRep::Set(name,result);
727 if(Rake != 0) {delete Rake; Rake = 0;}
728 return 0;
729 }
730 if(Rake != 0) {delete Rake; Rake = 0;}
731 return 1;
732}
733
734#include <TColGeom_SequenceOfCurve.hxx>
735#include <Geom_TrimmedCurve.hxx>
736#include <GeomFill_NSections.hxx>
737#include <BRepBuilderAPI_MakeFace.hxx>
738//=======================================================================
739//function : OCC606
740//purpose :
741//=======================================================================
742static Standard_Integer OCC606 ( Draw_Interpretor& di, Standard_Integer n, const char ** a )
743{
744 if (n != 3 && n != 4)
745 {
586db386 746 di << "Usage : " << a[0] << " result shape [-t]\n";
7fd59977 747 return 0;
748 }
749
750 Standard_Boolean TrimMode = (n == 4);
586db386 751 if (TrimMode) di<<"INFO: Using trimmed curves...\n";
752 else di<<"INFO: Using non trimmed curves...\n";
7fd59977 753
754 TopoDS_Shape S = DBRep::Get(a[2]);
755
756 TopExp_Explorer t_exp(S,TopAbs_EDGE);
757 TColGeom_SequenceOfCurve n_curves1;
758 TColStd_SequenceOfReal np;
759 Standard_Real param = 5.0;
760
761 for (;t_exp.More();t_exp.Next())
762 {
763 Standard_Real f,l;
764 Handle(Geom_Curve) h_cur = BRep_Tool::Curve(TopoDS::Edge(t_exp.Current()),f,l);
765 if (!h_cur.IsNull())
766 {
767 if (TrimMode) h_cur = new Geom_TrimmedCurve(h_cur,f,l);
768
769 n_curves1.Append(h_cur);
770 np.Append(param);
771 param += 1.0;
772 }
773 }
774
775 if (n_curves1.Length()>1 && !np.IsEmpty())
776 {
777 try
778 {
779 OCC_CATCH_SIGNALS
780 GeomFill_NSections b_surface1(n_curves1, np);
7fd59977 781 Handle(Geom_BSplineSurface) result_surf1 = b_surface1.BSplineSurface();
782 if (!result_surf1.IsNull())
783 {
1c72dff6 784 BRepBuilderAPI_MakeFace b_face1(result_surf1, Precision::Confusion());
7fd59977 785 TopoDS_Face bsp_face1 = b_face1.Face();
786 DBRep::Set(a[1],bsp_face1);
787 }
788 }
a738b534 789 catch(Standard_Failure const&)
7fd59977 790 {
586db386 791 di<<"ERROR: Exception in GeomFill_NSections\n";
7fd59977 792 }
793 }
794
795
796 return 0;
797}
798
799//=======================================================================
800//function : OCC813
801//purpose :
802//=======================================================================
803static Standard_Integer OCC813 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
804{
805 if (argc < 3)
806 {
586db386 807 di << "Usage : " << argv[0] << " U V\n";
7fd59977 808 return 1;
809 }
810
811 Standard_CString str;
91322f44 812 Standard_Real U = Draw::Atof(argv[1]);
813 Standard_Real V = Draw::Atof(argv[2]);
7fd59977 814
815 //Between ellipse and point:
816
817 Handle(Geom_Ellipse) ell = new Geom_Ellipse(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
818 gp_Dir(0.173648,0.984808,0.000000),
819 gp_Dir(-0.932169,0.164367,-0.322560)), 150, 100);
820 Handle(Geom_Plane) plne = new Geom_Plane(gp_Ax3(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
821 gp_Dir(0.173648,0.984808,0.000000),
822 gp_Dir(-0.932169,0.164367,-0.322560))) );
823
824 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
825
826 gp_Pnt2d pt2d(U,V);
827 gp_Pln pln = plne->Pln();
828
829 str = "OCC813_pnt"; DrawTrSurf::Set(str,pt2d);
830
831 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d(ell,pln);
832 Geom2dAdaptor_Curve acur(curve2d);
833 Geom2dGcc_QualifiedCurve qcur(acur, GccEnt_outside);
834
835 str = "OCC813_ell"; DrawTrSurf::Set(str,curve2d);
836 if(!aContext.IsNull()) {
837 Handle(AIS_Shape) aisp =
838 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
0577ae8c 839 aContext->Display (aisp, Standard_False);
7fd59977 840 }
841
842 //This does not give any solutions.
843 Geom2dGcc_Lin2d2Tan lintan(qcur, pt2d, 0.1);
844 di<<"OCC813 nb of solutions = "<<lintan.NbSolutions()<<"\n";
845
846 Standard_Character abuf[16];
847 Standard_CString st = abuf;
848
849 Standard_Integer i;
850 for(i=1;i<=lintan.NbSolutions();i++) {
91322f44 851 Sprintf(abuf,"lintan_%d",i);
7fd59977 852 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
853 DrawTrSurf::Set(st,glin);
854 if(!aContext.IsNull()) {
855 Handle(AIS_Shape) aisp =
0577ae8c 856 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge());
857 aContext->Display (aisp, Standard_False);
7fd59977 858 }
859 }
860
0577ae8c 861 if (!aContext.IsNull())
862 {
863 aContext->UpdateCurrentViewer();
864 }
865
7fd59977 866 return 0;
867}
868
869//=======================================================================
870//function : OCC814
871//purpose :
872//=======================================================================
873static Standard_Integer OCC814 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
874{
875 if (argc > 1)
876 {
877 di << "Usage : " << argv[0] << "\n";
878 return 1;
879 }
880
881 Standard_CString str;
882
883 //Between Ellipse and Circle:
884
885 Handle(Geom_Circle) cir = new Geom_Circle(gp_Ax2(gp_Pnt(823.687192,502.366825,478.960440),
886 gp_Dir(0.173648,0.984808,0.000000),
887 gp_Dir(-0.932169,0.164367,-0.322560)), 50);
888 Handle(Geom_Ellipse) ell = new Geom_Ellipse(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
889 gp_Dir(0.173648,0.984808,0.000000),
890 gp_Dir(-0.932169,0.164367,-0.322560)), 150, 100);
891 Handle(Geom_Plane) plne = new Geom_Plane(gp_Ax3(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
892 gp_Dir(0.173648,0.984808,0.000000),
893 gp_Dir(-0.932169,0.164367,-0.322560))) );
894
895 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
896
897 gp_Pln pln = plne->Pln();
898 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d(ell, pln);
899 Handle(Geom2d_Curve) fromcurve2d = GeomAPI::To2d(cir, pln);
900
901 str = "OCC814_cir"; DrawTrSurf::Set(str,curve2d);
902 str = "OCC814_ell"; DrawTrSurf::Set(str,fromcurve2d);
903 if(!aContext.IsNull()) {
904 Handle(AIS_Shape) aisp =
905 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
0577ae8c 906 aContext->Display (aisp, Standard_False);
7fd59977 907 }
908 if(!aContext.IsNull()) {
909 Handle(AIS_Shape) aisp =
910 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(fromcurve2d, pln)).Edge());
0577ae8c 911 aContext->Display (aisp, Standard_False);
7fd59977 912 }
913
914 Geom2dAdaptor_Curve acur(curve2d), afromcur(fromcurve2d);
915
916 Geom2dGcc_QualifiedCurve qcur(acur, GccEnt_outside) ;
917 Geom2dGcc_QualifiedCurve qfromcur(afromcur, GccEnt_outside) ;
918
919 //This does not give any solutions.
920 Geom2dGcc_Lin2d2Tan lintan(qcur, qfromcur, 0.1);
921 di<<"OCC814 nb of solutions = "<<lintan.NbSolutions()<<"\n";
922
923 Standard_Character abuf[16];
924 Standard_CString st = abuf;
925
926 Standard_Integer i;
927 for(i=1;i<=lintan.NbSolutions();i++) {
91322f44 928 Sprintf(abuf,"lintan_%d",i);
7fd59977 929 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
930 DrawTrSurf::Set(st,glin);
931 if(!aContext.IsNull()) {
932 Handle(AIS_Shape) aisp =
0577ae8c 933 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge());
934 aContext->Display (aisp, Standard_False);
7fd59977 935 }
936 }
937
0577ae8c 938 if (!aContext.IsNull())
939 {
940 aContext->UpdateCurrentViewer();
941 }
942
7fd59977 943 return 0;
944}
945
946#include <ShapeAnalysis_Wire.hxx>
947#include <IntRes2d_SequenceOfIntersectionPoint.hxx>
948#include <TColgp_SequenceOfPnt.hxx>
949#include <ShapeFix_Wire.hxx>
950//=======================================================================
951//function : OCC884
952//purpose :
953//=======================================================================
954static Standard_Integer OCC884 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
955{
956 if (argc < 3 || argc > 5)
957 {
586db386 958 di << "Usage : " << argv[0] << " result shape [toler [maxtoler]]\n";
7fd59977 959 return 1;
960 }
961
962 TopoDS_Shape shape = DBRep::Get(argv[2]); //read the shape
963
964 TopExp_Explorer exp(shape, TopAbs_EDGE);
965 if (!exp.More())
966 {
586db386 967 di<<"Error: no edge found\n";
7fd59977 968 return 1;
969 }
970
971 BRep_Builder builder;
972 TopoDS_Wire wire;
973 builder.MakeWire(wire);
974 builder.Add(wire, TopoDS::Edge(exp.Current()));
975
976 // HelpDesk: Create planar face if possible
977 TopoDS_Face face = BRepBuilderAPI_MakeFace(wire,Standard_True);
978
979 Handle(ShapeAnalysis_Wire) advWA = new ShapeAnalysis_Wire;
980 advWA->Load(wire);
981 advWA->SetFace(face);
982 advWA->SetPrecision(0.001);
983
984 IntRes2d_SequenceOfIntersectionPoint points2d;
985 TColgp_SequenceOfPnt points3d;
986
987 di << "Info: CheckSelfIntersectingEdge = " << (Standard_Integer) advWA->CheckSelfIntersectingEdge(1,points2d,points3d) << "\n";
988
989 ShapeExtend_Status status = ShapeExtend_FAIL1;
990 if (advWA->StatusSelfIntersection(status))
991 di << "Info: No P Curve found in the edge\n";
992
993 status = ShapeExtend_FAIL2;
994 if (advWA->StatusSelfIntersection(status))
995 di << "Info: No Vertices found in the edge\n";
996
997 status = ShapeExtend_DONE1;
998 if (advWA->StatusSelfIntersection(status))
999 di << "Info: Self-intersection found in the edge\n";
1000
1001 Standard_Integer i, num = points2d.Length();
1002 di << "Info: No. of self-intersection points : " << num << "\n";
1003
1004 char str[80];
75259fc5 1005 Standard_CString aName = str;
7fd59977 1006 for (i = 1; i <= num; ++i)
1007 {
1008 gp_Pnt pt = points3d(i);
1009 di << "Info: Intersecting pt : (" << pt.X() << ", " << pt.Y() << ", " << pt.Z() << ")\n";
91322f44 1010 Sprintf(str,"p_%d",i);
75259fc5 1011 DrawTrSurf::Set(aName,pt);
7fd59977 1012 }
1013
1014 Handle(ShapeFix_Wire) sfw = new ShapeFix_Wire;
1015 sfw->Load(wire);
1016 sfw->SetFace(face);
1017
91322f44 1018 if (argc > 3) sfw->SetPrecision(Draw::Atof(argv[3])/*0.1*/);
1019 if (argc > 4) sfw->SetMaxTolerance(Draw::Atof(argv[4]));
7fd59977 1020 di << "Info: Precision is set to " << sfw->Precision() << "\n";
1021 di << "Info: MaxTolerance is set to " << sfw->MaxTolerance() << "\n";
1022
1023 sfw->ModifyTopologyMode() = 1;
1024 sfw->ModifyGeometryMode() = 1;
1025 sfw->FixSelfIntersectingEdgeMode() = 1;
1026 //printf("Info: FixSelfIntersection = %d\n",sfw->FixSelfIntersection());
1027 di << "Info: FixSelfIntersection = " << (Standard_Integer) sfw->FixSelfIntersection() << "\n";
1028
1029 DBRep::Set(argv[1],sfw->Wire());
1030
1031 status = ShapeExtend_OK;
1032 if (sfw->StatusSelfIntersection(status))
1033 di << "Info: ShapeExtend_OK : No intersection found\n";
1034 //printf("Info: ShapeExtend_OK : No intersection found\n");
1035
1036 status = ShapeExtend_FAIL1;
1037 if (sfw->StatusSelfIntersection(status))
1038 di << "Info: ShapeExtend_FAIL1 : analysis failed (edge has no pcurve, or no vertices etc.)\n";
1039
1040 status = ShapeExtend_FAIL2;
1041 if (sfw->StatusSelfIntersection(status))
1042 di << "Info: ShapeExtend_FAIL2 : self-intersection was found, but not fixed because of limit of increasing tolerance (MaxTolerance)\n";
1043
1044 status = ShapeExtend_FAIL3;
1045 if (sfw->StatusSelfIntersection(status))
1046 di << "Info: ShapeExtend_FAIL3 : intercestion of non adjacent edges found, but not fixed because of limit of increasing tolerance (MaxTolerance)\n";
1047
1048 status = ShapeExtend_DONE1;
1049 if (sfw->StatusSelfIntersection(status))
1050 di << "Info: ShapeExtend_DONE1 : tolerance of vertex was increased to fix self-intersection\n";
1051
1052 status = ShapeExtend_DONE2;
1053 if (sfw->StatusSelfIntersection(status))
1054 di << "Info: ShapeExtend_DONE2 : vertex was moved to fix self-intersection\n";
1055
1056 status = ShapeExtend_DONE3;
1057 if (sfw->StatusSelfIntersection(status))
1058 di << "Info: ShapeExtend_DONE3 : some edges were removed because of intersection\n";
1059
1060 status = ShapeExtend_DONE4;
1061 if (sfw->StatusSelfIntersection(status))
1062 di << "Info: ShapeExtend_DONE4 : pcurve(s) was(were) modified\n";
1063
1064 status = ShapeExtend_DONE5;
1065 if (sfw->StatusSelfIntersection(status))
1066 di << "Info: ShapeExtend_DONE5 : non adjacent intersection fixed by increasing tolerance of vertex(vertices)\n";
1067
1068 status = ShapeExtend_DONE6;
1069 if (sfw->StatusSelfIntersection(status))
1070 di << "Info: ShapeExtend_DONE6 : tolerance of edge was increased to hide intersection\n";
1071
1072 status = ShapeExtend_DONE7;
1073 if (sfw->StatusSelfIntersection(status))
1074 di << "Info: ShapeExtend_DONE7 : range of some edges was decreased to avoid intersection\n";
1075
1076 return 0;
1077}
1078
7fd59977 1079#include <Graphic3d_MaterialAspect.hxx>
6262338c 1080#include <Prs3d_Drawer.hxx>
7fd59977 1081#include <Prs3d_ShadingAspect.hxx>
1082//=======================================================================
1083//function : OCC1174_1
1084//purpose :
1085//=======================================================================
1086static Standard_Integer OCC1174_1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1087{
1088 if (argc != 2)
1089 {
586db386 1090 di << "Usage : " << argv[0] << " shape\n";
7fd59977 1091 return 1;
1092 }
1093
6262338c 1094 Handle(AIS_InteractiveContext) anAISContext = ViewerTest::GetAISContext();
1095 if(anAISContext.IsNull())
7fd59977 1096 {
1097 di << "use 'vinit' command before " << argv[0] << "\n";
1098 return 1;
1099 }
1100
6262338c 1101 TopoDS_Shape aShape = DBRep::Get(argv[1]);
1102
1103 Handle(AIS_Shape) anAisIO = new AIS_Shape(aShape);
7fd59977 1104
ba00aab7 1105 Quantity_Color aColF(0.0, 0.4, 0.0, Quantity_TOC_sRGB);
1106 Quantity_Color aColB(0.0, 0.0, 0.6, Quantity_TOC_sRGB);
7fd59977 1107
6262338c 1108 Handle(Prs3d_Drawer) aDrawer = anAisIO->Attributes();
1109 Handle(Prs3d_ShadingAspect) aShadingAspect = aDrawer->ShadingAspect();
7fd59977 1110
6262338c 1111 Graphic3d_MaterialAspect aFront = aShadingAspect->Material(Aspect_TOFM_FRONT_SIDE);
1112 aFront.SetAmbientColor(aColF);
1113 aFront.SetDiffuseColor(aColF);
1114 aFront.SetSpecularColor(aColF);
61168418 1115 aFront.SetEmissiveColor(Quantity_NOC_BLACK);
6262338c 1116 aFront.SetTransparency(0.0);
1117 aShadingAspect->SetMaterial(aFront,Aspect_TOFM_FRONT_SIDE);
7fd59977 1118
6262338c 1119 Graphic3d_MaterialAspect aBack = aShadingAspect->Material(Aspect_TOFM_BACK_SIDE);
1120 aBack.SetAmbientColor(aColB);
1121 aBack.SetDiffuseColor(aColB);
1122 aBack.SetSpecularColor(aColB);
61168418 1123 aBack.SetEmissiveColor(Quantity_NOC_BLACK);
6262338c 1124 aBack.SetTransparency(0.0);
1125 aShadingAspect->SetMaterial(aBack,Aspect_TOFM_BACK_SIDE);
7fd59977 1126
6262338c 1127 aDrawer->SetShadingAspect (aShadingAspect);
7fd59977 1128
0577ae8c 1129 anAISContext->Display (anAisIO, 1, 0, Standard_True);
7fd59977 1130
1131 Standard_Real r, g, b;
ba00aab7 1132 aShadingAspect->Color(Aspect_TOFM_FRONT_SIDE).Values(r,g,b, Quantity_TOC_sRGB);
7fd59977 1133 di << "Info: color on front side (" << r << "," << g << "," << b << ")\n";
ba00aab7 1134 aShadingAspect->Color(Aspect_TOFM_BACK_SIDE).Values(r,g,b, Quantity_TOC_sRGB);
7fd59977 1135 di << "Info: color on back side (" << r << "," << g << "," << b << ")\n";
1136
1137 return 0;
1138}
1139
1140//=======================================================================
1141//function : OCC1174_2
1142//purpose :
1143//=======================================================================
1144static Standard_Integer OCC1174_2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1145{
1146 if (argc != 2)
1147 {
586db386 1148 di << "Usage : " << argv[0] << " shape\n";
7fd59977 1149 return 1;
1150 }
1151
1152 Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
1153 if(AISContext.IsNull())
1154 {
1155 di << "use 'vinit' command before " << argv[0] << "\n";
1156 return 1;
1157 }
1158
1159 TopoDS_Shape sh = DBRep::Get(argv[1]);
1160
1161 Handle(AIS_Shape) ais = new AIS_Shape(sh);
0577ae8c 1162 AISContext->Display (ais, 1, 0, Standard_False);
1163 AISContext->SetMaterial (ais, Graphic3d_NOM_SHINY_PLASTIC, Standard_False);
7fd59977 1164
ba00aab7 1165 Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_sRGB);
1166 Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_sRGB);
7fd59977 1167 Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect();
1168
1169 Graphic3d_MaterialAspect front = sa->Material(Aspect_TOFM_FRONT_SIDE);
1170 front.SetAmbientColor(colf);
1171 front.SetDiffuseColor(colf);
1172 front.SetSpecularColor(colf);
61168418 1173 front.SetEmissiveColor(Quantity_NOC_BLACK);
4e1bc39a 1174 front.SetTransparency (0.4f);
7fd59977 1175 sa->SetMaterial(front,Aspect_TOFM_FRONT_SIDE);
1176
1177 Graphic3d_MaterialAspect back = sa->Material(Aspect_TOFM_BACK_SIDE);
1178 back.SetAmbientColor(colb);
1179 back.SetDiffuseColor(colb);
1180 back.SetSpecularColor(colb);
61168418 1181 back.SetEmissiveColor(Quantity_NOC_BLACK);
4e1bc39a 1182 back.SetTransparency (0.2f);
7fd59977 1183 sa->SetMaterial(back,Aspect_TOFM_BACK_SIDE);
1184
0577ae8c 1185 AISContext->Redisplay (ais, 1, 0);
7fd59977 1186
1187 return 0;
1188}
1189
7fd59977 1190#include <TopoDS_Solid.hxx>
1191#include <BRepFeat_MakeDPrism.hxx>
1192//=======================================================================
1193//function : OCCN1
1194//purpose : FEATURE OPERATION (BOSS and SLOT)
1195//=======================================================================
1196static Standard_Integer OCCN1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1197{
1198 if (argc != 4)
1199 {
586db386 1200 di << "Usage : " << argv[0] << " angle fuse(1 for boss / 0 for slot) length\n";
7fd59977 1201 return 1;
1202 }
1203
1204 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1205 if(aContext.IsNull())
1206 {
1207 di << "use 'vinit' command before " << argv[0] << "\n";
1208 return 1;
1209 }
91322f44 1210 Standard_Real angle = Draw::Atof(argv[1]);
1211 Standard_Integer fuse = Draw::Atoi(argv[2]);
1212 Standard_Real length = Draw::Atof(argv[3]);
7fd59977 1213
1214 BRepBuilderAPI_MakeEdge edge1(gp_Pnt(0, 0, 0), gp_Pnt(50, 0, 0));
1215 BRepBuilderAPI_MakeEdge edge2(gp_Pnt(50, 0, 0), gp_Pnt(50, 50, 0));
1216 BRepBuilderAPI_MakeEdge edge3(gp_Pnt(50, 50, 0), gp_Pnt(0, 50, 0));
1217 BRepBuilderAPI_MakeEdge edge4(gp_Pnt(0, 50, 0), gp_Pnt(0, 0, 0));
1218 TopoDS_Edge ted1 = edge1.Edge();
1219 TopoDS_Edge ted2 = edge2.Edge();
1220 TopoDS_Edge ted3 = edge3.Edge();
1221 TopoDS_Edge ted4 = edge4.Edge();
1222
1223 BRepBuilderAPI_MakeWire wire(ted1, ted2, ted3, ted4);
1224 TopoDS_Wire twire = wire.Wire();
1225
1226 BRepBuilderAPI_MakeFace face(twire);
1227 TopoDS_Face tface = face.Face();
857ffd5e 1228 ////////Handle(AIS_Shape) face_ais = new AIS_Shape( tface );
7fd59977 1229 ////////aContext->Display(face_ais);
1230
1231 TopoDS_Solid box;
1232 BRepPrimAPI_MakeBox block(gp_Pnt(-50, -50, -150), 150, 150, 100);
1233 box = block.Solid();
1234
1235 TopoDS_Face top_face;
1236 top_face = block.TopFace();
1237
1238 BRepFeat_MakeDPrism slot(box, tface, top_face, angle, fuse,
1239 Standard_True);
1240
1241 slot.Perform(length);
1242 TopoDS_Shape S2 = slot.Shape();
1243
1244 DBRep::Set("OCCN1_tface",tface);
1245 DBRep::Set("OCCN1_slot",S2);
1246
1247 return 0;
1248}
1249
1250#include <BRepPrimAPI_MakeCylinder.hxx>
1251#include <BRepPrimAPI_MakeSphere.hxx>
1252#include <BRepAlgoAPI_Section.hxx>
7fd59977 1253//=======================================================================
1254//function : OCCN2
1255//purpose : BOOLEAN OPERATION
1256//=======================================================================
1257static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1258{
1259 if (argc > 2) {
431d0f18 1260 di << "Usage : " << argv[0] << "\n";
7fd59977 1261 return 1;
1262 }
7fd59977 1263
1264 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1265 if(aContext.IsNull())
1266 {
1267 di << "use 'vinit' command before " << argv[0] << "\n";
1268 return 1;
1269 }
1270
1271 BRepPrimAPI_MakeCylinder cylinder(50,200);
1272 TopoDS_Shape cylinder_sh = cylinder.Shape();
1273
1274 BRepPrimAPI_MakeSphere sphere(gp_Pnt(60,0,100),50);
1275 TopoDS_Shape sphere_sh = sphere.Shape();
1276
431d0f18 1277 di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)\n";
1278 BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
1279 if (!section.IsDone()){
1280 di << "Error performing intersection: not done.\n";
7fd59977 1281 }
431d0f18 1282 const TopoDS_Shape& shape = section.Shape();
7fd59977 1283
1284 DBRep::Set("OCCN2_cylinder",cylinder_sh);
1285 DBRep::Set("OCCN2_sphere",sphere_sh);
1286 DBRep::Set("OCCN2_section",shape);
1287
1288 return 0;
1289}
1290
1291#include <TColgp_Array1OfPnt.hxx>
1292#include <Geom_BezierCurve.hxx>
1293
1294static Standard_Integer OCC2569 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1295{
1296 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1297 if(aContext.IsNull())
1298 {
1299 di << "use 'vinit' command before " << argv[0] << "\n";
1300 return 1;
1301 }
1302 if(argc != 3) {
586db386 1303 di << "Usage : " << argv[0] << " nbpoles result\n";
7fd59977 1304 return 1;
1305 }
1306
91322f44 1307 int poles=Draw::Atoi(argv[1]);
7fd59977 1308
1309 TColgp_Array1OfPnt arr(1, poles);
1310 for(int i=1; i<=poles; i++)
1311 arr.SetValue(i, gp_Pnt(i+10, i*2+20, i*3+45));
1312
857ffd5e 1313 Handle(Geom_BezierCurve) bez = new Geom_BezierCurve(arr);
7fd59977 1314 if(bez.IsNull()) {
1315 di << "\n The curve is not created.\n";
1316 } else {
1317 di << "\n Degree = " << bez->Degree() << "\n";
1318 }
1319 TopoDS_Edge sh = BRepBuilderAPI_MakeEdge(bez).Edge();
857ffd5e 1320 Handle(AIS_Shape) ais = new AIS_Shape(sh);
0577ae8c 1321 aContext->Display (ais, Standard_True);
7fd59977 1322 DrawTrSurf::Set(argv[2],bez);
1323 return 0;
1324}
1325
1326#include <TopTools_IndexedMapOfShape.hxx>
1327#include <TopExp.hxx>
1328
1329static Standard_Integer OCC1642 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1330{
1331 if (argc != 10) {
586db386 1332 di<<"Usage: " << argv[0] << " FinalWare FinalFace InitWare InitFace shape FixReorder FixDegenerated FixConnected FixSelfIntersection\n";
7fd59977 1333 return 1;
1334 }
1335
1336 TopoDS_Shape shape = DBRep::Get(argv[5]);
1337
1338 TopExp_Explorer exp(shape, TopAbs_WIRE);
1339 TopoDS_Shape wire = exp.Current();
1340
1341 Handle(ShapeAnalysis_Wire) advWA = new ShapeAnalysis_Wire;
1342 advWA->Load(TopoDS::Wire(wire));
1343
1344 DBRep::Set(argv[3],wire);
1345
1346 TopoDS_Face face =
1347 BRepBuilderAPI_MakeFace(TopoDS::Wire(wire),Standard_True);
1348
1349 DBRep::Set(argv[4],face);
1350
1351 advWA->SetFace(face);
5e27df78 1352 Standard_Real precision_to_ana = 0.0001;
7fd59977 1353 advWA->SetPrecision(precision_to_ana);
1354
1355 TopTools_IndexedMapOfShape M;
1356 TopExp::MapShapes(wire, TopAbs_EDGE, M);
1357
1358 int j= 1;
1359 for(j= 1; j<=M.Extent(); ++j) {
1360 Standard_Integer num=1;
1361 IntRes2d_SequenceOfIntersectionPoint points2d;
1362 TColgp_SequenceOfPnt points3d;
1363
04232180 1364 std::cout << "\n j =" << j << ", CheckSelfIntersectingEdge = " <<
7fd59977 1365 advWA->CheckSelfIntersectingEdge(j, points2d, points3d);
1366
1367
1368 ShapeExtend_Status status = ShapeExtend_FAIL1;
1369 if(advWA->StatusSelfIntersection(status))
1370
1371 status = ShapeExtend_FAIL2;
1372 if(advWA->StatusSelfIntersection(status))
1373 di << "\n No Vertices found in the edge";
1374
1375 status = ShapeExtend_DONE1;
1376 if(advWA->StatusSelfIntersection(status))
1377 di << "\n Self-intersection found in the edge";
1378
1379 num = points2d.Length();
1380 di << "\n No. of self-intersecting edges : " << num;
1381
1382 for(int i=1; i<=num; ++i) {
1383 gp_Pnt pt = points3d(i);
1384 di << "\n Intersecting pt : (" << pt.X() << ", " << pt.Y()<< ", " << pt.Z() << ")";
1385 }
1386
1387 }
1388
857ffd5e 1389 Handle(ShapeFix_Wire) sfw = new ShapeFix_Wire;
7fd59977 1390 sfw->Load(TopoDS::Wire(wire));
1391 sfw->SetFace(face);
1392 sfw->SetPrecision(Precision::Confusion());
1393
1394 sfw->FixReorderMode() = 1;
1395 sfw->ClosedWireMode() = 1;
1396 sfw->FixDegeneratedMode() = 1;
1397 sfw->FixConnectedMode() = 1;
1398 sfw->ModifyTopologyMode() = 1;
1399 sfw->ModifyGeometryMode() = 1;
1400 sfw->FixSelfIntersectionMode() = 1;
1401 sfw->FixSelfIntersectingEdgeMode() = 1;
1402 sfw->FixIntersectingEdgesMode() = 1;
1403 sfw->FixNonAdjacentIntersectingEdgesMode() = 1;
1404 sfw->FixEdgeCurvesMode() = 1;
1405
1406 sfw->ModifyRemoveLoopMode() = 1;
1407 sfw->SetMaxTolerance(1.0);
1408
1409 di << "\n FixReorder = " << (Standard_Integer) sfw->FixReorder();
1410 di << "\n FixDegenerated = " << (Standard_Integer) sfw->FixDegenerated();
1411 di << "\n FixConnected = " << (Standard_Integer) sfw->FixConnected();
1412 di << "\n";
1413 di << "\n FixSelfIntersection = " << (Standard_Integer) sfw->FixSelfIntersection();
1414 di << "\n";
1415
1416 Draw::Set(argv[6],sfw->FixReorder()) ;
1417 Draw::Set(argv[7],sfw->FixDegenerated()) ;
1418 Draw::Set(argv[8],sfw->FixConnected()) ;
1419 Draw::Set(argv[9],sfw->FixSelfIntersection()) ;
1420
1421 ShapeExtend_Status status = ShapeExtend_OK;
1422 if(sfw->StatusSelfIntersection(status))
1423 di << "\n ShapeExtend_OK : No intersection found";
1424
1425 status = ShapeExtend_FAIL1;
1426 if(sfw->StatusSelfIntersection(status))
1427 di << "\n ShapeExtend_FAIL1 : analysis failed (edge has no pcurve,or no vertices etc.)";
1428
1429 status = ShapeExtend_FAIL2;
1430 if(sfw->StatusSelfIntersection(status))
1431 di << "\n ShapeExtend_FAIL2 : self-intersection was found, but not fixed because of limit of increasing tolerance (MaxTolerance)";
1432
1433 status = ShapeExtend_FAIL3;
1434 if(sfw->StatusSelfIntersection(status))
1435 di << "\n ShapeExtend_FAIL3 : intercestion of non adjacent edges found, but not fixed because of limit of increasing tolerance (MaxTolerance)";
1436
1437 status = ShapeExtend_DONE1;
1438 if(sfw->StatusSelfIntersection(status))
1439 di << "\n ShapeExtend_DONE1 : tolerance of vertex was increased to fix self-intersection";
1440
1441 status = ShapeExtend_DONE2;
1442 if(sfw->StatusSelfIntersection(status))
1443 di << "\n ShapeExtend_DONE2 : vertex was moved to fix self-intersection";
1444
1445 status = ShapeExtend_DONE3;
1446 if(sfw->StatusSelfIntersection(status))
1447 di << "\n ShapeExtend_DONE3 : some edges were removed because of intersection";
1448
1449 status = ShapeExtend_DONE4;
1450 if(sfw->StatusSelfIntersection(status))
1451 di << "\n ShapeExtend_DONE4 : pcurve(s) was(were) modified";
1452
1453 status = ShapeExtend_DONE5;
1454 if(sfw->StatusSelfIntersection(status))
1455 di << "\n ShapeExtend_DONE5 : non adjacent intersection fixed by increasing tolerance of vertex(vertices)";
1456
1457 status = ShapeExtend_DONE6;
1458 if(sfw->StatusSelfIntersection(status))
1459 di << "\n ShapeExtend_DONE6 : tolerance of edge was increased to hide intersection";
1460
1461 status = ShapeExtend_DONE7;
1462 if(sfw->StatusSelfIntersection(status))
1463 di << "\n ShapeExtend_DONE7 : range of some edges was decreased to avoid intersection";
1464
1465 TopoDS_Wire finalwire = sfw->Wire();
1466
1467 DBRep::Set(argv[1],finalwire);
1468
1469
1470 advWA->Load(TopoDS::Wire(finalwire));
1471
1472 TopoDS_Face fface =
1473 BRepBuilderAPI_MakeFace(TopoDS::Wire(finalwire),Standard_True);
1474
1475 DBRep::Set(argv[2],fface);
1476
1477 advWA->SetFace(fface);
1478
1479 TopTools_IndexedMapOfShape fM;
1480 TopExp::MapShapes(finalwire, TopAbs_EDGE, fM);
1481
1482 for(j= 1; j<=fM.Extent(); ++j) {
1483 Standard_Integer num=1;
1484 IntRes2d_SequenceOfIntersectionPoint points2d;
1485 TColgp_SequenceOfPnt points3d;
1486
1487 di << "\n j =" << j << ", CheckSelfIntersectingEdge = " <<
1488 (Standard_Integer) advWA->CheckSelfIntersectingEdge(j, points2d, points3d);
1489
1490
51740958 1491 status = ShapeExtend_FAIL1;
7fd59977 1492 if(advWA->StatusSelfIntersection(status))
1493
1494 status = ShapeExtend_FAIL2;
1495 if(advWA->StatusSelfIntersection(status))
1496 di << "\n No Vertices found in the edge";
1497
1498 status = ShapeExtend_DONE1;
1499 if(advWA->StatusSelfIntersection(status))
1500 di << "\n Self-intersection found in the edge";
1501
1502 num = points2d.Length();
1503 di << "\n No. of self-intersecting edges : " << num;
1504
1505 for(int i=1; i<=num; ++i) {
1506 gp_Pnt pt = points3d(i);
1507 di << "\n Intersecting pt : (" << pt.X() << ", " << pt.Y() << ", " << pt.Z() << ")";
1508 }
1509
1510 }
1511
1512 di << "\n";
1513
1514 return 0;
1515}
1516
1cd84fee 1517void QABugs::Commands_17(Draw_Interpretor& theCommands) {
1365140b 1518 const char *group = "QABugs";
7fd59977 1519
1520 theCommands.Add ("BUC60842", "BUC60842", __FILE__, BUC60842, group);
1521 theCommands.Add ("BUC60843", "BUC60843 result_shape name_of_circle name_of_curve [ par1 [ tol ] ]", __FILE__, BUC60843, group);
1522 theCommands.Add ("BUC60970", "BUC60970 shape result", __FILE__, BUC60970, group);
7fd59977 1523 theCommands.Add ("BUC60915", "BUC60915", __FILE__, BUC60915_1, group);
1524 theCommands.Add ("OCC138", "OCC138", __FILE__, OCC138, group);
7fd59977 1525 theCommands.Add ("OCC353","OCC353",__FILE__,OCC353,group);
1526 theCommands.Add ("OCC280","OCC280 hlr=0/1 setsurfecedetail=0/1; set perspecrive view",__FILE__,OCC280,group);
7fd59977 1527 theCommands.Add ("OCC138LC", "OCC138LC", __FILE__, OCC138LC, group);
7fd59977 1528 theCommands.Add ("OCC566", "OCC566 shape [ xmin ymin zmin xmax ymax zmax] ; print bounding box", __FILE__, OCC566, group);
1529 theCommands.Add ("OCC570", "OCC570 result", __FILE__, OCC570, group);
1530
1531 theCommands.Add("OCC570mkevol",
1532 "OCC570mkevol result object (then use updatevol) [R/Q/P]; mkevol",
1533 __FILE__, MKEVOL,group);
1534 theCommands.Add("OCC570updatevol",
1535 "OCC570updatevol edge u1 rad1 u2 rad2 ...; updatevol",
1536 __FILE__, UPDATEVOL,group);
1537 theCommands.Add("OCC570updatevollaw",
1538 "OCC570updatevollaw edge u1 rad1 u2 rad2 ...; updatevollaw",
1539 __FILE__, UPDATEVOL,group);
1540 theCommands.Add("OCC570buildevol",
1541 "OCC570buildevol; end of the evol fillet computation",
1542 __FILE__, BUILDEVOL,group);
1543
1544 theCommands.Add ("OCC606", "OCC606 result shape [-t]", __FILE__, OCC606, group);
1545
1546 theCommands.Add ("OCC813", "OCC813 U V", __FILE__, OCC813, group);
1547 theCommands.Add ("OCC814", "OCC814", __FILE__, OCC814, group);
1548 theCommands.Add ("OCC884", "OCC884 result shape [toler [maxtoler]]", __FILE__, OCC884, group);
7fd59977 1549
1550 theCommands.Add ("OCC1174_1", "OCC1174_1 shape", __FILE__, OCC1174_1, group);
1551 theCommands.Add ("OCC1174_2", "OCC1174_2 shape", __FILE__, OCC1174_2, group);
1552
7fd59977 1553 theCommands.Add ("OCCN1", "OCCN1 angle fuse(1 for boss / 0 for slot) length", __FILE__, OCCN1, group);
1554 theCommands.Add ("OCCN2", "OCCN2", __FILE__, OCCN2, group);
1555
1556 theCommands.Add ("OCC2569", "OCC2569 nbpoles result", __FILE__, OCC2569, group);
1557
1558 theCommands.Add ("OCC1642", "OCC1642 FinalWare FinalFace InitWare InitFace shape FixReorder FixDegenerated FixConnected FixSelfIntersection", __FILE__, OCC1642, group);
1559
7fd59977 1560 return;
1561}