Commit 89bf6e79 authored by Laurent Belcour's avatar Laurent Belcour

Fixing all the plugins with the new interfaces

parent c966a9f5
......@@ -14,7 +14,7 @@
data* rational_fitter_eigen::provide_data() const
{
return new rational_data() ;
return new vertical_segment() ;
}
function* rational_fitter_eigen::provide_function() const
......@@ -32,7 +32,7 @@ rational_fitter_eigen::~rational_fitter_eigen()
bool rational_fitter_eigen::fit_data(const data* dat, function* fit)
{
rational_function* r = dynamic_cast<rational_function*>(fit) ;
const rational_data* d = dynamic_cast<const rational_data*>(dat) ;
const vertical_segment* d = dynamic_cast<const vertical_segment*>(dat) ;
if(r == NULL || d == NULL)
{
std::cerr << "<<ERROR>> not passing the correct class to the fitter" << std::endl ;
......@@ -77,7 +77,7 @@ void rational_fitter_eigen::set_parameters(const arguments& args)
_nq = args.get_float("nq", 10) ;
}
bool rational_fitter_eigen::fit_data(const rational_data* d, int np, int nq, rational_function* r)
bool rational_fitter_eigen::fit_data(const vertical_segment* d, int np, int nq, rational_function* r)
{
// Multidimensional coefficients
......@@ -101,7 +101,7 @@ bool rational_fitter_eigen::fit_data(const rational_data* d, int np, int nq, rat
// np and nq are the degree of the RP to fit to the data
// y is the dimension to fit on the y-data (e.g. R, G or B for RGB signals)
// the function return a ration BRDF function and a boolean
bool rational_fitter_eigen::fit_data(const rational_data* d, int np, int nq, int ny, rational_function* r)
bool rational_fitter_eigen::fit_data(const vertical_segment* d, int np, int nq, int ny, rational_function* r)
{
// Each constraint (fitting interval or point
// add another dimension to the constraint
......
......@@ -10,9 +10,8 @@
#include <core/data.h>
#include <core/fitter.h>
#include <core/args.h>
#include <rational_function.h>
#include <rational_data.h>
#include <core/rational_function.h>
#include <core/vertical_segment.h>
class rational_fitter_eigen : public QObject, public fitter
{
......@@ -41,8 +40,8 @@ class rational_fitter_eigen : public QObject, public fitter
// Fitting a data object using np elements in the numerator and nq
// elements in the denominator
virtual bool fit_data(const rational_data* d, int np, int nq, rational_function* fit) ;
virtual bool fit_data(const rational_data* dat, int np, int nq, int ny, rational_function* fit) ;
virtual bool fit_data(const vertical_segment* d, int np, int nq, rational_function* fit) ;
virtual bool fit_data(const vertical_segment* dat, int np, int nq, int ny, rational_function* fit) ;
protected: // data
......
......@@ -16,7 +16,7 @@
data* rational_fitter_matlab::provide_data() const
{
return new rational_data() ;
return new vertical_segment() ;
}
function* rational_fitter_matlab::provide_function() const
......@@ -34,7 +34,7 @@ rational_fitter_matlab::~rational_fitter_matlab()
bool rational_fitter_matlab::fit_data(const data* dat, function* fit)
{
rational_function* r = dynamic_cast<rational_function*>(fit) ;
const rational_data* d = dynamic_cast<const rational_data*>(dat) ;
const vertical_segment* d = dynamic_cast<const vertical_segment*>(dat) ;
if(r == NULL || d == NULL || ep == NULL)
{
std::cerr << "<<ERROR>> not passing the correct class to the fitter" << std::endl ;
......@@ -102,7 +102,7 @@ void rational_fitter_matlab::set_parameters(const arguments& args)
_min_nq = args.get_float("min-nq", _max_nq) ;
}
bool rational_fitter_matlab::fit_data(const rational_data* d, int np, int nq, rational_function* r)
bool rational_fitter_matlab::fit_data(const vertical_segment* d, int np, int nq, rational_function* r)
{
// Multidimensional coefficients
......@@ -126,7 +126,7 @@ bool rational_fitter_matlab::fit_data(const rational_data* d, int np, int nq, ra
// np and nq are the degree of the RP to fit to the data
// y is the dimension to fit on the y-data (e.g. R, G or B for RGB signals)
// the function return a ration BRDF function and a boolean
bool rational_fitter_matlab::fit_data(const rational_data* d, int np, int nq, int ny, rational_function* r)
bool rational_fitter_matlab::fit_data(const vertical_segment* d, int np, int nq, int ny, rational_function* r)
{
// Size of the problem
int N = np+nq ;
......
......@@ -11,9 +11,8 @@
#include <core/data.h>
#include <core/fitter.h>
#include <core/args.h>
#include <rational_function.h>
#include <rational_data.h>
#include <core/rational_function.h>
#include <core/vertical_segment.h>
class rational_fitter_matlab : public QObject, public fitter
{
......@@ -42,8 +41,8 @@ class rational_fitter_matlab : public QObject, public fitter
// Fitting a data object using np elements in the numerator and nq
// elements in the denominator
virtual bool fit_data(const rational_data* d, int np, int nq, rational_function* fit) ;
virtual bool fit_data(const rational_data* dat, int np, int nq, int ny, rational_function* fit) ;
virtual bool fit_data(const vertical_segment* d, int np, int nq, rational_function* fit) ;
virtual bool fit_data(const vertical_segment* dat, int np, int nq, int ny, rational_function* fit) ;
protected: // data
......
......@@ -13,12 +13,10 @@
#include <QTime>
#include <rational_function.h>
#include <rational_data.h>
data* rational_fitter_quadprog::provide_data() const
{
return new rational_data() ;
return new vertical_segment() ;
}
function* rational_fitter_quadprog::provide_function() const
......@@ -36,7 +34,7 @@ rational_fitter_quadprog::~rational_fitter_quadprog()
bool rational_fitter_quadprog::fit_data(const data* dat, function* fit)
{
rational_function* r = dynamic_cast<rational_function*>(fit) ;
const rational_data* d = dynamic_cast<const rational_data*>(dat) ;
const vertical_segment* d = dynamic_cast<const vertical_segment*>(dat) ;
if(r == NULL || d == NULL)
{
std::cerr << "<<ERROR>> not passing the correct class to the fitter" << std::endl ;
......@@ -97,7 +95,7 @@ void rational_fitter_quadprog::set_parameters(const arguments& args)
}
bool rational_fitter_quadprog::fit_data(const rational_data* d, int np, int nq, rational_function* r)
bool rational_fitter_quadprog::fit_data(const vertical_segment* d, int np, int nq, rational_function* r)
{
// Multidimensional coefficients
......@@ -121,10 +119,10 @@ bool rational_fitter_quadprog::fit_data(const rational_data* d, int np, int nq,
// np and nq are the degree of the RP to fit to the data
// y is the dimension to fit on the y-data (e.g. R, G or B for RGB signals)
// the function return a ration BRDF function and a boolean
bool rational_fitter_quadprog::fit_data(const rational_data* dat, int np, int nq, int ny, rational_function* rf)
bool rational_fitter_quadprog::fit_data(const vertical_segment* dat, int np, int nq, int ny, rational_function* rf)
{
rational_function* r = dynamic_cast<rational_function*>(rf) ;
const rational_data* d = dynamic_cast<const rational_data*>(dat) ;
const vertical_segment* d = dynamic_cast<const vertical_segment*>(dat) ;
if(r == NULL || d == NULL)
{
std::cerr << "<<ERROR>> not passing the correct class to the fitter" << std::endl ;
......
......@@ -10,9 +10,8 @@
#include <core/data.h>
#include <core/fitter.h>
#include <core/args.h>
#include <rational_function.h>
#include <rational_data.h>
#include <core/rational_function.h>
#include <core/vertical_segment.h>
class rational_fitter_quadprog : public QObject, public fitter
......@@ -42,8 +41,8 @@ class rational_fitter_quadprog : public QObject, public fitter
// Fitting a data object using np elements in the numerator and nq
// elements in the denominator
virtual bool fit_data(const rational_data* d, int np, int nq, rational_function* fit) ;
virtual bool fit_data(const rational_data* dat, int np, int nq, int ny, rational_function* fit) ;
virtual bool fit_data(const vertical_segment* d, int np, int nq, rational_function* fit) ;
virtual bool fit_data(const vertical_segment* dat, int np, int nq, int ny, rational_function* fit) ;
// min and Max usable np and nq values for the fitting
int _max_np, _max_nq ;
......
......@@ -16,7 +16,7 @@
class rational_function_chebychev : public QObject, public rational_function
{
Q_OBJECT
Q_INTERFACES(function)
Q_INTERFACES(function rational_function)
public: // methods
......
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