g4tools  5.4.0
Public Member Functions | Protected Attributes | List of all members
tools::sg::c3d2plot Class Reference
Inheritance diagram for tools::sg::c3d2plot:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::c3d2plot:
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 float z_axis_min () const
 
virtual float z_axis_max () const
 
virtual unsigned int points () const
 
virtual bool ith_point (unsigned int a_index, float &a_x, float &a_y, float &a_z) const
 
 c3d2plot (const histo::c3d &a_data)
 
virtual ~c3d2plot ()
 
 c3d2plot (const c3d2plot &a_from)
 
c3d2plotoperator= (const c3d2plot &a_from)
 
- Public Member Functions inherited from tools::sg::points3D
virtual void * cast (const std::string &a_class) const
 
virtual ~points3D ()
 
- Public Member Functions inherited from tools::sg::plottable
virtual ~plottable ()
 

Protected Attributes

const histo::c3dm_data
 
std::string m_name
 
std::string m_legend
 

Detailed Description

Definition at line 126 of file cloud2plot.

Constructor & Destructor Documentation

◆ c3d2plot() [1/2]

tools::sg::c3d2plot::c3d2plot ( const histo::c3d a_data)
inline

Definition at line 198 of file cloud2plot.

199  :m_data(a_data)
200  {
201 #ifdef TOOLS_MEM
202  mem::increment(s_class().c_str());
203 #endif
204  }

◆ ~c3d2plot()

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

Definition at line 205 of file cloud2plot.

205  {
206 #ifdef TOOLS_MEM
207  mem::decrement(s_class().c_str());
208 #endif
209  }

◆ c3d2plot() [2/2]

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

Definition at line 211 of file cloud2plot.

212  :plottable(a_from)
213  ,points3D(a_from)
214  ,m_data(a_from.m_data)
215  ,m_name(a_from.m_name)
216  ,m_legend(a_from.m_legend)
217  {
218 #ifdef TOOLS_MEM
219  mem::increment(s_class().c_str());
220 #endif
221  }

Member Function Documentation

◆ copy()

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

Implements tools::sg::plottable.

Reimplemented in tools::sg::c3d2plot_cp.

Definition at line 129 of file cloud2plot.

129 {return new c3d2plot(*this);}

◆ infos()

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

Implements tools::sg::plottable.

Definition at line 137 of file cloud2plot.

137  {
138  a_sinfos.clear();
139  std::string f_lf("\n");
140  std::vector<std::string> ws;
141  words(a_opts," ",false,ws);
142  std::vector<std::string>::const_iterator it;
143 
144  for(it=ws.begin();it!=ws.end();++it) {
145  if(((*it)=="name") && m_name.size()) {
146  if(a_sinfos.size()) a_sinfos += f_lf;
147  a_sinfos += "Name\n";
148  a_sinfos += m_name;
149 
150  } else if((*it)=="entries") {
151  if(a_sinfos.size()) a_sinfos += f_lf;
152  a_sinfos += "Entries\n";
153  if(!numas<unsigned int>(m_data.entries(),a_sinfos)){}
154 
155  } else if((*it)=="mean") {
156  if(a_sinfos.size()) a_sinfos += f_lf;
157  a_sinfos += "MeanX\n";
158  if(!numas<double>(m_data.mean_x(),a_sinfos)){}
159  a_sinfos += f_lf;
160  a_sinfos += "MeanY\n";
161  if(!numas<double>(m_data.mean_y(),a_sinfos)){}
162  a_sinfos += f_lf;
163  a_sinfos += "MeanZ\n";
164  if(!numas<double>(m_data.mean_z(),a_sinfos)){}
165 
166  } else if((*it)=="rms") {
167  if(a_sinfos.size()) a_sinfos += f_lf;
168  a_sinfos += "RMS X\n";
169  if(!numas<double>(m_data.rms_x(),a_sinfos)){}
170  a_sinfos += f_lf;
171  a_sinfos += "RMS Y\n";
172  if(!numas<double>(m_data.rms_y(),a_sinfos)){}
173  a_sinfos += f_lf;
174  a_sinfos += "RMS Z\n";
175  if(!numas<double>(m_data.rms_z(),a_sinfos)){}
176 
177  }
178  }
179  }

◆ is_valid()

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

Implements tools::sg::plottable.

Definition at line 130 of file cloud2plot.

130 {return true;}

◆ ith_point()

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

Implements tools::sg::points3D.

Definition at line 189 of file cloud2plot.

