1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
#ifndef Fireworks_Core_FWDisplayProperties_h
#define Fireworks_Core_FWDisplayProperties_h
// -*- C++ -*-
//
// Package: Core
// Class : FWDisplayProperties
//
/**\class FWDisplayProperties FWDisplayProperties.h Fireworks/Core/interface/FWDisplayProperties.h
Description: <one line class summary>
Usage:
<usage>
*/
//
// Original Author:
// Created: Thu Jan 3 14:22:36 EST 2008
//
// system include files
#include "Rtypes.h"
// user include files
// forward declarations
class FWDisplayProperties {
public:
static const FWDisplayProperties defaultProperties;
/** Note that I removed the default values to make sure that properties do
not get copied around via the not so uncommon paradigm:
FWDisplayProperties new(old.color(), old.isVisible());
or similar which has the drawback of not carring over transparency
information.
In general it's a good idea to have a copy and modify approach when
changing updating only one value.
*/
FWDisplayProperties(Color_t iColor, bool isVisible, Char_t transparency);
//virtual ~FWDisplayProperties();
// ---------- const member functions ---------------------
Color_t color() const { return m_color; }
Char_t transparency() const { return m_transparency; }
bool isVisible() const { return m_isVisible; }
bool operator==(const FWDisplayProperties& iRHS) const {
return m_color == iRHS.m_color && m_isVisible == iRHS.m_isVisible && m_transparency == iRHS.m_transparency;
}
bool operator!=(const FWDisplayProperties& iRHS) const { return not(*this == iRHS); }
// ---------- static member functions --------------------
// ---------- member functions ---------------------------
void setColor(Color_t iColor) { m_color = iColor; }
/** Notice that transparency in root is in the range [0, 100] */
void setTransparency(Char_t transparency) {
transparency = transparency < 0 ? 0 : transparency;
transparency = transparency > 100 ? 100 : transparency;
m_transparency = transparency;
}
void setIsVisible(bool iSet) { m_isVisible = iSet; }
private:
//FWDisplayProperties(const FWDisplayProperties&); // stop default
//const FWDisplayProperties& operator=(const FWDisplayProperties&); // stop default
// ---------- member data --------------------------------
Color_t m_color;
bool m_isVisible;
Char_t m_transparency;
};
#endif
|