21 #include "resqml2/AbstractValuesProperty.h" 22 #include "common/AbstractHdfProxy.h" 49 const unsigned int & dimension,
const gsoap_resqml2_0_1::resqml2__IndexableElements & attachmentKind);
69 const unsigned int & dimension,
const gsoap_resqml2_0_1::resqml2__IndexableElements & attachmentKind,
const gsoap_resqml2_0_1::resqml2__ResqmlUom & uom,
const gsoap_resqml2_0_1::resqml2__ResqmlPropertyKind & energisticsPropertyKind);
82 const unsigned int & dimension,
const gsoap_resqml2_0_1::resqml2__IndexableElements & attachmentKind,
const gsoap_resqml2_0_1::resqml2__ResqmlUom & uom,
RESQML2_NS::PropertyKind * localPropKind);
95 const unsigned int & dimension,
const gsoap_resqml2_0_1::resqml2__IndexableElements & attachmentKind,
const std::string & nonStandardUom,
const gsoap_resqml2_0_1::resqml2__ResqmlPropertyKind & energisticsPropertyKind);
108 const unsigned int & dimension,
const gsoap_resqml2_0_1::resqml2__IndexableElements & attachmentKind,
const std::string & nonStandardUom,
RESQML2_NS::PropertyKind * localPropKind);
113 ContinuousProperty(gsoap_resqml2_0_1::_resqml2__ContinuousProperty* fromGsoap): AbstractValuesProperty(fromGsoap) {}
120 static const char* XML_TAG;
127 const gsoap_resqml2_0_1::resqml2__ResqmlUom & getUom()
const;
133 std::string getUomAsString()
const;
144 const double & minimumValue = std::numeric_limits<double>::quiet_NaN(),
const double & maximumValue = std::numeric_limits<double>::quiet_NaN());
155 void pushBackDoubleHdf5Array2dOfValues(
double * values,
const ULONG64 & valueCountInFastestDim,
const ULONG64 & valueCountInSlowestDim,
COMMON_NS::AbstractHdfProxy* proxy,
156 const double & minimumValue = std::numeric_limits<double>::quiet_NaN(),
const double & maximumValue = std::numeric_limits<double>::quiet_NaN());
168 void pushBackDoubleHdf5Array3dOfValues(
double * values,
const ULONG64 & valueCountInFastestDim,
const ULONG64 & valueCountInMiddleDim,
const ULONG64 & valueCountInSlowestDim,
COMMON_NS::AbstractHdfProxy* proxy,
169 const double & minimumValue = std::numeric_limits<double>::quiet_NaN(),
const double & maximumValue = std::numeric_limits<double>::quiet_NaN());
180 void pushBackDoubleHdf5ArrayOfValues(
double * values,
unsigned long long * numValues,
const unsigned int & numArrayDimensions,
COMMON_NS::AbstractHdfProxy* proxy,
181 double * minimumValue =
nullptr,
double * maximumValue =
nullptr);
192 const float & minimumValue = std::numeric_limits<float>::quiet_NaN(),
const float & maximumValue = std::numeric_limits<float>::quiet_NaN());
203 void pushBackFloatHdf5Array2dOfValues(
float * values,
const ULONG64 & valueCountInFastestDim,
const ULONG64 & valueCountInSlowestDim,
COMMON_NS::AbstractHdfProxy* proxy,
204 const float & minimumValue = std::numeric_limits<float>::quiet_NaN(),
const float & maximumValue = std::numeric_limits<float>::quiet_NaN());
216 void pushBackFloatHdf5Array3dOfValues(
float * values,
const ULONG64 & valueCountInFastestDim,
const ULONG64 & valueCountInMiddleDim,
const ULONG64 & valueCountInSlowestDim,
COMMON_NS::AbstractHdfProxy* proxy,
217 const float & minimumValue = std::numeric_limits<float>::quiet_NaN(),
const float & maximumValue = std::numeric_limits<float>::quiet_NaN());
228 void pushBackFloatHdf5ArrayOfValues(
float * values,
unsigned long long * numValues,
const unsigned int & numArrayDimensions,
COMMON_NS::AbstractHdfProxy* proxy,
229 float * minimumValue =
nullptr,
float * maximumValue =
nullptr);
237 void pushBackFloatHdf5ArrayOfValues(
238 unsigned long long* numValues,
239 const unsigned int& numArrayDimensions,
250 void pushBackFloatHdf5ArrayOfValues(
251 const ULONG64& valueCountInFastestDim,
252 const ULONG64& valueCountInMiddleDim,
253 const ULONG64& valueCountInSlowestDim,
270 void setValuesOfFloatHdf5ArrayOfValues(
272 const ULONG64& valueCountInFastestDim,
273 const ULONG64& valueCountInMiddleDim,
274 const ULONG64& valueCountInSlowestDim,
275 const ULONG64& offsetInFastestDim,
276 const ULONG64& offsetInMiddleDim,
277 const ULONG64& offsetInSlowestDim,
279 unsigned int patchIndex = (std::numeric_limits<unsigned int>::max)()
292 void setValuesOfFloatHdf5ArrayOfValues(
294 unsigned long long * numValues,
295 unsigned long long * offsetValues,
296 const unsigned int & numArrayDimensions,
298 unsigned int patchIndex = (std::numeric_limits<unsigned int>::max)()
309 std::string pushBackRefToExistingDataset(
COMMON_NS::AbstractHdfProxy* hdfProxy,
const std::string & datasetName =
"",
const long & nullValue = (std::numeric_limits<long>::max)());
316 void getDoubleValuesOfPatch(
const unsigned int & patchIndex,
double * values);
323 void getFloatValuesOfPatch(
const unsigned int & patchIndex,
float * values);
333 void getFloatValuesOfPatch(
334 const unsigned int& patchIndex,
336 unsigned long long* numValuesInEachDimension,
337 unsigned long long* offsetInEachDimension,
338 const unsigned int& numArrayDimensions
352 void getFloatValuesOf3dPatch(
353 const unsigned int& patchIndex,
355 const ULONG64& valueCountInFastestDim,
356 const ULONG64& valueCountInMiddleDim,
357 const ULONG64& valueCountInSlowestDim,
358 const ULONG64& offsetInFastestDim,
359 const ULONG64& offsetInMiddleDim,
360 const ULONG64& offsetInSlowestDim
367 double getMinimumValue();
373 double getMaximumValue();
383 bool validatePropertyKindAssociation(
const gsoap_resqml2_0_1::resqml2__ResqmlPropertyKind & pk);
396 void setPropertyMinMax(
398 unsigned long long* numValuesInEachDimension,
399 const unsigned int& numArrayDimensions,
400 T * minimumValue =
nullptr, T * maximumValue =
nullptr)
402 gsoap_resqml2_0_1::_resqml2__ContinuousProperty* prop =
static_cast<gsoap_resqml2_0_1::_resqml2__ContinuousProperty*
>(gsoapProxy2_0_1);
403 prop->MinimumValue.clear();
404 prop->MaximumValue.clear();
406 if (minimumValue !=
nullptr && maximumValue !=
nullptr) {
407 for (
unsigned int i = 0; i < prop->Count; ++i)
409 prop->MinimumValue.push_back(minimumValue[i]);
410 prop->MaximumValue.push_back(maximumValue[i]);
415 ULONG64 nValues = numValuesInEachDimension[0];
416 if (prop->Count == 1) {
417 for (
unsigned int dim = 1; dim < numArrayDimensions; dim++) {
418 nValues *= numValuesInEachDimension[dim];
421 else if (prop->Count > 1) {
423 for (
unsigned int dim = 1; dim < numArrayDimensions - 1; dim++) {
424 nValues *= numValuesInEachDimension[dim];
428 throw std::invalid_argument(
"Cannot compute and set min and max value on a property which has a Count set to zero or negative.");
431 for (ULONG64 propIndex = 0; propIndex < prop->Count; ++propIndex) {
432 size_t i = propIndex;
433 T computedMin = std::numeric_limits<T>::quiet_NaN();
434 T computedMax = std::numeric_limits<T>::quiet_NaN();
435 while (i < nValues && values[i] != values[i]) i += prop->Count;
438 if (prop->Count == 1) {
442 prop->MinimumValue.push_back(std::numeric_limits<T>::quiet_NaN());
443 prop->MaximumValue.push_back(std::numeric_limits<T>::quiet_NaN());
446 computedMin = values[i];
447 computedMax = values[i];
449 for (; i < nValues; i += prop->Count) {
450 T propVal = values[i];
451 if (propVal < computedMin) {
452 computedMin = propVal;
454 else if (propVal > computedMax) {
455 computedMax = propVal;
458 prop->MinimumValue.push_back(computedMin);
459 prop->MaximumValue.push_back(computedMax);
Definition: AbstractRepresentation.h:31
Definition: EpcDocument.h:65
virtual std::string getXmlTag() const
Definition: ContinuousProperty.h:121
ContinuousProperty()
Definition: ContinuousProperty.h:36
ContinuousProperty(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject)
Definition: ContinuousProperty.h:56
Definition: AbstractHdfProxy.h:30
Definition: PropertyKind.h:25
ContinuousProperty(gsoap_resqml2_0_1::_resqml2__ContinuousProperty *fromGsoap)
Definition: ContinuousProperty.h:113
virtual ~ContinuousProperty()
Definition: ContinuousProperty.h:118
Definition: AbstractValuesProperty.h:26
Definition: EpcDocument.h:49
Definition: ContinuousProperty.h:29