VGM
Version 5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
packages
BaseVGM
source
solids
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
19
#include "
BaseVGM/solids/VBooleanSolid.h
"
20
#include "
BaseVGM/common/utilities.h
"
21
22
#include <math.h>
23
24
//_____________________________________________________________________________
25
std::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
//_____________________________________________________________________________
33
std::string
VGM::BooleanTypeName
(
VGM::BooleanType
typeId)
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
//_____________________________________________________________________________
56
BaseVGM::VBooleanSolid::VBooleanSolid
() :
VGM
::IBooleanSolid()
57
{
59
}
60
61
//_____________________________________________________________________________
62
BaseVGM::VBooleanSolid::~VBooleanSolid
()
63
{
64
//
65
}
66
67
//_____________________________________________________________________________
68
std::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
}
utilities.h
operator<<
std::ostream & operator<<(std::ostream &out, const VGM::IBooleanSolid &boolean)
Definition
VBooleanSolid.cxx:25
VBooleanSolid.h
BaseVGM::VBooleanSolid::~VBooleanSolid
virtual ~VBooleanSolid()
Definition
VBooleanSolid.cxx:62
BaseVGM::VBooleanSolid::VBooleanSolid
VBooleanSolid()
Definition
VBooleanSolid.cxx:56
BaseVGM::VBooleanSolid::Put
virtual std::ostream & Put(std::ostream &out) const
Put the printing of the solid parameters in the out stream.
Definition
VBooleanSolid.cxx:68
VGM::IBooleanSolid
The VGM interface to Boolean solids.
Definition
IBooleanSolid.h:41
VGM::IBooleanSolid::ConstituentSolidB
virtual ISolid * ConstituentSolidB() const =0
Return the second constituent solid.
VGM::IBooleanSolid::ConstituentSolidA
virtual ISolid * ConstituentSolidA() const =0
Return the first constituent solid.
VGM::IBooleanSolid::BoolType
virtual BooleanType BoolType() const =0
Return the Boolean type of this solid.
VGM::IBooleanSolid::Displacement
virtual Transform Displacement() const =0
Return the 3D displacement of the second constituent solid with respect to the first one.
VGM::ISolid
The VGM interface to solids.
Definition
ISolid.h:58
BaseVGM::Round
double Round(double x)
Round number.
Definition
utilities.cxx:34
VGM
VGM interfaces.
Definition
VMedium.h:28
VGM::BooleanType
BooleanType
Definition
IBooleanSolid.h:31
VGM::kUnknownBoolean
@ kUnknownBoolean
Definition
IBooleanSolid.h:35
VGM::kIntersection
@ kIntersection
Definition
IBooleanSolid.h:32
VGM::kSubtraction
@ kSubtraction
Definition
IBooleanSolid.h:33
VGM::kUnion
@ kUnion
Definition
IBooleanSolid.h:34
VGM::kAngleZ
@ kAngleZ
Definition
Transform.h:49
VGM::kDx
@ kDx
Definition
Transform.h:44
VGM::kAngleY
@ kAngleY
Definition
Transform.h:48
VGM::kDz
@ kDz
Definition
Transform.h:46
VGM::kAngleX
@ kAngleX
Definition
Transform.h:47
VGM::kDy
@ kDy
Definition
Transform.h:45
VGM::BooleanTypeName
std::string BooleanTypeName(BooleanType typeId)
Definition
VBooleanSolid.cxx:33
Generated on
for VGM by
1.17.0