Fesapi 2.10.1.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Loading...
Searching...
No Matches
IjkGridParametricRepresentation.h
1/*-----------------------------------------------------------------------
2Licensed to the Apache Software Foundation (ASF) under one
3or more contributor license agreements. See the NOTICE file
4distributed with this work for additional information
5regarding copyright ownership. The ASF licenses this file
6to you under the Apache License, Version 2.0 (the
7"License"; you may not use this file except in compliance
8with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing,
13software distributed under the License is distributed on an
14"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15KIND, either express or implied. See the License for the
16specific language governing permissions and limitations
17under the License.
18-----------------------------------------------------------------------*/
19#pragma once
20
21#include "AbstractIjkGridRepresentation.h"
22
23namespace RESQML2_NS
24{
32 {
33 public:
37 DLL_IMPORT_OR_EXPORT virtual ~IjkGridParametricRepresentation() {}
38
39 DLL_IMPORT_OR_EXPORT void getXyzPointsOfKInterfaceSequence(unsigned int kInterfaceStart, unsigned int kInterfaceEnd, double * xyzPoints) final;
40
48 DLL_IMPORT_OR_EXPORT void getXyzPointsOfBlock(double * xyzPoints) final;
49
61 DLL_IMPORT_OR_EXPORT virtual unsigned int getControlPointMaxCountPerPillar() const = 0;
62
84 DLL_IMPORT_OR_EXPORT void getControlPoints(double * controlPoints, bool reverseIAxis = false, bool reverseJAxis= false, bool reverseKAxis= false) const;
85
96 DLL_IMPORT_OR_EXPORT virtual bool hasControlPointParameters() const = 0;
97
124 DLL_IMPORT_OR_EXPORT void getControlPointParameters(double * controlPointParameters, bool reverseIAxis = false, bool reverseJAxis= false, bool reverseKAxis= false) const;
125
136 DLL_IMPORT_OR_EXPORT virtual bool isParametricLineKindConstant() const = 0;
137
148 DLL_IMPORT_OR_EXPORT virtual short getConstantParametricLineKind() const = 0;
149
168 DLL_IMPORT_OR_EXPORT void getParametricLineKind(int16_t* pillarKind, bool reverseIAxis = false, bool reverseJAxis = false) const;
169
189 DLL_IMPORT_OR_EXPORT void getParametersOfNodes(double * parameters, bool reverseIAxis = false, bool reverseJAxis= false, bool reverseKAxis= false) const;
190
213 DLL_IMPORT_OR_EXPORT void getParametersOfNodesOfKInterfaceSequence(unsigned int kInterfaceStart, unsigned int kInterfaceEnd, double * parameters);
214
259 gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, bool isRightHanded,
260 double const * parameters, double const * controlPoints, double const * controlPointParameters, unsigned int controlPointMaxCountPerPillar, short const * pillarKind,
261 EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr);
262
308 gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded,
309 const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointMaxCountPerPillar, const std::string & pillarKind, const std::string & definedPillars,
310 EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr);
311
377 DLL_IMPORT_OR_EXPORT virtual void setGeometryAsParametricSplittedPillarNodes(
378 gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, bool isRightHanded,
379 double const * parameters, double const * controlPoints, double const * controlPointParameters, unsigned int controlPointMaxCountPerPillar, short const * pillarKind, EML2_NS::AbstractHdfProxy* proxy,
380 uint64_t splitCoordinateLineCount, unsigned int const * pillarOfCoordinateLine,
381 unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0;
382
452 gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded,
453 const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointMaxCountPerPillar, const std::string & pillarKind, const std::string & definedPillars, EML2_NS::AbstractHdfProxy* proxy,
454 uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine,
455 const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0;
456
520 DLL_IMPORT_OR_EXPORT void setGeometryAsParametricSplittedPillarNodes(bool isRightHanded,
521 double const * parameters, double const * controlPoints, double const * controlPointParameters, unsigned int controlPointCountPerPillar, short pillarKind, EML2_NS::AbstractHdfProxy* proxy,
522 uint64_t splitCoordinateLineCount, unsigned int const * pillarOfCoordinateLine,
523 unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr);
524
588 gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded,
589 const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointCountPerPillar, short pillarKind, EML2_NS::AbstractHdfProxy* proxy,
590 uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine,
591 const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0;
592
593 DLL_IMPORT_OR_EXPORT bool isNodeGeometryCompressed() const final;
594
595 DLL_IMPORT_OR_EXPORT geometryKind getGeometryKind() const final;
596
597 protected:
598 IjkGridParametricRepresentation(COMMON_NS::DataObjectRepository * repo,
599 const std::string & guid, const std::string & title,
600 unsigned int iCount, unsigned int jCount, unsigned int kCount, bool* kGaps = nullptr, EML2_NS::AbstractHdfProxy* proxy = nullptr) :
601 AbstractIjkGridRepresentation(repo, guid, title, iCount, jCount, kCount, kGaps, proxy) {}
602
603 IjkGridParametricRepresentation(RESQML2_NS::AbstractFeatureInterpretation* interp,
604 const std::string & guid, const std::string & title,
605 unsigned int iCount, unsigned int jCount, unsigned int kCount, bool* kGaps = nullptr, EML2_NS::AbstractHdfProxy* proxy = nullptr) :
606 AbstractIjkGridRepresentation(interp, guid, title, iCount, jCount, kCount, kGaps, proxy) {}
607
611 IjkGridParametricRepresentation(gsoap_resqml2_0_1::_resqml20__IjkGridRepresentation* fromGsoap) : AbstractIjkGridRepresentation(fromGsoap) {}
612 IjkGridParametricRepresentation(gsoap_eml2_3::_resqml22__IjkGridRepresentation* fromGsoap) : AbstractIjkGridRepresentation(fromGsoap) {}
613 IjkGridParametricRepresentation(gsoap_resqml2_0_1::_resqml20__TruncatedIjkGridRepresentation* fromGsoap) : AbstractIjkGridRepresentation(fromGsoap) {}
614 IjkGridParametricRepresentation(gsoap_eml2_3::_resqml22__TruncatedIjkGridRepresentation* fromGsoap) : AbstractIjkGridRepresentation(fromGsoap) {}
615
619 gsoap_resqml2_0_1::resqml20__KDirection computeKDirection(double const * controlPoints, unsigned int controlPointCountPerPillar, short const * pillarKind, EML2_NS::AbstractLocal3dCrs const * localCrs);
620
621 void writeGeometryOnHdf(double const * parameters,
622 double const * controlPoints, double const * controlPointParameters, unsigned int controlPointCountPerPillar,
623 uint64_t splitCoordinateLineCount, unsigned int const * pillarOfCoordinateLine,
624 unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, EML2_NS::AbstractHdfProxy * proxy);
625
626 virtual EML2_NS::AbstractHdfProxy* getParameterDatasetPath(std::string & datasetPathInExternalFile) const = 0;
627 virtual EML2_NS::AbstractHdfProxy* getControlPointDatasetPath(std::string & datasetPathInExternalFile) const = 0;
628 virtual EML2_NS::AbstractHdfProxy* getControlPointParametersDatasetPath(std::string & datasetPathInExternalFile) const = 0;
629 virtual EML2_NS::AbstractHdfProxy* getParametersOfNodesDatasetPath(std::string & datasetPathInExternalFile) const = 0;
630 virtual void getRawParametricLineKind(short * pillarKind) const = 0;
631 void getXyzPointsFromParametricPoints(double * xyzPoints) const;
632
633 private:
637 class BSpline
638 {
639 public:
640 BSpline() {};
641 BSpline(const std::vector<double>& parametersAtControlPoint, const std::vector<double>& valuesAtControlPoint);
642 ~BSpline() = default;
643
644 double getValueFromParameter(double param) const;
645 void setParameterAndValueAtControlPoint(const std::vector<double>& parametersAtControlPoint, const std::vector<double>& valuesAtControlPoint);
646
647 private:
648
649 void checkIfParametersIncreaseOrDecrease();
650 std::size_t getSplineIndexFromParameter(double param) const;
651
652 bool areParametersIncreasing;
653
654 // basically each of set of 5 double describe a spline
655 std::vector<double> a;
656 std::vector<double> b;
657 std::vector<double> c;
658 std::vector<double> d;
659 std::vector<double> parameter; //named x in the wiki link
660 };
661
662 class PillarInformation
663 {
664 public:
665 uint32_t maxControlPointCount = 0;
666 uint32_t parametricLineCount = 0;
667 uint64_t splitLineCount = 0;
668 std::unique_ptr<double[]> controlPoints;
669 std::unique_ptr<double[]> controlPointParameters;
670 std::unique_ptr<int16_t[]> pillarKind;
671 std::unique_ptr<uint32_t[]> pillarOfSplitCoordLines;
672 std::vector< std::vector< BSpline > > splines;
673
674 PillarInformation() {}
675 };
676
681 void loadPillarInformation() const;
682
683 void getXyzPointsAlongACoordinateLine(uint64_t pillarIndex, uint64_t coordLineIndex, uint64_t ijNodeCount, uint64_t kNodeCount, double const* parameters, double* xyzPoints) const;
684
685 // Use a pointer to keep the instance of this class const when modified (i.e when computed for getting XYZ Points)
686 std::unique_ptr<PillarInformation> pillarInformation{ new PillarInformation() };
687 };
688}
Proxy class for an abstract IJK grid representation. This class is semantically abstract....
Definition AbstractIjkGridRepresentation.h:34
geometryKind
Definition AbstractIjkGridRepresentation.h:38
An IJK Grid parametric representation define the cell corner positions by means of parameters along t...
Definition IjkGridParametricRepresentation.h:32
void getParametricLineKind(int16_t *pillarKind, bool reverseIAxis=false, bool reverseJAxis=false) const
virtual bool isParametricLineKindConstant() const =0
void setGeometryAsParametricNonSplittedPillarNodes(gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, bool isRightHanded, double const *parameters, double const *controlPoints, double const *controlPointParameters, unsigned int controlPointMaxCountPerPillar, short const *pillarKind, eml2::AbstractHdfProxy *proxy=nullptr, eml2::AbstractLocal3dCrs *localCrs=nullptr)
void getControlPoints(double *controlPoints, bool reverseIAxis=false, bool reverseJAxis=false, bool reverseKAxis=false) const
void getControlPointParameters(double *controlPointParameters, bool reverseIAxis=false, bool reverseJAxis=false, bool reverseKAxis=false) const
void getXyzPointsOfBlock(double *xyzPoints) final
Gets all the XYZ points of the current block. XYZ points are given in the local CRS....
void setGeometryAsParametricNonSplittedPillarNodesUsingExistingDatasets(gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string &parameters, const std::string &controlPoints, const std::string &controlPointParameters, unsigned int controlPointMaxCountPerPillar, const std::string &pillarKind, const std::string &definedPillars, eml2::AbstractHdfProxy *proxy=nullptr, eml2::AbstractLocal3dCrs *localCrs=nullptr)
virtual void setGeometryAsParametricSplittedPillarNodesUsingExistingDatasets(gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string &parameters, const std::string &controlPoints, const std::string &controlPointParameters, unsigned int controlPointMaxCountPerPillar, const std::string &pillarKind, const std::string &definedPillars, eml2::AbstractHdfProxy *proxy, uint64_t splitCoordinateLineCount, const std::string &pillarOfCoordinateLine, const std::string &splitCoordinateLineColumnCumulativeCount, const std::string &splitCoordinateLineColumns, eml2::AbstractLocal3dCrs *localCrs=nullptr)=0
void getParametersOfNodesOfKInterfaceSequence(unsigned int kInterfaceStart, unsigned int kInterfaceEnd, double *parameters)
void getParametersOfNodes(double *parameters, bool reverseIAxis=false, bool reverseJAxis=false, bool reverseKAxis=false) const
virtual void setGeometryAsParametricSplittedPillarNodes(gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, bool isRightHanded, double const *parameters, double const *controlPoints, double const *controlPointParameters, unsigned int controlPointMaxCountPerPillar, short const *pillarKind, eml2::AbstractHdfProxy *proxy, uint64_t splitCoordinateLineCount, unsigned int const *pillarOfCoordinateLine, unsigned int const *splitCoordinateLineColumnCumulativeCount, unsigned int const *splitCoordinateLineColumns, eml2::AbstractLocal3dCrs *localCrs=nullptr)=0
virtual ~IjkGridParametricRepresentation()
Definition IjkGridParametricRepresentation.h:37
virtual short getConstantParametricLineKind() const =0
virtual unsigned int getControlPointMaxCountPerPillar() const =0
virtual void setGeometryAsParametricSplittedPillarNodesUsingExistingDatasets(gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string &parameters, const std::string &controlPoints, const std::string &controlPointParameters, unsigned int controlPointCountPerPillar, short pillarKind, eml2::AbstractHdfProxy *proxy, uint64_t splitCoordinateLineCount, const std::string &pillarOfCoordinateLine, const std::string &splitCoordinateLineColumnCumulativeCount, const std::string &splitCoordinateLineColumns, eml2::AbstractLocal3dCrs *localCrs=nullptr)=0
void getXyzPointsOfKInterfaceSequence(unsigned int kInterfaceStart, unsigned int kInterfaceEnd, double *xyzPoints) final
Gets all the XYZ points of a particular sequence of K interfaces. XYZ points are given in the local C...
void setGeometryAsParametricSplittedPillarNodes(bool isRightHanded, double const *parameters, double const *controlPoints, double const *controlPointParameters, unsigned int controlPointCountPerPillar, short pillarKind, eml2::AbstractHdfProxy *proxy, uint64_t splitCoordinateLineCount, unsigned int const *pillarOfCoordinateLine, unsigned int const *splitCoordinateLineColumnCumulativeCount, unsigned int const *splitCoordinateLineColumns, eml2::AbstractLocal3dCrs *localCrs=nullptr)
virtual bool hasControlPointParameters() const =0