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