Fesapi 2.3.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
StreamlinesRepresentation.h
1/*-----------------------------------------------------------------------
2Licensed to the Apache Software Foundation (ASF) under one
3or more contributor license agreements. See the NOTICE file
4distributed with this work for additional information
5regarding copyright ownership. The ASF licenses this file
6to you under the Apache License, Version 2.0 (the
7"License"; you may not use this file except in compliance
8with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing,
13software distributed under the License is distributed on an
14"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15KIND, either express or implied. See the License for the
16specific language governing permissions and limitations
17under the License.
18-----------------------------------------------------------------------*/
19#pragma once
20
21#include "AbstractRepresentation.h"
22
23namespace 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
287 DLL_IMPORT_OR_EXPORT virtual void setIntervalGridCells(uint16_t const* gridIndices, uint16_t gridIndicesNullValue,
288 int64_t const* cellIndices,
289 uint8_t const* localFacePairPerCellIndices, uint8_t localFacePairPerCellIndicesNullValue,
290 const std::vector<RESQML2_NS::AbstractGridRepresentation*> & supportingGrids,
291 EML2_NS::AbstractHdfProxy * hdfProxy = nullptr) = 0;
292
307 DLL_IMPORT_OR_EXPORT virtual uint16_t getGridIndices(uint16_t * gridIndices) const = 0;
308
324 DLL_IMPORT_OR_EXPORT virtual int64_t getCellIndices(int64_t * cellIndices) const = 0;
325
339 DLL_IMPORT_OR_EXPORT virtual uint8_t getLocalFacePairPerCellIndices(uint8_t * localFacePairPerCellIndices) const = 0;
340
349 DLL_IMPORT_OR_EXPORT virtual uint16_t getGridRepresentationCount() const = 0;
350
362 DLL_IMPORT_OR_EXPORT RESQML2_NS::AbstractGridRepresentation* getGridRepresentation(uint16_t index) const;
363
374 virtual COMMON_NS::DataObjectReference getGridRepresentationDor(uint16_t index) const = 0;
375
376 DLL_IMPORT_OR_EXPORT unsigned int getPatchCount() const final { return 1; }
377
380
384 DLL_IMPORT_OR_EXPORT static const char* XML_TAG;
385
386 DLL_IMPORT_OR_EXPORT virtual std::string getXmlTag() const final { return XML_TAG; }
387 };
388}
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::AbstractGridRepresentation * getGridRepresentation(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 int64_t getCellIndices(int64_t *cellIndices) const =0
resqml2::WellboreTrajectoryRepresentation * getWellboreTrajectory(uint16_t index) const
virtual common::DataObjectReference getWellboreTrajectoryDor(uint16_t index) const =0
virtual uint16_t getGridRepresentationCount() const =0
virtual void setIntervalGridCells(uint16_t const *gridIndices, uint16_t gridIndicesNullValue, int64_t const *cellIndices, uint8_t const *localFacePairPerCellIndices, uint8_t localFacePairPerCellIndicesNullValue, const std::vector< resqml2::AbstractGridRepresentation * > &supportingGrids, eml2::AbstractHdfProxy *hdfProxy=nullptr)=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
StreamlinesRepresentation(gsoap_eml2_3::_resqml22__StreamlinesRepresentation *fromGsoap)
Definition: StreamlinesRepresentation.h:57
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:376