Commit 4d0b1283 authored by Laurent Belcour's avatar Laurent Belcour
Browse files

Adding scons script to the data_brdf_slice plugin

parent 3313e771
# Building datas
SConscript('data_merl/SConscript')
SConscript('data_brdf_slice/SConscript')
SConscript('data_interpolant/SConscript')
# Building fitters
......
env = Environment()
env.Append(CPPPATH = ['../../../external/build/include', '../../', '/usr/include/OpenEXR/'])
env.Append(LIBPATH = ['../../build'])
sources = ['data.cpp']
libs = ['-lcore', '-lIlmImf', '-lIlmThread']
env.SharedLibrary('../../build/data_brdf_slice', sources, LIBS=libs)
......@@ -3,10 +3,14 @@
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <core/vertical_segment.h>
data_interpolant::data_interpolant()
{
_kdtree = new flann::Index< flann::L2<double> >(flann::KDTreeIndexParams(4));
_data = new vertical_segment();
_knn = 10;
}
......@@ -29,6 +33,8 @@ void data_interpolant::load(const std::string& filename)
setMin(_data->min());
setMax(_data->max());
std::cout << " " << _kdtree->veclen() << std::endl;
// Update the KDtreee by inserting all points
for(int i=0; i<_data->size(); ++i)
{
......@@ -106,6 +112,7 @@ vec data_interpolant::value(vec x) const
// Get data size, e.g. the number of samples to fit
int data_interpolant::size() const
{
assert(_data != NULL);
return _data->size();
}
......
......@@ -19,7 +19,7 @@ int main(int argc, char** argv)
if(args.is_defined("help")) {
std::cout << "<<HELP>> data2data --input data.file --output data.file --out-data exporter.so --in-data importer.so" << std::endl ;
std::cout << " - input, output, func, data are mandatory parameters" << std::endl ;
std::cout << " - input, output, out-data are mandatory parameters" << std::endl ;
return 0 ;
}
......@@ -31,14 +31,12 @@ int main(int argc, char** argv)
std::cerr << "<<ERROR>> the output filename is not defined" << std::endl ;
return 1 ;
}
if(! args.is_defined("in-data")) {
std::cerr << "<<ERROR>> the data importer is not defined" << std::endl ;
return 1 ;
}
/*
if(! args.is_defined("out-data")) {
std::cerr << "<<ERROR>> the data exporter is not defined" << std::endl ;
return 1 ;
}
*/
// Import data
......
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