36 #include "resqml2/AbstractValuesProperty.h" 37 #include "resqml2/AbstractHdfProxy.h" 64 const unsigned int & dimension,
const gsoap_resqml2_0_1::resqml2__IndexableElements & attachmentKind);
79 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);
92 const unsigned int & dimension,
const gsoap_resqml2_0_1::resqml2__IndexableElements & attachmentKind,
const gsoap_resqml2_0_1::resqml2__ResqmlUom & uom,
resqml2::PropertyKind * localPropKind);
105 const unsigned int & dimension,
const gsoap_resqml2_0_1::resqml2__IndexableElements & attachmentKind,
const std::string & nonStandardUom,
const gsoap_resqml2_0_1::resqml2__ResqmlPropertyKind & energisticsPropertyKind);
118 const unsigned int & dimension,
const gsoap_resqml2_0_1::resqml2__IndexableElements & attachmentKind,
const std::string & nonStandardUom,
resqml2::PropertyKind * localPropKind);
123 ContinuousProperty(gsoap_resqml2_0_1::_resqml2__ContinuousProperty* fromGsoap): AbstractValuesProperty(fromGsoap) {}
130 static const char* XML_TAG;
136 const gsoap_resqml2_0_1::resqml2__ResqmlUom & getUom()
const;
141 std::string getUomAsString()
const;
152 const double & minimumValue = std::numeric_limits<double>::quiet_NaN(),
const double & maximumValue = std::numeric_limits<double>::quiet_NaN());
163 void pushBackDoubleHdf5Array2dOfValues(
double * values,
const ULONG64 & valueCountInFastestDim,
const ULONG64 & valueCountInSlowestDim,
resqml2::AbstractHdfProxy* proxy,
164 const double & minimumValue = std::numeric_limits<double>::quiet_NaN(),
const double & maximumValue = std::numeric_limits<double>::quiet_NaN());
176 void pushBackDoubleHdf5Array3dOfValues(
double * values,
const ULONG64 & valueCountInFastestDim,
const ULONG64 & valueCountInMiddleDim,
const ULONG64 & valueCountInSlowestDim,
resqml2::AbstractHdfProxy* proxy,
177 const double & minimumValue = std::numeric_limits<double>::quiet_NaN(),
const double & maximumValue = std::numeric_limits<double>::quiet_NaN());
188 void pushBackDoubleHdf5ArrayOfValues(
double * values,
unsigned long long * numValues,
const unsigned int & numArrayDimensions,
resqml2::AbstractHdfProxy* proxy,
189 double * minimumValue =
nullptr,
double * maximumValue =
nullptr);
200 const double & minimumValue = std::numeric_limits<double>::quiet_NaN(),
const double & maximumValue = std::numeric_limits<double>::quiet_NaN());
211 void pushBackFloatHdf5Array2dOfValues(
float * values,
const ULONG64 & valueCountInFastestDim,
const ULONG64 & valueCountInSlowestDim,
resqml2::AbstractHdfProxy* proxy,
212 const double & minimumValue = std::numeric_limits<double>::quiet_NaN(),
const double & maximumValue = std::numeric_limits<double>::quiet_NaN());
224 void pushBackFloatHdf5Array3dOfValues(
float * values,
const ULONG64 & valueCountInFastestDim,
const ULONG64 & valueCountInMiddleDim,
const ULONG64 & valueCountInSlowestDim,
resqml2::AbstractHdfProxy* proxy,
225 const double & minimumValue = std::numeric_limits<double>::quiet_NaN(),
const double & maximumValue = std::numeric_limits<double>::quiet_NaN());
236 void pushBackFloatHdf5ArrayOfValues(
float * values,
unsigned long long * numValues,
const unsigned int & numArrayDimensions,
resqml2::AbstractHdfProxy* proxy,
237 double * minimumValue =
nullptr,
double * maximumValue =
nullptr);
245 void createFloatHdf5ArrayOfValues(
246 unsigned long long* numValues,
247 const unsigned int& numArrayDimensions,
258 void createFloatHdf5Array3dOfValues(
259 const ULONG64& valueCountInFastestDim,
260 const ULONG64& valueCountInMiddleDim,
261 const ULONG64& valueCountInSlowestDim,
276 void pushBackFloatHdf5SlabArray3dOfValues(
278 const ULONG64& valueCountInFastestDim,
279 const ULONG64& valueCountInMiddleDim,
280 const ULONG64& valueCountInSlowestDim,
281 const ULONG64& offsetInFastestDim,
282 const ULONG64& offsetInMiddleDim,
283 const ULONG64& offsetInSlowestDim,
296 void pushBackFloatHdf5SlabArrayOfValues(
298 unsigned long long * numValues,
299 unsigned long long * offsetValues,
300 const unsigned int & numArrayDimensions,
308 void getDoubleValuesOfPatch(
const unsigned int & patchIndex,
double * values);
314 void getFloatValuesOfPatch(
const unsigned int & patchIndex,
float * values);
324 void getFloatValuesOfPatch(
325 const unsigned int& patchIndex,
327 unsigned long long* numValuesInEachDimension,
328 unsigned long long* offsetInEachDimension,
329 const unsigned int& numArrayDimensions
343 void getFloatValuesOf3dPatch(
344 const unsigned int& patchIndex,
346 const ULONG64& valueCountInFastestDim,
347 const ULONG64& valueCountInMiddleDim,
348 const ULONG64& valueCountInSlowestDim,
349 const ULONG64& offsetInFastestDim,
350 const ULONG64& offsetInMiddleDim,
351 const ULONG64& offsetInSlowestDim
354 double getMinimumValue();
355 double getMaximumValue();
357 gsoap_resqml2_0_1::resqml2__ResqmlPropertyKind getFirstAllowedPropertyKindParent()
const;
368 void setPropertyMinMax(
370 unsigned long long* numValuesInEachDimension,
371 const unsigned int& numArrayDimensions
373 gsoap_resqml2_0_1::_resqml2__ContinuousProperty* prop =
374 static_cast<gsoap_resqml2_0_1::_resqml2__ContinuousProperty*
>(gsoapProxy2_0_1);
375 if (prop->Count == 1) {
377 ULONG64 nValues = numValuesInEachDimension[0];
379 for (
unsigned int dim = 1; dim < numArrayDimensions; dim++) {
380 nValues *= numValuesInEachDimension[dim];
383 T computedMin = prop->MinimumValue[0];
384 T computedMax = prop->MaximumValue[0];
386 for (ULONG64 i = 0; i < nValues; ++i) {
387 if( values[i] < computedMin ) {
388 computedMin = values[i];
389 }
else if( values[i] > computedMax ) {
390 computedMax = values[i];
393 prop->MinimumValue[0] = computedMin;
394 prop->MaximumValue[0] = computedMax;
395 }
else if (prop->Count > 1) {
398 ULONG64 nValues = numValuesInEachDimension[0];
400 for (
unsigned int dim = 1; dim < numArrayDimensions-1; dim++) {
401 nValues *= numValuesInEachDimension[dim];
404 const int nProperties = prop->Count;
406 for(
int propIndex = 0; propIndex < nProperties; ++propIndex) {
407 T computedMin = prop->MinimumValue[propIndex];
408 T computedMax = prop->MaximumValue[propIndex];
410 for (ULONG64 valIndex = 0; valIndex < nValues; ++valIndex) {
411 T propVal = values[propIndex+(nProperties*valIndex)];
412 if( propVal < computedMin ) {
413 computedMin = values[valIndex];
414 }
else if( propVal > computedMax ) {
415 computedMax = values[valIndex];
418 prop->MinimumValue.push_back(computedMin);
419 prop->MaximumValue.push_back(computedMax);
424 template <
class valueType>
425 void pushBackXmlPartOfArrayNdOfExplicitValues(valueType * values,
unsigned long long * numValues,
const unsigned int & numValueDimensions,
resqml2::AbstractHdfProxy * proxy,
426 double * minimumValue =
nullptr,
double * maximumValue =
nullptr)
429 gsoap_resqml2_0_1::_resqml2__ContinuousProperty* prop =
static_cast<gsoap_resqml2_0_1::_resqml2__ContinuousProperty*
>(gsoapProxy2_0_1);
431 if (prop->Count == 1)
433 double computedMinimumValue;
434 double computedMaximumValue;
435 if (minimumValue ==
nullptr || maximumValue ==
nullptr)
437 ULONG64 numTotalValues = numValues[0];
438 for (
unsigned int dim = 1; dim < numValueDimensions; dim++)
439 numTotalValues *= numValues[dim];
442 computedMinimumValue = std::numeric_limits<double>::quiet_NaN();
443 computedMaximumValue = std::numeric_limits<double>::quiet_NaN();
444 while (values[i] != values[i]) ++i;
445 if (i < numTotalValues)
447 computedMinimumValue = values[i];
448 computedMaximumValue = values[i];
450 for (; i < numTotalValues; ++i)
452 if (values[i] == values[i])
454 if (values[i] > computedMaximumValue)
455 computedMaximumValue = values[i];
456 else if (values[i] < computedMinimumValue)
457 computedMinimumValue = values[i];
463 computedMinimumValue = minimumValue[0];
464 computedMaximumValue = maximumValue[0];
467 prop->MinimumValue.push_back(computedMinimumValue);
468 prop->MaximumValue.push_back(computedMaximumValue);
470 else if (minimumValue || maximumValue)
474 prop->MinimumValue.clear();
475 for (
unsigned int i = 0; i < prop->Count; i++)
477 prop->MinimumValue.push_back(minimumValue[i]);
482 prop->MaximumValue.clear();
483 for (
unsigned int i = 0; i < prop->Count; i++)
485 prop->MaximumValue.push_back(maximumValue[i]);
490 gsoap_resqml2_0_1::resqml2__PatchOfValues* patch = gsoap_resqml2_0_1::soap_new_resqml2__PatchOfValues(gsoapProxy2_0_1->soap, 1);
491 patch->RepresentationPatchIndex =
static_cast<ULONG64*
>(soap_malloc(gsoapProxy2_0_1->soap,
sizeof(ULONG64)));
492 *(patch->RepresentationPatchIndex) = prop->PatchOfValues.size();
495 gsoap_resqml2_0_1::resqml2__DoubleHdf5Array* xmlValues = gsoap_resqml2_0_1::soap_new_resqml2__DoubleHdf5Array(gsoapProxy2_0_1->soap, 1);
496 xmlValues->Values = gsoap_resqml2_0_1::soap_new_eml__Hdf5Dataset(gsoapProxy2_0_1->soap, 1);
497 xmlValues->Values->HdfProxy = proxy->newResqmlReference();
498 std::ostringstream ossForHdf;
499 ossForHdf <<
"values_patch" << *(patch->RepresentationPatchIndex);
500 xmlValues->Values->PathInHdfFile =
"/RESQML/" + prop->uuid +
"/" + ossForHdf.str();
501 patch->Values = xmlValues;
503 prop->PatchOfValues.push_back(patch);
Definition: AbstractHdfProxy.h:44
virtual ~ContinuousProperty()
Definition: ContinuousProperty.h:128
Definition: AbstractValuesProperty.h:40
Definition: PropertyKind.h:40
Definition: ContinuousProperty.h:44
virtual std::string getXmlTag() const
Definition: ContinuousProperty.h:131
Definition: EpcDocument.h:79
Definition: AbstractRepresentation.h:40
ContinuousProperty()
Definition: ContinuousProperty.h:51
ContinuousProperty(gsoap_resqml2_0_1::_resqml2__ContinuousProperty *fromGsoap)
Definition: ContinuousProperty.h:123