Geant4  10.01.p03
F04ElementField.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 result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: F04ElementField.hh 78551 2014-01-07 09:45:08Z gcosmo $
27 //
30 //
31 
32 #ifndef F04ElementField_h
33 #define F04ElementField_h 1
34 
35 #include "globals.hh"
36 
37 #include "G4Navigator.hh"
39 
40 #include "G4UserLimits.hh"
41 #include "G4VisAttributes.hh"
42 
43 // class F04ElementField - interface for the EM field of one element
44 
45 // This is the interface class used by GlobalField to compute the field
46 // value at a given point[].
47 
48 // An element that represents an element with an EM field will
49 // derive a class from this one and implement the computation for the
50 // element. The Construct() function will add the derived object into
51 // GlobalField.
52 
54 {
55 
56  private:
57 
59 
60  public:
61 
64 
66  void Construct();
67 
69  virtual ~F04ElementField() {}
70 
72  void SetMaxStep(G4double stp)
73  {
74  fMaxStep = stp;
77  }
78 
81 
84  {
85  fColor = c;
87  }
88 
90  G4String GetColor() { return fColor; }
91 
94 
101  void SetGlobalPoint(const G4double point[4])
102  {
103  if(fMinX == -DBL_MAX || fMinX > point[0]) fMinX = point[0];
104  if(fMinY == -DBL_MAX || fMinY > point[1]) fMinY = point[1];
105  if(fMinZ == -DBL_MAX || fMinZ > point[2]) fMinZ = point[2];
106  if(fMaxX == DBL_MAX || fMaxX < point[0]) fMaxX = point[0];
107  if(fMaxY == DBL_MAX || fMaxY < point[1]) fMaxY = point[1];
108  if(fMaxZ == DBL_MAX || fMaxZ < point[2]) fMaxZ = point[2];
109  }
110 
113  bool IsInBoundingBox(const G4double point[4]) const
114  {
115  if(point[2] < fMinZ || point[2] > fMaxZ) return false;
116  if(point[0] < fMinX || point[0] > fMaxX) return false;
117  if(point[1] < fMinY || point[1] > fMaxY) return false;
118  return true;
119  }
120 
129  virtual void
130  AddFieldValue(const G4double point[4], G4double field[6]) const = 0;
131 
132  virtual G4double GetLength() = 0;
133  virtual G4double GetWidth() = 0;
134  virtual G4double GetHeight() = 0;
135 
136  protected:
137 
139 
141 
142 // F04ElementField(const F04ElementField&);
143 
144  private:
145 
147 
149 
152 
155 
156 };
157 
158 #endif
void SetMaxStep(G4double stp)
SetMaxStep(G4double) sets the max. step size.
virtual void SetMaxAllowedStep(G4double ustepMax)
CLHEP::Hep3Vector G4ThreeVector
void SetGlobalPoint(const G4double point[4])
SetGlobalPoint() ensures that the point is within the global bounding box of this ElementField's glob...
F04ElementField(const G4ThreeVector, G4LogicalVolume *)
Constructor.
void SetUserLimits(G4UserLimits *pULimits)
virtual void AddFieldValue(const G4double point[4], G4double field[6]) const =0
AddFieldValue() will add the field value for this element to field[]. Implementations must be sure to...
static G4VisAttributes * GetVisAttribute(G4String color)
GetVisAttribute() returns the appropriate G4VisAttributes.
#define G4ThreadLocal
Definition: tls.hh:89
void SetColor(G4String c)
SetColor(G4String) sets the color.
G4UserLimits * fUserLimits
virtual G4double GetLength()=0
G4ThreeVector fCenter
virtual G4double GetWidth()=0
G4double GetMaxStep()
GetMaxStep() returns the max. step size.
F04ElementField & operator=(const F04ElementField &)
G4String GetColor()
GetColor() returns the color.
virtual G4double GetHeight()=0
G4AffineTransform fGlobal2local
bool IsInBoundingBox(const G4double point[4]) const
IsInBoundingBox() returns true if the point is within the global bounding box - global coordinates...
G4LogicalVolume * fVolume
double G4double
Definition: G4Types.hh:76
void Construct()
the actual implementation constructs the F04ElementField
#define DBL_MAX
Definition: templates.hh:83
static G4ThreadLocal G4Navigator * fNavigator
void SetVisAttributes(const G4VisAttributes *pVA)
virtual ~F04ElementField()
Destructor.