h5geo 0.4.0
C++17 and python API to work with geo-data (seismic, wells, maps, other in process) based on HDF5. Aimed at geoscientists and developers.
Loading...
Searching...
No Matches
h5baseobjectimpl.h
1#ifndef H5BASEOBJECTIMPL_H
2#define H5BASEOBJECTIMPL_H
3
4#include "../h5baseobject.h"
5#include "h5baseimpl.h"
6#include "h5gt/H5Group.hpp"
7
8class OGRCoordinateTransformation;
9
10template <typename TBase = H5BaseObject>
11class H5BaseObjectImpl : public H5BaseImpl<TBase>
12{
13protected:
14 explicit H5BaseObjectImpl(const h5gt::Group &group);
15 virtual ~H5BaseObjectImpl() = default;
16
17public:
18 virtual H5BasePoints* openPoints(
19 const std::string& name) override;
20 virtual H5BasePoints* openPoints(
21 h5gt::Group group) override;
22
23 virtual H5Horizon* openHorizon(
24 const std::string& name) override;
25 virtual H5Horizon* openHorizon(
26 h5gt::Group group) override;
27
28 virtual H5Points1* createPoints1(
29 std::string& name,
31 h5geo::CreationType createFlag) override;
32 virtual H5Points1* createPoints1(
33 h5gt::Group group,
35 h5geo::CreationType createFlag) override;
36 virtual H5Points2* createPoints2(
37 std::string& name,
39 h5geo::CreationType createFlag) override;
40 virtual H5Points2* createPoints2(
41 h5gt::Group group,
43 h5geo::CreationType createFlag) override;
44 virtual H5Points3* createPoints3(
45 std::string& name,
47 h5geo::CreationType createFlag) override;
48 virtual H5Points3* createPoints3(
49 h5gt::Group group,
51 h5geo::CreationType createFlag) override;
52 virtual H5Points4* createPoints4(
53 std::string& name,
55 h5geo::CreationType createFlag) override;
56 virtual H5Points4* createPoints4(
57 h5gt::Group group,
59 h5geo::CreationType createFlag) override;
60
61 virtual H5Horizon* createHorizon(
62 std::string& name,
64 h5geo::CreationType createFlag) override;
65 virtual H5Horizon* createHorizon(
66 h5gt::Group group,
68 h5geo::CreationType createFlag) override;
69
70 virtual H5Base* clone() override;
71#ifdef H5GEO_USE_GDAL
75 virtual OGRCoordinateTransformation* createCoordinateTransformationToReadData(
76 const std::string& unitsTo) override;
80 virtual OGRCoordinateTransformation* createCoordinateTransformationToWriteData(
81 const std::string& unitsFrom) override;
82#endif
83
84 virtual bool setSpatialReference(const std::string& str) override;
85 virtual bool setSpatialReference(
86 const std::string& authName, const std::string& code) override;
87 virtual bool setLengthUnits(const std::string& str) override;
88 virtual bool setTemporalUnits(const std::string& str) override;
89 virtual bool setAngularUnits(const std::string& str) override;
90 virtual bool setDataUnits(const std::string& str) override;
91 virtual bool setNullValue(double val) override;
92
93 virtual std::string getSpatialReference() override;
94 virtual std::string getLengthUnits() override;
95 virtual std::string getTemporalUnits() override;
96 virtual std::string getAngularUnits() override;
97 virtual std::string getDataUnits() override;
98 virtual double getNullValue() override;
99
100 virtual h5gt::File getH5File() const override;
101 virtual h5gt::Group getObjG() const override;
102
103 virtual std::string getName() const override;
104 virtual std::string getFullName() const override;
105
106 virtual std::vector<h5gt::Group> getObjGroupList(const h5geo::ObjectType& objType, bool recursive) override;
107 virtual std::vector<std::string> getObjNameList(const h5geo::ObjectType& objType, bool recursive) override;
108 virtual size_t getObjCount(const h5geo::ObjectType& objType, bool recursive) override;
109
110 virtual bool isEqual(H5BaseObject* other) const override;
111
112 virtual bool operator == (const H5BaseObject& other) const override;
113 virtual bool operator != (const H5BaseObject& other) const override;
114
115protected:
120 std::optional<h5gt::Group>
121 getParentG(const h5geo::ObjectType& objType);
122
123 virtual std::optional<h5gt::Group>
124 getGroupOpt(
125 h5gt::Group& parent,
126 const std::string& groupName) const;
127
128 virtual std::optional<h5gt::DataSet>
129 getDatasetOpt(
130 const h5gt::Group& parent,
131 const std::string& datasetName) const;
132
133 //----------- FRIEND CLASSES -----------
134 friend H5BaseObject* h5geo::openBaseObject(h5gt::Group group);
135
136protected:
137 h5gt::Group objG;
138};
139
140#endif // H5BASEOBJECTIMPL_H
Base class for all geo-containers and geo-objects.
Definition h5base.h:182
Definition h5baseimpl.h:8
Base class for geo-objects.
Definition h5baseobject.h:13
Definition h5baseobjectimpl.h:12
virtual H5BasePoints * openPoints(const std::string &name) override
Open H5BasePoints derived points.
Definition h5baseobjectimpl.cpp:113
virtual size_t getObjCount(const h5geo::ObjectType &objType, bool recursive) override
Get number of geo-objects of specified type within current geo-object.
Definition h5baseobjectimpl.cpp:533
virtual std::string getAngularUnits() override
Get angular units for the current geo-object.
Definition h5baseobjectimpl.cpp:453
virtual bool operator==(const H5BaseObject &other) const override
Check if geo-objects are the same (compares HDF5 Groups)
Definition h5baseobjectimpl.cpp:549
virtual std::string getName() const override
Get geo-object's name without path.
Definition h5baseobjectimpl.cpp:508
virtual std::string getTemporalUnits() override
Get temporal units for the current geo-object.
Definition h5baseobjectimpl.cpp:446
virtual std::string getLengthUnits() override
Get length units for the current geo-object.
Definition h5baseobjectimpl.cpp:439
std::optional< h5gt::Group > getParentG(const h5geo::ObjectType &objType)
getParent Search for parent of type ObjectType for the objG
Definition h5baseobjectimpl.cpp:563
virtual std::string getFullName() const override
Get geo-object's name with full path to that object.
Definition h5baseobjectimpl.cpp:515
virtual bool setLengthUnits(const std::string &str) override
Set length units for the current geo-object.
Definition h5baseobjectimpl.cpp:392
virtual std::string getDataUnits() override
Get data units for the current geo-object.
Definition h5baseobjectimpl.cpp:460
virtual H5Base * clone() override
virtual bool setNullValue(double val) override
Set NULL value for the current geo-object.
Definition h5baseobjectimpl.cpp:424
virtual bool setAngularUnits(const std::string &str) override
Set angular units for the current geo-object.
Definition h5baseobjectimpl.cpp:408
virtual bool operator!=(const H5BaseObject &other) const override
Check if geo-objects are not the same (compares HDF5 Groups)
Definition h5baseobjectimpl.cpp:557
virtual std::string getSpatialReference() override
Get spatial reference for current geo-object.
Definition h5baseobjectimpl.cpp:432
virtual bool setDataUnits(const std::string &str) override
Set data units for the current geo-object.
Definition h5baseobjectimpl.cpp:416
virtual std::vector< std::string > getObjNameList(const h5geo::ObjectType &objType, bool recursive) override
Find all geo-objects of specified type within current geo-object and return them as vector of names.
Definition h5baseobjectimpl.cpp:527
virtual h5gt::File getH5File() const override
Get HDF5 file.
Definition h5baseobjectimpl.cpp:474
virtual h5gt::Group getObjG() const override
Get HDF5 Group.
Definition h5baseobjectimpl.cpp:479
virtual bool setSpatialReference(const std::string &str) override
Set spatial reference for current geo-object using authName:code form.
Definition h5baseobjectimpl.cpp:375
virtual bool isEqual(H5BaseObject *other) const override
Check if geo-objects are the same.
Definition h5baseobjectimpl.cpp:538
virtual double getNullValue() override
Get NULL value for the current geo-object.
Definition h5baseobjectimpl.cpp:467
virtual std::vector< h5gt::Group > getObjGroupList(const h5geo::ObjectType &objType, bool recursive) override
Find all geo-objects of specified type within current geo-object and return them as vector of Groups.
Definition h5baseobjectimpl.cpp:521
virtual bool setTemporalUnits(const std::string &str) override
Set temporal units for the current geo-object.
Definition h5baseobjectimpl.cpp:400
Base class for Points.
Definition h5basepoints.h:16
Provides API to work with horizons.
Definition h5horizon.h:17
Provides API to work with 1D points.
Definition h5points1.h:12
Provides API to work with 2D points.
Definition h5points2.h:12
Provides API to work with 3D points.
Definition h5points3.h:12
Provides API to work with 4D points.
Definition h5points4.h:12
H5GEO_EXPORT H5BaseObject * openBaseObject(h5gt::Group group)
Factory function for opening H5BaseObject.
Definition h5baseimpl.cpp:2000
CreationType
Definition h5enum.h:468
Class for creating H5Horizon.
Definition h5base.h:87
Common class for creating H5Points1, H5Points2, H5Points3, H5Points4.
Definition h5base.h:71