0024166: Unable to create file with "Save" menu of voxeldemo Qt sample
[occt.git] / src / BOPTest / BOPTest_BOPCommands.cxx
CommitLineData
b311480e 1// Created on: 2000-03-16
2// Created by: Peter KURNEV
3// Copyright (c) 2000-2012 OPEN CASCADE SAS
4//
5// The content of this file is subject to the Open CASCADE Technology Public
6// License Version 6.5 (the "License"). You may not use the content of this file
7// except in compliance with the License. Please obtain a copy of the License
8// at http://www.opencascade.org and read it completely before using this file.
9//
10// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12//
13// The Original Code and all software distributed under the License is
14// distributed on an "AS IS" basis, without warranty of any kind, and the
15// Initial Developer hereby disclaims all such warranties, including without
16// limitation, any warranties of merchantability, fitness for a particular
17// purpose or non-infringement. Please see the License for the specific terms
18// and conditions governing the rights and limitations under the License.
19
7fd59977 20
7fd59977 21#include <BOPTest.ixx>
22
23#include <stdio.h>
24
25#include <DBRep.hxx>
7fd59977 26
4e57c75e 27#include <NCollection_BaseAllocator.hxx>
28#include <NCollection_IncAllocator.hxx>
7fd59977 29
7fd59977 30#include <TopoDS_Shape.hxx>
4e57c75e 31#include <TopoDS_Compound.hxx>
7fd59977 32#include <BRep_Builder.hxx>
33
4e57c75e 34#include <BOPAlgo_PaveFiller.hxx>
35#include <BOPAlgo_Operation.hxx>
36#include <BOPAlgo_BOP.hxx>
4e57c75e 37#include <BOPDS_DS.hxx>
7fd59977 38#include <BOPTest_DrawableShape.hxx>
4e57c75e 39#include <BOPCol_ListOfShape.hxx>
7fd59977 40
4e57c75e 41#include <TCollection_AsciiString.hxx>
42#include <IntTools_FaceFace.hxx>
43#include <IntTools_Curve.hxx>
44#include <DrawTrSurf.hxx>
45#include <Draw_Color.hxx>
46#include <Draw.hxx>
da219023 47#include <BRepAlgoAPI_BooleanOperation.hxx>
48#include <BRepAlgoAPI_Common.hxx>
49#include <BRepAlgoAPI_Fuse.hxx>
50#include <BRepAlgoAPI_Cut.hxx>
51#include <BRepAlgoAPI_Section.hxx>
7fd59977 52
53//
4e57c75e 54static BOPAlgo_PaveFiller* pPF=NULL;
7fd59977 55//
7fd59977 56
4e57c75e 57static
58 Standard_Integer bopsmt(Draw_Interpretor& di,
59 Standard_Integer n,
60 const char** a,
61 const BOPAlgo_Operation aOp);
62static
63 Standard_Integer bsmt (Draw_Interpretor& di,
64 Standard_Integer n,
65 const char** a,
66 const BOPAlgo_Operation aOp);
7fd59977 67//
4e57c75e 68static Standard_Integer bop (Draw_Interpretor&, Standard_Integer, const char**);
69static Standard_Integer bopsection(Draw_Interpretor&, Standard_Integer, const char**);
70static Standard_Integer boptuc (Draw_Interpretor&, Standard_Integer, const char**);
71static Standard_Integer bopcut (Draw_Interpretor&, Standard_Integer, const char**);
72static Standard_Integer bopfuse (Draw_Interpretor&, Standard_Integer, const char**);
73static Standard_Integer bopcommon (Draw_Interpretor&, Standard_Integer, const char**);
7fd59977 74//
4e57c75e 75static Standard_Integer bsection (Draw_Interpretor&, Standard_Integer, const char**);
76static Standard_Integer btuc (Draw_Interpretor&, Standard_Integer, const char**);
77static Standard_Integer bcut (Draw_Interpretor&, Standard_Integer, const char**);
78static Standard_Integer bfuse (Draw_Interpretor&, Standard_Integer, const char**);
79static Standard_Integer bcommon (Draw_Interpretor&, Standard_Integer, const char**);
7fd59977 80//
4e57c75e 81static Standard_Integer bopcurves (Draw_Interpretor&, Standard_Integer, const char**);
82static Standard_Integer bopnews (Draw_Interpretor&, Standard_Integer, const char**);
7fd59977 83
7fd59977 84//=======================================================================
85//function : BOPCommands
86//purpose :
87//=======================================================================
4e57c75e 88 void BOPTest::BOPCommands(Draw_Interpretor& theCommands)
7fd59977 89{
90 static Standard_Boolean done = Standard_False;
4e57c75e 91 if (done) return;
7fd59977 92 done = Standard_True;
93 // Chapter's name
4e57c75e 94 const char* g = "BOP commands";
95 // Commands
96
97 theCommands.Add("bop" , "use bop s1 s2" , __FILE__, bop, g);
98 theCommands.Add("bopcommon" , "use bopcommon r" , __FILE__, bopcommon, g);
99 theCommands.Add("bopfuse" , "use bopfuse r" , __FILE__,bopfuse, g);
100 theCommands.Add("bopcut" , "use bopcut" , __FILE__,bopcut, g);
101 theCommands.Add("boptuc" , "use boptuc" , __FILE__,boptuc, g);
102 theCommands.Add("bopsection", "use bopsection" , __FILE__,bopsection, g);
7fd59977 103 //
4e57c75e 104 theCommands.Add("bcommon" , "use bcommon r s1 s2" , __FILE__,bcommon, g);
105 theCommands.Add("bfuse" , "use bfuse r s1 s2" , __FILE__,bfuse, g);
106 theCommands.Add("bcut" , "use bcut r s1 s2" , __FILE__,bcut, g);
107 theCommands.Add("btuc" , "use btuc r s1 s2" , __FILE__,btuc, g);
108 theCommands.Add("bsection", "Use >bsection r s1 s2 [-n2d/-n2d1/-n2d2] [-na]",
109 __FILE__, bsection, g);
7fd59977 110 //
4e57c75e 111 theCommands.Add("bopcurves", "use bopcurves F1 F2", __FILE__, bopcurves, g);
112 theCommands.Add("bopnews", "use bopnews -v[e,f]" , __FILE__, bopnews, g);
7fd59977 113}
4e57c75e 114
7fd59977 115//=======================================================================
116//function : bop
117//purpose :
118//=======================================================================
4e57c75e 119Standard_Integer bop (Draw_Interpretor& di, Standard_Integer n, const char** a)
7fd59977 120{
4e57c75e 121 char buf[32];
122 Standard_Integer iErr;
123 TopoDS_Shape aS1, aS2;
124 BOPCol_ListOfShape aLC;
125 //
126 if (n!=3) {
127 di << " use bop Shape1 Shape2\n";
7fd59977 128 return 1;
129 }
4e57c75e 130 //
131 aS1=DBRep::Get(a[1]);
132 aS2=DBRep::Get(a[2]);
133 //
134 if (aS1.IsNull() || aS2.IsNull()) {
135 di << " null shapes are not allowed \n";
7fd59977 136 return 1;
137 }
4e57c75e 138 //
139 aLC.Append(aS1);
140 aLC.Append(aS2);
141 //
5d05cf31 142 if (pPF!=NULL) {
4e57c75e 143 delete pPF;
5d05cf31 144 pPF=NULL;
7fd59977 145 }
5d05cf31 146 Handle(NCollection_BaseAllocator)aAL=new NCollection_IncAllocator;
147 pPF=new BOPAlgo_PaveFiller(aAL);
4e57c75e 148 //
149 pPF->SetArguments(aLC);
150 //
151 pPF->Perform();
152 iErr=pPF->ErrorStatus();
153 if (iErr) {
154 Sprintf(buf, " ErrorStatus : %d\n", iErr);
155 di << buf;
156 return 0;
7fd59977 157 }
4e57c75e 158 //
7fd59977 159 return 0;
160}
7fd59977 161//=======================================================================
4e57c75e 162//function : bopcommon
7fd59977 163//purpose :
164//=======================================================================
4e57c75e 165Standard_Integer bopcommon (Draw_Interpretor& di, Standard_Integer n, const char** a)
7fd59977 166{
4e57c75e 167 return bopsmt(di, n, a, BOPAlgo_COMMON);
168}
169//=======================================================================
170//function : bopfuse
171//purpose :
172//=======================================================================
173Standard_Integer bopfuse(Draw_Interpretor& di, Standard_Integer n, const char** a)
174{
175 return bopsmt(di, n, a, BOPAlgo_FUSE);
176}
177//=======================================================================
178//function : bopcut
179//purpose :
180//=======================================================================
181Standard_Integer bopcut(Draw_Interpretor& di, Standard_Integer n, const char** a)
182{
183 return bopsmt(di, n, a, BOPAlgo_CUT);
184}
185//=======================================================================
186//function : boptuc
187//purpose :
188//=======================================================================
189Standard_Integer boptuc(Draw_Interpretor& di, Standard_Integer n, const char** a)
190{
191 return bopsmt(di, n, a, BOPAlgo_CUT21);
192}
193//=======================================================================
194//function : bopsection
195//purpose :
196//=======================================================================
197Standard_Integer bopsection(Draw_Interpretor& di, Standard_Integer n, const char** a)
198{
199 return bopsmt(di, n, a, BOPAlgo_SECTION);
200}
201//=======================================================================
202//function : bopsmt
203//purpose :
204//=======================================================================
205Standard_Integer bopsmt(Draw_Interpretor& di,
206 Standard_Integer n,
207 const char** a,
208 const BOPAlgo_Operation aOp)
209{
210 if (n<2) {
211 di << " use bopsmt r\n";
212 return 0;
7fd59977 213 }
4e57c75e 214 //
215 if (!pPF) {
216 di << " prepare PaveFiller first\n";
217 return 0;
218 }
219 //
220 if (pPF->ErrorStatus()) {
221 di << " PaveFiller has not been done\n";
222 return 0;
223 }
224 //
225 char buf[64];
226 Standard_Integer aNb, iErr;
227 BOPAlgo_BOP aBOP;
228 //
229 const BOPCol_ListOfShape& aLC=pPF->Arguments();
230 aNb=aLC.Extent();
231 if (aNb!=2) {
232 Sprintf (buf, " wrong number of arguments %s\n", aNb);
233 di << buf;
234 return 0;
235 }
236 //
237 const TopoDS_Shape& aS1=aLC.First();
238 const TopoDS_Shape& aS2=aLC.Last();
239 //
240 aBOP.AddArgument(aS1);
241 aBOP.AddTool(aS2);
242 aBOP.SetOperation(aOp);
243 //
244 aBOP.PerformWithFiller(*pPF);
245 iErr=aBOP.ErrorStatus();
246 if (iErr) {
247 Sprintf(buf, " ErrorStatus : %d\n", iErr);
248 di << buf;
249 return 0;
250 }
251 //
252 const TopoDS_Shape& aR=aBOP.Shape();
253 if (aR.IsNull()) {
254 di << " null shape\n";
255 return 0;
256 }
257 //
258 DBRep::Set(a[1], aR);
259 return 0;
7fd59977 260}
7fd59977 261//=======================================================================
262//function : bcommon
263//purpose :
264//=======================================================================
4e57c75e 265Standard_Integer bcommon (Draw_Interpretor& di, Standard_Integer n, const char** a)
7fd59977 266{
4e57c75e 267 return bsmt(di, n, a, BOPAlgo_COMMON);
7fd59977 268}
269//=======================================================================
270//function : bfuse
271//purpose :
272//=======================================================================
4e57c75e 273Standard_Integer bfuse (Draw_Interpretor& di, Standard_Integer n, const char** a)
7fd59977 274{
4e57c75e 275 return bsmt(di, n, a, BOPAlgo_FUSE);
7fd59977 276}
7fd59977 277//=======================================================================
278//function : bcut
279//purpose :
280//=======================================================================
4e57c75e 281Standard_Integer bcut (Draw_Interpretor& di, Standard_Integer n, const char** a)
7fd59977 282{
4e57c75e 283 return bsmt(di, n, a, BOPAlgo_CUT);
284}
285//=======================================================================
286//function : btuc
287//purpose :
288//=======================================================================
289Standard_Integer btuc (Draw_Interpretor& di, Standard_Integer n, const char** a)
290{
291 return bsmt(di, n, a, BOPAlgo_CUT21);
7fd59977 292}
293//=======================================================================
294//function : bsection
295//purpose :
296//=======================================================================
297Standard_Integer bsection(Draw_Interpretor& di,
4e57c75e 298 Standard_Integer n,
299 const char** a)
7fd59977 300{
4e57c75e 301 const char* usage = " Usage: bsection Result s1 s2 [-n2d/-n2d1/-n2d2] [-na]\n";
7fd59977 302 if (n < 4) {
303 di << usage;
304 return 1;
305 }
306
4e57c75e 307 TopoDS_Shape aS1 = DBRep::Get(a[2]);
308 TopoDS_Shape aS2 = DBRep::Get(a[3]);
7fd59977 309
4e57c75e 310 if (aS1.IsNull() || aS2.IsNull()) {
7fd59977 311 di << " Null shapes are not allowed \n";
312 return 1;
313 }
314
da219023 315 Standard_Boolean bApp, bPC1, bPC2;
316 //
317 bApp = Standard_True;
318 bPC1 = Standard_True;
319 bPC2 = Standard_True;
320
7fd59977 321 Standard_Boolean isbadparameter = Standard_False;
322
323 if(n > 4) {
324 const char* key1 = a[4];
325 const char* key2 = (n > 5) ? a[5] : NULL;
326 const char* pcurveconf = NULL;
7fd59977 327
4e57c75e 328 if (key1 && (!strcasecmp(key1,"-n2d") || !strcasecmp(key1,"-n2d1") || !strcasecmp(key1,"-n2d2"))) {
7fd59977 329 pcurveconf = key1;
330 }
331 else {
4e57c75e 332 if (!strcasecmp(key1,"-na")) {
da219023 333 bApp = Standard_False;
7fd59977 334 }
335 else {
4e57c75e 336 isbadparameter = Standard_True;
7fd59977 337 }
338 }
4e57c75e 339 if (key2) {
4e57c75e 340 if(!strcasecmp(key2,"-na")) {
da219023 341 bApp = Standard_False;
7fd59977 342 }
343 else {
4e57c75e 344 isbadparameter = Standard_True;
7fd59977 345 }
346 }
7fd59977 347
4e57c75e 348 if(!isbadparameter && pcurveconf) {
4e57c75e 349 if (!strcasecmp(pcurveconf, "-n2d1")) {
da219023 350 bPC1 = Standard_False;
7fd59977 351 }
352 else {
4e57c75e 353 if (!strcasecmp(pcurveconf, "-n2d2")) {
da219023 354 bPC2 = Standard_False;
4e57c75e 355 }
356 else {
4e57c75e 357 if (!strcasecmp(pcurveconf, "-n2d")) {
da219023 358 bPC1 = Standard_False;
359 bPC2 = Standard_False;
4e57c75e 360 }
361 }
7fd59977 362 }
363 }
7fd59977 364 }
365
da219023 366 if(!isbadparameter) {
4e57c75e 367 Standard_Integer iErr;
368 char buf[80];
369 //
da219023 370 BRepAlgoAPI_Section aSec(aS1, aS2, Standard_False);
371 aSec.Approximation(bApp);
372 aSec.ComputePCurveOn1(bPC1);
373 aSec.ComputePCurveOn2(bPC2);
4e57c75e 374 //
da219023 375 aSec.Build();
376 iErr=aSec.ErrorStatus();
377 if (!aSec.IsDone()) {
4e57c75e 378 Sprintf(buf, " ErrorStatus : %d\n", iErr);
379 di << buf;
380 return 0;
7fd59977 381 }
4e57c75e 382 //
da219023 383 const TopoDS_Shape& aR=aSec.Shape();
4e57c75e 384 if (aR.IsNull()) {
385 di << " null shape\n";
386 return 0;
387 }
388 DBRep::Set(a[1], aR);
389 return 0;
7fd59977 390 }
391 else {
392 di << usage;
393 return 1;
394 }
7fd59977 395}
7fd59977 396//=======================================================================
4e57c75e 397//function : bsmt
7fd59977 398//purpose :
399//=======================================================================
4e57c75e 400Standard_Integer bsmt (Draw_Interpretor& di,
401 Standard_Integer n,
402 const char** a,
403 const BOPAlgo_Operation aOp)
7fd59977 404{
4e57c75e 405 char buf[32];
406 Standard_Integer iErr;
407 TopoDS_Shape aS1, aS2;
408 BOPCol_ListOfShape aLC;
409 //
da219023 410 if (n!=4) {
4e57c75e 411 di << " use bx r s1 s2\n";
7fd59977 412 return 1;
413 }
4e57c75e 414 //
415 aS1=DBRep::Get(a[2]);
416 aS2=DBRep::Get(a[3]);
417 //
418 if (aS1.IsNull() || aS2.IsNull()) {
419 di << " null shapes are not allowed \n";
7fd59977 420 return 1;
421 }
4e57c75e 422 aLC.Append(aS1);
423 aLC.Append(aS2);
424 //
425 Handle(NCollection_BaseAllocator)aAL=new NCollection_IncAllocator;
426 BOPAlgo_PaveFiller aPF(aAL);
427 //
428 aPF.SetArguments(aLC);
429 //
430 aPF.Perform();
431 iErr=aPF.ErrorStatus();
432 if (iErr) {
433 Sprintf(buf, " ErrorStatus : %d\n", iErr);
434 di << buf;
435 return 0;
7fd59977 436 }
437 //
da219023 438 BRepAlgoAPI_BooleanOperation* pBuilder=NULL;
439 //
440 if (aOp==BOPAlgo_COMMON) {
441 pBuilder=new BRepAlgoAPI_Common(aS1, aS2, aPF);
442 }
443 else if (aOp==BOPAlgo_FUSE) {
444 pBuilder=new BRepAlgoAPI_Fuse(aS1, aS2, aPF);
445 }
446 else if (aOp==BOPAlgo_CUT) {
447 pBuilder=new BRepAlgoAPI_Cut (aS1, aS2, aPF);
448 }
449 else if (aOp==BOPAlgo_CUT21) {
450 pBuilder=new BRepAlgoAPI_Cut(aS1, aS2, aPF, Standard_False);
451 }
4e57c75e 452 //
da219023 453 iErr = pBuilder->ErrorStatus();
454 if (!pBuilder->IsDone()) {
4e57c75e 455 Sprintf(buf, " ErrorStatus : %d\n", iErr);
456 di << buf;
457 return 0;
7fd59977 458 }
da219023 459 const TopoDS_Shape& aR=pBuilder->Shape();
4e57c75e 460 if (aR.IsNull()) {
461 di << " null shape\n";
462 return 0;
7fd59977 463 }
4e57c75e 464 DBRep::Set(a[1], aR);
7fd59977 465 return 0;
466}
467
468//=======================================================================
4e57c75e 469//function : bopnews
7fd59977 470//purpose :
471//=======================================================================
4e57c75e 472Standard_Integer bopnews (Draw_Interpretor& di,
473 Standard_Integer n,
474 const char** a)
7fd59977 475{
4e57c75e 476 if (n!=2) {
477 di << " use bopnews -v[e,f]\n";
478 return 0;
7fd59977 479 }
4e57c75e 480 //
481 if (pPF==NULL) {
482 di << " Prepare BOPAlgo_PaveFiller first >bop S1 S2\n";
7fd59977 483 return 0;
484 }
4e57c75e 485 //
486 char buf[32];
487 Standard_CString aText;
488 Standard_Integer i, i1, i2, iFound;
7fd59977 489 Draw_Color aTextColor(Draw_cyan);
4e57c75e 490 TopAbs_ShapeEnum aT;
491 Handle(BOPTest_DrawableShape) aDShape;
7fd59977 492 //
4e57c75e 493 const BOPDS_PDS& pDS=pPF->PDS();
7fd59977 494 //
4e57c75e 495 aT=TopAbs_SHAPE;
496 if (!strcmp (a[1], "-f")) {
497 aT=TopAbs_FACE;
7fd59977 498 }
4e57c75e 499 else if (!strcmp (a[1], "-e")){
500 aT=TopAbs_EDGE;
7fd59977 501 }
4e57c75e 502 else if (!strcmp (a[1], "-v")){
503 aT=TopAbs_VERTEX;
7fd59977 504 }
4e57c75e 505 else {
506 di << " use bopnews -v[e,f]\n";
507 return 0;
7fd59977 508 }
509 //
4e57c75e 510 iFound=0;
511 i1=pDS->NbSourceShapes();
512 i2=pDS->NbShapes();
513 for (i=i1; i<i2; ++i) {
514 const BOPDS_ShapeInfo& aSI=pDS->ShapeInfo(i);
515 if (aSI.ShapeType()==aT) {
516 const TopoDS_Shape& aS=aSI.Shape();
517 //
518 Sprintf (buf, "z%d", i);
519 aText=buf;
520 aDShape=new BOPTest_DrawableShape (aS, aText, aTextColor);
7fd59977 521 Draw::Set (aText, aDShape);
4e57c75e 522 //
523 Sprintf (buf, " z%d", i);
524 di << buf;
525 //
526 iFound=1;
7fd59977 527 }
528 }
4e57c75e 529 //
530 if (iFound) {
7fd59977 531 di << "\n";
532 }
7fd59977 533 else {
4e57c75e 534 di << " not found\n";
7fd59977 535 }
7fd59977 536 //
7fd59977 537 return 0;
538}
539
7fd59977 540//=======================================================================
4e57c75e 541//function : bopcurves
7fd59977 542//purpose :
543//=======================================================================
4e57c75e 544Standard_Integer bopcurves (Draw_Interpretor& di,
545 Standard_Integer n,
546 const char** a)
7fd59977 547{
4e57c75e 548 if (n<3) {
549 di << " use bopcurves F1 F2\n";
550 return 1;
7fd59977 551 }
552
4e57c75e 553 TopoDS_Shape S1 = DBRep::Get(a[1]);
554 TopoDS_Shape S2 = DBRep::Get(a[2]);
555 TopAbs_ShapeEnum aType;
7fd59977 556
4e57c75e 557 if (S1.IsNull() || S2.IsNull()) {
558 di << " Null shapes is not allowed \n";
559 return 1;
7fd59977 560 }
7fd59977 561
4e57c75e 562 aType=S1.ShapeType();
563 if (aType != TopAbs_FACE) {
564 di << " Type mismatch F1\n";
565 return 1;
7fd59977 566 }
4e57c75e 567 aType=S2.ShapeType();
568 if (aType != TopAbs_FACE) {
569 di << " Type mismatch F2\n";
570 return 1;
7fd59977 571 }
572
7fd59977 573
4e57c75e 574 const TopoDS_Face& aF1=*(TopoDS_Face*)(&S1);
575 const TopoDS_Face& aF2=*(TopoDS_Face*)(&S2);
7fd59977 576
4e57c75e 577 Standard_Boolean aToApproxC3d, aToApproxC2dOnS1, aToApproxC2dOnS2, anIsDone;
578 Standard_Integer i, aNbCurves;
579 Standard_Real anAppTol, aTolR;
580 TCollection_AsciiString aNm("c_");
7fd59977 581
4e57c75e 582 aToApproxC3d=Standard_True;
583 aToApproxC2dOnS1=Standard_False;
584 aToApproxC2dOnS2=Standard_False;
585 anAppTol=0.0000001;
7fd59977 586
7fd59977 587
4e57c75e 588 IntTools_FaceFace aFF;
7fd59977 589
4e57c75e 590 aFF.SetParameters (aToApproxC3d,
591 aToApproxC2dOnS1,
592 aToApproxC2dOnS2,
593 anAppTol);
7fd59977 594
4e57c75e 595 aFF.Perform (aF1, aF2);
7fd59977 596
4e57c75e 597 anIsDone=aFF.IsDone();
598 if (!anIsDone) {
599 di << " anIsDone=" << (Standard_Integer) anIsDone << "\n";
600 return 1;
7fd59977 601 }
602
4e57c75e 603 aFF.PrepareLines3D();
604 const IntTools_SequenceOfCurves& aSCs=aFF.Lines();
7fd59977 605
4e57c75e 606 //
607 aTolR=aFF.TolReached3d();
608 di << "Tolerance Reached=" << aTolR << "\n";
7fd59977 609
4e57c75e 610 aNbCurves=aSCs.Length();
611 if (!aNbCurves) {
612 di << " has no 3d curve\n";
613 return 1;
7fd59977 614 }
615
4e57c75e 616 for (i=1; i<=aNbCurves; i++) {
617 const IntTools_Curve& anIC=aSCs(i);
7fd59977 618
4e57c75e 619 Handle (Geom_Curve) aC3D=anIC.Curve();
7fd59977 620
4e57c75e 621 if (aC3D.IsNull()) {
622 di << " has Null 3d curve# " << i << "%d\n";
623 continue;
7fd59977 624 }
7fd59977 625
4e57c75e 626 TCollection_AsciiString anIndx(i), aNmx;
627 aNmx=aNm+anIndx;
628 Standard_CString name= aNmx.ToCString();
629 DrawTrSurf::Set(name, aC3D);
630 di << name << " ";
7fd59977 631 }
7fd59977 632
7fd59977 633 di << "\n";
7fd59977 634
4e57c75e 635 return 0;
7fd59977 636}