Commit ef7decaa authored by Laurent Belcour's avatar Laurent Belcour

Updating class names for documentation

parent bd7fc1ad
......@@ -186,6 +186,7 @@ class arguments
if(_map.count(key) > 0)
{
std::string s = _map.find(key)->second;
std::cout << s << std::endl;
if(s[0] == '[') // Is an array of type [a, b, c]
{
int i = 0;
......
......@@ -27,8 +27,8 @@ class data : public parametrized
{
std::ofstream file(filename.c_str(), std::ios_base::trunc);
file << "#DIM " << _nX << " " << _nY << std::endl;
file << "PARAM_IN " << params::get_name(input_parametrization()) << std::endl;
file << "PARAM_OUT " << params::get_name(output_parametrization()) << std::endl;
file << "#PARAM_IN " << params::get_name(input_parametrization()) << std::endl;
file << "#PARAM_OUT " << params::get_name(output_parametrization()) << std::endl;
for(int i=0; i<size(); ++i)
{
vec x = this->get(i);
......
......@@ -454,9 +454,9 @@ void plugins_manager::check_compatibility(data*& d, function*& f,
std::cout << "<<DEBUG>> function will take the parametrization of the data" << std::endl;
f->setParametrization(d->input_parametrization());
}
else if(d->input_parametrization() != f->input_parametrization())
else if(d->input_parametrization() != f->input_parametrization() && args.is_defined("change-param"))
{
std::cout << "<<INFO>> has to change the parametrization of the input data" << std::endl;
std::cout << "<<INFO>> has to change the parametrization of the input data " << params::get_name(d->input_parametrization()) << std::endl;
std::cout << "<<INFO>> to " << params::get_name(f->input_parametrization()) << std::endl;
data_params* dd = new data_params(d, f->input_parametrization());
d = dd ;
......
......@@ -60,9 +60,11 @@ void vertical_segment::load(const std::string& filename, const arguments& args)
min = args.get_vec("min", _nX, -std::numeric_limits<float>::max()) ;
max = args.get_vec("max", _nX, std::numeric_limits<float>::max()) ;
std::cout << "<<DEBUG>> data will remove outside of " << min << " -> " << max << " x-interval" << std::endl;
ymin = args.get_vec("ymin", _nY, -std::numeric_limits<float>::max()) ;
ymax = args.get_vec("ymax", _nY, std::numeric_limits<float>::max()) ;
std::cout << "<<DEBUG>> data will remove outside of " << ymin << " -> " << ymax << " y-interval" << std::endl;
/*
for(int k=0; k<dimX(); ++k)
......
......@@ -11,11 +11,11 @@
ALTA_DLL_EXPORT function* provide_function()
{
return new schlick();
return new schlick_fresnel();
}
//! Load function specific files
bool schlick::load(std::istream& in)
bool schlick_fresnel::load(std::istream& in)
{
// fresnel::load(in);
......@@ -31,7 +31,7 @@ bool schlick::load(std::istream& in)
return false;
}
// Checking for the comment line #FUNC nonlinear_fresnel_schlick
// Checking for the comment line #FUNC nonlinear_fresnel_schlick_fresnel
std::string token;
in >> token;
if(token != "#FUNC")
......@@ -55,7 +55,7 @@ bool schlick::load(std::istream& in)
return true;
}
void schlick::save_call(std::ostream& out, const arguments& args) const
void schlick_fresnel::save_call(std::ostream& out, const arguments& args) const
{
bool is_alta = !args.is_defined("export") || args["export"] == "alta";
......@@ -80,7 +80,7 @@ void schlick::save_call(std::ostream& out, const arguments& args) const
}
}
void schlick::save_body(std::ostream& out, const arguments& args) const
void schlick_fresnel::save_body(std::ostream& out, const arguments& args) const
{
bool is_shader = args["export"] == "shader" || args["export"] == "explorer";
......@@ -97,7 +97,7 @@ void schlick::save_body(std::ostream& out, const arguments& args) const
}
vec schlick::value(const vec& x) const
vec schlick_fresnel::value(const vec& x) const
{
double xp[3], cart[6];
params::convert(&x[0], input_parametrization(), params::RUSIN_VH, xp);
......@@ -119,12 +119,12 @@ vec schlick::value(const vec& x) const
}
//! \brief Number of parameters to this non-linear function
int schlick::nbParameters() const
int schlick_fresnel::nbParameters() const
{
return dimY();
}
vec schlick::getParametersMin() const
vec schlick_fresnel::getParametersMin() const
{
vec m(dimY());
for(int i=0; i<dimY(); ++i) { m[i] = 0.0; }
......@@ -132,7 +132,7 @@ vec schlick::getParametersMin() const
}
//! Get the vector of min parameters for the function
vec schlick::getParametersMax() const
vec schlick_fresnel::getParametersMax() const
{
vec M(dimY());
for(int i=0; i<dimY(); ++i) { M[i] = 1.0; }
......@@ -140,7 +140,7 @@ vec schlick::getParametersMax() const
}
//! \brief Get the vector of parameters for the function
vec schlick::parameters() const
vec schlick_fresnel::parameters() const
{
vec p(dimY());
for(int i=0; i<dimY(); ++i) { p[i] = R[i]; }
......@@ -148,14 +148,14 @@ vec schlick::parameters() const
}
//! \brief Update the vector of parameters for the function
void schlick::setParameters(const vec& p)
void schlick_fresnel::setParameters(const vec& p)
{
for(int i=0; i<dimY(); ++i) { R[i] = p[i]; }
}
//! \brief Obtain the derivatives of the function with respect to the
//! parameters.
vec schlick::parametersJacobian(const vec& x) const
vec schlick_fresnel::parametersJacobian(const vec& x) const
{
const int nY = dimY();
double xp[3], cart[6];
......@@ -179,7 +179,7 @@ vec schlick::parametersJacobian(const vec& x) const
}
void schlick::bootstrap(const data* d, const arguments& args)
void schlick_fresnel::bootstrap(const data* d, const arguments& args)
{
for(int i=0; i<dimY(); ++i) { R[i] = 0.5; }
}
......@@ -16,12 +16,12 @@
* \ingroup functions
* \brief Schlick's rational approximation of the Fresnel term.
*/
class schlick : public nonlinear_function//fresnel
class schlick_fresnel : public nonlinear_function
{
public: // methods
schlick()
schlick_fresnel()
{
setParametrization(params::CARTESIAN);
setDimX(6);
......
......@@ -11,11 +11,11 @@
ALTA_DLL_EXPORT function* provide_function()
{
return new schlick();
return new schlick_masking();
}
//! Load function specific files
bool schlick::load(std::istream& in)
bool schlick_masking::load(std::istream& in)
{
// fresnel::load(in);
......@@ -31,7 +31,7 @@ bool schlick::load(std::istream& in)
return false;
}
// Checking for the comment line #FUNC nonlinear_fresnel_schlick
// Checking for the comment line #FUNC nonlinear_fresnel_schlick_masking
std::string token;
in >> token;
if(token != "#FUNC")
......@@ -41,7 +41,7 @@ bool schlick::load(std::istream& in)
}
in >> token;
if(token != "nonlinear_fresnel_schlick")
if(token != "nonlinear_masking_schlick")
{
std::cerr << "<<ERROR>> parsing the stream. function name is not the next token." << std::endl;
return false;
......@@ -55,13 +55,13 @@ bool schlick::load(std::istream& in)
return true;
}
void schlick::save_call(std::ostream& out, const arguments& args) const
void schlick_masking::save_call(std::ostream& out, const arguments& args) const
{
bool is_alta = !args.is_defined("export") || args["export"] == "alta";
if(is_alta)
{
out << "#FUNC nonlinear_shadowing_schlick" << std::endl ;
out << "#FUNC nonlinear_masking_schlick" << std::endl ;
for(int i=0; i<dimY(); ++i)
{
out << "K " << w[i] << std::endl;
......@@ -70,7 +70,7 @@ void schlick::save_call(std::ostream& out, const arguments& args) const
}
else
{
out << "shadowing_schlick(L, V, N, X, Y, vec3";
out << "masking_schlick(L, V, N, X, Y, vec3";
for(int i=0; i<dimY(); ++i)
{
out << w[i];
......@@ -80,14 +80,14 @@ void schlick::save_call(std::ostream& out, const arguments& args) const
}
}
void schlick::save_body(std::ostream& out, const arguments& args) const
void schlick_masking::save_body(std::ostream& out, const arguments& args) const
{
bool is_shader = args["export"] == "shader" || args["export"] == "explorer";
if(is_shader)
{
out << std::endl;
out << "vec3 shadowing_schlick(vec3 L, vec3 V, vec3 N, vec3 X, vec3 Y, vec3 K)" << std::endl;
out << "vec3 masking_schlick(vec3 L, vec3 V, vec3 N, vec3 X, vec3 Y, vec3 K)" << std::endl;
out << "{" << std::endl;
out << "\tconst float dotLN = dot(L, N);" << std::endl;
out << "\tconst float dotVN = dot(L, N);" << std::endl;
......@@ -102,7 +102,7 @@ void schlick::save_body(std::ostream& out, const arguments& args) const
}
vec schlick::value(const vec& x) const
vec schlick_masking::value(const vec& x) const
{
vec res(dimY());
const double u = x[5];
......@@ -118,12 +118,12 @@ vec schlick::value(const vec& x) const
}
//! \brief Number of parameters to this non-linear function
int schlick::nbParameters() const
int schlick_masking::nbParameters() const
{
return dimY();
}
vec schlick::getParametersMin() const
vec schlick_masking::getParametersMin() const
{
vec m(dimY());
for(int i=0; i<dimY(); ++i) { m[i] = 0.0; }
......@@ -131,7 +131,7 @@ vec schlick::getParametersMin() const
}
//! \brief Get the vector of parameters for the function
vec schlick::parameters() const
vec schlick_masking::parameters() const
{
vec p(dimY());
for(int i=0; i<dimY(); ++i) { p[i] = w[i]; }
......@@ -139,14 +139,14 @@ vec schlick::parameters() const
}
//! \brief Update the vector of parameters for the function
void schlick::setParameters(const vec& p)
void schlick_masking::setParameters(const vec& p)
{
for(int i=0; i<dimY(); ++i) { w[i] = p[i]; }
}
//! \brief Obtain the derivatives of the function with respect to the
//! parameters.
vec schlick::parametersJacobian(const vec& x) const
vec schlick_masking::parametersJacobian(const vec& x) const
{
const int nY = dimY();
vec jac(nY*nY);
......@@ -178,7 +178,7 @@ vec schlick::parametersJacobian(const vec& x) const
}
void schlick::bootstrap(const data*, const arguments&)
void schlick_masking::bootstrap(const data*, const arguments&)
{
// Start with a non occluding value for k
for(int i=0; i<dimY(); ++i) { w[i] = 0.0; }
......
......@@ -16,12 +16,12 @@
* \ingroup functions
* \brief Schlick's rational approximation of the Masking term.
*/
class schlick : public nonlinear_function//fresnel
class schlick_masking : public nonlinear_function
{
public: // methods
schlick()
schlick_masking()
{
setParametrization(params::CARTESIAN);
setDimX(6);
......
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