Geant4 Cross Reference |
1 // Copyright (C) 2010, Guy Barrand. All rights reserved. 2 // See the file tools.license for terms. 3 4 #ifndef tools_sg_cloud2plot_cp 5 #define tools_sg_cloud2plot_cp 6 7 #include "cloud2plot" 8 9 namespace tools { 10 namespace sg { 11 12 class c2d2plot_cp : public c2d2plot { 13 public: 14 TOOLS_SCLASS(tools::sg::c2d2plot_cp) 15 public: 16 virtual void* cast(const std::string& a_class) const { 17 if(void* p = cmp_cast<c2d2plot_cp>(this,a_class)) {return p;} 18 return c2d2plot::cast(a_class); 19 } 20 public: 21 virtual plottable* copy() const {return new c2d2plot_cp(*this);} 22 public: 23 c2d2plot_cp(const histo::c2d& a_data) 24 :c2d2plot(m_cp) 25 ,m_cp(a_data) 26 { 27 #ifdef TOOLS_MEM 28 mem::increment(s_class().c_str()); 29 #endif 30 } 31 virtual ~c2d2plot_cp(){ 32 #ifdef TOOLS_MEM 33 mem::decrement(s_class().c_str()); 34 #endif 35 } 36 public: 37 c2d2plot_cp(const c2d2plot_cp& a_from) 38 :plottable(a_from),points2D(a_from),c2d2plot(m_cp) 39 ,m_cp(a_from.m_cp) 40 { 41 #ifdef TOOLS_MEM 42 mem::increment(s_class().c_str()); 43 #endif 44 } 45 c2d2plot_cp& operator=(const c2d2plot_cp& a_from){ 46 c2d2plot::operator=(a_from); 47 m_cp = a_from.m_cp; 48 return *this; 49 } 50 protected: 51 histo::c2d m_cp; 52 }; 53 54 class c3d2plot_cp : public c3d2plot { 55 public: 56 TOOLS_SCLASS(tools::sg::c3d2plot_cp) 57 public: 58 virtual void* cast(const std::string& a_class) const { 59 if(void* p = cmp_cast<c3d2plot_cp>(this,a_class)) {return p;} 60 return c3d2plot::cast(a_class); 61 } 62 public: 63 virtual plottable* copy() const {return new c3d2plot_cp(*this);} 64 public: 65 c3d2plot_cp(const histo::c3d& a_data) 66 :c3d2plot(m_cp) 67 ,m_cp(a_data) 68 { 69 #ifdef TOOLS_MEM 70 mem::increment(s_class().c_str()); 71 #endif 72 } 73 virtual ~c3d2plot_cp(){ 74 #ifdef TOOLS_MEM 75 mem::decrement(s_class().c_str()); 76 #endif 77 } 78 public: 79 c3d2plot_cp(const c3d2plot_cp& a_from) 80 :plottable(a_from),points3D(a_from),c3d2plot(m_cp) 81 ,m_cp(a_from.m_cp) 82 { 83 #ifdef TOOLS_MEM 84 mem::increment(s_class().c_str()); 85 #endif 86 } 87 c3d2plot_cp& operator=(const c3d2plot_cp& a_from){ 88 c3d2plot::operator=(a_from); 89 m_cp = a_from.m_cp; 90 return *this; 91 } 92 protected: 93 histo::c3d m_cp; 94 }; 95 96 }} 97 98 #endif