VGM Version 5.3
Loading...
Searching...
No Matches
solid.cxx
Go to the documentation of this file.
1// $Id$
2
3// -----------------------------------------------------------------------
4// The BaseVGM package of the Virtual Geometry Model
5// Copyright (C) 2007, Ivana Hrivnacova
6// All rights reserved.
7//
8// For the licensing terms see vgm/LICENSE.
9// Contact: ivana@ipno.in2p3.fr
10// -----------------------------------------------------------------------
11
12//
13// VGM::ISolid output stream and utility function
14//
15// Author: Ivana Hrivnacova; IPN Orsay
16
17#include "VGM/solids/ISolid.h"
18
19//_____________________________________________________________________________
20std::ostream& operator<<(std::ostream& out, const VGM::ISolid& solid)
21{
22 out << VGM::SolidTypeName(solid.Type()) << " \"" << solid.Name() << "\"";
23 return solid.Put(out);
24}
25
26//_____________________________________________________________________________
28{
29 // Returns the solid type name for specified typeId
30 switch (typeId) {
31 case kArb8:
32 return "Arb8";
33 break;
34 case kBox:
35 return "Box";
36 break;
37 case kCons:
38 return "Cons";
39 break;
40 case kCtubs:
41 return "Ctubs";
42 break;
43 case kEllipsoid:
44 return "Ellipsoid";
45 break;
46 case kEltu:
47 return "Eltu";
48 break;
49 case kExtruded:
50 return "Extruded";
51 break;
52 case kHype:
53 return "Hype";
54 break;
55 case kPara:
56 return "Para";
57 break;
58 case kParaboloid:
59 return "Paraboloid";
60 break;
61 case kPolycone:
62 return "Polycone";
63 break;
64 case kPolyhedra:
65 return "Polygone";
66 break;
67 case kSphere:
68 return "Sphere";
69 break;
70 case kTessellated:
71 return "Tessellated";
72 break;
73 case kTorus:
74 return "Torus";
75 break;
76 case kTrap:
77 return "Trap";
78 break;
79 case kTrd:
80 return "Trd";
81 break;
82 case kTubs:
83 return "Tubs";
84 break;
85 case kBoolean:
86 return "Boolean";
87 break;
88 case kDisplaced:
89 return "Displaced";
90 break;
91 case kMultiUnion:
92 return "MultiUnion";
93 break;
94 case kScaled:
95 return "Scaled";
96 break;
97 case kUnknownSolid:
98 return "Unknown";
99 break;
100 default:
101 return "Undefined";
102 break;
103 };
104}
The VGM interface to solids.
Definition ISolid.h:58
virtual SolidType Type() const =0
Return the type of this solid.
virtual std::ostream & Put(std::ostream &out) const =0
Put the printing of the solid parameters in the out stream.
virtual std::string Name() const =0
Return the name of this solid.
std::string SolidTypeName(VGM::SolidType typeId)
Definition solid.cxx:27
SolidType
Definition ISolid.h:29
@ kTessellated
Definition ISolid.h:43
@ kEllipsoid
Definition ISolid.h:34
@ kScaled
Definition ISolid.h:51
@ kTorus
Definition ISolid.h:44
@ kTrd
Definition ISolid.h:46
@ kCons
Definition ISolid.h:32
@ kUnknownSolid
Definition ISolid.h:52
@ kTubs
Definition ISolid.h:47
@ kExtruded
Definition ISolid.h:36
@ kPara
Definition ISolid.h:38
@ kSphere
Definition ISolid.h:42
@ kPolycone
Definition ISolid.h:40
@ kTrap
Definition ISolid.h:45
@ kMultiUnion
Definition ISolid.h:50
@ kPolyhedra
Definition ISolid.h:41
@ kEltu
Definition ISolid.h:35
@ kParaboloid
Definition ISolid.h:39
@ kHype
Definition ISolid.h:37
@ kBoolean
Definition ISolid.h:48
@ kArb8
Definition ISolid.h:30
@ kCtubs
Definition ISolid.h:33
@ kBox
Definition ISolid.h:31
@ kDisplaced
Definition ISolid.h:49
std::ostream & operator<<(std::ostream &out, const VGM::ISolid &solid)
Definition solid.cxx:20