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

Public Member Functions

virtual void * cast (const std::string &a_class) const
 
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 bool value (float a_x, float a_y, float &a_v) const
 
virtual unsigned int x_steps () const
 
virtual float x_min () const
 
virtual float x_max () const
 
virtual unsigned int y_steps () const
 
virtual float y_min () const
 
virtual float y_max () const
 
 f2d2plot (const T &a_data)
 
virtual ~f2d2plot ()
 
 f2d2plot (const f2d2plot &a_from)
 
f2d2plotoperator= (const f2d2plot &a_from)
 
void set_title (const std::string &a_s)
 
- Public Member Functions inherited from tools::sg::func2D
virtual ~func2D ()
 
- Public Member Functions inherited from tools::sg::plottable
virtual ~plottable ()
 

Protected Attributes

const T & m_data
 
std::string m_name
 
std::string m_legend
 
std::string m_title
 

Detailed Description

template<class T>
class tools::sg::f2d2plot< T >

Definition at line 134 of file f2plot.

Constructor & Destructor Documentation

◆ f2d2plot() [1/2]

template<class T >
tools::sg::f2d2plot< T >::f2d2plot ( const T &  a_data)
inline

Definition at line 177 of file f2plot.

177  :m_data(a_data){
178 #ifdef TOOLS_MEM
179  mem::increment(s_class().c_str());
180 #endif
181  }

◆ ~f2d2plot()

template<class T >
virtual tools::sg::f2d2plot< T >::~f2d2plot ( )
inlinevirtual

Definition at line 182 of file f2plot.

182  {
183 #ifdef TOOLS_MEM
184  mem::decrement(s_class().c_str());
185 #endif
186  }

◆ f2d2plot() [2/2]

template<class T >
tools::sg::f2d2plot< T >::f2d2plot ( const f2d2plot< T > &  a_from)
inline

Definition at line 188 of file f2plot.

189  :plottable(a_from),func2D(a_from)
190  ,m_data(a_from.m_data)
191  ,m_name(a_from.m_name)
192  ,m_legend(a_from.m_legend)
193  ,m_title(a_from.m_title)
194  {
195 #ifdef TOOLS_MEM
196  mem::increment(s_class().c_str());
197 #endif
198  }

Member Function Documentation

◆ cast()

template<class T >
virtual void* tools::sg::f2d2plot< T >::cast ( const std::string &  a_class) const
inlinevirtual

Reimplemented from tools::sg::func2D.

Reimplemented in tools::sg::f2d2plot_cp< T >.

Definition at line 137 of file f2plot.

137  {
138  if(void* p = cmp_cast<f2d2plot>(this,a_class)) {return p;}
139  return func2D::cast(a_class);
140  }

◆ copy()

template<class T >
virtual plottable* tools::sg::f2d2plot< T >::copy ( ) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 142 of file f2plot.

142 {return new f2d2plot(*this);}

◆ infos()

template<class T >
virtual void tools::sg::f2d2plot< T >::infos ( const std::string &  a_opts,
std::string &  a_sinfos 
) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 150 of file f2plot.

150  {
151  a_sinfos.clear();
152  std::string f_lf("\n");
153  std::vector<std::string> _words;
154  words(a_opts," ",false,_words);
155  tools_vforcit(std::string,_words,it) {
156  if(((*it)=="name") && m_name.size()) {
157  if(a_sinfos.size()) a_sinfos += f_lf;
158  a_sinfos += "Name\n";
159  a_sinfos += m_name;
160  }
161  }
162  }

◆ is_valid()

template<class T >
virtual bool tools::sg::f2d2plot< T >::is_valid ( ) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 143 of file f2plot.

143 {return true;}

◆ legend()

template<class T >
virtual const std::string& tools::sg::f2d2plot< T >::legend ( ) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 147 of file f2plot.

147 {return m_legend;}

◆ name()

template<class T >
virtual const std::string& tools::sg::f2d2plot< T >::name ( ) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 144 of file f2plot.

144 {return m_name;}

◆ operator=()

template<class T >
f2d2plot& tools::sg::f2d2plot< T >::operator= ( const f2d2plot< T > &  a_from)
inline

Definition at line 199 of file f2plot.

199  {
200  m_name = a_from.m_name;
201  m_legend = a_from.m_legend;
202  m_title = a_from.m_title;
203  return *this;
204  }

