Attention une mise à jour du serveur va être effectuée le vendredi 16 avril entre 12h et 12h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit e9791b19 authored by Laurent Belcour's avatar Laurent Belcour

Debugging the brdf2data and brdf2gnuplot programs

parent 3bd27e30
......@@ -58,8 +58,7 @@ int main(int argc, char** argv)
}
// Get the associated data object and load the file is any
ptr<data> d = NULL ;
d = plugins_manager::get_data(args["data"]) ;
ptr<data> d = plugins_manager::get_data(args["data"]) ;
if(args.is_defined("data-file"))
{
d->load(args["data-file"]);
......@@ -67,14 +66,9 @@ int main(int argc, char** argv)
// Get the output object. In the case where it is not a VS file, we use
// the load object.
ptr<data> d_out = NULL;
if(!dynamic_pointer_cast<vertical_segment>(d))
ptr<data> d_out = plugins_manager::get_data(args["data"]);
if(dynamic_pointer_cast<vertical_segment>(d))
{
d_out = d;
}
else
{
d_out = ptr<data>(new vertical_segment());
d_out->setDimX(d->dimX());
d_out->setDimY(d->dimY());
d_out->setParametrization(d->input_parametrization());
......
......@@ -67,13 +67,19 @@ int main(int argc, char** argv)
// Load a data file
ptr<data> d = NULL ;
if(args.is_defined("data") || args.is_defined("in-data"))
{
d = plugins_manager::get_data(args["data"]);
if(dynamic_pointer_cast<vertical_segment>(d))
ptr<data> d = plugins_manager::get_data(args["data"]);
// Load data file if the plugin manager created a plugin object.
if(d)
{
d->load(args["data-file"]);
}
else
{
d->load(args["in-data"]);
std::cerr << "<<ERROR>> unable to load the data plugin" << std::endl;
return 1;
}
// Print the distance to the data to check if it correspond to the value
......@@ -97,8 +103,6 @@ int main(int argc, char** argv)
linear_plot = true;
}
if(d)
{
for(int i=0; i<d->size(); ++i)
{
vec v = d->get(i) ;
......@@ -155,11 +159,6 @@ int main(int argc, char** argv)
file << std::endl ;
}
}
else
{
std::cerr << "<<ERROR>> data argument is incorrectly defined" << std::endl ;
}
}
else if(args.is_defined("polar-plot"))
{
vec spherical(4);
......
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