BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSVisFieldModel.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2023.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef BDSVISFIELDMODEL_H
20#define BDSVISFIELDMODEL_H
21#include "BDSFieldQueryInfo.hh"
22
23#include "G4ThreeVector.hh"
24#include "G4Types.hh"
25#include "G4VModel.hh"
26
27#include <vector>
28
30class G4Field;
31class G4VisAttributes;
32
33class BDSVisFieldModel: public G4VModel
34{
35public:
36 explicit BDSVisFieldModel(const std::vector<BDSFieldQueryInfo*>& queriesIn);
37
38 BDSVisFieldModel(const BDSVisFieldModel&) = delete;
39 BDSVisFieldModel& operator=(const BDSVisFieldModel&) = delete;
40
41 virtual ~BDSVisFieldModel();
42
43 // The main task of a model is to describe itself to the graphics scene.
44 virtual void DescribeYourselfTo(G4VGraphicsScene& sceneHandler);
45
46private:
49 static G4int instanceCounter;
50
52 G4double CalculateArrowLength(const BDSFieldQueryInfo* query) const;
53
55 G4double QIL(const BDSFieldQueryInfo::QueryDimensionInfo& qi) const;
56
61 G4ThreeVector BoxHalfSize(const BDSFieldQueryInfo* qi) const;
62
64 const std::vector<BDSFieldQueryInfo*> queries;
65
67 G4VisAttributes* pointVisB;
68 G4VisAttributes* pointVisE;
70};
71
72#endif
Holder class for all information required for a field query.
G4double CalculateArrowLength(const BDSFieldQueryInfo *query) const
Return the minimum of 0.8 x the step length in x,y,z.
const std::vector< BDSFieldQueryInfo * > queries
Cache of queries.
G4ThreeVector BoxHalfSize(const BDSFieldQueryInfo *qi) const
G4double QIL(const BDSFieldQueryInfo::QueryDimensionInfo &qi) const
Query Info Length. For one dimension, return 0.8 x step size.
G4VisAttributes * pointVisB
The vis attributes for a zero-field marker.
G4VisAttributes * pointVisE
The vis attributes for a zero-field marker.
static G4int instanceCounter