My Project
AbstractIjkGridRepresentation.h
1 /*-----------------------------------------------------------------------
2 Copyright F2I-CONSULTING, (2014-2016)
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/AbstractColumnLayerGridRepresentation.h"
37 
38 #include <stdexcept>
39 
40 namespace resqml2_0_1
41 {
47  {
48  private :
49 
53  void init(soap* soapContext, resqml2::AbstractLocal3dCrs * crs,
54  const std::string & guid, const std::string & title,
55  const unsigned int & iCount, const unsigned int & jCount, const unsigned int & kCount,
56  bool withTruncatedPillars);
57 
58  protected :
59 
63  AbstractIjkGridRepresentation(gsoap_resqml2_0_1::_resqml2__IjkGridRepresentation* fromGsoap) : AbstractColumnLayerGridRepresentation(fromGsoap, false), splitInformation(nullptr) {}
64  AbstractIjkGridRepresentation(gsoap_resqml2_0_1::_resqml2__TruncatedIjkGridRepresentation* fromGsoap) : AbstractColumnLayerGridRepresentation(fromGsoap, true), splitInformation(nullptr) {}
65 
66  gsoap_resqml2_0_1::_resqml2__IjkGridRepresentation* getSpecializedGsoapProxy() const;
67  gsoap_resqml2_0_1::_resqml2__TruncatedIjkGridRepresentation* getSpecializedTruncatedGsoapProxy() const;
68 
69  gsoap_resqml2_0_1::resqml2__PointGeometry* getPointGeometry2_0_1(const unsigned int & patchIndex) const;
70 
71  std::vector< std::pair< unsigned int, std::vector<unsigned int> > >* splitInformation;
72 
73  public:
74 
75  enum geometryKind { UNKNOWN = 0, EXPLICIT = 1, PARAMETRIC = 2, LATTICE = 3, NO_GEOMETRY = 4}; // UNKNOWN exists in case of partial transfer
76 
81  const std::string & guid, const std::string & title,
82  const unsigned int & iCount, const unsigned int & jCount, const unsigned int & kCount,
83  bool withTruncatedPillars = false);
84 
86  const std::string & guid, const std::string & title,
87  const unsigned int & iCount, const unsigned int & jCount, const unsigned int & kCount,
88  bool withTruncatedPillars = false);
89 
93  AbstractIjkGridRepresentation(gsoap_resqml2_0_1::eml__DataObjectReference* partialObject,
94  bool withTruncatedPillars = false) :
95  AbstractColumnLayerGridRepresentation(nullptr, partialObject, withTruncatedPillars), splitInformation(nullptr)
96  {
97  }
98 
103 
107  unsigned int getICellCount() const;
108 
112  void setICellCount(const unsigned int & iCount);
113 
117  unsigned int getJCellCount() const;
118 
122  void setJCellCount(const unsigned int & jCount);
123 
127  ULONG64 getCellCount() const {return getICellCount() * getJCellCount() * getKCellCount();}
128 
132  unsigned int getColumnCount() const {return getICellCount() * getJCellCount();}
133 
137  unsigned int getPillarCount() const {return (getICellCount()+1) * (getJCellCount()+1);}
138 
143  unsigned int getFaceCount() const;
144 
148  unsigned int getIPillarFromGlobalIndex(const unsigned int & globalIndex) const;
149 
153  unsigned int getJPillarFromGlobalIndex(const unsigned int & globalIndex) const;
154 
158  unsigned int getGlobalIndexPillarFromIjIndex(const unsigned int & iPillar, const unsigned int & jPillar) const;
159 
163  unsigned int getIColumnFromGlobalIndex(const unsigned int & globalIndex) const;
164 
168  unsigned int getJColumnFromGlobalIndex(const unsigned int & globalIndex) const;
169 
173  unsigned int getGlobalIndexColumnFromIjIndex(const unsigned int & iColumn, const unsigned int & jColumn) const;
174 
178  unsigned int getGlobalIndexCellFromIjkIndex(const unsigned int & iCell, const unsigned int & jCell, const unsigned int & kCell) const;
179 
180  bool isRightHanded() const;
181 
187  void getPillarsOfSplitCoordinateLines(unsigned int * pillarIndices, bool reverseIAxis = false, bool reverseJAxis = false) const;
188 
193  void getColumnsOfSplitCoordinateLines(unsigned int * columnIndices, bool reverseIAxis = false, bool reverseJAxis = false) const;
194  void getColumnCountOfSplitCoordinateLines(unsigned int * columnIndexCountPerSplitCoordinateLine) const;
195 
199  unsigned long getSplitCoordinateLineCount() const;
200 
204  ULONG64 getSplitNodeCount() const;
205 
206  void getPillarGeometryIsDefined(bool * pillarGeometryIsDefined, bool reverseIAxis = false, bool reverseJAxis = false) const;
207 
211  bool hasEnabledCellInformation() const;
212 
218  void getEnabledCells(bool * enabledCells, bool reverseIAxis = false, bool reverseJAxis= false, bool reverseKAxis= false) const;
219 
225  void setEnabledCells(unsigned char* enabledCells);
226 
231  void loadSplitInformation();
232 
236  void unloadSplitInformation();
237 
248  bool isColumnEdgeSplitted(const unsigned int & iColumn, const unsigned int & jColumn, const unsigned int & edge) const;
249 
264  ULONG64 getXyzPointIndexFromCellCorner(const unsigned int & iCell, const unsigned int & jCell, const unsigned int & kCell, const unsigned int & corner) const;
265 
269  gsoap_resqml2_0_1::resqml2__KDirection getKDirection() const;
270 
271  virtual geometryKind getGeometryKind() const { return UNKNOWN; }
272  virtual std::string getHdfProxyUuid() const { throw std::logic_error("Partial object"); }
273  virtual ULONG64 getXyzPointCountOfPatch(const unsigned int & patchIndex) const { throw std::logic_error("Partial object"); }
274  virtual void getXyzPointsOfPatch(const unsigned int & patchIndex, double * xyzPoints) const { throw std::logic_error("Partial object"); }
275 
276  static const char* XML_TAG;
277  static const char* XML_TAG_TRUNCATED;
278  virtual std::string getXmlTag() const;
279 
280  unsigned int getPatchCount() const {return 1;}
281  };
282 }
virtual ~AbstractIjkGridRepresentation()
Definition: AbstractIjkGridRepresentation.h:102
Definition: AbstractIjkGridRepresentation.h:46
Definition: AbstractLocal3dCrs.h:40
virtual ULONG64 getXyzPointCountOfPatch(const unsigned int &patchIndex) const
Definition: AbstractIjkGridRepresentation.h:273
unsigned int getPillarCount() const
Definition: AbstractIjkGridRepresentation.h:137
Definition: EpcDocument.h:79
AbstractIjkGridRepresentation(gsoap_resqml2_0_1::eml__DataObjectReference *partialObject, bool withTruncatedPillars=false)
Definition: AbstractIjkGridRepresentation.h:93
unsigned int getColumnCount() const
Definition: AbstractIjkGridRepresentation.h:132
Definition: AbstractColumnLayerGridRepresentation.h:45
ULONG64 getCellCount() const
Definition: AbstractIjkGridRepresentation.h:127
virtual void getXyzPointsOfPatch(const unsigned int &patchIndex, double *xyzPoints) const
Definition: AbstractIjkGridRepresentation.h:274
Definition: AbstractFeatureInterpretation.h:45
AbstractIjkGridRepresentation(gsoap_resqml2_0_1::_resqml2__IjkGridRepresentation *fromGsoap)
Definition: AbstractIjkGridRepresentation.h:63