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) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef BDSVISFIELDMODEL_H
19#define BDSVISFIELDMODEL_H
20#include "BDSFieldQueryInfo.hh"
21
22#include "G4ThreeVector.hh"
23#include "G4Types.hh"
24#include "G4VModel.hh"
25
26#include <vector>
27
29class G4Field;
30class G4VisAttributes;
31
32class BDSVisFieldModel: public G4VModel
33{
34public:
35 explicit BDSVisFieldModel(const std::vector<BDSFieldQueryInfo*>& queriesIn);
36
37 BDSVisFieldModel(const BDSVisFieldModel&) = delete;
38 BDSVisFieldModel& operator=(const BDSVisFieldModel&) = delete;
39
40 virtual ~BDSVisFieldModel();
41
42 // The main task of a model is to describe itself to the graphics scene.
43 virtual void DescribeYourselfTo(G4VGraphicsScene& sceneHandler);
44
45private:
48 static G4int instanceCounter;
49
51 G4double CalculateArrowLength(const BDSFieldQueryInfo* query) const;
52
54 G4double QIL(const BDSFieldQueryInfo::QueryDimensionInfo& qi) const;
55
60 G4ThreeVector BoxHalfSize(const BDSFieldQueryInfo* qi) const;
61
63 const std::vector<BDSFieldQueryInfo*> queries;
64
66 G4VisAttributes* pointVisB;
67 G4VisAttributes* pointVisE;
69};
70
71#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