diff --git a/sources/core/data.h b/sources/core/data.h index ca4334284450e74fc8f5220459192156acec4a53..d97f27ec1538b6e46a1a200498440b7de6469031 100644 --- a/sources/core/data.h +++ b/sources/core/data.h @@ -71,8 +71,7 @@ class data //! match the total dimension: dimX + dimY. virtual vec value(const vec& in) const = 0; - //! \brief Put the sample inside the data - virtual void set(const vec& x) = 0; + //! \brief Put the sample inside the data at index I. virtual void set(int i, const vec& x) = 0; @@ -162,12 +161,6 @@ class data_params : public data return _data[i]; } - //! \todo This should crash at execution. - virtual void set(const vec& x) - { - this->set(x); - } - virtual void set(int i, const vec& x) { this->set(i, x); diff --git a/sources/core/vertical_segment.cpp b/sources/core/vertical_segment.cpp index 9d121f94d8eb048ea621ed09e93372e61f5a9510..287f9a7b7b23bf27bcdd44b816c56e9d47c84a05 100644 --- a/sources/core/vertical_segment.cpp +++ b/sources/core/vertical_segment.cpp @@ -133,24 +133,6 @@ vec vertical_segment::get(int i) const return res ; } -//! \todo Check the vertical segment size and if the data -//! is not already present. -void vertical_segment::set(const vec& x) -{ - // Check if the input data 'x' has the size of a vertical segment (i.e. dimX+3*dimY), - // if it only has the size of a single value, then create the segment. - if(x.size() == _parameters.dimX() + 3*_parameters.dimY()) { - _data.push_back(x); - - } else if(x.size() == _parameters.dimX() + _parameters.dimY()) { - _data.push_back(vs(x)); - - } else { - std::cerr << "<> Passing an incorrect element to vertical_segment::set" << std::endl; - throw; - } -} - void vertical_segment::set(int i, const vec& x) { // Check if the input data 'x' has the size of a vertical segment (i.e. dimX+3*dimY), diff --git a/sources/core/vertical_segment.h b/sources/core/vertical_segment.h index d7060d85e42603c726cf399408047f868134cf1e..4d2b40ada0421f4cf0781e3b8f86d976274dedf8 100644 --- a/sources/core/vertical_segment.h +++ b/sources/core/vertical_segment.h @@ -96,8 +96,7 @@ class vertical_segment : public data NOT_IMPLEMENTED(); } - //! \brief Put the sample inside the data - virtual void set(const vec& x); + //! \brief Put the sample inside the data at index I. virtual void set(int i, const vec& x); //! \brief Specific accessor to a vertical segment, this gives the diff --git a/sources/plugins/data_interpolants/grid.cpp b/sources/plugins/data_interpolants/grid.cpp index 6dcf157ab6a87c3472ef038de4ce9deb787320d4..295de4014d66f38e47ba1cafeb58a0ac1e4d8df5 100644 --- a/sources/plugins/data_interpolants/grid.cpp +++ b/sources/plugins/data_interpolants/grid.cpp @@ -310,10 +310,6 @@ class BrdfGrid : public vertical_segment { return get(i) ; } - void set(const vec& x) - { - NOT_IMPLEMENTED(); - } void set(int id, const vec& x) { vertical_segment::set(id, x); diff --git a/sources/plugins/data_interpolants/matlab.cpp b/sources/plugins/data_interpolants/matlab.cpp index d7951920808a3eeb29669cd77d68519513ff8fe9..2b3e67f82e66ad5713b2f5398d6076563ac8a0b6 100644 --- a/sources/plugins/data_interpolants/matlab.cpp +++ b/sources/plugins/data_interpolants/matlab.cpp @@ -149,10 +149,6 @@ class MatlabInterpolant : public data return get(i) ; } - virtual void set(const vec& x) - { - NOT_IMPLEMENTED(); - } virtual void set(int i, const vec& x) { _data->set(i, x); diff --git a/sources/plugins/data_interpolants/rbf.cpp b/sources/plugins/data_interpolants/rbf.cpp index 4a38fd83d2fdba697571f9c93dd9091b502406f2..67c883508993f97b4b6c043dd8eaba730082447d 100644 --- a/sources/plugins/data_interpolants/rbf.cpp +++ b/sources/plugins/data_interpolants/rbf.cpp @@ -134,11 +134,6 @@ class rbf_interpolant : public data return get(i) ; } - //! \todo Test this function - virtual void set(const vec& x) - { - NOT_IMPLEMENTED(); - } virtual void set(int i, const vec& x) { NOT_IMPLEMENTED(); diff --git a/sources/plugins/data_io/merl.cpp b/sources/plugins/data_io/merl.cpp index 418a4e53c521abe8265a76bf19d1a2fb0992eea0..1dc2f189da08ab25efa6038f6a0ff2375404f6c7 100644 --- a/sources/plugins/data_io/merl.cpp +++ b/sources/plugins/data_io/merl.cpp @@ -147,25 +147,6 @@ public: // methods return res ; } - //! \todo Test this function - void set(const vec& x) - { - assert(x.size() == 6); - const int phid_ind = phi_diff_index(x[2]); - const int thed_ind = theta_diff_index(x[1]); - const int theh_ind = theta_half_index(x[0]); - - const int i = (theh_ind*BRDF_SAMPLING_RES_THETA_D + thed_ind)*(BRDF_SAMPLING_RES_PHI_D/2) + phid_ind; -#ifdef DEBUG - std::cout << "set -> " << i << " (" << theh_ind << ", " << thed_ind << ", " << phid_ind << ")" << std::endl; - std::cout << " " << x[0] << ", " << x[1] << ", " << x[2] << std::endl; - std::cout << std::endl; -#endif - brdf[i] = x[3] / RED_SCALE; - brdf[i + BRDF_SAMPLING_RES_THETA_H*BRDF_SAMPLING_RES_THETA_D*BRDF_SAMPLING_RES_PHI_D/2] = x[4] / GREEN_SCALE; - brdf[i + BRDF_SAMPLING_RES_THETA_H*BRDF_SAMPLING_RES_THETA_D*BRDF_SAMPLING_RES_PHI_D] = x[5] / BLUE_SCALE; - } - void set(int i, const vec& x) { assert(x.size() == parametrization().dimY()); int iR = i; diff --git a/sources/plugins/data_io/slice.cpp b/sources/plugins/data_io/slice.cpp index 90479cff27511ef7671513e836d0f865e72054fe..7e18a538e40a8fbdb4f2e4de68f2a92eee79be5c 100644 --- a/sources/plugins/data_io/slice.cpp +++ b/sources/plugins/data_io/slice.cpp @@ -149,31 +149,6 @@ class BrdfSlice : public data { return res ; } - //! \todo Test this function - void set(const vec& x) - { - // Copy vector is required - vec _x = x; - - // Reverse the first part of the vector - if(_reverse) { - _x.segment(0, parametrization().dimX()).reverseInPlace(); - } - - assert(_x.size() == parametrization().dimX()+parametrization().dimY()); - assert(_x[0] <= _max[0] && _x[0] >= _min[0]); - assert(_x[1] <= _max[1] && _x[1] >= _min[1]); - - const int i = floor((_x[0]-_min[0]) * _width / (_max[0] - _min[0])); - const int j = floor((_x[1]-_min[1]) * _height / (_max[1] - _min[1])); - const int k = 0; - //const int k = floor(x[2] * _slice / (M_PI)); - const int id = i + j*_width + k*_width*_height; - - _data[3*id + 0] = _x[parametrization().dimX()+0]; - _data[3*id + 1] = _x[parametrization().dimX()+1]; - _data[3*id + 2] = _x[parametrization().dimX()+2]; - } void set(int id, const vec& x) { assert(x.size() == parametrization().dimX() + parametrization().dimY()); diff --git a/sources/plugins/data_io/utia.cpp b/sources/plugins/data_io/utia.cpp index 9fabf9da7344415cfde0ee93e7e18f842486f990..88b5652a84741cc57a2863a1adf7b8a315b40a01 100644 --- a/sources/plugins/data_io/utia.cpp +++ b/sources/plugins/data_io/utia.cpp @@ -264,24 +264,6 @@ public: return RGB; } - // Set data - virtual void set(const vec& x) { - assert(x.size() == parametrization().dimX()+parametrization().dimY()); - - const double PI2 = M_PI*0.5; - if(x[0]>PI2 || x[2]>PI2) { - return; - } - - int iti, ipi, itv, ipv; - vecToIndex(x, iti, ipi, itv, ipv); - - const int index = ((iti*npi + ipi)*ntv + itv)*npv + ipv; - Bd[index + 0*nPerPlane] = x[parametrization().dimX() + 0]; - Bd[index + 1*nPerPlane] = x[parametrization().dimX() + 1]; - Bd[index + 2*nPerPlane] = x[parametrization().dimX() + 2]; - } - virtual void set(int i, const vec& x) { assert(x.size() == parametrization().dimY()); for(int isp=0; isp