VGM Version 5.3
Loading...
Searching...
No Matches
Box.cxx
Go to the documentation of this file.
1// $Id$
2
3// -----------------------------------------------------------------------
4// The RootGM 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 Box
14// ---------------
15// VGM implementation for Root box solid.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
19#include "RootGM/solids/Box.h"
20#include "RootGM/common/Units.h"
22
23#include "TGeoBBox.h"
24
25//_____________________________________________________________________________
26RootGM::Box::Box(const std::string& name, double hx, double hy, double hz)
27 : VGM::ISolid(),
28 VGM::IBox(),
29 BaseVGM::VBox(),
30 fBox(new TGeoBBox(name.data(), hx / RootGM::Units::Length(),
31 hy / RootGM::Units::Length(), hz / RootGM::Units::Length()))
32{
37
39}
40
41//_____________________________________________________________________________
42RootGM::Box::Box(TGeoBBox* box, bool addInMap)
43 : VGM::ISolid(), VGM::IBox(), BaseVGM::VBox(), fBox(box)
44{
46
47 if (addInMap) RootGM::SolidMap::Instance()->AddSolid(this, fBox);
48}
49
50//_____________________________________________________________________________
51RootGM::Box::Box() : VGM::ISolid(), VGM::IBox(), BaseVGM::VBox()
52{
54}
55
56//_____________________________________________________________________________
58 : VGM::ISolid(rhs), VGM::IBox(rhs), BaseVGM::VBox(rhs)
59{
61}
62
63//_____________________________________________________________________________
65{
66 //
67}
68
69//
70// public methods
71//
72
73//_____________________________________________________________________________
74std::string RootGM::Box::Name() const { return fBox->GetName(); }
75
76//_____________________________________________________________________________
78{
79 return fBox->GetDX() * RootGM::Units::Length();
80}
81
82//_____________________________________________________________________________
84{
85 return fBox->GetDY() * RootGM::Units::Length();
86}
87
88//_____________________________________________________________________________
90{
91 return fBox->GetDZ() * RootGM::Units::Length();
92}
VGM implementation for Root box solid.
Definition Box.h:32
virtual double YHalfLength() const
Return the half-length along the y axis in mm.
Definition Box.cxx:83
virtual double XHalfLength() const
Return the half-length along the x axis in mm.
Definition Box.cxx:77
virtual std::string Name() const
Return the name of this solid.
Definition Box.cxx:74
virtual ~Box()
Definition Box.cxx:64
virtual double ZHalfLength() const
Return the half-length along the z axis in mm.
Definition Box.cxx:89
void AddSolid(VGM::ISolid *, TGeoShape *)
Definition SolidMap.cxx:59
static SolidMap * Instance()
Definition SolidMap.cxx:28
Conversion from Root physical units to VGM units.
Definition Units.h:28
static double Length()
Return Root length unit in VGM units.
Definition Units.h:84
BaseVGM utilities.
Definition utilities.h:23
VGM implementation for Root.
Definition axis.h:28
VGM interfaces.
Definition VMedium.h:28