Fesapi  0.13.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
IjkGridParametricRepresentation.h
1 /*-----------------------------------------------------------------------
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"; you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18 -----------------------------------------------------------------------*/
19 #pragma once
20 
21 #include "resqml2_0_1/AbstractIjkGridRepresentation.h"
22 
23 #include "tools/BSpline.h"
24 
25 namespace RESQML2_0_1_NS
26 {
28  {
29  private:
30  void getXyzPointsOfPatchFromParametricPoints(gsoap_resqml2_0_1::resqml2__Point3dParametricArray* parametricPoint3d, double * xyzPoints) const;
31 
32  class PillarInformation
33  {
34  public:
35 
36  unsigned int maxControlPointCount;
37  unsigned int parametricLineCount;
38  unsigned int splitLineCount;
39  double * controlPoints;
40  double * controlPointParameters;
41  short * pillarKind;
42  unsigned int* pillarOfSplitCoordLines;
43  std::vector< std::vector< geometry::BSpline > > splines;
44 
45  PillarInformation():maxControlPointCount(0), parametricLineCount(0), splitLineCount(0),
46  controlPoints(nullptr), controlPointParameters(nullptr), pillarKind(nullptr), pillarOfSplitCoordLines(nullptr) {}
47 
48  ~PillarInformation() {
49  cleanMemory();
50  }
51 
52  void cleanMemory() {
53  if (controlPoints != nullptr) delete[] controlPoints;
54  if (controlPointParameters != nullptr) delete[] controlPointParameters;
55  if (pillarKind != nullptr) delete[] pillarKind;
56  if (pillarOfSplitCoordLines != nullptr) delete[] pillarOfSplitCoordLines;
57  }
58  };
59 
64  void loadPillarInformation(PillarInformation & pillarInfo) const;
65 
69  gsoap_resqml2_0_1::resqml2__KDirection computeKDirection(double * controlPoints, const unsigned int & controlPointCountPerPillar);
70  protected:
71  PillarInformation* pillarInformation;
72 
73  public:
75  const std::string & guid, const std::string & title,
76  const unsigned int & iCount, const unsigned int & jCount, const unsigned int & kCount,
77  bool withTruncatedPillars = false);
78 
80  const std::string & guid, const std::string & title,
81  const unsigned int & iCount, const unsigned int & jCount, const unsigned int & kCount,
82  bool withTruncatedPillars = false);
83 
87  IjkGridParametricRepresentation(gsoap_resqml2_0_1::_resqml2__IjkGridRepresentation* fromGsoap) : AbstractIjkGridRepresentation(fromGsoap), pillarInformation(nullptr) {}
88  IjkGridParametricRepresentation(gsoap_resqml2_0_1::_resqml2__TruncatedIjkGridRepresentation* fromGsoap) : AbstractIjkGridRepresentation(fromGsoap), pillarInformation(nullptr) {}
89 
94  if (pillarInformation != nullptr)
95  delete pillarInformation;
96  }
97 
98  std::string getHdfProxyUuid() const;
99 
103  ULONG64 getXyzPointCountOfPatch(const unsigned int & patchIndex) const;
104 
113  void getXyzPointsOfKInterfaceSequenceOfPatch(const unsigned int & kInterfaceStart, const unsigned int & kInterfaceEnd, const unsigned int & patchIndex, double * xyzPoints);
114 
120  void getXyzPointsOfBlockOfPatch(const unsigned int & patchIndex, double * xyzPoints);
121 
127  void getXyzPointsOfPatch(const unsigned int & patchIndex, double * xyzPoints) const;
128 
132  unsigned int getControlPointMaxCountPerPillar() const;
133 
139  void getControlPoints(double * controlPoints, bool reverseIAxis = false, bool reverseJAxis= false, bool reverseKAxis= false) const;
140 
145  bool hasControlPointParameters() const;
146 
153  void getControlPointParameters(double * controlPointParameters, bool reverseIAxis = false, bool reverseJAxis= false, bool reverseKAxis= false) const;
154 
158  bool isParametricLineKindConstant() const;
159 
160  /*
161  * Get the constant parametric line count in the grid.
162  */
163  short getConstantParametricLineKind() const;
164 
170  void getParametricLineKind(short * pillarKind, bool reverseIAxis = false, bool reverseJAxis= false) const;
171 
177  void getParametersOfNodes(double * parameters, bool reverseIAxis = false, bool reverseJAxis= false, bool reverseKAxis= false) const;
178 
192  void setGeometryAsParametricNonSplittedPillarNodes(
193  const gsoap_resqml2_0_1::resqml2__PillarShape & mostComplexPillarGeometry, const bool & isRightHanded,
194  double * parameters, double * controlPoints, double * controlPointParameters, const unsigned int & controlPointMaxCountPerPillar, short * pillarKind, COMMON_NS::AbstractHdfProxy* proxy);
195 
200  void setGeometryAsParametricNonSplittedPillarNodesUsingExistingDatasets(
201  const gsoap_resqml2_0_1::resqml2__PillarShape & mostComplexPillarGeometry, const gsoap_resqml2_0_1::resqml2__KDirection & kDirectionKind, const bool & isRightHanded,
202  const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, const unsigned int & controlPointMaxCountPerPillar, const std::string & pillarKind, const std::string & definedPillars, COMMON_NS::AbstractHdfProxy* proxy);
203 
220  void setGeometryAsParametricSplittedPillarNodes(
221  const gsoap_resqml2_0_1::resqml2__PillarShape & mostComplexPillarGeometry, const bool & isRightHanded,
222  double * parameters, double * controlPoints, double * controlPointParameters, const unsigned int & controlPointMaxCountPerPillar, short * pillarKind, COMMON_NS::AbstractHdfProxy* proxy,
223  const unsigned long & splitCoordinateLineCount, unsigned int * pillarOfCoordinateLine,
224  unsigned int * splitCoordinateLineColumnCumulativeCount, unsigned int * splitCoordinateLineColumns);
225 
230  void setGeometryAsParametricSplittedPillarNodesUsingExistingDatasets(
231  const gsoap_resqml2_0_1::resqml2__PillarShape & mostComplexPillarGeometry, const gsoap_resqml2_0_1::resqml2__KDirection & kDirectionKind, const bool & isRightHanded,
232  const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, const unsigned int & controlPointMaxCountPerPillar, const std::string & pillarKind, const std::string & definedPillars, COMMON_NS::AbstractHdfProxy* proxy,
233  const unsigned long & splitCoordinateLineCount, const std::string & pillarOfCoordinateLine,
234  const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns);
235 
251  void setGeometryAsParametricSplittedPillarNodes(const bool & isRightHanded,
252  double * parameters, double * controlPoints, double * controlPointParameters, const unsigned int & controlPointCountPerPillar, short pillarKind, COMMON_NS::AbstractHdfProxy* proxy,
253  const unsigned long & splitCoordinateLineCount, unsigned int * pillarOfCoordinateLine,
254  unsigned int * splitCoordinateLineColumnCumulativeCount, unsigned int * splitCoordinateLineColumns);
255 
259  void setGeometryAsParametricSplittedPillarNodesUsingExistingDatasets(
260  const gsoap_resqml2_0_1::resqml2__KDirection & kDirectionKind, const bool & isRightHanded,
261  const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, const unsigned int & controlPointCountPerPillar, short pillarKind, COMMON_NS::AbstractHdfProxy* proxy,
262  const unsigned long & splitCoordinateLineCount, const std::string & pillarOfCoordinateLine,
263  const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns);
264 
265  geometryKind getGeometryKind() const;
266  };
267 }
268 
Definition: AbstractIjkGridRepresentation.h:32
Definition: AbstractFeatureInterpretation.h:30
Definition: EpcDocument.h:65
virtual ~IjkGridParametricRepresentation()
Definition: IjkGridParametricRepresentation.h:93
Definition: IjkGridParametricRepresentation.h:27
Definition: AbstractHdfProxy.h:30
Definition: AbstractLocal3dCrs.h:25
IjkGridParametricRepresentation(gsoap_resqml2_0_1::_resqml2__IjkGridRepresentation *fromGsoap)
Definition: IjkGridParametricRepresentation.h:87