Commit ad899d90 authored by Laurent Belcour's avatar Laurent Belcour

Updating the classes to have the value function implemented

parent d9a96ce4
......@@ -44,18 +44,26 @@ class data
// Acces to data
virtual vec get(int i) const = 0 ;
virtual vec operator[](int i) const = 0 ;
virtual vec value(vec in, vec out) const
{
return vec(_nY) ;
}
//! \brief Provide an evaluation in a BRDF way of the data.
//!
//! \details
//! The input vector in (can have texture coordinate) and the output
//! vector out are taken to grad a value and return it. The two vectors
//! should be compliant with the size and parametrization of the data.
virtual vec value(vec in, vec out) const = 0;
// Get data size, e.g. the number of samples to fit
virtual int size() const = 0 ;
// Get min and max input space values
virtual vec min() const = 0 ;
virtual vec max() const = 0 ;
// Get the size of the input X domain and output Y domain
virtual int dimX() const { return _nX ; }
virtual int dimY() const { return _nY ; }
......@@ -131,6 +139,12 @@ class data_params : public data
save(std::string("cluster.gnuplot"));
}
virtual vec value(vec in, vec out) const
{
std::cerr << "<<ERROR>> not implemented: " << __func__ << std::endl;
throw;
}
// Load data from a file
virtual void load(const std::string& filename)
{
......
......@@ -209,7 +209,7 @@ data* plugins_manager::get_data(const std::string& n)
return NULL;
}
DataPrototype myData = (DataPrototype) data_lib.resolve("_Z16provide_datav");
DataPrototype myData = (DataPrototype) data_lib.resolve("_Z12provide_datav");
if(myData != NULL)
{
......
......@@ -18,15 +18,29 @@ class vertical_segment : public data
virtual void load(const std::string& filename) ;
virtual void load(const std::string& filename, const arguments& args) ;
// Acces to data
virtual void get(int i, vec &x, vec &yl, vec &yu) const ;
virtual vec get(int i) const ;
virtual void get(int i, vec& yl, vec& yu) const ;
virtual vec operator[](int i) const ;
virtual vec value(vec in, vec out) const
{
std::cerr << "<<ERROR>> not implemented: " << __func__ << std::endl;
throw;
}
//! \brief Specific accessor to a vertical segment, this gives the
//! complete vector, plus the ordinate segment
virtual void get(int i, vec &x, vec &yl, vec &yu) const ;
//! \brief Specific accessor to a vertical segment. Provides only the
//! ordinate segment.
virtual void get(int i, vec& yl, vec& yu) const ;
// Get data size
virtual int size() const ;
// Get min and max input parameters
virtual vec min() const ;
virtual vec max() const ;
......
......@@ -13,5 +13,6 @@ SUBDIRS = \
nonlinear_levenberg_eigen \
nonlinear_function_phong \
nonlinear_function_lafortune \
data_merl
data_merl \
data_astm
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment