inlib  1.2.0
Public Types | Public Member Functions | Protected Member Functions
inlib::sg::xy2plot< T > Class Template Reference
Inheritance diagram for inlib::sg::xy2plot< T >:
Inheritance graph
[legend]
Collaboration diagram for inlib::sg::xy2plot< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::vector< T > data_t

Public Member Functions

virtual plottablecopy () const
virtual bool is_valid () const
virtual std::string name ()
virtual void set_name (const std::string &a_s)
virtual std::string title ()
virtual std::string legend ()
virtual void set_legend (const std::string &a_s)
virtual std::string infos (const std::string &a_opts)
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
 xy2plot (const data_t &a_x, const data_t &a_y)
virtual ~xy2plot ()

Protected Member Functions

 xy2plot (const xy2plot &a_from)

Detailed Description

template<class T>
class inlib::sg::xy2plot< T >

Definition at line 18 of file vec2plot.


Member Typedef Documentation

template<class T >
typedef std::vector<T> inlib::sg::xy2plot< T >::data_t

Definition at line 69 of file vec2plot.


Constructor & Destructor Documentation

template<class T >
inlib::sg::xy2plot< T >::xy2plot ( const data_t a_x,
const data_t a_y 
) [inline]

Definition at line 71 of file vec2plot.

  :m_x(a_x)
  ,m_y(a_y)
  {
    inlib::minimum<T>(a_x,m_x_min);
    inlib::maximum<T>(a_x,m_x_max);

    inlib::minimum<T>(a_y,m_y_min);
    inlib::maximum<T>(a_y,m_y_max);
  }
template<class T >
virtual inlib::sg::xy2plot< T >::~xy2plot ( ) [inline, virtual]

Definition at line 81 of file vec2plot.

{}
template<class T >
inlib::sg::xy2plot< T >::xy2plot ( const xy2plot< T > &  a_from) [inline, protected]

Definition at line 83 of file vec2plot.

  :plottable(a_from),points2D(a_from)
  ,m_x(a_from.m_x)
  ,m_y(a_from.m_y)
  ,m_name(a_from.m_name)
  ,m_legend(a_from.m_legend)
  ,m_x_min(a_from.m_x_min)
  ,m_x_max(a_from.m_x_max)
  ,m_y_min(a_from.m_y_min)
  ,m_y_max(a_from.m_y_max)
  {}  

Member Function Documentation

template<class T >
virtual plottable* inlib::sg::xy2plot< T >::copy ( ) const [inline, virtual]

Implements inlib::sg::plottable.

Definition at line 20 of file vec2plot.

{return new xy2plot(*this);}
template<class T >
virtual std::string inlib::sg::xy2plot< T >::infos ( const std::string &  a_opts) [inline, virtual]

Implements inlib::sg::plottable.

Definition at line 28 of file vec2plot.

                                                  {
    std::string f_lf("\n");
    std::string sinfos;
    std::vector<std::string> words;
    inlib::words(a_opts," ",false,words);
    std::vector<std::string>::const_iterator it;
  
    for(it=words.begin();it!=words.end();++it) {
      if(((*it)=="name") && m_name.size()) {
        if(sinfos.size()) sinfos += f_lf;
        sinfos += "Name\n";
        sinfos += m_name;
  
      } else if((*it)=="entries") {
        if(sinfos.size()) sinfos += f_lf;
        sinfos += "Entries\n";
        sinfos += inlib::to<int>
          (inlib::mn<unsigned int>(m_x.size(),m_y.size()));
  
      }
    }
  
    return sinfos;
  }  
template<class T >
virtual bool inlib::sg::xy2plot< T >::is_valid ( ) const [inline, virtual]

Implements inlib::sg::plottable.

Definition at line 21 of file vec2plot.

{return true;}
template<class T >
virtual bool inlib::sg::xy2plot< T >::ith_point ( unsigned int  a_index,
float &  a_x,
float &  a_y 
) const [inline, virtual]

Implements inlib::sg::points2D.

Definition at line 61 of file vec2plot.

                                                                           {
    if(a_index>=m_x.size()) {a_x = T();a_y = T();return false;}
    if(a_index>=m_y.size()) {a_x = T();a_y = T();return false;}
    a_x = m_x[a_index];
    a_y = m_y[a_index];
    return true;
  }
template<class T >
virtual std::string inlib::sg::xy2plot< T >::legend ( ) [inline, virtual]

Implements inlib::sg::plottable.

Definition at line 25 of file vec2plot.

{return m_legend;}
template<class T >
virtual std::string inlib::sg::xy2plot< T >::name ( ) [inline, virtual]

Implements inlib::sg::plottable.

Definition at line 22 of file vec2plot.

{return m_name;}
template<class T >
virtual unsigned int inlib::sg::xy2plot< T >::points ( ) const [inline, virtual]

Implements inlib::sg::points2D.

Definition at line 58 of file vec2plot.

                                      {
    return inlib::mn<unsigned int>(m_x.size(),m_y.size());
  }
template<class T >
virtual void inlib::sg::xy2plot< T >::set_legend ( const std::string &  a_s) [inline, virtual]

Implements inlib::sg::plottable.

Definition at line 26 of file vec2plot.

{m_legend = a_s;}
template<class T >
virtual void inlib::sg::xy2plot< T >::set_name ( const std::string &  a_s) [inline, virtual]

Implements inlib::sg::plottable.

Definition at line 23 of file vec2plot.

{m_name = a_s;}
template<class T >
virtual std::string inlib::sg::xy2plot< T >::title ( ) [inline, virtual]

Implements inlib::sg::plottable.

Definition at line 24 of file vec2plot.

{return "";}
template<class T >
virtual float inlib::sg::xy2plot< T >::x_axis_max ( ) const [inline, virtual]

Implements inlib::sg::points2D.

Definition at line 54 of file vec2plot.

{return float(m_x_max);}
template<class T >
virtual float inlib::sg::xy2plot< T >::x_axis_min ( ) const [inline, virtual]

Implements inlib::sg::points2D.

Definition at line 53 of file vec2plot.

{return float(m_x_min);}
template<class T >
virtual float inlib::sg::xy2plot< T >::y_axis_max ( ) const [inline, virtual]

Implements inlib::sg::points2D.

Definition at line 56 of file vec2plot.

{return float(m_y_max);}
template<class T >
virtual float inlib::sg::xy2plot< T >::y_axis_min ( ) const [inline, virtual]

Implements inlib::sg::points2D.

Definition at line 55 of file vec2plot.

{return float(m_y_min);}

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines