Commit bb923bb4 authored by Laurent Belcour's avatar Laurent Belcour
Browse files

Merge and update of the data2data.

parents 88daacce dca250cd
<doxygenlayout version="1.0">
<navindex>
<tab type="mainpage" visible="yes" title="Overview"/>
<tab type="user" url="@ref examples" title="Examples"/>
<tab type="user" url="@ref tutorials" title="Tutorials"/>
<tab type="user" url="@ref license" title="License"/>
<tab type="user" url="@ref contacts" title="Contacts"/>
</navindex>
......
......@@ -80,6 +80,8 @@ Matlab m file, C++ code, or BRDF Explorer shader. Note that this tool cannot
convert to another ALTA file (e.g. converting a Blinn lobe to a Beckmann
distribution).
You can find more examples of how to use ALTA on the \ref tutorials page.
<h2>Contribute</h2>
......
/*!
\page tutorials Tutorials
<h2>Fitting using the command line</h2>
The \a data2brdf allows to perform a fitting procedure by converting a \ref
data object into a brdf object (also named \ref function).
\verbatim
./build/data2brdf --input ../data/1d/Kirby2/Kirby2.dat --output Kirby.brdf --fitter ./build/librational_fitter_eigen.so
\endverbatim
<h2>Moment analysis using the command line</h2>
The \a data2moment allows to perform a moment analysis on a \ref data object.
It can be useful to determine whether a given data correspond to a separable
function along its different axis.
*/
......@@ -9,4 +9,5 @@ obtain.obtain('Eigen v3.2.1', 'eigen-eigen-ffa86ffb5570', 'http://bitbucket.org/
rep = 'build' + os.sep + 'include' + os.sep + 'Eigen'
if not os.path.exists(rep):
shutil.copytree('eigen-eigen-ffa86ffb5570' + os.sep + 'Eigen', rep)
shutil.copytree('eigen-eigen-ffa86ffb5570' + os.sep + 'unsupported', rep)
#end
......@@ -5,6 +5,7 @@ SConscript('data_interpolant/SConscript')
# Building fitters
SConscript('nonlinear_fitter_ceres/SConscript')
SConscript('nonlinear_fitter_eigen/SConscript')
SConscript('rational_fitter_eigen/SConscript')
SConscript('rational_fitter_quadprog/SConscript')
......
env = Environment()
env.Append(CPPPATH = ['../../../external/build/include', '../../'])
env.Append(LIBPATH = ['../../build'])
sources = ['fitter.cpp']
libs = ['-lcore']
env.SharedLibrary('../../build/nonlinear_fitter_eigen', sources, LIBS=libs)
......@@ -28,9 +28,14 @@ bool rational_fitter_eigen::fit_data(const data* dat, function* fit, const argum
{
rational_function* r = dynamic_cast<rational_function*>(fit) ;
const vertical_segment* d = dynamic_cast<const vertical_segment*>(dat) ;
if(r == NULL || d == NULL)
if(r == NULL)
{
std::cerr << "<<ERROR>> not passing the correct class to the fitter" << std::endl ;
std::cerr << "<<ERROR>> not passing the correct function object to the fitter" << std::endl ;
return false ;
}
if(d == NULL)
{
std::cerr << "<<ERROR>> not passing the correct data object to the fitter" << std::endl ;
return false ;
}
......
......@@ -23,6 +23,21 @@
int main(int argc, char** argv)
{
arguments args(argc, argv) ;
if(args.is_defined("help")) {
std::cout << "Usage: brdf2brdf [options] --input data.file --output data.file" << std::endl ;
std::cout << "Re-export a function object to another output format."<< std::endl ;
std::cout << std::endl;
std::cout << "Mandatory arguments:" << std::endl;
std::cout << " --input [filename]" << std::endl;
std::cout << " --output [filename]" << std::endl;
std::cout << std::endl;
std::cout << "Optional arguments:" << std::endl;
std::cout << " --export [type] Name of the export format used to save the outputed" << std::endl ;
std::cout << " function file. Available types are: alta, matlab," << std::endl ;
std::cout << " explorer or shader." << std::endl ;
return 0 ;
}
if(! args.is_defined("input")) {
std::cerr << "<<ERROR>> the input filename is not defined" << std::endl ;
......
......@@ -35,6 +35,24 @@ int main(int argc, char** argv)
#ifdef __linux__
//feenableexcept(FE_DIVBYZERO | FE_OVERFLOW | FE_INVALID);
#endif
if(args.is_defined("help")) {
std::cout << "Usage: data2brdf [options] --input data.file --output data.file" << std::endl ;
std::cout << "Convert a data object to a function object using a fitting procedure."<< std::endl ;
std::cout << std::endl;
std::cout << "Mandatory arguments:" << std::endl;
std::cout << " --input [filename]" << std::endl;
std::cout << " --output [filename]" << std::endl;
std::cout << " --fitter [filename]" << std::endl;
std::cout << std::endl;
std::cout << "Optional arguments:" << std::endl;
std::cout << " --func [filename] Name of the function plugin. If not defined, a" << std::endl ;
std::cout << " monomial rational function will be used." << std::endl ;
std::cout << " --data [filename] Name of the data plugin used to load the input" << std::endl ;
std::cout << " data file. If no plugin is defined, the data file" << std::endl ;
std::cout << " will be load using ALTA format." << std::endl ;
return 0 ;
}
fitter* fit = plugins_manager::get_fitter(args["fitter"]) ;
if(fit == NULL)
......
......@@ -65,6 +65,8 @@ int main(int argc, char** argv)
std::cout << " No output data plugin is specified. Please see " << std::endl;
std::cout << " --help-params for the list of available " << std::endl ;
std::cout << " parametrizations." << std::endl ;
std::cout << " --data-correct-cosine Divide the value of the data points by the product of" << std::endl;
std::cout << " the light and view vector dot product with the normal." << std::endl ;
return 0 ;
}
if(args.is_defined("help-params")) {
......
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