]> git.uio.no Git - u/mrichter/AliRoot.git/blame - AliGeant4/AliColour.cxx
New&delete used for array with variable size
[u/mrichter/AliRoot.git] / AliGeant4 / AliColour.cxx
CommitLineData
676fb573 1// $Id$
2// Category: visualization
3//
4// See the class description in the header file.
5
6#include "AliColour.h"
c97337f9 7#include <G4Colour.hh>
8
676fb573 9AliColour::AliColour()
10 : fName (""),
11 fRed(0.),
12 fBlue(0.),
13 fGreen(0.)
14{
15//
16}
17
18AliColour::AliColour(G4String name, G4double red, G4double blue, G4double green)
19 : fName(name),
20 fRed(red),
21 fBlue(blue),
22 fGreen(green)
23{
24//
25}
26
27AliColour::AliColour(const AliColour& right) {
28//
58c0119e 29 // copy stuff
30 *this = right;
676fb573 31}
32
33AliColour::~AliColour() {
34//
35}
36
37// operators
38
39AliColour& AliColour::operator=(const AliColour& right)
40{
41 // check assignement to self
42 if (this == &right) return *this;
43
44 fName = right.fName;
45 fRed = right.fRed;
46 fBlue = right.fBlue;
47 fGreen = right.fGreen;
48
49 return *this;
50}
51
52G4int AliColour::operator==(const AliColour& right) const
53{
54//
55 G4int returnValue = 0;
56 if ( fName == right.fName &&
57 fRed == right.fRed && fBlue == right.fBlue && fGreen == right.fGreen)
58 { returnValue = 1; };
59
60 return returnValue;
61}
62
63G4int AliColour::operator!=(const AliColour& right) const
64{
65//
66 G4int returnValue = 1;
67 if (*this == right) returnValue = 0;
68
69 return returnValue;
70}