Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/Geant4/tools/sg/style_color is written in an unsupported language. File is not indexed.

0001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
0002 // See the file tools.license for terms.
0003 
0004 #ifndef tools_sg_style_color
0005 #define tools_sg_style_color
0006 
0007 #include "../colorf"
0008 
0009 #ifdef TOOLS_MEM
0010 #include "../mem"
0011 #include "../S_STRING"
0012 #endif
0013 
0014 namespace tools {
0015 namespace sg {
0016 
0017 class style_color : public std::pair<std::string,colorf> {
0018   typedef std::pair<std::string,colorf> parent;
0019 #ifdef TOOLS_MEM
0020   TOOLS_SCLASS(tools::sg::style_color)
0021 #endif
0022 public:
0023   style_color():parent("",colorf()) {
0024 #ifdef TOOLS_MEM
0025     mem::increment(s_class().c_str());
0026 #endif
0027   }
0028   style_color(const std::string& a_name,const colorf& a_color):parent(a_name,a_color) {
0029 #ifdef TOOLS_MEM
0030     mem::increment(s_class().c_str());
0031 #endif
0032   }
0033   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)) {
0034 #ifdef TOOLS_MEM
0035     mem::increment(s_class().c_str());
0036 #endif
0037   }
0038   virtual ~style_color(){
0039 #ifdef TOOLS_MEM
0040     mem::decrement(s_class().c_str());
0041 #endif
0042   }
0043 public:
0044   style_color(const style_color& a_from):parent(a_from.first,a_from.second) {
0045 #ifdef TOOLS_MEM
0046     mem::increment(s_class().c_str());
0047 #endif
0048   }
0049   style_color& operator=(const style_color& a_from){
0050     first = a_from.first;
0051     second = a_from.second;
0052     return *this;
0053   }
0054 public:
0055   void set_name(const std::string& a_name) {first = a_name;}
0056   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);}
0057 };
0058 
0059 }}
0060 
0061 #endif
0062 
0063 
0064