Salome HOME
This commit was generated by cvs2git to create tag 'TRIPOLI_323'.
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_ShapeInfo.cxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #include <GEOMAlgo_ShapeInfo.hxx>
21
22
23 static
24   Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType);
25 static
26   void DumpKindOfShape(const GEOMAlgo_KindOfShape aKS);
27 static
28   void DumpKindOfClosed(const GEOMAlgo_KindOfClosed aKC);
29 static
30   void DumpKindOfBounds(const GEOMAlgo_KindOfBounds aKB);
31 static
32   void DumpKindOfName(const GEOMAlgo_KindOfName aKS);
33 static
34   void DumpPosition(const gp_Ax3& aAx3);
35 static
36   void DumpLocation(const gp_Pnt& aP);
37 static
38   void DumpDirection(const gp_Dir& aD);
39 //=======================================================================
40 //function :
41 //purpose  :
42 //=======================================================================
43   GEOMAlgo_ShapeInfo::GEOMAlgo_ShapeInfo()
44 {
45   Reset();
46 }
47 //=======================================================================
48 //function : ~
49 //purpose  :
50 //=======================================================================
51   GEOMAlgo_ShapeInfo::~GEOMAlgo_ShapeInfo()
52 {
53 }
54 //=======================================================================
55 //function : Reset
56 //purpose  :
57 //=======================================================================
58   void GEOMAlgo_ShapeInfo::Reset()
59 {
60   Standard_Integer i;
61   //
62   myType=TopAbs_SHAPE;
63   //
64   myNbTypes=9;
65   for (i=0; i<myNbTypes; ++i) {
66     myNbSubShapes[i]=0;
67   }
68   //
69   myKindOfShape=GEOMAlgo_KS_UNKNOWN;
70   myKindOfBounds=GEOMAlgo_KB_UNKNOWN;
71   myKindOfClosed=GEOMAlgo_KC_UNKNOWN;
72   myKindOfName=GEOMAlgo_KN_UNKNOWN;
73   //
74   myLocation.SetCoord(99., 99., 99.);
75   myDirection.SetCoord(1.,0.,0.);
76   //
77   myRadius1=-1.;
78   myRadius2=-2.;
79   myLength=-3.;
80   myWidth=-3.;
81   myHeight=-3.;
82 }
83 //=======================================================================
84 //function : SetType
85 //purpose  :
86 //=======================================================================
87   void GEOMAlgo_ShapeInfo::SetType(const TopAbs_ShapeEnum aType)
88 {
89   myType=aType;
90 }
91 //=======================================================================
92 //function : Type
93 //purpose  :
94 //=======================================================================
95   TopAbs_ShapeEnum GEOMAlgo_ShapeInfo::Type() const
96 {
97   return myType;
98 }
99 //=======================================================================
100 //function : SetNbSubShapes
101 //purpose  :
102 //=======================================================================
103   void GEOMAlgo_ShapeInfo::SetNbSubShapes(const TopAbs_ShapeEnum aType,
104                                           const Standard_Integer aNb)
105 {
106   Standard_Integer iN;
107
108   iN=TypeToInteger(aType);
109   if (iN>=0 && iN<myNbTypes) {
110     myNbSubShapes[iN]=aNb;
111   }
112 }
113 //=======================================================================
114 //function : NbSubShapes
115 //purpose  :
116 //=======================================================================
117   Standard_Integer GEOMAlgo_ShapeInfo::NbSubShapes(const TopAbs_ShapeEnum aType) const
118 {
119   Standard_Integer iN;
120
121   iN=TypeToInteger(aType);
122   if (iN>=0 && iN<myNbTypes) {
123     return myNbSubShapes[iN];
124   }
125   return 0;
126 }
127 //=======================================================================
128 //function : SetKindOfShape
129 //purpose  :
130 //=======================================================================
131   void GEOMAlgo_ShapeInfo::SetKindOfShape(const GEOMAlgo_KindOfShape aT)
132 {
133   myKindOfShape=aT;
134 }
135 //=======================================================================
136 //function : KindOfShape
137 //purpose  :
138 //=======================================================================
139   GEOMAlgo_KindOfShape GEOMAlgo_ShapeInfo::KindOfShape() const
140 {
141   return myKindOfShape;
142 }
143 //=======================================================================
144 //function : SetKindOfName
145 //purpose  :
146 //=======================================================================
147   void GEOMAlgo_ShapeInfo::SetKindOfName(const GEOMAlgo_KindOfName aT)
148 {
149   myKindOfName=aT;
150 }
151 //=======================================================================
152 //function : KindOfName
153 //purpose  :
154 //=======================================================================
155   GEOMAlgo_KindOfName GEOMAlgo_ShapeInfo::KindOfName() const
156 {
157   return myKindOfName;
158 }
159 //=======================================================================
160 //function : SetKindOfBounds
161 //purpose  :
162 //=======================================================================
163   void GEOMAlgo_ShapeInfo::SetKindOfBounds(const GEOMAlgo_KindOfBounds aT)
164 {
165   myKindOfBounds=aT;
166 }
167 //=======================================================================
168 //function : KindOfBounds
169 //purpose  :
170 //=======================================================================
171   GEOMAlgo_KindOfBounds GEOMAlgo_ShapeInfo::KindOfBounds() const
172 {
173   return myKindOfBounds;
174 }
175 //=======================================================================
176 //function : SetKindOfClosed
177 //purpose  :
178 //=======================================================================
179   void GEOMAlgo_ShapeInfo::SetKindOfClosed(const GEOMAlgo_KindOfClosed aT)
180 {
181   myKindOfClosed=aT;
182 }
183 //=======================================================================
184 //function : KindOfClosed
185 //purpose  :
186 //=======================================================================
187   GEOMAlgo_KindOfClosed GEOMAlgo_ShapeInfo::KindOfClosed() const
188 {
189   return myKindOfClosed;
190 }
191 //=======================================================================
192 //function : SetLocation
193 //purpose  :
194 //=======================================================================
195   void GEOMAlgo_ShapeInfo::SetLocation(const gp_Pnt& aP)
196 {
197   myLocation=aP;
198 }
199 //=======================================================================
200 //function : Location
201 //purpose  :
202 //=======================================================================
203   const gp_Pnt& GEOMAlgo_ShapeInfo::Location() const
204 {
205   return myLocation;
206 }
207 //=======================================================================
208 //function : SetDirection
209 //purpose  :
210 //=======================================================================
211   void GEOMAlgo_ShapeInfo::SetDirection(const gp_Dir& aD)
212 {
213   myDirection=aD;
214 }
215 //=======================================================================
216 //function : Direction
217 //purpose  :
218 //=======================================================================
219   const gp_Dir& GEOMAlgo_ShapeInfo::Direction() const
220 {
221   return myDirection;
222 }
223 //=======================================================================
224 //function : SetPosition
225 //purpose  :
226 //=======================================================================
227   void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax2& aAx2)
228 {
229   gp_Ax3 aAx3(aAx2);
230   SetPosition(aAx3);
231 }
232 //=======================================================================
233 //function : SetPosition
234 //purpose  :
235 //=======================================================================
236   void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax3& aAx3)
237 {
238   myPosition=aAx3;
239 }
240 //=======================================================================
241 //function : Position
242 //purpose  :
243 //=======================================================================
244   const gp_Ax3& GEOMAlgo_ShapeInfo::Position() const
245 {
246   return myPosition;
247 }
248
249 //=======================================================================
250 //function : SetPnt1
251 //purpose  :
252 //=======================================================================
253   void GEOMAlgo_ShapeInfo::SetPnt1(const gp_Pnt& aP)
254 {
255   myPnt1=aP;
256 }
257 //=======================================================================
258 //function : Pnt1
259 //purpose  :
260 //=======================================================================
261   const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt1() const
262 {
263   return myPnt1;
264 }
265 //=======================================================================
266 //function : SetPnt2
267 //purpose  :
268 //=======================================================================
269   void GEOMAlgo_ShapeInfo::SetPnt2(const gp_Pnt& aP)
270 {
271   myPnt2=aP;
272 }
273 //=======================================================================
274 //function : Pnt2
275 //purpose  :
276 //=======================================================================
277   const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt2() const
278 {
279   return myPnt2;
280 }
281 //=======================================================================
282 //function : SetRadius1
283 //purpose  :
284 //=======================================================================
285   void GEOMAlgo_ShapeInfo::SetRadius1(const Standard_Real aR)
286 {
287   myRadius1=aR;
288 }
289 //=======================================================================
290 //function : Radius1
291 //purpose  :
292 //=======================================================================
293   Standard_Real GEOMAlgo_ShapeInfo::Radius1() const
294 {
295   return myRadius1;
296 }
297 //=======================================================================
298 //function : SetRadius2
299 //purpose  :
300 //=======================================================================
301   void GEOMAlgo_ShapeInfo::SetRadius2(const Standard_Real aR)
302 {
303   myRadius2=aR;
304 }
305 //=======================================================================
306 //function : Radius2
307 //purpose  :
308 //=======================================================================
309   Standard_Real GEOMAlgo_ShapeInfo::Radius2() const
310 {
311   return myRadius2;
312 }
313 //=======================================================================
314 //function : SetLength
315 //purpose  :
316 //=======================================================================
317   void GEOMAlgo_ShapeInfo::SetLength(const Standard_Real aL)
318 {
319   myLength=aL;
320 }
321 //=======================================================================
322 //function : Length
323 //purpose  :
324 //=======================================================================
325   Standard_Real GEOMAlgo_ShapeInfo::Length() const
326 {
327   return myLength;
328 }
329 //=======================================================================
330 //function : SetWidth
331 //purpose  :
332 //=======================================================================
333   void GEOMAlgo_ShapeInfo::SetWidth(const Standard_Real aW)
334 {
335   myWidth=aW;
336 }
337 //=======================================================================
338 //function : Width
339 //purpose  :
340 //=======================================================================
341   Standard_Real GEOMAlgo_ShapeInfo::Width() const
342 {
343   return myWidth;
344 }
345 //=======================================================================
346 //function : SetHeight
347 //purpose  :
348 //=======================================================================
349   void GEOMAlgo_ShapeInfo::SetHeight(const Standard_Real aH)
350 {
351   myHeight=aH;
352 }
353 //=======================================================================
354 //function : Height
355 //purpose  :
356 //=======================================================================
357   Standard_Real GEOMAlgo_ShapeInfo::Height() const
358 {
359   return myHeight;
360 }
361 //=======================================================================
362 //function : TypeToInteger
363 //purpose  :
364 //=======================================================================
365 Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
366 {
367   Standard_Integer iN;
368   //
369   iN=(Standard_Integer)aType;
370   return iN;
371 }
372 //=======================================================================
373 //function : Dump
374 //purpose  :
375 //=======================================================================
376   void GEOMAlgo_ShapeInfo::Dump()const
377 {
378   switch (myType) {
379     //
380   case TopAbs_VERTEX:
381     DumpVertex();
382     break;
383     //
384   case TopAbs_EDGE:
385     DumpEdge();
386     break;
387     //
388   case TopAbs_WIRE:
389     DumpWire();
390     break;
391     //
392   case TopAbs_FACE:
393     DumpFace();
394     break;
395     //
396   case TopAbs_SHELL:
397     DumpShell();
398     break;
399     //
400   case TopAbs_SOLID:
401     DumpSolid();
402     break;
403     //
404   case TopAbs_COMPSOLID:
405     DumpCompSolid();
406     break;
407     //
408   case TopAbs_COMPOUND:
409     DumpCompound();
410     break;
411     //
412   default:
413     printf(" * not implememted yet\n");
414     break;
415   }
416 }
417 //=======================================================================
418 //function : DumpCompound
419 //purpose  :
420 //=======================================================================
421   void GEOMAlgo_ShapeInfo::DumpCompound()const
422 {
423   Standard_Integer aNbV, aNbE, aNbF, aNbS, aNbC, aNbP;
424   GEOMAlgo_KindOfShape aKS;
425   GEOMAlgo_KindOfName aKN;
426   GEOMAlgo_KindOfBounds aKB;
427   GEOMAlgo_KindOfClosed aKC;
428   //
429   aNbV=NbSubShapes(TopAbs_VERTEX);
430   aNbE=NbSubShapes(TopAbs_EDGE);
431   aNbF=NbSubShapes(TopAbs_FACE);
432   aNbS=NbSubShapes(TopAbs_SOLID);
433   aNbC=NbSubShapes(TopAbs_COMPSOLID);
434   aNbP=NbSubShapes(TopAbs_COMPOUND);
435   aKS=KindOfShape();
436   aKN=KindOfName();
437   aKB=KindOfBounds();
438   aKC=KindOfClosed();
439   //
440   printf(" *COMPOUND\n");
441   printf("  number of vertices    : %d\n", aNbV);
442   printf("  number of edges       : %d\n", aNbE);
443   printf("  number of faces       : %d\n", aNbF);
444   printf("  number of solids      : %d\n", aNbS);
445   printf("  number of compsolids  : %d\n", aNbC);
446   printf("  number of compounds   : %d\n", aNbP);
447   DumpKindOfShape (aKS);
448   DumpKindOfName (aKN);
449   DumpKindOfBounds(aKB);
450   DumpKindOfClosed(aKC);
451 }
452 //=======================================================================
453 //function : DumpCompSolid
454 //purpose  :
455 //=======================================================================
456   void GEOMAlgo_ShapeInfo::DumpCompSolid()const
457 {
458   Standard_Integer aNbV, aNbE, aNbF, aNbS;
459   GEOMAlgo_KindOfShape aKS;
460   GEOMAlgo_KindOfName aKN;
461   GEOMAlgo_KindOfBounds aKB;
462   GEOMAlgo_KindOfClosed aKC;
463   //
464   aNbV=NbSubShapes(TopAbs_VERTEX);
465   aNbE=NbSubShapes(TopAbs_EDGE);
466   aNbF=NbSubShapes(TopAbs_FACE);
467   aNbS=NbSubShapes(TopAbs_SOLID);
468   aKS=KindOfShape();
469   aKN=KindOfName();
470   aKB=KindOfBounds();
471   aKC=KindOfClosed();
472   //
473   printf(" *COMPSOLID\n");
474   printf("  number of vertices: %d\n", aNbV);
475   printf("  number of edges   : %d\n", aNbE);
476   printf("  number of faces   : %d\n", aNbF);
477   printf("  number of solids  : %d\n", aNbS);
478   DumpKindOfShape (aKS);
479   DumpKindOfName (aKN);
480   DumpKindOfBounds(aKB);
481   DumpKindOfClosed(aKC);
482 }
483
484 //=======================================================================
485 //function : DumpSolid
486 //purpose  :
487 //=======================================================================
488   void GEOMAlgo_ShapeInfo::DumpSolid()const
489 {
490   Standard_Integer aNbV, aNbE, aNbF;
491   GEOMAlgo_KindOfShape aKS;
492   GEOMAlgo_KindOfName aKN;
493   GEOMAlgo_KindOfBounds aKB;
494   GEOMAlgo_KindOfClosed aKC;
495   //
496   aNbV=NbSubShapes(TopAbs_VERTEX);
497   aNbE=NbSubShapes(TopAbs_EDGE);
498   aNbF=NbSubShapes(TopAbs_FACE);
499   aKS=KindOfShape();
500   aKN=KindOfName();
501   aKB=KindOfBounds();
502   aKC=KindOfClosed();
503   //
504   printf(" *SOLID\n");
505   printf("  number of vertices: %d\n", aNbV);
506   printf("  number of edges   : %d\n", aNbE);
507   printf("  number of faces   : %d\n", aNbF);
508   DumpKindOfShape (aKS);
509   DumpKindOfName (aKN);
510   DumpKindOfBounds(aKB);
511   DumpKindOfClosed(aKC);
512   //
513   if (aKN==GEOMAlgo_KN_SPHERE) {
514     DumpLocation (myLocation);
515     DumpPosition (myPosition);
516     printf("  Radius1   : %.3lf\n", myRadius1);
517   }
518   if (aKN==GEOMAlgo_KN_CYLINDER) {
519     DumpLocation (myLocation);
520     DumpPosition (myPosition);
521     printf("  Radius1   : %.3lf\n", myRadius1);
522     printf("  Height    : %.3lf\n", myHeight);
523   }
524   else if (aKN==GEOMAlgo_KN_CONE) {
525     DumpLocation (myLocation);
526     DumpPosition (myPosition);
527     printf("  Radius1   : %.3lf\n", myRadius1);
528     printf("  Radius2   : %.3lf\n", myRadius2);
529     printf("  Height    : %.3lf\n", myHeight);
530   }
531   else if (aKN==GEOMAlgo_KN_TORUS) {
532     DumpLocation (myLocation);
533     DumpPosition (myPosition);
534     printf("  Radius1   : %.3lf\n", myRadius1);
535     printf("  Radius2   : %.3lf\n", myRadius2);
536   }
537   else if (aKN==GEOMAlgo_KN_POLYHEDRON) {
538     DumpLocation (myLocation);
539     DumpPosition (myPosition);
540   }
541   else if (aKN==GEOMAlgo_KN_BOX) {
542     DumpLocation (myLocation);
543     DumpPosition (myPosition);
544     printf("  Length    : %.3lf\n", myLength);
545     printf("  Width     : %.3lf\n", myWidth);
546     printf("  Height    : %.3lf\n", myHeight);
547   }
548 }
549
550 //=======================================================================
551 //function : DumpFace
552 //purpose  :
553 //=======================================================================
554   void GEOMAlgo_ShapeInfo::DumpFace()const
555 {
556   Standard_Integer aNbV, aNbE;
557   GEOMAlgo_KindOfShape aKS;
558   GEOMAlgo_KindOfName aKN;
559   GEOMAlgo_KindOfBounds aKB;
560   GEOMAlgo_KindOfClosed aKC;
561   //
562   aNbV=NbSubShapes(TopAbs_VERTEX);
563   aNbE=NbSubShapes(TopAbs_EDGE);
564   aKS=KindOfShape();
565   aKN=KindOfName();
566   aKB=KindOfBounds();
567   aKC=KindOfClosed();
568   //
569   printf(" *FACE\n");
570   printf("  number of vertices: %d\n", aNbV);
571   printf("  number of edges   : %d\n", aNbE);
572   DumpKindOfShape (aKS);
573   DumpKindOfName (aKN);
574   DumpKindOfBounds(aKB);
575   DumpKindOfClosed(aKC);
576   //
577   // PLANE
578   if (aKN==GEOMAlgo_KN_PLANE) {
579     DumpLocation (myLocation);
580     DumpPosition (myPosition);
581   }
582   else if (aKN==GEOMAlgo_KN_DISKCIRCLE) {
583     DumpLocation (myLocation);
584     DumpPosition (myPosition);
585     printf("  Radius1   : %.3lf\n", myRadius1);
586   }
587   else if (aKN==GEOMAlgo_KN_DISKELLIPSE) {
588     DumpLocation (myLocation);
589     DumpPosition (myPosition);
590     printf("  Radius1   : %.3lf\n", myRadius1);
591     printf("  Radius2   : %.3lf\n", myRadius2);
592   }
593   else if (aKN==GEOMAlgo_KN_RECTANGLE) {
594     DumpLocation (myLocation);
595     DumpPosition (myPosition);
596     printf("  Length    : %.3lf\n", myLength);
597     printf("  Width     : %.3lf\n", myWidth);
598   }
599   else if (aKN==GEOMAlgo_KN_TRIANGLE ||
600            aKN==GEOMAlgo_KN_QUADRANGLE||
601            aKN==GEOMAlgo_KN_POLYGON) {
602     DumpLocation (myLocation);
603     DumpPosition (myPosition);
604   }
605   //
606   // SPHERE
607   else if (aKN==GEOMAlgo_KN_SPHERE) {
608     DumpLocation (myLocation);
609     DumpPosition (myPosition);
610     printf("  Radius1   : %.3lf", myRadius1);
611   }
612   //
613   // CYLINDER
614   else if (aKN==GEOMAlgo_KN_CYLINDER) {
615     DumpLocation (myLocation);
616     DumpPosition (myPosition);
617     printf("  Radius1   : %.3lf\n", myRadius1);
618     printf("  Height    : %.3lf\n", myHeight);
619   }
620   //
621   // CONE
622   else if (aKN==GEOMAlgo_KN_CONE) {
623     DumpLocation (myLocation);
624     DumpPosition (myPosition);
625     printf("  Radius1   : %.3lf\n", myRadius1);
626     printf("  Radius2   : %.3lf\n", myRadius2);
627     printf("  Height    : %.3lf\n", myHeight);
628   }
629   //
630   // TORUS
631   else if (aKN==GEOMAlgo_KN_TORUS) {
632     DumpLocation (myLocation);
633     DumpPosition (myPosition);
634     printf("  Radius1   : %.3lf\n", myRadius1);
635     printf("  Radius2   : %.3lf\n", myRadius2);
636   }
637
638
639   printf("\n");
640 }
641 //=======================================================================
642 //function : DumpShell
643 //purpose  :
644 //=======================================================================
645   void GEOMAlgo_ShapeInfo::DumpShell()const
646 {
647   Standard_Integer aNbV, aNbE, aNbF;
648   GEOMAlgo_KindOfClosed aKC;
649   //
650   printf(" *SHELL\n");
651   //
652   aNbV=NbSubShapes(TopAbs_VERTEX);
653   aNbE=NbSubShapes(TopAbs_EDGE);
654   aNbF=NbSubShapes(TopAbs_FACE);
655   printf("  number of vertices: %d\n", aNbV);
656   printf("  number of edges   : %d\n", aNbE);
657   printf("  number of faces   : %d\n", aNbF);
658   aKC=KindOfClosed();
659   DumpKindOfClosed(aKC);
660   printf("\n");
661 }
662 //=======================================================================
663 //function : DumpWire
664 //purpose  :
665 //=======================================================================
666   void GEOMAlgo_ShapeInfo::DumpWire()const
667 {
668   Standard_Integer aNbV, aNbE;
669   GEOMAlgo_KindOfClosed aKC;
670   //
671   printf(" *WIRE\n");
672   //
673   aNbV=NbSubShapes(TopAbs_VERTEX);
674   aNbE=NbSubShapes(TopAbs_EDGE);
675   printf("  number of vertices: %d\n", aNbV);
676   printf("  number of edges   : %d\n", aNbE);
677
678   aKC=KindOfClosed();
679   DumpKindOfClosed(aKC);
680   printf("\n");
681 }
682 //=======================================================================
683 //function : DumpEdge
684 //purpose  :
685 //=======================================================================
686   void GEOMAlgo_ShapeInfo::DumpEdge()const
687 {
688   Standard_Integer aNbV;
689   Standard_Real aX, aY, aZ;
690   GEOMAlgo_KindOfShape aKS;
691   GEOMAlgo_KindOfName aKN;
692   GEOMAlgo_KindOfBounds aKB;
693   GEOMAlgo_KindOfClosed aKC;
694   //
695   aNbV=NbSubShapes(TopAbs_VERTEX);
696   aKS=KindOfShape();
697   aKN=KindOfName();
698   aKB=KindOfBounds();
699   aKC=KindOfClosed();
700   //
701   printf(" *EDGE\n");
702   printf("  number of vertices: %d\n", aNbV);
703   DumpKindOfShape (aKS);
704   DumpKindOfName (aKN);
705   DumpKindOfBounds(aKB);
706   DumpKindOfClosed(aKC);
707   //
708   // LINE
709   if (aKN==GEOMAlgo_KN_LINE) {
710     DumpLocation (myLocation);
711     DumpDirection(myDirection);
712   }
713   else if (aKN==GEOMAlgo_KN_SEGMENT) {
714     DumpLocation (myLocation);
715     DumpDirection(myDirection);
716     printf("  Length    : %.3lf\n", myLength);
717     myPnt1.Coord(aX, aY, aZ);
718     printf("  Pnt1 : %.3lf %.3lf %.3lf\n", aX, aY, aZ);
719     myPnt2.Coord(aX, aY, aZ);
720     printf("  Pnt2 : %.3lf %.3lf %.3lf\n", aX, aY, aZ);
721
722   }
723   else if (aKN==GEOMAlgo_KN_CIRCLE) {
724     DumpLocation (myLocation);
725     DumpPosition (myPosition);
726     printf("  Radius1   : %.3lf\n", myRadius1);
727   }
728   else if (aKN==GEOMAlgo_KN_ARCCIRCLE) {
729     DumpLocation (myLocation);
730     DumpPosition (myPosition);
731     printf("  Radius1   : %.3lf\n", myRadius1);
732     myPnt1.Coord(aX, aY, aZ);
733     printf("  Pnt1 : %.3lf %.3lf %.3lf\n", aX, aY, aZ);
734     myPnt2.Coord(aX, aY, aZ);
735     printf("  Pnt2 : %.3lf %.3lf %.3lf\n", aX, aY, aZ);
736   }
737   else if (aKN==GEOMAlgo_KN_ELLIPSE) {
738     DumpLocation (myLocation);
739     DumpPosition (myPosition);
740     printf("  Radius1   : %.3lf\n", myRadius1);
741     printf("  Radius2   : %.3lf\n", myRadius2);
742   }
743   else if (aKN==GEOMAlgo_KN_ARCELLIPSE) {
744     DumpLocation (myLocation);
745     DumpPosition (myPosition);
746     printf("  Radius1   : %.3lf\n", myRadius1);
747     printf("  Radius2   : %.3lf\n", myRadius2);
748     myPnt1.Coord(aX, aY, aZ);
749     printf("  Pnt1 : %.3lf %.3lf %.3lf\n", aX, aY, aZ);
750     myPnt2.Coord(aX, aY, aZ);
751     printf("  Pnt2 : %.3lf %.3lf %.3lf\n", aX, aY, aZ);
752   }
753   printf("\n");
754 }
755 //=======================================================================
756 //function : DumpVertex
757 //purpose  :
758 //=======================================================================
759   void GEOMAlgo_ShapeInfo::DumpVertex()const
760 {
761   printf(" *VERTEX\n");
762   DumpLocation(myLocation);
763 }
764 //=======================================================================
765 //function : DumpLocation
766 //purpose  :
767 //=======================================================================
768   void DumpLocation(const gp_Pnt& aP)
769 {
770   Standard_Real aX, aY, aZ;
771   //
772   aP.Coord(aX, aY, aZ);
773   printf("  Location : %.3lf %.3lf %.3lf \n", aX, aY, aZ);
774 }
775 //=======================================================================
776 //function : DumpDirection
777 //purpose  :
778 //=======================================================================
779   void DumpDirection(const gp_Dir& aD)
780 {
781   Standard_Real aX, aY, aZ;
782   //
783   aD.Coord(aX, aY, aZ);
784   printf("  Direction: %.3lf %.3lf %.3lf \n", aX, aY, aZ);
785 }
786 //=======================================================================
787 //function : DumpPosition
788 //purpose  :
789 //=======================================================================
790 void DumpPosition(const gp_Ax3& aAx3)
791 {
792   const gp_Dir& aDZ=aAx3.Axis().Direction();
793   const gp_Dir& aDX=aAx3.XDirection();
794   const gp_Dir& aDY=aAx3.YDirection();
795   printf("  Position:\n");
796   printf("  Axis: %.3lf %.3lf %.3lf \n", aDZ.X(), aDZ.Y(), aDZ.Z());
797   printf("  X   : %.3lf %.3lf %.3lf \n", aDX.X(), aDX.Y(), aDX.Z());
798   printf("  Y   : %.3lf %.3lf %.3lf \n", aDY.X(), aDY.Y(), aDY.Z());
799 }
800 //=======================================================================
801 //function : DumpKindOfBounds
802 //purpose  :
803 //=======================================================================
804 void DumpKindOfBounds(const GEOMAlgo_KindOfBounds aKB)
805 {
806   const char *pStr[]={
807     "KB_UNKNOWN",
808     "KB_TRIMMED",
809     "KB_INFINITE"
810   };
811   int i;
812   //
813   i=(Standard_Integer)aKB;
814   printf(" KindOfBounds: %s\n", pStr[i]);
815
816 }
817 //=======================================================================
818 //function : DumpKindOfClosed
819 //purpose  :
820 //=======================================================================
821 void DumpKindOfClosed(const GEOMAlgo_KindOfClosed aKC)
822 {
823   const char *pStr[]={
824     "KC_UNKNOWN",
825     "KC_CLOSED",
826     "KC_NOTCLOSED"
827   };
828   int i;
829   //
830   i=(Standard_Integer)aKC;
831   printf(" KindOfClosed: %s\n", pStr[i]);
832
833 }
834 //=======================================================================
835 //function : DumpKindOfShape
836 //purpose  :
837 //=======================================================================
838 void DumpKindOfShape(const GEOMAlgo_KindOfShape aKS)
839 {
840   const char *pStr[]={
841     "KS_UNKNOWN",
842     "KS_SPHERE",
843     "KS_CYLINDER",
844     "KS_BOX",
845     "KS_TORUS",
846     "KS_CONE",
847     "KS_ELLIPSE",
848     "KS_PLANE",
849     "KS_CIRCLE",
850     "KS_LINE",
851     "KS_DEGENERATED"
852     };
853   int i;
854   //
855   i=(Standard_Integer)aKS;
856   printf(" KindOfShape : %s\n", pStr[i]);
857 }
858 //=======================================================================
859 //function : DumpKindOfName
860 //purpose  :
861 //=======================================================================
862 void DumpKindOfName(const GEOMAlgo_KindOfName aKS)
863 {
864   const char *pStr[]={
865     "KN_UNKNOWN",
866     "KN_SPHERE",
867     "KN_CYLINDER",
868     "KN_TORUS",
869     "KN_CONE",
870     "KN_ELLIPSE",
871     "KN_CIRCLE",
872     "KN_PLANE",
873     "KN_LINE",
874     "KN_BOX",
875     "KN_SEGMENT",
876     "KN_ARCCIRCLE",
877     "KN_POLYGON",
878     "KN_POLYHEDRON",
879     "KN_DISKCIRCLE",
880     "KN_DISKELLIPSE",
881     "KN_RECTANGLE",
882     "KN_TRIANGLE",
883     "KN_QUADRANGLE",
884     "KN_ARCELLIPSE"
885     };
886   int i;
887   //
888   i=(Standard_Integer)aKS;
889   printf(" KindOfName  : %s\n", pStr[i]);
890 }