VGM Version 5.3
Loading...
Searching...
No Matches
Box.cxx
Go to the documentation of this file.
1// $Id$
2
3// -----------------------------------------------------------------------
4// The Geant4GM 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 Geant4 box solid.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
19#include "ClhepVGM/Units.h"
20
21#include "Geant4GM/solids/Box.h"
23
24#include "G4Box.hh"
25#include "G4ReflectedSolid.hh"
26
27//_____________________________________________________________________________
28Geant4GM::Box::Box(const std::string& name, double hx, double hy, double hz)
29 : VGM::ISolid(),
30 VGM::IBox(),
31 BaseVGM::VBox(),
32 fBox(new G4Box(name, hx / ClhepVGM::Units::Length(),
33 hy / ClhepVGM::Units::Length(), hz / ClhepVGM::Units::Length()))
34{
39
41}
42
43//_____________________________________________________________________________
44Geant4GM::Box::Box(G4Box* box, G4ReflectedSolid* reflBox)
45 : VGM::ISolid(), VGM::IBox(), BaseVGM::VBox(), fBox(box)
46{
48
49 if (reflBox)
50 Geant4GM::SolidMap::Instance()->AddSolid(this, reflBox);
51 else
53}
54
55//_____________________________________________________________________________
56Geant4GM::Box::Box() : VGM::ISolid(), VGM::IBox(), BaseVGM::VBox()
57{
59}
60
61//_____________________________________________________________________________
63 : VGM::ISolid(rhs), VGM::IBox(rhs), BaseVGM::VBox(rhs)
64{
66}
67
68//_____________________________________________________________________________
70{
71 //
72}
73
74//_____________________________________________________________________________
75std::string Geant4GM::Box::Name() const { return fBox->GetName(); }
76
77//_____________________________________________________________________________
79{
80 return fBox->GetXHalfLength() * ClhepVGM::Units::Length();
81}
82
83//_____________________________________________________________________________
85{
86 return fBox->GetYHalfLength() * ClhepVGM::Units::Length();
87}
88
89//_____________________________________________________________________________
91{
92 return fBox->GetZHalfLength() * ClhepVGM::Units::Length();
93}
static double Length()
Return CLHEP default length unit in VGM units.
Definition Units.cxx:83
VGM implementation for Geant4 box solid.
Definition Box.h:33
virtual std::string Name() const
Return the name of this solid.
Definition Box.cxx:75
virtual double YHalfLength() const
Return the half-length along the y axis in mm.
Definition Box.cxx:84
virtual double ZHalfLength() const
Return the half-length along the z axis in mm.
Definition Box.cxx:90
virtual double XHalfLength() const
Return the half-length along the x axis in mm.
Definition Box.cxx:78
virtual ~Box()
Definition Box.cxx:69
static SolidMap * Instance()
Definition SolidMap.cxx:28
void AddSolid(VGM::ISolid *, G4VSolid *)
Definition SolidMap.cxx:59
BaseVGM utilities.
Definition utilities.h:23
ClhepVGM utilities.
Definition transform.h:29
VGM interfaces.
Definition VMedium.h:28