BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
bdsim
parser
newcolour.cc
1
/*
2
Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3
University of London 2001 - 2023.
4
5
This file is part of BDSIM.
6
7
BDSIM is free software: you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published
9
by the Free Software Foundation version 3 of the License.
10
11
BDSIM is distributed in the hope that it will be useful, but
12
WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
#include "newcolour.h"
20
21
using namespace
GMAD
;
22
23
NewColour::NewColour
()
24
{
25
clear
();
26
PublishMembers
();
27
}
28
29
void
NewColour::clear
()
30
{
31
name =
""
;
32
red = 0;
33
green = 0;
34
blue = 0;
35
alpha = 1;
// so visible by default
36
}
37
38
void
NewColour::PublishMembers
()
39
{
40
publish
(
"name"
, &NewColour::name);
41
publish
(
"red"
, &NewColour::red);
42
publish
(
"green"
, &NewColour::green);
43
publish
(
"blue"
, &NewColour::blue);
44
publish
(
"alpha"
, &NewColour::alpha);
45
}
46
47
void
NewColour::print
()
const
48
{
49
std::cout <<
"colour: "
50
<<
"name "
<< name << std::endl
51
<<
"red "
<< red << std::endl
52
<<
"green "
<< green << std::endl
53
<<
"blue "
<< blue << std::endl
54
<<
"alpha "
<< alpha << std::endl;
55
}
GMAD::NewColour::print
void print() const
Print some properties.
Definition:
newcolour.cc:47
GMAD::NewColour::NewColour
NewColour()
Constructor.
Definition:
newcolour.cc:23
GMAD::NewColour::PublishMembers
void PublishMembers()
publish members
Definition:
newcolour.cc:38
GMAD::NewColour::clear
void clear()
Reset.
Definition:
newcolour.cc:29
GMAD::Published< NewColour >::publish
void publish(const std::string &name, T C::*mp)
Make pointer to member from class C and type T with accessible with a name.
Definition:
published.h:92
GMAD
Parser namespace for GMAD language. Combination of Geant4 and MAD.
Definition:
BDSBeamlineIntegral.hh:27
Generated on Mon Aug 14 2023 13:49:30 for BDSIM by
1.9.6