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