VGM Version 5.3
Loading...
Searching...
No Matches
VBooleanSolid.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// Class VBooleanSolid
14// --------------------
15// The ABC for Boolean solids.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
21
22#include <math.h>
23
24//_____________________________________________________________________________
25std::ostream& operator<<(std::ostream& out, const VGM::IBooleanSolid& boolean)
26{
27 const VGM::ISolid& booleanSolid = boolean;
28 out << booleanSolid;
29 return out;
30}
31
32//_____________________________________________________________________________
34{
35 // Returns the Boolean solid type name for specified typeId
36 switch (typeId) {
37 case kIntersection:
38 return "Intersection";
39 break;
40 case kSubtraction:
41 return "Subtraction";
42 break;
43 case kUnion:
44 return "Union";
45 break;
46 case kUnknownBoolean:
47 return "Unknown";
48 break;
49 default:
50 return "Undefined";
51 break;
52 };
53}
54
55//_____________________________________________________________________________
57{
59}
60
61//_____________________________________________________________________________
66
67//_____________________________________________________________________________
68std::ostream& BaseVGM::VBooleanSolid::Put(std::ostream& out) const
69{
70 out << " " << VGM::BooleanTypeName(BoolType()) << ": " << std::endl
71 << " ConstituentA = " << *ConstituentSolidA() << std::endl
72 << " ConstituentB = " << *ConstituentSolidB() << std::endl
73 << " Displacement translation (object): ( " << Displacement()[VGM::kDx]
74 << ", " << Displacement()[VGM::kDy] << ", " << Displacement()[VGM::kDz]
75 << ") mm " << std::endl
76 << " Displacement rotation (object): (" << Displacement()[VGM::kAngleX]
77 << ", " << Displacement()[VGM::kAngleY] << ", "
78 << Displacement()[VGM::kAngleZ] << ") deg ";
79
80 if (Round(Displacement()[6]) == 0)
81 out << " no reflectionZ";
82 else
83 out << " reflectionZ";
84
85 return out;
86}
std::ostream & operator<<(std::ostream &out, const VGM::IBooleanSolid &boolean)
virtual std::ostream & Put(std::ostream &out) const
Put the printing of the solid parameters in the out stream.
The VGM interface to Boolean solids.
The VGM interface to solids.
Definition ISolid.h:58
double Round(double x)
Round number.
Definition utilities.cxx:34
VGM interfaces.
Definition VMedium.h:28
@ kUnknownBoolean
@ kIntersection
@ kSubtraction
@ kAngleZ
Definition Transform.h:49
@ kDx
Definition Transform.h:44
@ kAngleY
Definition Transform.h:48
@ kDz
Definition Transform.h:46
@ kAngleX
Definition Transform.h:47
@ kDy
Definition Transform.h:45
std::string BooleanTypeName(BooleanType typeId)