Commit ab1941e9 authored by Laurent Belcour's avatar Laurent Belcour

Correction of a bug in the product function. Setting parametrization was not done properly.

Cleaning the parsing code for Beckmann and retro Beckmann lobes.
parent ad3967ee
......@@ -755,7 +755,7 @@ product_function::product_function(nonlinear_function* g1, nonlinear_function* g
}
else
{
setParametrization(g1->input_parametrization());
function::setParametrization(g1->input_parametrization());
function::setDimX(g1->dimX());
}
}
......
......@@ -68,6 +68,10 @@ class params
\theta_v \sin(\Delta\phi).\f$]*/
ISOTROPIC_TD_PD, /*!< Difference between two directions such as R and H */
BARYCENTRIC_ALPHA_SIGMA, /*!< Barycentric parametrization defined in Stark et alL [2004].
Coordinates are: \f$[\alpha, \sigma] = [{1\over 2}(1 - \vec{l}\vec{v}),
(1-(\vec{h}.\vec{n})^2)(1 - \alpha)]\f$ */
CARTESIAN, /*!< View and Light vectors represented in cartesian coordinates.
We always pack the view vector first: \f$\vec{c} = [v.x, v.y,
v.z, l.x, l.y, l.z] \f$*/
......
......@@ -191,14 +191,16 @@ bool beckmann_function::load(std::istream& in)
if(token.compare("#FUNC") != 0)
{
std::cerr << "<<ERROR>> parsing the stream. The #FUNC is not the next line defined." << std::endl;
return false;
std::cerr << "<<ERROR>> got \"" << token << "\" instead." << std::endl;
return false;
}
in >> token;
if(token.compare("nonlinear_function_beckmann") != 0)
{
std::cerr << "<<ERROR>> parsing the stream. function name is not the next token." << std::endl;
return false;
std::cerr << "<<ERROR>> got \"" << token << "\" instead." << std::endl;
return false;
}
// Parse the lobe
......
......@@ -192,14 +192,24 @@ bool beckmann_function::load(std::istream& in)
if(token.compare("#FUNC") != 0)
{
std::cerr << "<<ERROR>> parsing the stream. The #FUNC is not the next line defined." << std::endl;
return false;
std::cerr << "<<ERROR>> got \"" << token << "\" instead." << std::endl;
return false;
}
in >> token;
if(token.compare("nonlinear_function_retrobeckmann") != 0)
{
std::cerr << "<<ERROR>> parsing the stream. function name is not the next token." << std::endl;
std::cerr << "<<ERROR>> got \"" << token << "\" instead." << std::endl;
return false;
}
in >> token;
if(token.compare("#TYPE") != 0)
{
std::cerr << "<<ERROR>> parsing the stream. The #FUNC is not the next line defined." << std::endl;
return false;
std::cerr << "<<ERROR>> parsing the stream. The #TYPE is not the next line defined." << std::endl;
std::cerr << "<<ERROR>> got \"" << token << "\" instead." << std::endl;
return false;
}
in >> token;
......@@ -213,13 +223,6 @@ bool beckmann_function::load(std::istream& in)
}
in >> token;
if(token.compare("nonlinear_function_retrobeckmann") != 0)
{
std::cerr << "<<ERROR>> parsing the stream. function name is not the next token." << std::endl;
return false;
}
// Parse the lobe
for(int i=0; i<_nY; ++i)
{
......
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