Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

Commit 653f2f20 authored by Ludovic Courtès's avatar Ludovic Courtès

data: Factorize the one-argument 'load' virtual method.

parent deb03d7f
......@@ -54,8 +54,8 @@ class data
virtual ~data() {}
// Load data from a file
virtual void load(const std::string& filename) = 0 ;
virtual void load(const std::string& filename, const arguments& args) = 0 ;
virtual void load(const std::string& filename,
const arguments& args = arguments()) = 0;
// Save the data to a file
virtual void save(const std::string& filename) const;
......@@ -167,13 +167,6 @@ class data_params : public data
NOT_IMPLEMENTED();
}
// Load data from a file
virtual void load(const std::string&)
{
std::cerr << "<<ERROR>> this data type cannot load data" << std::endl;
throw;
}
virtual void load(const std::string&, const arguments&)
{
std::cerr << "<<ERROR>> this data type cannot load data" << std::endl;
......
......@@ -61,13 +61,7 @@ vertical_segment::initializeToZero( unsigned int number_of_data_elements )
void vertical_segment::load(const std::string& filename)
{
arguments args ;
load(filename, args) ;
}
void vertical_segment::load(const std::string& filename, const arguments& args)
void vertical_segment::load(const std::string& filename, const arguments& args)
{
std::ifstream file;
......
......@@ -94,9 +94,6 @@ class vertical_segment : public data
unsigned int size );
// Load data from a file
virtual void load(const std::string& filename) ;
//! \brief Load data from a file using the command line arguments
//!
//! \details
......@@ -106,7 +103,8 @@ class vertical_segment : public data
//! --data-positive for the data to be positive
//! --dt-relative use a relative segment intervale. The dt is used
//! multipled by the data
virtual void load(const std::string& filename, const arguments& args) ;
virtual void load(const std::string& filename,
const arguments& args = arguments()) ;
// Acces to data
......
......@@ -285,9 +285,6 @@ class BrdfGrid : public vertical_segment {
load_data_from_text(file, header, *this);
}
// We're not overloading this one.
virtual void load(const std::string& filename);
void save(const std::string& filename) const
{
std::ofstream file;
......
/* ALTA --- Analysis of Bidirectional Reflectance Distribution Functions
Copyright (C) 2013 Inria
Copyright (C) 2013, 2016 Inria
Copyright (C) 2015 CNRS
This file is part of ALTA.
......@@ -87,10 +87,10 @@ class MatlabInterpolant : public data
}
// Load data from a file
virtual void load(const std::string& filename)
virtual void load(const std::string& filename, const arguments& args)
{
// Load the data
_data->load(filename);
_data->load(filename, args);
// Copy the informations
setDimX(_data->dimX());
......@@ -128,10 +128,6 @@ class MatlabInterpolant : public data
x = mxCreateDoubleMatrix(1, dimX(), mxREAL);
}
virtual void load(const std::string& filename, const arguments&)
{
load(filename);
}
virtual void save(const std::string& filename) const
{
......
......@@ -89,10 +89,10 @@ class rbf_interpolant : public data
}
// Load data from a file
virtual void load(const std::string& filename)
virtual void load(const std::string& filename, const arguments& args)
{
// Load the data
_data->load(filename);
_data->load(filename, args);
// Copy the informations
parameters p(_data->parametrization().dimX(),
......@@ -129,10 +129,6 @@ class rbf_interpolant : public data
_kdtree->buildIndex();
#endif
}
virtual void load(const std::string& filename, const arguments&)
{
load(filename);
}
virtual void save(const std::string& filename) const
{
......
......@@ -126,7 +126,7 @@ public: //methods
}
// Load data from a file
virtual void load(const std::string& filename)
virtual void load(const std::string& filename, const arguments& args)
{
std::ifstream file(filename.c_str());
std::string line;
......@@ -171,10 +171,6 @@ public: //methods
file.close();
}
virtual void load(const std::string& filename, const arguments& args)
{
this->load(filename);
}
};
ALTA_DLL_EXPORT data* provide_data(const arguments&)
......
......@@ -100,15 +100,7 @@ public: // methods
// Load data from a file
void load(const std::string& filename)
{
if(!read_brdf(filename.c_str(), brdf))
{
std::cerr << "<<ERROR>> unable to load the data as a MERL file" << std::endl ;
throw;
}
}
void load(const std::string& filename, const arguments&)
void load(const std::string& filename, const arguments& args)
{
if(!read_brdf(filename.c_str(), brdf))
{
......
......@@ -106,16 +106,11 @@ class BrdfSlice : public data {
}
// Load data from a file
void load(const std::string& filename)
void load(const std::string& filename, const arguments& args)
{
delete[] _data;
t_EXR_IO<double>::LoadEXR(filename.c_str(), width, height, _data);
}
void load(const std::string& filename, const arguments& args)
{
load(filename);
}
void save(const std::string& filename) const
{
......
......@@ -90,7 +90,7 @@ public:
}
// Load data from a file
virtual void load(const std::string& filename) {
virtual void load(const std::string& filename, const arguments& args) {
/* If the file is an OpenEXR image */
if(filename.substr(filename.find_last_of(".") + 1) == "exr") {
......@@ -135,9 +135,6 @@ public:
std::cout << "<<INFO>> Reading BRDF from file '" << filename << "' ...done" << std::endl;
}
virtual void load(const std::string& filename, const arguments&) {
load(filename);
}
virtual void save(const std::string& filename) const {
/* If the file is an OpenEXR image */
......
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