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