Geant4  10.02
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 
51 #if defined(G4GEOM_USE_USOLIDS)
52 
53 #include "UTet.hh"
54 
55 class G4UTet : public G4USolid
56 {
57 
58  public: // with description
59 
60  G4UTet(const G4String& pName,
61  G4ThreeVector anchor,
62  G4ThreeVector p2,
63  G4ThreeVector p3,
64  G4ThreeVector p4,
65  G4bool *degeneracyFlag=0);
66 
67  ~G4UTet();
68 
69  inline UTet* GetShape() const;
70 
71  public: // without description
72 
73  G4UTet(__void__&);
74  // Fake default constructor for usage restricted to direct object
75  // persistency for clients requiring preallocation of memory for
76  // persistifiable objects.
77 
78  G4UTet(const G4UTet& rhs);
79  G4UTet& operator=(const G4UTet& rhs);
80  // Copy constructor and assignment operator.
81 
82  inline std::vector<G4ThreeVector> GetVertices() const;
83  // Return the four vertices of the shape.
84 };
85 
86 // --------------------------------------------------------------------
87 // Inline methods
88 // --------------------------------------------------------------------
89 
90 inline UTet* G4UTet::GetShape() const
91 {
92  return (UTet*) fShape;
93 }
94 
95 inline std::vector<G4ThreeVector> G4UTet::GetVertices() const
96 {
97  std::vector<UVector3> vec = GetShape()->GetVertices();
98  std::vector<G4ThreeVector> vertices;
99  for (unsigned int i=0; i<vec.size(); ++i)
100  {
101  G4ThreeVector v(vec[i].x(), vec[i].y(), vec[i].z());
102  vertices.push_back(v);
103  }
104  return vertices;
105 }
106 
107 #endif // G4GEOM_USE_USOLIDS
108 
109 #endif
CLHEP::Hep3Vector G4ThreeVector
G4double z
Definition: TRTMaterials.hh:39
bool G4bool
Definition: G4Types.hh:79
const G4double x[NPOINTSGL]