g4tools  5.4.0
Public Member Functions | Protected Attributes | List of all members
tools::sg::c2d2plot Class Reference
Inheritance diagram for tools::sg::c2d2plot:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::c2d2plot:
Collaboration graph
[legend]

Public Member Functions

virtual plottablecopy () const
 
virtual bool is_valid () const
 
virtual const std::string & name () const
 
virtual void set_name (const std::string &a_s)
 
virtual const std::string & title () const
 
virtual const std::string & legend () const
 
virtual void set_legend (const std::string &a_s)
 
virtual void infos (const std::string &a_opts, std::string &a_sinfos) const
 
virtual float x_axis_min () const
 
virtual float x_axis_max () const
 
virtual float y_axis_min () const
 
virtual float y_axis_max () const
 
virtual unsigned int points () const
 
virtual bool ith_point (unsigned int a_index, float &a_x, float &a_y) const
 
 c2d2plot (const histo::c2d &a_data)
 
virtual ~c2d2plot ()
 
 c2d2plot (const c2d2plot &a_from)
 
c2d2plotoperator= (const c2d2plot &a_from)
 
- Public Member Functions inherited from tools::sg::points2D
virtual void * cast (const std::string &a_class) const
 
virtual ~points2D ()
 
- Public Member Functions inherited from tools::sg::plottable
virtual ~plottable ()
 

Protected Attributes

const histo::c2dm_data
 
std::string m_name
 
std::string m_legend
 

Detailed Description

Definition at line 21 of file cloud2plot.

Constructor & Destructor Documentation

◆ c2d2plot() [1/2]

tools::sg::c2d2plot::c2d2plot ( const histo::c2d a_data)
inline

Definition at line 84 of file cloud2plot.

85  :m_data(a_data)
86  {
87 #ifdef TOOLS_MEM
88  mem::increment(s_class().c_str());
89 #endif
90  }

◆ ~c2d2plot()

virtual tools::sg::c2d2plot::~c2d2plot ( )
inlinevirtual

Definition at line 91 of file cloud2plot.

91  {
92 #ifdef TOOLS_MEM
93  mem::decrement(s_class().c_str());
94 #endif
95  }

◆ c2d2plot() [2/2]

tools::sg::c2d2plot::c2d2plot ( const c2d2plot a_from)
inline

Definition at line 97 of file cloud2plot.

98  :plottable(a_from)
99  ,points2D(a_from)
100  ,m_data(a_from.m_data)
101  ,m_name(a_from.m_name)
102  ,m_legend(a_from.m_legend)
103  {
104 #ifdef TOOLS_MEM
105  mem::increment(s_class().c_str());
106 #endif
107  }

Member Function Documentation

◆ copy()

virtual plottable* tools::sg::c2d2plot::copy ( ) const
inlinevirtual

Implements tools::sg::plottable.

Reimplemented in tools::sg::c2d2plot_cp.

Definition at line 24 of file cloud2plot.

24 {return new c2d2plot(*this);}

◆ infos()

virtual void tools::sg::c2d2plot::infos ( const std::string &  a_opts,
std::string &  a_sinfos 
) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 32 of file cloud2plot.

32  {
33  a_sinfos.clear();
34  std::string f_lf("\n");
35  std::vector<std::string> ws;
36  words(a_opts," ",false,ws);
37  std::vector<std::string>::const_iterator it;
38 
39  for(it=ws.begin();it!=ws.end();++it) {
40  if(((*it)=="name") && m_name.size()) {
41  if(a_sinfos.size()) a_sinfos += f_lf;
42  a_sinfos += "Name\n";
43  a_sinfos += m_name;
44 
45  } else if((*it)=="entries") {
46  if(a_sinfos.size()) a_sinfos += f_lf;
47  a_sinfos += "Entries\n";
48  if(!numas<unsigned int>(m_data.entries(),a_sinfos)){}
49 
50  } else if((*it)=="mean") {
51  if(a_sinfos.size()) a_sinfos += f_lf;
52  a_sinfos += "MeanX\n";
53  if(!numas<double>(m_data.mean_x(),a_sinfos)){}
54  a_sinfos += f_lf;
55  a_sinfos += "MeanY\n";
56  if(!numas<double>(m_data.mean_y(),a_sinfos)){}
57 
58  } else if((*it)=="rms") {
59  if(a_sinfos.size()) a_sinfos += f_lf;
60  a_sinfos += "RMS X\n";
61  if(!numas<double>(m_data.rms_x(),a_sinfos)){}
62  a_sinfos += f_lf;
63  a_sinfos += "RMS Y\n";
64  if(!numas<double>(m_data.rms_y(),a_sinfos)){}
65 
66  }
67  }
68  }

◆ is_valid()

virtual bool tools::sg::c2d2plot::is_valid ( ) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 25 of file cloud2plot.

25 {return true;}

◆ ith_point()

virtual bool tools::sg::c2d2plot::ith_point ( unsigned int  a_index,
float &  a_x,
float &  a_y 
) const
inlinevirtual

