36 #include "resqml2/AbstractValuesProperty.h" 37 #include "common/AbstractHdfProxy.h" 64 const unsigned int & dimension,
const gsoap_resqml2_0_1::resqml2__IndexableElements & attachmentKind);
71 ContinuousProperty(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) :
resqml2::AbstractValuesProperty(partialObject) {}
84 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);
97 const unsigned int & dimension,
const gsoap_resqml2_0_1::resqml2__IndexableElements & attachmentKind,
const gsoap_resqml2_0_1::resqml2__ResqmlUom & uom,
resqml2::PropertyKind * localPropKind);
110 const unsigned int & dimension,
const gsoap_resqml2_0_1::resqml2__IndexableElements & attachmentKind,
const std::string & nonStandardUom,
const gsoap_resqml2_0_1::resqml2__ResqmlPropertyKind & energisticsPropertyKind);
123 const unsigned int & dimension,
const gsoap_resqml2_0_1::resqml2__IndexableElements & attachmentKind,
const std::string & nonStandardUom,
resqml2::PropertyKind * localPropKind);
128 ContinuousProperty(gsoap_resqml2_0_1::_resqml2__ContinuousProperty* fromGsoap): AbstractValuesProperty(fromGsoap) {}
135 static const char* XML_TAG;
142 const gsoap_resqml2_0_1::resqml2__ResqmlUom & getUom()
const;
148 std::string getUomAsString()
const;
158 void pushBackDoubleHdf5Array1dOfValues(
double * values,
const ULONG64 & valueCount,
common::AbstractHdfProxy* proxy,
159 const double & minimumValue = std::numeric_limits<double>::quiet_NaN(),
const double & maximumValue = std::numeric_limits<double>::quiet_NaN());
170 void pushBackDoubleHdf5Array2dOfValues(
double * values,
const ULONG64 & valueCountInFastestDim,
const ULONG64 & valueCountInSlowestDim,
common::AbstractHdfProxy* proxy,
171 const double & minimumValue = std::numeric_limits<double>::quiet_NaN(),
const double & maximumValue = std::numeric_limits<double>::quiet_NaN());
183 void pushBackDoubleHdf5Array3dOfValues(
double * values,
const ULONG64 & valueCountInFastestDim,
const ULONG64 & valueCountInMiddleDim,
const ULONG64 & valueCountInSlowestDim,
common::AbstractHdfProxy* proxy,
184 const double & minimumValue = std::numeric_limits<double>::quiet_NaN(),
const double & maximumValue = std::numeric_limits<double>::quiet_NaN());
195 void pushBackDoubleHdf5ArrayOfValues(
double * values,
unsigned long long * numValues,
const unsigned int & numArrayDimensions,
common::AbstractHdfProxy* proxy,
196 double * minimumValue =
nullptr,
double * maximumValue =
nullptr);
207 const float & minimumValue = std::numeric_limits<float>::quiet_NaN(),
const float & maximumValue = std::numeric_limits<float>::quiet_NaN());
218 void pushBackFloatHdf5Array2dOfValues(
float * values,
const ULONG64 & valueCountInFastestDim,
const ULONG64 & valueCountInSlowestDim,
common::AbstractHdfProxy* proxy,
219 const float & minimumValue = std::numeric_limits<float>::quiet_NaN(),
const float & maximumValue = std::numeric_limits<float>::quiet_NaN());
231 void pushBackFloatHdf5Array3dOfValues(
float * values,
const ULONG64 & valueCountInFastestDim,
const ULONG64 & valueCountInMiddleDim,
const ULONG64 & valueCountInSlowestDim,
common::AbstractHdfProxy* proxy,
232 const float & minimumValue = std::numeric_limits<float>::quiet_NaN(),
const float & maximumValue = std::numeric_limits<float>::quiet_NaN());
243 void pushBackFloatHdf5ArrayOfValues(
float * values,
unsigned long long * numValues,
const unsigned int & numArrayDimensions,
common::AbstractHdfProxy* proxy,
244 float * minimumValue =
nullptr,
float * maximumValue =
nullptr);
252 void pushBackFloatHdf5ArrayOfValues(
253 unsigned long long* numValues,
254 const unsigned int& numArrayDimensions,
265 void pushBackFloatHdf5ArrayOfValues(
266 const ULONG64& valueCountInFastestDim,
267 const ULONG64& valueCountInMiddleDim,
268 const ULONG64& valueCountInSlowestDim,
285 void setValuesOfFloatHdf5ArrayOfValues(
287 const ULONG64& valueCountInFastestDim,
288 const ULONG64& valueCountInMiddleDim,
289 const ULONG64& valueCountInSlowestDim,
290 const ULONG64& offsetInFastestDim,
291 const ULONG64& offsetInMiddleDim,
292 const ULONG64& offsetInSlowestDim,
294 unsigned int patchIndex = (std::numeric_limits<unsigned int>::max)()
307 void setValuesOfFloatHdf5ArrayOfValues(
309 unsigned long long * numValues,
310 unsigned long long * offsetValues,
311 const unsigned int & numArrayDimensions,
313 unsigned int patchIndex = (std::numeric_limits<unsigned int>::max)()
324 std::string pushBackRefToExistingDataset(
common::AbstractHdfProxy* hdfProxy,
const std::string & datasetName =
"",
const long & nullValue = (std::numeric_limits<long>::max)());
331 void getDoubleValuesOfPatch(
const unsigned int & patchIndex,
double * values);
338 void getFloatValuesOfPatch(
const unsigned int & patchIndex,
float * values);
348 void getFloatValuesOfPatch(
349 const unsigned int& patchIndex,
351 unsigned long long* numValuesInEachDimension,
352 unsigned long long* offsetInEachDimension,
353 const unsigned int& numArrayDimensions
367 void getFloatValuesOf3dPatch(
368 const unsigned int& patchIndex,
370 const ULONG64& valueCountInFastestDim,
371 const ULONG64& valueCountInMiddleDim,
372 const ULONG64& valueCountInSlowestDim,
373 const ULONG64& offsetInFastestDim,
374 const ULONG64& offsetInMiddleDim,
375 const ULONG64& offsetInSlowestDim
378 double getMinimumValue();
379 double getMaximumValue();
389 bool validatePropertyKindAssociation(
const gsoap_resqml2_0_1::resqml2__ResqmlPropertyKind & pk);
402 void setPropertyMinMax(
404 unsigned long long* numValuesInEachDimension,
405 const unsigned int& numArrayDimensions,
406 T * minimumValue =
nullptr, T * maximumValue =
nullptr)
408 gsoap_resqml2_0_1::_resqml2__ContinuousProperty* prop =
static_cast<gsoap_resqml2_0_1::_resqml2__ContinuousProperty*
>(gsoapProxy2_0_1);
409 prop->MinimumValue.clear();
410 prop->MaximumValue.clear();
412 if (minimumValue !=
nullptr && maximumValue !=
nullptr) {
413 for (
unsigned int i = 0; i < prop->Count; ++i)
415 prop->MinimumValue.push_back(minimumValue[i]);
416 prop->MaximumValue.push_back(maximumValue[i]);
421 ULONG64 nValues = numValuesInEachDimension[0];
422 if (prop->Count == 1) {
423 for (
unsigned int dim = 1; dim < numArrayDimensions; dim++) {
424 nValues *= numValuesInEachDimension[dim];
427 else if (prop->Count > 1) {
429 for (
unsigned int dim = 1; dim < numArrayDimensions - 1; dim++) {
430 nValues *= numValuesInEachDimension[dim];
434 throw std::invalid_argument(
"Cannot compute and set min and max value on a property which has a Count set to zero or negative.");
437 for (
unsigned int propIndex = 0; propIndex < prop->Count; ++propIndex) {
438 size_t i = propIndex;
439 T computedMin = std::numeric_limits<T>::quiet_NaN();
440 T computedMax = std::numeric_limits<T>::quiet_NaN();
441 while (i < nValues && values[i] != values[i]) i += prop->Count;
443 throw std::invalid_argument(
"All values of a dimension of the vectorial property look to be only NaN values.");
445 computedMin = values[i];
446 computedMax = values[i];
448 for (; i < nValues; i += prop->Count) {
449 T propVal = values[i];
450 if (propVal < computedMin) {
451 computedMin = propVal;
453 else if (propVal > computedMax) {
454 computedMax = propVal;
457 prop->MinimumValue.push_back(computedMin);
458 prop->MaximumValue.push_back(computedMax);
ContinuousProperty(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject)
Definition: ContinuousProperty.h:71
virtual ~ContinuousProperty()
Definition: ContinuousProperty.h:133
Definition: AbstractValuesProperty.h:41
Definition: PropertyKind.h:40
Definition: ContinuousProperty.h:44
virtual std::string getXmlTag() const
Definition: ContinuousProperty.h:136
Definition: EpcDocument.h:78
Definition: AbstractRepresentation.h:44
Definition: EpcDocument.h:62
Definition: AbstractHdfProxy.h:45
ContinuousProperty()
Definition: ContinuousProperty.h:51
ContinuousProperty(gsoap_resqml2_0_1::_resqml2__ContinuousProperty *fromGsoap)
Definition: ContinuousProperty.h:128