Geant4  10.00.p02
G4UTet.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the intellectual property of the *
19 // * Vanderbilt University Free Electron Laser Center *
20 // * Vanderbilt University, Nashville, TN, USA *
21 // * Development supported by: *
22 // * United States MFEL program under grant FA9550-04-1-0045 *
23 // * and NASA under contract number NNG04CT05P. *
24 // * Written by Marcus H. Mendenhall and Robert A. Weller. *
25 // * *
26 // * Contributed to the Geant4 Core, January, 2005. *
27 // * *
28 // ********************************************************************
29 //
30 //
31 // $Id:$
32 //
33 //
34 // --------------------------------------------------------------------
35 // GEANT 4 class header file
36 //
37 // G4UTet
38 //
39 // Class description:
40 //
41 // Wrapper class for UTet to make use of UTet from USolids module.
42 
43 // History:
44 // 1.11.13 G.Cosmo, CERN/PH
45 // --------------------------------------------------------------------
46 #ifndef G4UTET_HH
47 #define G4UTET_HH
48 
49 #include "G4USolid.hh"
50 #include "UTet.hh"
51 
52 class G4UTet : public G4USolid
53 {
54 
55  public: // with description
56 
57  G4UTet(const G4String& pName,
58  G4ThreeVector anchor,
59  G4ThreeVector p2,
60  G4ThreeVector p3,
61  G4ThreeVector p4,
62  G4bool *degeneracyFlag=0);
63 
64  ~G4UTet();
65 
66  inline UTet* GetShape() const;
67 
68  public: // without description
69 
70  G4UTet(__void__&);
71  // Fake default constructor for usage restricted to direct object
72  // persistency for clients requiring preallocation of memory for
73  // persistifiable objects.
74 
75  G4UTet(const G4UTet& rhs);
76  G4UTet& operator=(const G4UTet& rhs);
77  // Copy constructor and assignment operator.
78 
79  inline std::vector<G4ThreeVector> GetVertices() const;
80  // Return the four vertices of the shape.
81 };
82 
83 // --------------------------------------------------------------------
84 // Inline methods
85 // --------------------------------------------------------------------
86 
87 inline UTet* G4UTet::GetShape() const
88 {
89  return (UTet*) fShape;
90 }
91 
92 inline std::vector<G4ThreeVector> G4UTet::GetVertices() const
93 {
94  std::vector<UVector3> vec = GetShape()->GetVertices();
95  std::vector<G4ThreeVector> vertices;
96  for (unsigned int i=0; i<vec.size(); ++i)
97  {
98  G4ThreeVector v(vec[i].x, vec[i].y, vec[i].z);
99  vertices.push_back(v);
100  }
101  return vertices;
102 }
103 
104 #endif
CLHEP::Hep3Vector G4ThreeVector
G4double z
Definition: TRTMaterials.hh:39
UTet * GetShape() const
Definition: G4UTet.hh:87
Definition: G4UTet.hh:52
VUSolid * fShape
Definition: G4USolid.hh:182
bool G4bool
Definition: G4Types.hh:79
~G4UTet()
Definition: G4UTet.cc:76
std::vector< UVector3 > GetVertices() const
Definition: UTet.cc:604
G4UTet & operator=(const G4UTet &rhs)
Definition: G4UTet.cc:94
Definition: UTet.hh:27
std::vector< G4ThreeVector > GetVertices() const
Definition: G4UTet.hh:92
G4UTet(const G4String &pName, G4ThreeVector anchor, G4ThreeVector p2, G4ThreeVector p3, G4ThreeVector p4, G4bool *degeneracyFlag=0)
Definition: G4UTet.cc:48