Implements tools::sg::points2D.

Definition at line 76 of file cloud2plot.

76  {
77  if(a_index>=m_data.entries()) {a_x = 0;a_y = 0;return false;}
78  if(a_index>=m_data.entries()) {a_x = 0;a_y = 0;return false;}
79  a_x = (float)m_data.value_x(a_index);
80  a_y = (float)m_data.value_y(a_index);
81  return true;
82  }

◆ legend()

virtual const std::string& tools::sg::c2d2plot::legend ( ) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 29 of file cloud2plot.

29 {return m_legend;}

◆ name()

virtual const std::string& tools::sg::c2d2plot::name ( ) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 26 of file cloud2plot.

26 {return m_name;}

◆ operator=()

c2d2plot& tools::sg::c2d2plot::operator= ( const c2d2plot a_from)
inline

Definition at line 108 of file cloud2plot.

108  {
109  m_name = a_from.m_name;
110  m_legend = a_from.m_legend;
111  return *this;
112  }

◆ points()

virtual unsigned int tools::sg::c2d2plot::points ( ) const
inlinevirtual

Implements tools::sg::points2D.

Definition at line 75 of file cloud2plot.

75 {return m_data.entries();}

◆ set_legend()

virtual void tools::sg::c2d2plot::set_legend ( const std::string &  a_s)
inlinevirtual

Implements tools::sg::plottable.

Definition at line 30 of file cloud2plot.

30 {m_legend = a_s;}

◆ set_name()

virtual void tools::sg::c2d2plot::set_name ( const std::string &  a_s)
inlinevirtual

Implements tools::sg::plottable.

Definition at line 27 of file cloud2plot.

27 {m_name = a_s;}

◆ title()

virtual const std::string& tools::sg::c2d2plot::title ( ) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 28 of file cloud2plot.

28 {return m_data.title();}

◆ x_axis_max()

virtual float tools::sg::c2d2plot::x_axis_max ( ) const
inlinevirtual

Implements tools::sg::points2D.

Definition at line 71 of file cloud2plot.

71 {return (float)m_data.upper_edge_x();}

◆ x_axis_min()

virtual float tools::sg::c2d2plot::x_axis_min ( ) const
inlinevirtual

Implements tools::sg::points2D.

Definition at line 70 of file cloud2plot.

70 {return (float)m_data.lower_edge_x();}

◆ y_axis_max()

virtual float tools::sg::c2d2plot::y_axis_max ( ) const
inlinevirtual

Implements tools::sg::points2D.

Definition at line 73 of file cloud2plot.

73 {return (float)m_data.upper_edge_y();}

◆ y_axis_min()

virtual float tools::sg::c2d2plot::y_axis_min ( ) const
inlinevirtual

Implements tools::sg::points2D.

Definition at line 72 of file cloud2plot.

72 {return (float)m_data.lower_edge_y();}

Member Data Documentation

◆ m_data

const histo::c2d& tools::sg::c2d2plot::m_data
protected

Definition at line 114 of file cloud2plot.

◆ m_legend

std::string tools::sg::c2d2plot::m_legend
protected

Definition at line 116 of file cloud2plot.

◆ m_name

std::string tools::sg::c2d2plot::m_name
protected

Definition at line 115 of file cloud2plot.


The documentation for this class was generated from the following file:
tools::histo::c2d::entries
unsigned int entries() const
Definition: c2d:26
tools::histo::base_cloud::title
const std::string & title() const
Definition: base_cloud:56
tools::histo::c2d::lower_edge_x
double lower_edge_x() const
Definition: c2d:34
tools::histo::c2d::upper_edge_x
double upper_edge_x() const
Definition: c2d:36
tools::sg::c2d2plot::m_legend
std::string m_legend
Definition: cloud2plot:116
tools::histo::c2d::rms_x
double rms_x() const
Definition: c2d:342
tools::sg::c2d2plot::m_data
const histo::c2d & m_data
Definition: cloud2plot:114
tools::histo::c2d::mean_y
double mean_y() const
Definition: c2d:42
tools::histo::c2d::rms_y
double rms_y() const
Definition: c2d:356
tools::histo::c2d::value_x
double value_x(unsigned int a_index) const
Definition: c2d:38
tools::histo::c2d::mean_x
double mean_x() const
Definition: c2d:41
tools::histo::c2d::lower_edge_y
double lower_edge_y() const
Definition: c2d:35
tools::sg::c2d2plot::c2d2plot
c2d2plot(const histo::c2d &a_data)
Definition: cloud2plot:84
tools::words
void words(const std::string &a_string, const std::string &a_sep, bool a_take_empty, std::vector< std::string > &a_words, bool a_clear=true)
Definition: words:12
tools::histo::c2d::upper_edge_y
double upper_edge_y() const
Definition: c2d:37
tools::sg::c2d2plot::m_name
std::string m_name
Definition: cloud2plot:115
tools::histo::c2d::value_y
double value_y(unsigned int a_index) const
Definition: c2d:39