My Project
UnstructuredGridRepresentation.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/AbstractGridRepresentation.h"
37 
38 namespace resqml2_0_1
39 {
41  {
42  private :
43 
47  void init(soap* soapContext, resqml2::AbstractLocal3dCrs * crs,
48  const std::string & guid, const std::string & title,
49  const ULONG64 & cellCount);
50 
51  gsoap_resqml2_0_1::_resqml2__UnstructuredGridRepresentation* getSpecializedGsoapProxy() const;
52 
53  gsoap_resqml2_0_1::resqml2__PointGeometry* getPointGeometry2_0_1(const unsigned int & patchIndex) const;
54 
67  void setConstantCellShapeGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points,
68  ULONG64 pointCount, ULONG64 faceCount, resqml2::AbstractHdfProxy* proxy,
69  const std::string& faceIndicesPerCell, ULONG64 faceCountPerCell,
70  const std::string& nodeIndicesPerFace, ULONG64 nodeCountPerFace);
71 
84  void setConstantCellShapeGeometry(unsigned char * cellFaceIsRightHanded, double * points,
85  ULONG64 pointCount, ULONG64 faceCount, resqml2::AbstractHdfProxy* proxy,
86  ULONG64 * faceIndicesPerCell, ULONG64 faceCountPerCell,
87  ULONG64 * nodeIndicesPerFace, ULONG64 nodeCountPerFace);
88 
89  unsigned int constantNodeCountPerFace;
90  unsigned int constantFaceCountPerCell;
91  ULONG64 * cumulativeNodeCountPerFace;
92  ULONG64 * cumulativeFaceCountPerCell;
93  ULONG64 * nodeIndicesOfFaces;
94  ULONG64 * faceIndicesOfCells;
95 
96  public:
97 
101  UnstructuredGridRepresentation(gsoap_resqml2_0_1::eml__DataObjectReference* partialObject):
102  resqml2::AbstractGridRepresentation(nullptr, partialObject, false), constantNodeCountPerFace(0), constantFaceCountPerCell(0),
103  cumulativeNodeCountPerFace(nullptr), cumulativeFaceCountPerCell(nullptr),
104  nodeIndicesOfFaces(nullptr), faceIndicesOfCells(nullptr)
105  {
106  }
107 
112  const std::string & guid, const std::string & title,
113  const ULONG64 & cellCount);
114 
116  const std::string & guid, const std::string & title,
117  const ULONG64 & cellCount);
118 
122  UnstructuredGridRepresentation(gsoap_resqml2_0_1::_resqml2__UnstructuredGridRepresentation* fromGsoap):
123  resqml2::AbstractGridRepresentation(fromGsoap, false), constantNodeCountPerFace(0), constantFaceCountPerCell(0),
124  cumulativeNodeCountPerFace(nullptr), cumulativeFaceCountPerCell(nullptr),
125  nodeIndicesOfFaces(nullptr), faceIndicesOfCells(nullptr) {}
126 
131 
135  bool hasGeometry() const;
136 
137  std::string getHdfProxyUuid() const;
138 
142  ULONG64 getXyzPointCountOfPatch(const unsigned int & patchIndex) const;
143 
149  void getXyzPointsOfPatch(const unsigned int & patchIndex, double * xyzPoints) const;
150 
155  void getFaceIndicesOfCells(ULONG64 * faceIndices) const;
156 
164  void getCumulativeFaceCountPerCell(ULONG64 * cumulativeFaceCountPerCell) const;
165 
172  void getFaceCountPerCell(ULONG64 * faceCountPerCell) const;
173 
177  bool isFaceCountOfCellsConstant() const;
178 
179  /*
180  * Get the constant face count per cell in the grid.
181  */
182  unsigned int getConstantFaceCountOfCells() const;
183 
188  void getNodeIndicesOfFaces(ULONG64 * nodeIndices) const;
189 
197  void getCumulativeNodeCountPerFace(ULONG64 * nodeCountPerFace) const;
198 
205  void getNodeCountPerFace(ULONG64 * nodeCountPerFace) const;
206 
210  bool isNodeCountOfFacesConstant() const;
211 
212  /*
213  * Get the constant node count per face in the grid.
214  */
215  unsigned int getConstantNodeCountOfFaces() const;
216 
221  void loadGeometry();
222 
226  void unloadGeometry();
227 
232  unsigned int getFaceCountOfCell(const ULONG64 & cellIndex) const;
233 
238  unsigned int getNodeCountOfFaceOfCell(const ULONG64 & cellIndex, const unsigned int & localFaceIndex) const;
239 
244  ULONG64 * getNodeIndicesOfFaceOfCell(const ULONG64 & cellIndex, const unsigned int & localFaceIndex) const;
245 
249  ULONG64 getCellCount() const;
250 
254  ULONG64 getFaceCount() const;
255 
259  ULONG64 getNodeCount() const;
260 
264  void getCellFaceIsRightHanded(unsigned char* cellFaceIsRightHanded) const;
265 
279  void setGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, ULONG64 pointCount, resqml2::AbstractHdfProxy* proxy,
280  const std::string& faceIndicesPerCell, const std::string&faceIndicesCumulativeCountPerCell,
281  ULONG64 faceCount, const std::string& nodeIndicesPerFace, const std::string& nodeIndicesCumulativeCountPerFace,
282  const gsoap_resqml2_0_1::resqml2__CellShape & cellShape);
283 
297  void setGeometry(unsigned char * cellFaceIsRightHanded, double * points, ULONG64 pointCount, resqml2::AbstractHdfProxy* proxy,
298  ULONG64 * faceIndicesPerCell, ULONG64 * faceIndicesCumulativeCountPerCell,
299  ULONG64 faceCount, ULONG64 * nodeIndicesPerFace, ULONG64 * nodeIndicesCumulativeCountPerFace,
300  const gsoap_resqml2_0_1::resqml2__CellShape & cellShape);
301 
312  void setTetrahedraOnlyGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points,
313  ULONG64 pointCount, ULONG64 faceCount, resqml2::AbstractHdfProxy* proxy,
314  const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace);
315 
326  void setTetrahedraOnlyGeometry(unsigned char * cellFaceIsRightHanded, double * points,
327  ULONG64 pointCount, ULONG64 faceCount, resqml2::AbstractHdfProxy* proxy,
328  ULONG64 * faceIndicesPerCell, ULONG64 * nodeIndicesPerFace);
329 
340  void setHexahedraOnlyGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points,
341  ULONG64 pointCount, ULONG64 faceCount, resqml2::AbstractHdfProxy* proxy,
342  const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace);
343 
354  void setHexahedraOnlyGeometry(unsigned char * cellFaceIsRightHanded, double * points,
355  ULONG64 pointCount, ULONG64 faceCount, resqml2::AbstractHdfProxy* proxy,
356  ULONG64 * faceIndicesPerCell, ULONG64 * nodeIndicesPerFace);
357 
358  static const char* XML_TAG;
359  virtual std::string getXmlTag() const {return XML_TAG;}
360 
361  unsigned int getPatchCount() const {return 1;}
362  };
363 }
virtual std::string getXmlTag() const
Definition: UnstructuredGridRepresentation.h:359
Definition: AbstractHdfProxy.h:44
Definition: AbstractLocal3dCrs.h:40
virtual ~UnstructuredGridRepresentation()
Definition: UnstructuredGridRepresentation.h:130
Definition: AbstractGridRepresentation.h:47
Definition: EpcDocument.h:79
UnstructuredGridRepresentation(gsoap_resqml2_0_1::_resqml2__UnstructuredGridRepresentation *fromGsoap)
Definition: UnstructuredGridRepresentation.h:122
Definition: UnstructuredGridRepresentation.h:40
UnstructuredGridRepresentation(gsoap_resqml2_0_1::eml__DataObjectReference *partialObject)
Definition: UnstructuredGridRepresentation.h:101
Definition: EpcDocument.h:61
Definition: AbstractFeatureInterpretation.h:45