189  {
190  if(a_index>=m_data.entries()) {a_x = 0;a_y = 0;a_z = 0;return false;}
191  if(a_index>=m_data.entries()) {a_x = 0;a_y = 0;a_z = 0;return false;}
192  a_x = (float)m_data.value_x(a_index);
193  a_y = (float)m_data.value_y(a_index);
194  a_z = (float)m_data.value_z(a_index);
195  return true;
196  }

◆ legend()

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

Implements tools::sg::plottable.

Definition at line 134 of file cloud2plot.

134 {return m_legend;}

◆ name()

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

Implements tools::sg::plottable.

Definition at line 131 of file cloud2plot.

131 {return m_name;}

◆ operator=()

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

Definition at line 222 of file cloud2plot.

222  {
223  m_name = a_from.m_name;
224  m_legend = a_from.m_legend;
225  return *this;
226  }

◆ points()

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

Implements tools::sg::points3D.

Definition at line 188 of file cloud2plot.

188 {return m_data.entries();}

◆ set_legend()

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

Implements tools::sg::plottable.

Definition at line 135 of file cloud2plot.

135 {m_legend = a_s;}

◆ set_name()

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

Implements tools::sg::plottable.

Definition at line 132 of file cloud2plot.

132 {m_name = a_s;}

◆ title()

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

Implements tools::sg::plottable.

Definition at line 133 of file cloud2plot.

133 {return m_data.title();}

◆ x_axis_max()

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

Implements tools::sg::points3D.

Definition at line 182 of file cloud2plot.

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

◆ x_axis_min()

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

Implements tools::sg::points3D.

Definition at line 181 of file cloud2plot.

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

◆ y_axis_max()

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

Implements tools::sg::points3D.

Definition at line 184 of file cloud2plot.

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

◆ y_axis_min()

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

Implements tools::sg::points3D.

Definition at line 183 of file cloud2plot.

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

◆ z_axis_max()

virtual float tools::sg::c3d2plot::z_axis_max ( ) const
inlinevirtual

Implements tools::sg::points3D.

Definition at line 186 of file cloud2plot.

186 {return (float)m_data.upper_edge_z();}

◆ z_axis_min()

virtual float tools::sg::c3d2plot::z_axis_min ( ) const
inlinevirtual

Implements tools::sg::points3D.

Definition at line 185 of file cloud2plot.

185 {return (float)m_data.lower_edge_z();}

Member Data Documentation

◆ m_data

const histo::c3d& tools::sg::c3d2plot::m_data
protected

Definition at line 228 of file cloud2plot.

◆ m_legend

std::string tools::sg::c3d2plot::m_legend
protected

Definition at line 230 of file cloud2plot.

◆ m_name

std::string tools::sg::c3d2plot::m_name
protected

Definition at line 229 of file cloud2plot.


The documentation for this class was generated from the following file:
tools::histo::c3d::mean_z
double mean_z() const
Definition: c3d:477
tools::histo::c3d::upper_edge_y
double upper_edge_y() const
Definition: c3d:445
tools::histo::c3d::upper_edge_z
double upper_edge_z() const
Definition: c3d:449
tools::histo::c3d::lower_edge_z
double lower_edge_z() const
Definition: c3d:437
tools::histo::base_cloud::title
const std::string & title() const
Definition: base_cloud:56
tools::histo::c3d::value_x
double value_x(unsigned int) const
Definition: c3d:453
tools::histo::c3d::entries
unsigned int entries() const
Definition: c3d:424
tools::sg::c3d2plot::m_data
const histo::c3d & m_data
Definition: cloud2plot:228
tools::histo::c3d::lower_edge_y
double lower_edge_y() const
Definition: c3d:433
tools::histo::c3d::rms_z
double rms_z() const
Definition: c3d:509
tools::histo::c3d::mean_x
double mean_x() const
Definition: c3d:469
tools::histo::c3d::rms_y
double rms_y() const
Definition: c3d:495
tools::histo::c3d::lower_edge_x
double lower_edge_x() const
Definition: c3d:429
tools::histo::c3d::upper_edge_x
double upper_edge_x() const
Definition: c3d:441
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::sg::c3d2plot::c3d2plot
c3d2plot(const histo::c3d &a_data)
Definition: cloud2plot:198
tools::sg::c3d2plot::m_legend
std::string m_legend
Definition: cloud2plot:230
tools::histo::c3d::value_z
double value_z(unsigned int) const
Definition: c3d:461
tools::histo::c3d::rms_x
double rms_x() const
Definition: c3d:481
tools::histo::c3d::value_y
double value_y(unsigned int) const
Definition: c3d:457
tools::histo::c3d::mean_y
double mean_y() const
Definition: c3d:473
tools::sg::c3d2plot::m_name
std::string m_name
Definition: cloud2plot:229