My Project
IjkGridParametricRepresentation.h
1 /*-----------------------------------------------------------------------
2 Copyright F2I-CONSULTING, (2014-2017)
3 
4 philippe.verney@f2i-consulting.com
5 
6 This software is a computer program whose purpose is to access to data formatted using Energistics standards.
7 
8 This software is governed by the CeCILL-B license under French law and
9 abiding by the rules of distribution of free software. You can use,
10 modify and/ or redistribute the software under the terms of the CeCILL-B
11 license as circulated by CEA, CNRS and INRIA at the following URL
12 "http://www.cecill.info".
13 
14 As a counterpart to the access to the source code and rights to copy,
15 modify and redistribute granted by the license, users are provided only
16 with a limited warranty and the software's author, the holder of the
17 economic rights, and the successive licensors have only limited
18 liability.
19 
20 In this respect, the user's attention is drawn to the risks associated
21 with loading, using, modifying and/or developing or reproducing the
22 software by the user in light of its specific status of free software,
23 that may mean that it is complicated to manipulate, and that also
24 therefore means that it is reserved for developers and experienced
25 professionals having in-depth computer knowledge. Users are therefore
26 encouraged to load and test the software's suitability as regards their
27 requirements in conditions enabling the security of their systems and/or
28 data to be ensured and, more generally, to use and operate it in the
29 same conditions as regards security.
30 
31 The fact that you are presently reading this means that you have had
32 knowledge of the CeCILL-B license and that you accept its terms.
33 -----------------------------------------------------------------------*/
34 #pragma once
35 
36 #include "resqml2_0_1/AbstractIjkGridRepresentation.h"
37 
38 #include "tools/BSpline.h"
39 
40 namespace resqml2_0_1
41 {
43  {
44  private:
45  void getXyzPointsOfPatchFromParametricPoints(gsoap_resqml2_0_1::resqml2__Point3dParametricArray* parametricPoint3d, double * xyzPoints) const;
46 
47  class PillarInformation
48  {
49  public:
50 
51  unsigned int maxControlPointCount;
52  unsigned int parametricLineCount;
53  unsigned int splitLineCount;
54  double * controlPoints;
55  double * controlPointParameters;
56  short * pillarKind;
57  unsigned int* pillarOfSplitCoordLines;
58  std::vector< std::vector< geometry::BSpline > > splines;
59 
60  PillarInformation():maxControlPointCount(0), parametricLineCount(0), splitLineCount(0),
61  controlPoints(nullptr), controlPointParameters(nullptr), pillarKind(nullptr), pillarOfSplitCoordLines(nullptr) {}
62 
63  ~PillarInformation() {
64  cleanMemory();
65  }
66 
67  void cleanMemory() {
68  if (controlPoints != nullptr) delete[] controlPoints;
69  if (controlPointParameters != nullptr) delete[] controlPointParameters;
70  if (pillarKind != nullptr) delete[] pillarKind;
71  if (pillarOfSplitCoordLines != nullptr) delete[] pillarOfSplitCoordLines;
72  }
73  };
74 
79  void loadPillarInformation(PillarInformation & pillarInfo) const;
80  protected:
81  PillarInformation* pillarInformation;
82 
83  public:
85  const std::string & guid, const std::string & title,
86  const unsigned int & iCount, const unsigned int & jCount, const unsigned int & kCount,
87  bool withTruncatedPillars = false);
88 
90  const std::string & guid, const std::string & title,
91  const unsigned int & iCount, const unsigned int & jCount, const unsigned int & kCount,
92  bool withTruncatedPillars = false);
93 
97  IjkGridParametricRepresentation(gsoap_resqml2_0_1::_resqml2__IjkGridRepresentation* fromGsoap) : AbstractIjkGridRepresentation(fromGsoap), pillarInformation(nullptr) {}
98  IjkGridParametricRepresentation(gsoap_resqml2_0_1::_resqml2__TruncatedIjkGridRepresentation* fromGsoap) : AbstractIjkGridRepresentation(fromGsoap), pillarInformation(nullptr) {}
99 
104  if (pillarInformation != nullptr)
105  delete pillarInformation;
106  }
107 
108  std::string getHdfProxyUuid() const;
109 
113  ULONG64 getXyzPointCountOfPatch(const unsigned int & patchIndex) const;
114 
123  void getXyzPointsOfKInterfaceSequenceOfPatch(const unsigned int & kInterfaceStart, const unsigned int & kInterfaceEnd, const unsigned int & patchIndex, double * xyzPoints);
124 
130  void getXyzPointsOfPatch(const unsigned int & patchIndex, double * xyzPoints) const;
131 
135  unsigned int getControlPointMaxCountPerPillar() const;
136 
142  void getControlPoints(double * controlPoints, bool reverseIAxis = false, bool reverseJAxis= false, bool reverseKAxis= false) const;
143 
148  bool hasControlPointParameters() const;
149 
156  void getControlPointParameters(double * controlPointParameters, bool reverseIAxis = false, bool reverseJAxis= false, bool reverseKAxis= false) const;
157 
161  bool isParametricLineKindConstant() const;
162 
163  /*
164  * Get the constant parametric line count in the grid.
165  */
166  short getConstantParametricLineKind() const;
167 
173  void getParametricLineKind(short * pillarKind, bool reverseIAxis = false, bool reverseJAxis= false) const;
174 
180  void getParametersOfNodes(double * parameters, bool reverseIAxis = false, bool reverseJAxis= false, bool reverseKAxis= false) const;
181 
196  void setGeometryAsParametricNonSplittedPillarNodes(
197  const gsoap_resqml2_0_1::resqml2__PillarShape & mostComplexPillarGeometry, const gsoap_resqml2_0_1::resqml2__KDirection & kDirectionKind, const bool & isRightHanded,
198  double * parameters, double * controlPoints, double * controlPointParameters, const unsigned int & controlPointMaxCountPerPillar, short * pillarKind, common::AbstractHdfProxy* proxy);
199 
204  void setGeometryAsParametricNonSplittedPillarNodesUsingExistingDatasets(
205  const gsoap_resqml2_0_1::resqml2__PillarShape & mostComplexPillarGeometry, const gsoap_resqml2_0_1::resqml2__KDirection & kDirectionKind, const bool & isRightHanded,
206  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::AbstractHdfProxy* proxy);
207 
225  void setGeometryAsParametricSplittedPillarNodes(
226  const gsoap_resqml2_0_1::resqml2__PillarShape & mostComplexPillarGeometry, const gsoap_resqml2_0_1::resqml2__KDirection & kDirectionKind, const bool & isRightHanded,
227  double * parameters, double * controlPoints, double * controlPointParameters, const unsigned int & controlPointMaxCountPerPillar, short * pillarKind, common::AbstractHdfProxy* proxy,
228  const unsigned long & splitCoordinateLineCount, unsigned int * pillarOfCoordinateLine,
229  unsigned int * splitCoordinateLineColumnCumulativeCount, unsigned int * splitCoordinateLineColumns);
230 
235  void setGeometryAsParametricSplittedPillarNodesUsingExistingDatasets(
236  const gsoap_resqml2_0_1::resqml2__PillarShape & mostComplexPillarGeometry, const gsoap_resqml2_0_1::resqml2__KDirection & kDirectionKind, const bool & isRightHanded,
237  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::AbstractHdfProxy* proxy,
238  const unsigned long & splitCoordinateLineCount, const std::string & pillarOfCoordinateLine,
239  const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns);
240 
257  void setGeometryAsParametricSplittedPillarNodes(
258  const gsoap_resqml2_0_1::resqml2__KDirection & kDirectionKind, const bool & isRightHanded,
259  double * parameters, double * controlPoints, double * controlPointParameters, const unsigned int & controlPointCountPerPillar, short pillarKind, common::AbstractHdfProxy* proxy,
260  const unsigned long & splitCoordinateLineCount, unsigned int * pillarOfCoordinateLine,
261  unsigned int * splitCoordinateLineColumnCumulativeCount, unsigned int * splitCoordinateLineColumns);
262 
266  void setGeometryAsParametricSplittedPillarNodesUsingExistingDatasets(
267  const gsoap_resqml2_0_1::resqml2__KDirection & kDirectionKind, const bool & isRightHanded,
268  const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, const unsigned int & controlPointCountPerPillar, short pillarKind, common::AbstractHdfProxy* proxy,
269  const unsigned long & splitCoordinateLineCount, const std::string & pillarOfCoordinateLine,
270  const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns);
271 
272  geometryKind getGeometryKind() const;
273  };
274 }
Definition: AbstractIjkGridRepresentation.h:46
Definition: AbstractLocal3dCrs.h:40
virtual ~IjkGridParametricRepresentation()
Definition: IjkGridParametricRepresentation.h:103
Definition: EpcDocument.h:78
Definition: IjkGridParametricRepresentation.h:42
Definition: AbstractHdfProxy.h:45
Definition: AbstractFeatureInterpretation.h:45
IjkGridParametricRepresentation(gsoap_resqml2_0_1::_resqml2__IjkGridRepresentation *fromGsoap)
Definition: IjkGridParametricRepresentation.h:97