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
h5baseobject_py.h
1#ifndef H5BASEOBJECT_PY_H
2#define H5BASEOBJECT_PY_H
3
4#include "h5geo_py.h"
5
6#include <h5geo/private/h5baseobjectimpl.h>
7
8namespace h5geopy {
9
10template <class TBase>
12{
14 py::class_<
17 H5Base,
18 std::unique_ptr<H5BaseObject, ObjectDeleter>>
19 &py_obj)
20 {
21 py_obj
22 .def("openPoints", py::overload_cast<
23 const std::string&>(&H5BaseObject::openPoints))
24 .def("openPoints", py::overload_cast<
25 h5gt::Group>(&H5BaseObject::openPoints))
26
27 .def("openHorizon", py::overload_cast<
28 const std::string&>(&H5BaseObject::openHorizon))
29 .def("openHorizon", py::overload_cast<
30 h5gt::Group>(&H5BaseObject::openHorizon))
31
32 .def("createPoints1", py::overload_cast<
33 std::string&,
35 h5geo::CreationType>(&H5BaseObject::createPoints3))
36 .def("createPoints1", py::overload_cast<
37 h5gt::Group,
39 h5geo::CreationType>(&H5BaseObject::createPoints3))
40 .def("createPoints2", py::overload_cast<
41 std::string&,
43 h5geo::CreationType>(&H5BaseObject::createPoints3))
44 .def("createPoints2", py::overload_cast<
45 h5gt::Group,
47 h5geo::CreationType>(&H5BaseObject::createPoints3))
48 .def("createPoints3", py::overload_cast<
49 std::string&,
51 h5geo::CreationType>(&H5BaseObject::createPoints3))
52 .def("createPoints3", py::overload_cast<
53 h5gt::Group,
55 h5geo::CreationType>(&H5BaseObject::createPoints3))
56 .def("createPoints4", py::overload_cast<
57 std::string&,
59 h5geo::CreationType>(&H5BaseObject::createPoints3))
60 .def("createPoints4", py::overload_cast<
61 h5gt::Group,
63 h5geo::CreationType>(&H5BaseObject::createPoints3))
64
65 .def("createHorizon", py::overload_cast<
66 std::string&,
68 h5geo::CreationType>(&H5BaseObject::createHorizon))
69 .def("createHorizon", py::overload_cast<
70 h5gt::Group,
72 h5geo::CreationType>(&H5BaseObject::createHorizon))
73
74
75 #ifdef H5GEO_USE_GDAL
76 .def("createCoordinateTransformationToReadData",
77 &H5BaseObject::createCoordinateTransformationToReadData)
78 .def("createCoordinateTransformationToWriteData",
79 &H5BaseObject::createCoordinateTransformationToWriteData)
80 #endif
81
82 .def("setSpatialReference", py::overload_cast<const std::string&>(
84 .def("setSpatialReference", py::overload_cast<const std::string&, const std::string&>(
86 .def("setLengthUnits", &H5BaseObject::setLengthUnits)
87 .def("setTemporalUnits", &H5BaseObject::setTemporalUnits)
88 .def("setAngularUnits", &H5BaseObject::setAngularUnits)
89 .def("setDataUnits", &H5BaseObject::setDataUnits)
90 .def("setNullValue", &H5BaseObject::setNullValue)
91
92 .def("getSpatialReference", &H5BaseObject::getSpatialReference)
93 .def("getLengthUnits", &H5BaseObject::getLengthUnits)
94 .def("getTemporalUnits", &H5BaseObject::getTemporalUnits)
95 .def("getAngularUnits", &H5BaseObject::getAngularUnits)
96 .def("getDataUnits", &H5BaseObject::getDataUnits)
97 .def("getNullValue", &H5BaseObject::getNullValue)
98
99 .def("getH5File", &H5BaseObject::getH5File)
100 .def("getObjG", &H5BaseObject::getObjG)
101
102 .def("getName", &H5BaseObject::getName)
103 .def("getFullName", &H5BaseObject::getFullName)
104
105 .def("getObjGroupList", &H5BaseObject::getObjGroupList)
106 .def("getObjNameList", &H5BaseObject::getObjNameList)
107 .def("getObjCount", &H5BaseObject::getObjCount)
108
109 .def("isEqual", &H5BaseObject::isEqual)
110
111 // operators == for abstract classes https://github.com/pybind/pybind11/issues/1487
112 .def("__eq__", [](const H5BaseObject &self, const H5BaseObject &other){ return self == other; })
113 .def("__ne__", [](const H5BaseObject &self, const H5BaseObject &other){ return self != other; });
114 }
115};
116
117
118} // h5geopy
119
120
121#endif // H5BASEOBJECT_PY_H
Base class for all geo-containers and geo-objects.
Definition h5base.h:182
Base class for geo-objects.
Definition h5baseobject.h:13
virtual bool setNullValue(double val)=0
Set NULL value for the current geo-object.
virtual bool setDataUnits(const std::string &str)=0
Set data units for the current geo-object.
virtual bool setLengthUnits(const std::string &str)=0
Set length units for the current geo-object.
virtual bool setSpatialReference(const std::string &str)=0
Set spatial reference for current geo-object using authName:code form.
virtual std::string getTemporalUnits()=0
Get temporal units for the current geo-object.
virtual double getNullValue()=0
Get NULL value for the current geo-object.
virtual std::string getDataUnits()=0
Get data units for the current geo-object.
virtual std::string getName() const =0
Get geo-object's name without path.
virtual h5gt::File getH5File() const =0
Get HDF5 file.
virtual size_t getObjCount(const h5geo::ObjectType &objType, bool recursive)=0
Get number of geo-objects of specified type within current geo-object.
virtual std::string getLengthUnits()=0
Get length units for the current geo-object.
virtual bool isEqual(H5BaseObject *other) const =0
Check if geo-objects are the same.
virtual std::string getFullName() const =0
Get geo-object's name with full path to that object.
virtual std::vector< h5gt::Group > getObjGroupList(const h5geo::ObjectType &objType, bool recursive)=0
Find all geo-objects of specified type within current geo-object and return them as vector of Groups.
virtual H5BasePoints * openPoints(const std::string &name)=0
Open H5BasePoints derived points.
virtual std::vector< std::string > getObjNameList(const h5geo::ObjectType &objType, bool recursive)=0
Find all geo-objects of specified type within current geo-object and return them as vector of names.
virtual bool setTemporalUnits(const std::string &str)=0
Set temporal units for the current geo-object.
virtual bool setAngularUnits(const std::string &str)=0
Set angular units for the current geo-object.
virtual std::string getAngularUnits()=0
Get angular units for the current geo-object.
virtual h5gt::Group getObjG() const =0
Get HDF5 Group.
virtual std::string getSpatialReference()=0
Get spatial reference for current geo-object.
Definition h5baseobjectimpl.h:12
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
Definition h5baseobject_py.h:12