◆ set_legend()

template<class T >
virtual void tools::sg::f2d2plot< T >::set_legend ( const std::string &  a_s)
inlinevirtual

Implements tools::sg::plottable.

Definition at line 148 of file f2plot.

148 {m_legend = a_s;}

◆ set_name()

template<class T >
virtual void tools::sg::f2d2plot< T >::set_name ( const std::string &  a_s)
inlinevirtual

Implements tools::sg::plottable.

Definition at line 145 of file f2plot.

145 {m_name = a_s;}

◆ set_title()

template<class T >
void tools::sg::f2d2plot< T >::set_title ( const std::string &  a_s)
inline

Definition at line 206 of file f2plot.

206 {m_title = a_s;} //for gopaw.

◆ title()

template<class T >
virtual const std::string& tools::sg::f2d2plot< T >::title ( ) const
inlinevirtual

Implements tools::sg::plottable.

Definition at line 146 of file f2plot.

146 {return m_title;}

◆ value()

template<class T >
virtual bool tools::sg::f2d2plot< T >::value ( float  a_x,
float  a_y,
float &  a_v 
) const
inlinevirtual

Implements tools::sg::func2D.

Definition at line 164 of file f2plot.

164  {
165  if(!m_data.in_domain(a_x,a_y)) {a_v = 0;return false;}
166  a_v = (float)m_data.value(a_x,a_y);
167  return true;
168  }

◆ x_max()

template<class T >
virtual float tools::sg::f2d2plot< T >::x_max ( ) const
inlinevirtual

Implements tools::sg::func2D.

Definition at line 172 of file f2plot.

172 {return m_data.xdomain_max();}

◆ x_min()

template<class T >
virtual float tools::sg::f2d2plot< T >::x_min ( ) const
inlinevirtual

Implements tools::sg::func2D.

Definition at line 171 of file f2plot.

171 {return m_data.xdomain_min();}

◆ x_steps()

template<class T >
virtual unsigned int tools::sg::f2d2plot< T >::x_steps ( ) const
inlinevirtual

Implements tools::sg::func2D.

Definition at line 170 of file f2plot.

170 {return m_data.xdomain_number_of_steps();}

◆ y_max()

template<class T >
virtual float tools::sg::f2d2plot< T >::y_max ( ) const
inlinevirtual

Implements tools::sg::func2D.

Definition at line 175 of file f2plot.

175 {return m_data.ydomain_max();}

◆ y_min()

template<class T >
virtual float tools::sg::f2d2plot< T >::y_min ( ) const
inlinevirtual

Implements tools::sg::func2D.

Definition at line 174 of file f2plot.

174 {return m_data.ydomain_min();}

◆ y_steps()

template<class T >
virtual unsigned int tools::sg::f2d2plot< T >::y_steps ( ) const
inlinevirtual

Implements tools::sg::func2D.

Definition at line 173 of file f2plot.

173 {return m_data.ydomain_number_of_steps();}

Member Data Documentation

◆ m_data

template<class T >
const T& tools::sg::f2d2plot< T >::m_data
protected

Definition at line 208 of file f2plot.

◆ m_legend

template<class T >
std::string tools::sg::f2d2plot< T >::m_legend
protected

Definition at line 210 of file f2plot.

◆ m_name

template<class T >
std::string tools::sg::f2d2plot< T >::m_name
protected

Definition at line 209 of file f2plot.

◆ m_title

template<class T >
std::string tools::sg::f2d2plot< T >::m_title
protected

Definition at line 211 of file f2plot.


The documentation for this class was generated from the following file:
tools::sg::f2d2plot::m_legend
std::string m_legend
Definition: f2plot:210
tools::sg::f2d2plot::m_data
const T & m_data
Definition: f2plot:208
tools::sg::func2D::cast
virtual void * cast(const std::string &a_class) const
Definition: plottables:97
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::f2d2plot::m_title
std::string m_title
Definition: f2plot:211
tools::sg::f2d2plot::m_name
std::string m_name
Definition: f2plot:209
tools_vforcit
#define tools_vforcit(a__T, a__v, a__it)
Definition: forit:7
tools::sg::f2d2plot::f2d2plot
f2d2plot(const T &a_data)
Definition: f2plot:177