g4tools  5.4.0
Public Member Functions | Protected Attributes | List of all members
tools::sg::f1d2plot< T > Class Template Reference
Inheritance diagram for tools::sg::f1d2plot< T >:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::f1d2plot< 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_v) const
 
virtual unsigned int x_steps () const
 
virtual float x_min () const
 
virtual float x_max () const
 
 f1d2plot (const T &a_data)
 
virtual ~f1d2plot ()
 
 f1d2plot (const f1d2plot &a_from)
 
f1d2plotoperator= (const f1d2plot &a_from)
 
void set_title (const std::string &a_s)
 
- Public Member Functions inherited from tools::sg::func1D
virtual ~func1D ()
 
- 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::f1d2plot< T >

Definition at line 25 of file f2plot.

Constructor & Destructor Documentation

◆ f1d2plot() [1/2]

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

Definition at line 66 of file f2plot.

66  :m_data(a_data){
67 #ifdef TOOLS_MEM
68  mem::increment(s_class().c_str());
69 #endif
70  }

◆ ~f1d2plot()

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

Definition at line 71 of file f2plot.

71  {
72 #ifdef TOOLS_MEM
73  mem::decrement(s_class().c_str());
74 #endif
75  }

◆ f1d2plot() [2/2]

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

Definition at line 77 of file f2plot.

78  :plottable(a_from),func1D(a_from)
79  ,m_data(a_from.m_data)
80  ,m_name(a_from.m_name)
81  ,m_legend(a_from.m_legend)
82  ,m_title(a_from.m_title)
83  {
84 #ifdef TOOLS_MEM
85  mem::increment(s_class().c_str());
86 #endif
87  }

Member Function Documentation

◆ cast()

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

Reimplemented from tools::sg::func1D.

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

Definition at line 28 of file f2plot.

28  {
29  if(void* p = cmp_cast<f1d2plot>(this,a_class)) {return p;}
30  return func1D::cast(a_class);
31  }

◆ copy()

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

Implements tools::sg::plottable.

Definition at line 33 of file f2plot.

33 {return new f1d2plot(*this);}

◆ infos()

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

Implements tools::sg::plottable.

Definition at line 41 of file f2plot.

41  {
42  a_sinfos.clear();
43  std::string f_lf("\n");
44  std::vector<std::string> _words;
45  words(a_opts," ",false,_words);
46  tools_vforcit(std::string,_words,it) {
47  if(((*it)=="name") && m_name.size()) {
48  if(a_sinfos.size()) a_sinfos += f_lf;
49  a_sinfos += "Name\n";
50  a_sinfos += m_name;
51  }
52  }
53  }

◆ is_valid()

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

Implements tools::sg::plottable.

Definition at line 34 of file f2plot.

34 {return true;}

◆ legend()

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

Implements tools::sg::plottable.

Definition at line 38 of file f2plot.

38 {return m_legend;}

◆ name()

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

Implements tools::sg::plottable.

Definition at line 35 of file f2plot.

35 {return m_name;}

◆ operator=()

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

Definition at line 88 of file f2plot.

88  {
89  m_name = a_from.m_name;
90  m_legend = a_from.m_legend;
91  m_title = a_from.m_title;
92  return *this;
93  }

◆ set_legend()

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

Implements tools::sg::plottable.

Definition at line 39 of file f2plot.

39 {m_legend = a_s;}

◆ set_name()

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

Implements tools::sg::plottable.

Definition at line 36 of file f2plot.

36 {m_name = a_s;}

◆ set_title()

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

Definition at line 95 of file f2plot.

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

◆ title()

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

Implements tools::sg::plottable.

Definition at line 37 of file f2plot.

37 {return m_title;}

◆ value()

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

Implements tools::sg::func1D.

Definition at line 55 of file f2plot.

55  {
56  if(!m_data.in_domain(a_x)) {a_v = 0;return false;}
57  a_v = (float)m_data.value(a_x);
58  return true;
59  }

◆ x_max()

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

Implements tools::sg::func1D.

Definition at line 63 of file f2plot.

63 {return (float)m_data.xdomain_max();}

◆ x_min()

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

Implements tools::sg::func1D.

Definition at line 62 of file f2plot.

62 {return (float)m_data.xdomain_min();}

◆ x_steps()

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

Implements tools::sg::func1D.

Definition at line 61 of file f2plot.

61 {return m_data.xdomain_number_of_steps();}

Member Data Documentation

◆ m_data

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

Definition at line 97 of file f2plot.

◆ m_legend

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

Definition at line 99 of file f2plot.

◆ m_name

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

Definition at line 98 of file f2plot.

◆ m_title

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

Definition at line 100 of file f2plot.


The documentation for this class was generated from the following file:
tools::sg::func1D::cast
virtual void * cast(const std::string &a_class) const
Definition: plottables:80
tools::sg::f1d2plot::m_name
std::string m_name
Definition: f2plot:98
tools::sg::f1d2plot::f1d2plot
f1d2plot(const T &a_data)
Definition: f2plot:66
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::f1d2plot::m_data
const T & m_data
Definition: f2plot:97
tools_vforcit
#define tools_vforcit(a__T, a__v, a__it)
Definition: forit:7
tools::sg::f1d2plot::m_title
std::string m_title
Definition: f2plot:100
tools::sg::f1d2plot::m_legend
std::string m_legend
Definition: f2plot:99