21#include "AbstractValuesProperty.h"
22#include "../eml2/AbstractHdfProxy.h"
37 class ContinuousProperty :
public AbstractValuesProperty
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);
117 double minimumValue,
double maximumValue, EML2_NS::AbstractHdfProxy* proxy =
nullptr);
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);
178 double * minimumValue,
double * maximumValue, EML2_NS::AbstractHdfProxy* proxy =
nullptr);
187 float minimumValue,
float maximumValue, EML2_NS::AbstractHdfProxy* proxy =
nullptr);
196 float minimumValue,
float maximumValue, EML2_NS::AbstractHdfProxy* proxy =
nullptr);
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);
217 float * minimumValue,
float * maximumValue, EML2_NS::AbstractHdfProxy* proxy =
nullptr);
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 COMMON_NS::AbstractObject::numericalDatatypeEnum datatype,
301 uint64_t
const * numValues,
302 unsigned int numArrayDimensions,
303 double * minimumValue,
double * maximumValue,
304 EML2_NS::AbstractHdfProxy* proxy =
nullptr
330 COMMON_NS::AbstractObject::numericalDatatypeEnum datatype,
332 double minimumValue,
double maximumValue,
333 EML2_NS::AbstractHdfProxy* proxy =
nullptr
362 COMMON_NS::AbstractObject::numericalDatatypeEnum datatype,
363 uint64_t valueCountInFastestDim,
364 uint64_t valueCountInSlowestDim,
365 double minimumValue,
double maximumValue,
366 EML2_NS::AbstractHdfProxy* proxy =
nullptr
397 COMMON_NS::AbstractObject::numericalDatatypeEnum datatype,
398 uint64_t valueCountInFastestDim,
399 uint64_t valueCountInMiddleDim,
400 uint64_t valueCountInSlowestDim,
401 double minimumValue,
double maximumValue,
402 EML2_NS::AbstractHdfProxy* proxy =
nullptr
446 float const * values,
447 uint64_t valueCountInFastestDim,
448 uint64_t valueCountInMiddleDim,
449 uint64_t valueCountInSlowestDim,
450 uint64_t offsetInFastestDim,
451 uint64_t offsetInMiddleDim,
452 uint64_t offsetInSlowestDim,
454 EML2_NS::AbstractHdfProxy* proxy =
nullptr,
455 uint64_t patchIndex = (std::numeric_limits<uint64_t>::max)()
457 using AbstractValuesProperty::setValuesOfFloatHdf5Array3dOfValues;
458 DLL_IMPORT_OR_EXPORT
void setValuesOfDoubleHdf5Array3dOfValues(
459 double const * values,
460 uint64_t valueCountInFastestDim,
461 uint64_t valueCountInMiddleDim,
462 uint64_t valueCountInSlowestDim,
463 uint64_t offsetInFastestDim,
464 uint64_t offsetInMiddleDim,
465 uint64_t offsetInSlowestDim,
467 EML2_NS::AbstractHdfProxy* proxy =
nullptr,
468 uint64_t patchIndex = (std::numeric_limits<uint64_t>::max)()
470 using AbstractValuesProperty::setValuesOfDoubleHdf5Array3dOfValues;
506 float const * values,
507 uint64_t
const * numValues,
508 uint64_t
const * offsetValues,
509 unsigned int numArrayDimensions,
511 EML2_NS::AbstractHdfProxy* proxy =
nullptr,
512 uint64_t patchIndex = (std::numeric_limits<uint64_t>::max)()
514 using AbstractValuesProperty::setValuesOfFloatHdf5ArrayOfValues;
516 DLL_IMPORT_OR_EXPORT
void setValuesOfDoubleHdf5ArrayOfValues(
517 double const * values,
518 uint64_t
const * numValues,
519 uint64_t
const * offsetValues,
520 unsigned int numArrayDimensions,
522 EML2_NS::AbstractHdfProxy* proxy =
nullptr,
523 uint64_t patchIndex = (std::numeric_limits<uint64_t>::max)()
525 using AbstractValuesProperty::setValuesOfDoubleHdf5ArrayOfValues;
528 DLL_IMPORT_OR_EXPORT
static const char*
XML_TAG;
542 ContinuousProperty() {}
549 ContinuousProperty(gsoap_resqml2_0_1::_resqml20__ContinuousProperty* fromGsoap) : AbstractValuesProperty(fromGsoap) {}
556 ContinuousProperty(gsoap_eml2_3::_resqml22__ContinuousProperty* fromGsoap) : AbstractValuesProperty(fromGsoap) {}
558 virtual size_t getMinimumValueSize()
const = 0;
559 virtual size_t getMaximumValueSize()
const = 0;
580 void setPropertyMinMax(
582 uint64_t
const * numValuesInEachDimension,
583 unsigned int numArrayDimensions,
584 T * minimumValue =
nullptr, T * maximumValue =
nullptr)
586 const uint64_t elementCount = getElementCountPerValue();
589 if (minimumValue !=
nullptr) {
590 for (
unsigned int propIndex = 0; propIndex < elementCount; ++propIndex) {
591 setMinimumValue(getMinimumValueSize() > propIndex ? fmin(getMinimumValue(propIndex), minimumValue[propIndex]) : minimumValue[propIndex], propIndex);
594 if (maximumValue !=
nullptr) {
595 for (
unsigned int propIndex = 0; propIndex < elementCount; ++propIndex) {
596 setMaximumValue(getMaximumValueSize() > propIndex ? fmax(getMaximumValue(propIndex), maximumValue[propIndex]) : maximumValue[propIndex], propIndex);
599 if (minimumValue !=
nullptr && maximumValue !=
nullptr)
return;
601 uint64_t nValues = numValuesInEachDimension[0];
603 for (
unsigned int dim = 1; dim < (elementCount == 1 ? numArrayDimensions : numArrayDimensions - 1); ++dim) {
604 nValues *= numValuesInEachDimension[dim];
608 std::unique_ptr<T[]> allComputedMin(
new T[elementCount]);
609 std::unique_ptr<T[]> allComputedMax(
new T[elementCount]);
610 for (
size_t propIndex = 0; propIndex < elementCount; ++propIndex) {
611 allComputedMin[propIndex] = std::numeric_limits<T>::quiet_NaN();
612 allComputedMax[propIndex] = std::numeric_limits<T>::quiet_NaN();
613 for (
size_t i = 0; i < nValues; i += elementCount) {
614 allComputedMin[propIndex] = fmin(allComputedMin[propIndex], values[i]);
615 allComputedMax[propIndex] = fmax(allComputedMax[propIndex], values[i]);
618 setPropertyMinMax(values, numValuesInEachDimension, numArrayDimensions, allComputedMin.get(), allComputedMax.get());
Proxy class for an abstract values property.
Definition AbstractValuesProperty.h:27
void pushBackDoubleHdf5Array2dOfValues(const double *values, uint64_t valueCountInFastestDim, uint64_t valueCountInSlowestDim, eml2::AbstractHdfProxy *proxy=nullptr)
Adds a 2d array of explicit double values to the property values.
void pushBackDoubleHdf5Array1dOfValues(const double *values, uint64_t valueCount, eml2::AbstractHdfProxy *proxy=nullptr)
Adds a 1d array of explicit double values to the property values.
void pushBackDoubleHdf5ArrayOfValues(double const *values, uint64_t const *numValues, unsigned int numArrayDimensions, eml2::AbstractHdfProxy *proxy=nullptr)
Adds an nd array of explicit double values to the property values.
void pushBackFloatHdf5Array3dOfValues(const float *values, uint64_t valueCountInFastestDim, uint64_t valueCountInMiddleDim, uint64_t valueCountInSlowestDim, eml2::AbstractHdfProxy *proxy=nullptr)
void pushBackFloatHdf5Array1dOfValues(const float *values, uint64_t valueCount, eml2::AbstractHdfProxy *proxy=nullptr)
void pushBackDoubleHdf5Array3dOfValues(const double *values, uint64_t valueCountInFastestDim, uint64_t valueCountInMiddleDim, uint64_t valueCountInSlowestDim, eml2::AbstractHdfProxy *proxy=nullptr)
Adds a 3d array of explicit double values to the property values.
void pushBackFloatHdf5Array2dOfValues(const float *values, uint64_t valueCountInFastestDim, uint64_t valueCountInSlowestDim, eml2::AbstractHdfProxy *proxy=nullptr)
void pushBackHdf5Array3dOfValues(common::AbstractObject::numericalDatatypeEnum datatype, uint64_t valueCountInFastestDim, uint64_t valueCountInMiddleDim, uint64_t valueCountInSlowestDim, int64_t nullValue=(std::numeric_limits< int64_t >::max)(), eml2::AbstractHdfProxy *proxy=nullptr)
void pushBackFloatHdf5ArrayOfValues(float const *values, uint64_t const *numValues, unsigned int numArrayDimensions, eml2::AbstractHdfProxy *proxy=nullptr)
void pushBackHdf5Array1dOfValues(common::AbstractObject::numericalDatatypeEnum datatype, uint64_t valueCount, int64_t nullValue=(std::numeric_limits< int64_t >::max)(), eml2::AbstractHdfProxy *proxy=nullptr)
void pushBackHdf5ArrayOfValues(common::AbstractObject::numericalDatatypeEnum datatype, uint64_t const *numValues, unsigned int numArrayDimensions, int64_t nullValue=(std::numeric_limits< int64_t >::max)(), eml2::AbstractHdfProxy *proxy=nullptr)
void pushBackHdf5Array2dOfValues(common::AbstractObject::numericalDatatypeEnum datatype, uint64_t valueCountInFastestDim, uint64_t valueCountInSlowestDim, int64_t nullValue=(std::numeric_limits< int64_t >::max)(), eml2::AbstractHdfProxy *proxy=nullptr)
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 pushBackHdf5Array2dOfValues(common::AbstractObject::numericalDatatypeEnum datatype, uint64_t valueCountInFastestDim, uint64_t valueCountInSlowestDim, double minimumValue, double maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)
virtual std::string getUomAsString() const =0
void pushBackHdf5Array1dOfValues(common::AbstractObject::numericalDatatypeEnum datatype, uint64_t valueCount, double minimumValue, double maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)
void pushBackDoubleHdf5ArrayOfValues(double const *values, uint64_t 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 gsoap_resqml2_0_1::resqml20__ResqmlUom getUom() const =0
void pushBackHdf5Array3dOfValues(common::AbstractObject::numericalDatatypeEnum datatype, uint64_t valueCountInFastestDim, uint64_t valueCountInMiddleDim, uint64_t valueCountInSlowestDim, double minimumValue, double maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)
void pushBackFloatHdf5ArrayOfValues(float const *values, uint64_t const *numValues, unsigned int numArrayDimensions, float *minimumValue, float *maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)
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 setValuesOfFloatHdf5ArrayOfValues(float const *values, uint64_t const *numValues, uint64_t const *offsetValues, unsigned int numArrayDimensions, bool computeMinMax, eml2::AbstractHdfProxy *proxy=nullptr, uint64_t patchIndex=(std::numeric_limits< uint64_t >::max)())
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.
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:528
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...
virtual ~ContinuousProperty()=default
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, uint64_t patchIndex=(std::numeric_limits< uint64_t >::max)())
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:530
void pushBackHdf5ArrayOfValues(common::AbstractObject::numericalDatatypeEnum datatype, uint64_t const *numValues, unsigned int numArrayDimensions, double *minimumValue, double *maximumValue, eml2::AbstractHdfProxy *proxy=nullptr)