g4tools  5.4.0
style_color
Go to the documentation of this file.
1 // Copyright (C) 2010, Guy Barrand. All rights reserved.
2 // See the file tools.license for terms.
3 
4 #ifndef tools_sg_style_color
5 #define tools_sg_style_color
6 
7 #include "../colorf"
8 
9 #ifdef TOOLS_MEM
10 #include "../mem"
11 #include "../S_STRING"
12 #endif
13 
14 namespace tools {
15 namespace sg {
16 
17 class style_color : public std::pair<std::string,colorf> {
18  typedef std::pair<std::string,colorf> parent;
19 #ifdef TOOLS_MEM
21 #endif
22 public:
23  style_color():parent("",colorf()) {
24 #ifdef TOOLS_MEM
25  mem::increment(s_class().c_str());
26 #endif
27  }
28  style_color(const std::string& a_name,const colorf& a_color):parent(a_name,a_color) {
29 #ifdef TOOLS_MEM
30  mem::increment(s_class().c_str());
31 #endif
32  }
33  style_color(const std::string& a_name,float a_r,float a_g,float a_b):parent(a_name,colorf(a_r,a_g,a_b)) {
34 #ifdef TOOLS_MEM
35  mem::increment(s_class().c_str());
36 #endif
37  }
38  virtual ~style_color(){
39 #ifdef TOOLS_MEM
40  mem::decrement(s_class().c_str());
41 #endif
42  }
43 public:
44  style_color(const style_color& a_from):parent(a_from.first,a_from.second) {
45 #ifdef TOOLS_MEM
46  mem::increment(s_class().c_str());
47 #endif
48  }
50  first = a_from.first;
51  second = a_from.second;
52  return *this;
53  }
54 public:
55  void set_name(const std::string& a_name) {first = a_name;}
56  void set_value(float a_r,float a_g,float a_b,float a_a) {second.set_value(a_r,a_g,a_b,a_a);}
57 };
58 
59 }}
60 
61 #endif
62 
63 
64 
tools::sg::style_color::operator=
style_color & operator=(const style_color &a_from)
Definition: style_color:49
tools::colorf
Definition: colorf:11
tools::sg::style_color::style_color
style_color(const std::string &a_name, float a_r, float a_g, float a_b)
Definition: style_color:33
tools::sg::style_color::style_color
style_color()
Definition: style_color:23
tools::sg::style_color::set_name
void set_name(const std::string &a_name)
Definition: style_color:55
TOOLS_SCLASS
#define TOOLS_SCLASS(a_name)
Definition: S_STRING:41
tools::sg::style_color::set_value
void set_value(float a_r, float a_g, float a_b, float a_a)
Definition: style_color:56
tools
inlined C code : ///////////////////////////////////
Definition: aida_ntuple:26
tools::sg::style_color::style_color
style_color(const std::string &a_name, const colorf &a_color)
Definition: style_color:28
tools::sg::style_color::~style_color
virtual ~style_color()
Definition: style_color:38
tools::sg::style_color
Definition: style_color:17
tools::sg::style_color::style_color
style_color(const style_color &a_from)
Definition: style_color:44