Fesapi  2.0.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
StreamlinesRepresentation.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 "AbstractRepresentation.h"
22 
23 namespace RESQML2_NS
24 {
25  class AbstractGridRepresentation;
26 
33  {
34  public:
35 
37 
43  DLL_IMPORT_OR_EXPORT StreamlinesRepresentation(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : AbstractRepresentation(partialObject) {}
44 
50  StreamlinesRepresentation(gsoap_resqml2_0_1::_resqml20__StreamlinesRepresentation* fromGsoap): AbstractRepresentation(fromGsoap) {}
51 
57  StreamlinesRepresentation(gsoap_eml2_3::_resqml22__StreamlinesRepresentation* fromGsoap) : AbstractRepresentation(fromGsoap) {}
58 
62  virtual ~StreamlinesRepresentation() = default;
63 
71  DLL_IMPORT_OR_EXPORT virtual uint32_t getLineCount() const = 0;
72 
73  //********************************
74  //**** WELLBORE INFO ************
75  //********************************
76 
85  DLL_IMPORT_OR_EXPORT virtual uint16_t getWellboreTrajectoryCount() const = 0;
86 
98  DLL_IMPORT_OR_EXPORT RESQML2_NS::WellboreTrajectoryRepresentation* getWellboreTrajectory(uint16_t index) const;
99 
110  virtual COMMON_NS::DataObjectReference getWellboreTrajectoryDor(uint16_t index) const = 0;
111 
121  DLL_IMPORT_OR_EXPORT virtual uint32_t getInjectorPerLine(uint32_t* injectorPerLine) const = 0;
122 
132  DLL_IMPORT_OR_EXPORT virtual uint32_t getProducerPerLine(uint32_t* producerPerLine) const = 0;
133 
147  void virtual setWellboreInformation(uint32_t const* injectorPerLine, uint32_t const* producerPerLine, const std::vector<RESQML2_NS::WellboreTrajectoryRepresentation*> & wellboreTrajectories,
148  uint32_t nullValue = (std::numeric_limits<uint32_t>::max)(), EML2_NS::AbstractHdfProxy* hdfProxy = nullptr) = 0;
149 
150  //********************************
151  //********** GEOMETRY ************
152  //********************************
153 
161  DLL_IMPORT_OR_EXPORT virtual void getNodeCountPerLine(uint32_t * nodeCountPerPolyline) const = 0;
162 
166  DLL_IMPORT_OR_EXPORT uint64_t getXyzPointCountOfPatch(unsigned int patchIndex) const final {
167  if (patchIndex > 0) {
168  throw std::out_of_range("The patch index is out of range and should only be zero.");
169  }
170 
171  const uint32_t lineCount = getLineCount();
172  std::unique_ptr<uint32_t[]> nodeCountPerPolyline(new uint32_t[lineCount]);
173  getNodeCountPerLine(nodeCountPerPolyline.get());
174 
175  uint64_t result = 0;
176  for (uint32_t lineIndex = 0; lineIndex < lineCount; ++lineIndex) {
177  result += nodeCountPerPolyline[lineIndex];
178  }
179  return result;
180  }
181 
189  DLL_IMPORT_OR_EXPORT void getIntervalCountPerLine(uint32_t * intervalCountPerPolyline) const {
190  getNodeCountPerLine(intervalCountPerPolyline);
191 
192  const uint32_t lineCount = getLineCount();
193  for (uint32_t lineIndex = 0; lineIndex < lineCount; ++lineIndex) {
194  intervalCountPerPolyline[lineIndex] -= 1;
195  }
196  }
197 
205  DLL_IMPORT_OR_EXPORT uint64_t getIntervalCount() const {
206  const uint32_t lineCount = getLineCount();
207  std::unique_ptr<uint32_t[]> intervalCountPerPolyline(new uint32_t[lineCount]);
208  getIntervalCountPerLine (intervalCountPerPolyline.get());
209 
210  uint64_t result = 0;
211  for (uint32_t lineIndex = 0; lineIndex < lineCount; ++lineIndex) {
212  result += intervalCountPerPolyline[lineIndex];
213  }
214  return result;
215  }
216 
240  DLL_IMPORT_OR_EXPORT virtual void setGeometry(
241  uint32_t const * nodeCountPerPolyline, double const * xyzPoints,
242  EML2_NS::AbstractHdfProxy* hdfProxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0;
243 
244  //********************************
245  //******* GRID INFO *************
246  //********************************
247 
288  DLL_IMPORT_OR_EXPORT virtual void setIntervalGridCells(uint16_t const* gridIndices, uint16_t gridIndicesNullValue,
289  uint64_t const* cellIndices, uint64_t cellIndicesNullValue,
290  uint8_t const* localFacePairPerCellIndices, uint8_t localFacePairPerCellIndicesNullValue,
291  const std::vector<RESQML2_NS::AbstractGridRepresentation*> & supportingGrids,
292  EML2_NS::AbstractHdfProxy * hdfProxy = nullptr) = 0;
293 
308  DLL_IMPORT_OR_EXPORT virtual uint16_t getGridIndices(uint16_t * gridIndices) const = 0;
309 
325  DLL_IMPORT_OR_EXPORT virtual int64_t getCellIndices(uint64_t * cellIndices) const = 0;
326 
340  DLL_IMPORT_OR_EXPORT virtual uint8_t getLocalFacePairPerCellIndices(uint8_t * localFacePairPerCellIndices) const = 0;
341 
350  DLL_IMPORT_OR_EXPORT virtual uint16_t getGridRepresentationCount() const = 0;
351 
363  DLL_IMPORT_OR_EXPORT RESQML2_NS::AbstractGridRepresentation* getGridRepresentation(uint16_t index) const;
364 
375  virtual COMMON_NS::DataObjectReference getGridRepresentationDor(uint16_t index) const = 0;
376 
377  DLL_IMPORT_OR_EXPORT unsigned int getPatchCount() const final { return 1; }
378 
381 
385  DLL_IMPORT_OR_EXPORT static const char* XML_TAG;
386 
387  DLL_IMPORT_OR_EXPORT virtual std::string getXmlTag() const final { return XML_TAG; }
388  };
389 }
Proxy class for an abstract representation.
Definition: AbstractRepresentation.h:32
Representation of streamlines associated with a streamline feature and interpretation....
Definition: StreamlinesRepresentation.h:33
virtual uint32_t getProducerPerLine(uint32_t *producerPerLine) const =0
Gets all the wellbore indices which are producers. Null values signify that that line does not termin...
virtual uint32_t getLineCount() const =0
virtual uint8_t getLocalFacePairPerCellIndices(uint8_t *localFacePairPerCellIndices) const =0
resqml2::WellboreTrajectoryRepresentation * getWellboreTrajectory(uint16_t index) const
StreamlinesRepresentation(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject)
Definition: StreamlinesRepresentation.h:43
virtual void getNodeCountPerLine(uint32_t *nodeCountPerPolyline) const =0
virtual common::DataObjectReference getGridRepresentationDor(uint16_t index) const =0
uint64_t getIntervalCount() const
Definition: StreamlinesRepresentation.h:205
virtual common::DataObjectReference getWellboreTrajectoryDor(uint16_t index) const =0
virtual int64_t getCellIndices(uint64_t *cellIndices) const =0
virtual uint16_t getGridRepresentationCount() const =0
StreamlinesRepresentation(gsoap_resqml2_0_1::_resqml20__StreamlinesRepresentation *fromGsoap)
Definition: StreamlinesRepresentation.h:50
virtual uint16_t getWellboreTrajectoryCount() const =0
virtual void setWellboreInformation(uint32_t const *injectorPerLine, uint32_t const *producerPerLine, const std::vector< resqml2::WellboreTrajectoryRepresentation * > &wellboreTrajectories, uint32_t nullValue=(std::numeric_limits< uint32_t >::max)(), eml2::AbstractHdfProxy *hdfProxy=nullptr)=0
virtual uint32_t getInjectorPerLine(uint32_t *injectorPerLine) const =0
Gets all the wellbore indices which are injectors. Null values signify that that line does not initia...
virtual uint16_t getGridIndices(uint16_t *gridIndices) const =0
void getIntervalCountPerLine(uint32_t *intervalCountPerPolyline) const
Definition: StreamlinesRepresentation.h:189
uint64_t getXyzPointCountOfPatch(unsigned int patchIndex) const final
Definition: StreamlinesRepresentation.h:166
resqml2::AbstractGridRepresentation * getGridRepresentation(uint16_t index) const
StreamlinesRepresentation(gsoap_eml2_3::_resqml22__StreamlinesRepresentation *fromGsoap)
Definition: StreamlinesRepresentation.h:57
virtual void setIntervalGridCells(uint16_t const *gridIndices, uint16_t gridIndicesNullValue, uint64_t const *cellIndices, uint64_t cellIndicesNullValue, uint8_t const *localFacePairPerCellIndices, uint8_t localFacePairPerCellIndicesNullValue, const std::vector< resqml2::AbstractGridRepresentation * > &supportingGrids, eml2::AbstractHdfProxy *hdfProxy=nullptr)=0
virtual void setGeometry(uint32_t const *nodeCountPerPolyline, double const *xyzPoints, eml2::AbstractHdfProxy *hdfProxy=nullptr, resqml2::AbstractLocal3dCrs *localCrs=nullptr)=0
virtual ~StreamlinesRepresentation()=default
unsigned int getPatchCount() const final
Definition: StreamlinesRepresentation.h:377