21 #include "AbstractValuesProperty.h"
22 #include "../eml2/AbstractHdfProxy.h"
48 throw std::logic_error(
"You cannot push back integer values in a Continuous Property.");
59 DLL_IMPORT_OR_EXPORT
virtual gsoap_resqml2_0_1::resqml20__ResqmlUom
getUom()
const = 0;
89 double minimumValue,
double maximumValue, EML2_NS::AbstractHdfProxy* proxy =
nullptr);
90 using AbstractValuesProperty::pushBackDoubleHdf5Array1dOfValues;
117 double minimumValue,
double maximumValue, EML2_NS::AbstractHdfProxy* proxy =
nullptr);
118 using AbstractValuesProperty::pushBackDoubleHdf5Array2dOfValues;
146 DLL_IMPORT_OR_EXPORT
void pushBackDoubleHdf5Array3dOfValues(
const double * values, uint64_t valueCountInFastestDim, uint64_t valueCountInMiddleDim, uint64_t valueCountInSlowestDim,
147 double minimumValue,
double maximumValue, EML2_NS::AbstractHdfProxy* proxy =
nullptr);
148 using AbstractValuesProperty::pushBackDoubleHdf5Array3dOfValues;
178 double * minimumValue,
double * maximumValue, EML2_NS::AbstractHdfProxy* proxy =
nullptr);
179 using AbstractValuesProperty::pushBackDoubleHdf5ArrayOfValues;
187 float minimumValue,
float maximumValue, EML2_NS::AbstractHdfProxy* proxy =
nullptr);
188 using AbstractValuesProperty::pushBackFloatHdf5Array1dOfValues;
196 float minimumValue,
float maximumValue, EML2_NS::AbstractHdfProxy* proxy =
nullptr);
197 using AbstractValuesProperty::pushBackFloatHdf5Array2dOfValues;
204 DLL_IMPORT_OR_EXPORT
void pushBackFloatHdf5Array3dOfValues(
const float * values, uint64_t valueCountInFastestDim, uint64_t valueCountInMiddleDim, uint64_t valueCountInSlowestDim,
205 float minimumValue,
float maximumValue, EML2_NS::AbstractHdfProxy* proxy =
nullptr);
206 using AbstractValuesProperty::pushBackFloatHdf5Array3dOfValues;
217 float * minimumValue,
float * maximumValue, EML2_NS::AbstractHdfProxy* proxy =
nullptr);
218 using AbstractValuesProperty::pushBackFloatHdf5ArrayOfValues;
233 DLL_IMPORT_OR_EXPORT
virtual double getMinimumValue(
unsigned int index = 0)
const = 0;
248 DLL_IMPORT_OR_EXPORT
virtual double getMaximumValue(
unsigned int index = 0)
const = 0;
259 DLL_IMPORT_OR_EXPORT
virtual void setMinimumValue(
double value,
unsigned int index = 0)
const = 0;
270 DLL_IMPORT_OR_EXPORT
virtual void setMaximumValue(
double value,
unsigned int index = 0)
const = 0;
300 unsigned long long const * numValues,
301 unsigned int numArrayDimensions,
302 float * minimumValue,
float * maximumValue,
303 EML2_NS::AbstractHdfProxy* proxy =
nullptr
332 uint64_t valueCountInFastestDim,
333 uint64_t valueCountInMiddleDim,
334 uint64_t valueCountInSlowestDim,
335 float minimumValue,
float maximumValue,
336 EML2_NS::AbstractHdfProxy* proxy =
nullptr
379 float const * values,
380 uint64_t valueCountInFastestDim,
381 uint64_t valueCountInMiddleDim,
382 uint64_t valueCountInSlowestDim,
383 uint64_t offsetInFastestDim,
384 uint64_t offsetInMiddleDim,
385 uint64_t offsetInSlowestDim,
387 EML2_NS::AbstractHdfProxy* proxy =
nullptr,
388 unsigned int patchIndex = (std::numeric_limits<unsigned int>::max)()
390 using AbstractValuesProperty::setValuesOfFloatHdf5Array3dOfValues;
426 float const * values,
427 unsigned long long const * numValues,
428 unsigned long long const * offsetValues,
429 unsigned int numArrayDimensions,
431 EML2_NS::AbstractHdfProxy* proxy =
nullptr,
432 unsigned int patchIndex = (std::numeric_limits<unsigned int>::max)()
434 using AbstractValuesProperty::setValuesOfFloatHdf5ArrayOfValues;
437 DLL_IMPORT_OR_EXPORT
static const char*
XML_TAG;
439 DLL_IMPORT_OR_EXPORT
virtual std::string
getXmlTag() const final {
return XML_TAG; }
451 ContinuousProperty() {}
458 ContinuousProperty(gsoap_resqml2_0_1::_resqml20__ContinuousProperty* fromGsoap) : AbstractValuesProperty(fromGsoap) {}
465 ContinuousProperty(gsoap_eml2_3::_resqml22__ContinuousProperty* fromGsoap) : AbstractValuesProperty(fromGsoap) {}
467 virtual size_t getMinimumValueSize()
const = 0;
468 virtual size_t getMaximumValueSize()
const = 0;
489 void setPropertyMinMax(
491 unsigned long long const * numValuesInEachDimension,
492 unsigned int numArrayDimensions,
493 T * minimumValue =
nullptr, T * maximumValue =
nullptr)
495 const unsigned int elementCount = getElementCountPerValue();
498 if (minimumValue !=
nullptr) {
499 for (
size_t propIndex = 0; propIndex < elementCount; ++propIndex) {
500 setMinimumValue(getMinimumValueSize() > propIndex ? fmin(getMinimumValue(propIndex), minimumValue[propIndex]) : minimumValue[propIndex], propIndex);
503 if (maximumValue !=
nullptr) {
504 for (
size_t propIndex = 0; propIndex < elementCount; ++propIndex) {
505 setMaximumValue(getMaximumValueSize() > propIndex ? fmax(getMaximumValue(propIndex), maximumValue[propIndex]) : maximumValue[propIndex], propIndex);
508 if (minimumValue !=
nullptr && maximumValue !=
nullptr)
return;
510 uint64_t nValues = numValuesInEachDimension[0];
512 for (
unsigned int dim = 1; dim < (elementCount == 1 ? numArrayDimensions : numArrayDimensions - 1); ++dim) {
513 nValues *= numValuesInEachDimension[dim];
517 std::unique_ptr<T[]> allComputedMin(
new T[elementCount]);
518 std::unique_ptr<T[]> allComputedMax(
new T[elementCount]);
519 for (
size_t propIndex = 0; propIndex < elementCount; ++propIndex) {
520 allComputedMin[propIndex] = std::numeric_limits<T>::quiet_NaN();
521 allComputedMax[propIndex] = std::numeric_limits<T>::quiet_NaN();
522 for (
size_t i = 0; i < nValues; i += elementCount) {
523 allComputedMin[propIndex] = fmin(allComputedMin[propIndex], values[i]);
524 allComputedMax[propIndex] = fmax(allComputedMax[propIndex], values[i]);
527 setPropertyMinMax(values, numValuesInEachDimension, numArrayDimensions, allComputedMin.get(), allComputedMax.get());
Proxy class for an abstract values property.
Definition: AbstractValuesProperty.h:28
Proxy class for a continuous property. Most common type of property used for storing rock or fluid at...
Definition: ContinuousProperty.h:38
void pushBackDoubleHdf5Array1dOfValues(const double *values, uint64_t valueCount, double minimumValue, double maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)
Adds a 1d array of explicit double values to the property values.
void setValuesOfFloatHdf5Array3dOfValues(float const *values, uint64_t valueCountInFastestDim, uint64_t valueCountInMiddleDim, uint64_t valueCountInSlowestDim, uint64_t offsetInFastestDim, uint64_t offsetInMiddleDim, uint64_t offsetInSlowestDim, bool computeMinMax, eml2::AbstractHdfProxy *proxy=nullptr, unsigned int patchIndex=(std::numeric_limits< unsigned int >::max)())
void pushBackFloatHdf5Array3dOfValues(uint64_t valueCountInFastestDim, uint64_t valueCountInMiddleDim, uint64_t valueCountInSlowestDim, float minimumValue, float maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)
virtual std::string getUomAsString() const =0
void setValuesOfFloatHdf5ArrayOfValues(float const *values, unsigned long long const *numValues, unsigned long long const *offsetValues, unsigned int numArrayDimensions, bool computeMinMax, eml2::AbstractHdfProxy *proxy=nullptr, unsigned int patchIndex=(std::numeric_limits< unsigned int >::max)())
void pushBackFloatHdf5ArrayOfValues(unsigned long long const *numValues, unsigned int numArrayDimensions, float *minimumValue, float *maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)
virtual gsoap_resqml2_0_1::resqml20__ResqmlUom getUom() const =0
virtual void setMinimumValue(double value, unsigned int index=0) const =0
Sets the minimum value of a non vector property or the minimum value of one given value of a vector p...
void pushBackFloatHdf5Array1dOfValues(const float *values, uint64_t valueCount, float minimumValue, float maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)
void pushBackFloatHdf5Array3dOfValues(const float *values, uint64_t valueCountInFastestDim, uint64_t valueCountInMiddleDim, uint64_t valueCountInSlowestDim, float minimumValue, float maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)
void pushBackDoubleHdf5Array2dOfValues(const double *values, uint64_t valueCountInFastestDim, uint64_t valueCountInSlowestDim, double minimumValue, double maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)
Adds a 2d array of explicit double values to the property values.
void pushBackDoubleHdf5ArrayOfValues(double const *values, unsigned long long const *numValues, unsigned int numArrayDimensions, double *minimumValue, double *maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)
Adds an nd array of explicit double values to the property values.
virtual double getMinimumValue(unsigned int index=0) const =0
Gets the minimum value of a non vector property or the minimum value of one given value of a vector p...
void pushBackFloatHdf5Array2dOfValues(const float *values, uint64_t valueCountInFastestDim, uint64_t valueCountInSlowestDim, float minimumValue, float maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)
virtual double getMaximumValue(unsigned int index=0) const =0
Gets the maximum value of a non vector property or the maximum value of one given value of a vector p...
static const char * XML_TAG
Definition: ContinuousProperty.h:437
std::string pushBackRefToExistingIntegerDataset(eml2::AbstractHdfProxy *, const std::string &, int64_t) final
Definition: ContinuousProperty.h:47
virtual void setMaximumValue(double value, unsigned int index=0) const =0
Sets the maximum value of a non vector property or the maximum value of one given value of a vector p...
void pushBackFloatHdf5ArrayOfValues(float const *values, unsigned long long const *numValues, unsigned int numArrayDimensions, float *minimumValue, float *maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)
virtual ~ContinuousProperty()=default
void pushBackDoubleHdf5Array3dOfValues(const double *values, uint64_t valueCountInFastestDim, uint64_t valueCountInMiddleDim, uint64_t valueCountInSlowestDim, double minimumValue, double maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)
Adds a 3d array of explicit double values to the property values.
virtual std::string getXmlTag() const final
Definition: ContinuousProperty.h:439