VGM Version 5.5
Loading...
Searching...
No Matches
Arb8.h
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
13//
21
22#ifndef GEANT4_GM_ARB8_SOLID_H
23#define GEANT4_GM_ARB8_SOLID_H
24
26
28
29#include "G4ThreeVector.hh"
30#include "globals.hh"
31
32#include <string>
33#include <vector>
34
35class G4TessellatedSolid;
36class G4GenericTrap;
37class G4ReflectedSolid;
38class G4VSolid;
39class G4VFacet;
40
41namespace Geant4GM {
42
43class Arb8 : public BaseVGM::VArb8
44{
45 public:
46 Arb8(
47 const std::string& name, double hz, std::vector<VGM::TwoVector> vertices);
48 Arb8(G4GenericTrap* genericTrap, G4ReflectedSolid* reflected = 0);
49 virtual ~Arb8();
50
51 // static methods
52 static bool IsTwisted(std::vector<VGM::TwoVector> vertices);
53 static double MaxTwistAngle(const std::vector<VGM::TwoVector>& vertices);
54
55 // methods
56 virtual std::string Name() const;
57 virtual int NofVertices() const;
58 virtual VGM::TwoVector Vertex(int index) const;
59 virtual double TwistAngle(int index) const;
60 virtual double ZHalfLength() const;
61
62 protected:
63 Arb8();
64 Arb8(const Arb8& rhs);
65
66 private:
67 // methods
68 void ReorderVertices(std::vector<G4ThreeVector>& vertices);
69
70 G4VFacet* MakeDownFacet(std::vector<G4ThreeVector> fromVertices, int ind1,
71 int ind2, int ind3) const;
72 G4VFacet* MakeUpFacet(std::vector<G4ThreeVector> fromVertices, int ind1,
73 int ind2, int ind3) const;
74 G4VFacet* MakeSideFacet(G4ThreeVector downVertex0, G4ThreeVector downVertex1,
75 G4ThreeVector upVertex1, G4ThreeVector upVertex0) const;
76
77 static double TwistAngleOfFace(
78 const std::vector<VGM::TwoVector>& vertices, int index);
79
80 // static data members
81 static const int fgkNofVertices;
82 static const double fgkTolerance;
83 static const double fgkMaxTwistAngle;
84
85 // data members
86 double fHz;
87 std::vector<VGM::TwoVector> fVertices;
88 G4TessellatedSolid* fTessellatedSolid;
89 G4VSolid* fSolid;
90};
91
92} // namespace Geant4GM
93
94#endif // GEANT4_GM_EXTRUDED_SOLID_H
The ABC for Arb8 solids.
Definition VArb8.h:30
static bool IsTwisted(std::vector< VGM::TwoVector > vertices)
Definition Arb8.cxx:81
virtual ~Arb8()
Definition Arb8.cxx:325
virtual int NofVertices() const
Return the number of vertices.
Definition Arb8.cxx:439
virtual double ZHalfLength() const
Return the half-length along the z axis in mm.
Definition Arb8.cxx:466
virtual VGM::TwoVector Vertex(int index) const
Return the index-th vertex.
Definition Arb8.cxx:442
Arb8(const std::string &name, double hz, std::vector< VGM::TwoVector > vertices)
Definition Arb8.cxx:108
static double MaxTwistAngle(const std::vector< VGM::TwoVector > &vertices)
Definition Arb8.cxx:65
virtual double TwistAngle(int index) const
Return the index-th twist angle.
Definition Arb8.cxx:454
virtual std::string Name() const
Return the name of this solid.
Definition Arb8.cxx:433
VGM implementation for Geant4.
Definition Element.h:29
std::pair< double, double > TwoVector
Definition TwoVector.h:28