Commit 005b41b9 authored by Laurent Belcour's avatar Laurent Belcour

Small corrections

parent 2a1ac82b
......@@ -15,10 +15,25 @@ ALTA_DLL_EXPORT function* provide_function()
}
//! Load function specific files
void schlick::load(const std::string& filename)
void schlick::load(std::istream& in)
{
std::cerr << "Cannot load a Schlick file." << std::endl;
throw;
// Parse line until the next comment
while(in.peek() != '#')
{
char line[256];
in.getline(line, 256);
}
// Checking for the comment line #FUNC nonlinear_fresnel_schlick
std::string token;
in >> token;
if(token != "FUNC") { std::cerr << "<<ERROR>> parsing the stream. The #FUNC is not the next line defined." << std::endl; }
in >> token;
if(token != "nonlinear_fresnel_schlick") { std::cerr << "<<ERROR>> parsing the stream. function name is not the next token." << std::endl; }
// R [double]
in >> token >> R;
}
vec schlick::fresnelValue(const vec& x) const
......
......@@ -18,7 +18,7 @@ class schlick : public fresnel
public: // methods
//! \brief Load function specific files
virtual void load(const std::string& filename) ;
virtual void load(std::istream& in) ;
......
......@@ -40,13 +40,13 @@ void diffuse_function::load(std::istream &in)
in.getline(line, 256);
}
// Checking for the comment line #FUNC nonlinear_diffuse
// Checking for the comment line #FUNC nonlinear_function_diffuse
std::string token;
in >> token;
if(token != "FUNC") { std::cerr << "<<ERROR>> parsing the stream. The #FUNC is not the next line defined." << std::endl; }
in >> token;
if(token != "nonlinear_diffuse") { std::cerr << "<<ERROR>> parsing the stream. function name is not the next token." << std::endl; }
if(token != "nonlinear_function_diffuse") { std::cerr << "<<ERROR>> parsing the stream. function name is not the next token." << std::endl; }
// kd [double]
for(int i=0; i<dimY(); ++i)
......
......@@ -315,13 +315,13 @@ void isotropic_lafortune_function::load(std::istream& in)
in.getline(line, 256);
}
// Checking for the comment line #FUNC nonlinear_diffuse
// Checking for the comment line #FUNC nonlinear_function_lafortune
std::string token;
in >> token;
if(token != "FUNC") { std::cerr << "<<ERROR>> parsing the stream. The #FUNC is not the next line defined." << std::endl; }
in >> token;
if(token != "nonlinear_lafortune") { std::cerr << "<<ERROR>> parsing the stream. function name is not the next token." << std::endl; }
if(token != "nonlinear_function_lafortune") { std::cerr << "<<ERROR>> parsing the stream. function name is not the next token." << std::endl; }
// Shoudl have the #NB_LOBES [int]
int nb_lobes;
......
......@@ -358,13 +358,13 @@ void lafortune_function::load(std::istream& in)
in.getline(line, 256);
}
// Checking for the comment line #FUNC nonlinear_diffuse
// Checking for the comment line #FUNC nonlinear_function_lafortune
std::string token;
in >> token;
if(token != "FUNC") { std::cerr << "<<ERROR>> parsing the stream. The #FUNC is not the next line defined." << std::endl; }
in >> token;
if(token != "nonlinear_lafortune") { std::cerr << "<<ERROR>> parsing the stream. function name is not the next token." << std::endl; }
if(token != "nonlinear_function_lafortune") { std::cerr << "<<ERROR>> parsing the stream. function name is not the next token." << std::endl; }
// Shoudl have the #NB_LOBES [int]
int nb_lobes;
......
......@@ -40,13 +40,13 @@ void phong_function::load(std::istream& in)
in.getline(line, 256);
}
// Checking for the comment line #FUNC nonlinear_diffuse
// Checking for the comment line #FUNC nonlinear_function_phong
std::string token;
in >> token;
if(token != "FUNC") { std::cerr << "<<ERROR>> parsing the stream. The #FUNC is not the next line defined." << std::endl; }
in >> token;
if(token != "nonlinear_phong") { std::cerr << "<<ERROR>> parsing the stream. function name is not the next token." << std::endl; }
if(token != "nonlinear_function_phong") { std::cerr << "<<ERROR>> parsing the stream. function name is not the next token." << std::endl; }
// ks [double]
// N [double]
......
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