]>
Commit | Line | Data |
---|---|---|
676fb573 | 1 | // $Id$ |
2 | // Category: visualization | |
3 | // | |
7005154f | 4 | // Author: I. Hrivnacova |
5 | // | |
6 | // Class AliColour | |
7 | // --------------- | |
676fb573 | 8 | // See the class description in the header file. |
9 | ||
10 | #include "AliColour.h" | |
c97337f9 | 11 | #include <G4Colour.hh> |
12 | ||
78ca1e9c | 13 | //_____________________________________________________________________________ |
676fb573 | 14 | AliColour::AliColour() |
15 | : fName (""), | |
16 | fRed(0.), | |
17 | fBlue(0.), | |
18 | fGreen(0.) | |
19 | { | |
20 | // | |
21 | } | |
22 | ||
78ca1e9c | 23 | //_____________________________________________________________________________ |
676fb573 | 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 | ||
78ca1e9c | 33 | //_____________________________________________________________________________ |
676fb573 | 34 | AliColour::AliColour(const AliColour& right) { |
35 | // | |
58c0119e | 36 | // copy stuff |
37 | *this = right; | |
676fb573 | 38 | } |
39 | ||
78ca1e9c | 40 | //_____________________________________________________________________________ |
676fb573 | 41 | AliColour::~AliColour() { |
42 | // | |
43 | } | |
44 | ||
45 | // operators | |
46 | ||
78ca1e9c | 47 | //_____________________________________________________________________________ |
676fb573 | 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 | ||
78ca1e9c | 61 | //_____________________________________________________________________________ |
676fb573 | 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 | ||
78ca1e9c | 73 | //_____________________________________________________________________________ |
676fb573 | 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 | } |