BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
newcolour.cc
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#include "newcolour.h"
20
21using namespace GMAD;
22
24{
25 clear();
27}
28
30{
31 name = "";
32 red = 0;
33 green = 0;
34 blue = 0;
35 alpha = 1; // so visible by default
36}
37
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
47void 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}
void print() const
Print some properties.
Definition: newcolour.cc:47
NewColour()
Constructor.
Definition: newcolour.cc:23
void PublishMembers()
publish members
Definition: newcolour.cc:38
void clear()
Reset.
Definition: newcolour.cc:29
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
Parser namespace for GMAD language. Combination of Geant4 and MAD.