pye57 0.4.1__cp38-cp38-win_amd64.whl → 0.4.2__cp38-cp38-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pye57 might be problematic. Click here for more details.

pye57/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.4.1"
1
+ __version__ = "0.4.2"
Binary file
pye57/xerces-c_3_2.dll CHANGED
Binary file
@@ -1,144 +1,142 @@
1
- Metadata-Version: 2.1
2
- Name: pye57
3
- Version: 0.4.1
4
- Summary: Python .e57 files reader/writer
5
- Home-page: https://www.github.com/davidcaron/pye57
6
- Author: David Caron
7
- Author-email: dcaron05@gmail.com
8
- License: MIT
9
- Platform: UNKNOWN
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Programming Language :: Python
12
- Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.7
14
- Classifier: Programming Language :: Python :: 3.8
15
- Classifier: Programming Language :: Python :: 3.9
16
- Classifier: Programming Language :: Python :: 3.10
17
- Classifier: Programming Language :: Python :: Implementation :: CPython
18
- Requires-Python: >=3.7
19
- Description-Content-Type: text/markdown
20
- License-File: LICENSE
21
- Requires-Dist: numpy
22
- Requires-Dist: pyquaternion
23
- Provides-Extra: test
24
- Requires-Dist: pytest ; extra == 'test'
25
-
26
-
27
- # pye57
28
-
29
- [![PyPI](https://img.shields.io/pypi/v/pye57.svg)](https://pypi.org/project/pye57)
30
- [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pye57.svg)](https://pypi.org/project/pye57)
31
- ![GitHub](https://img.shields.io/github/workflow/status/davidcaron/pye57/build)
32
-
33
- Python wrapper of [LibE57Format](https://github.com/asmaloney/libE57Format) to read and write .e57 point cloud files
34
-
35
- ## Example usage
36
-
37
- ```python
38
- import numpy as np
39
- import pye57
40
-
41
- e57 = pye57.E57("e57_file.e57")
42
-
43
- # read scan at index 0
44
- data = e57.read_scan(0)
45
-
46
- # 'data' is a dictionary with the point types as keys
47
- assert isinstance(data["cartesianX"], np.ndarray)
48
- assert isinstance(data["cartesianY"], np.ndarray)
49
- assert isinstance(data["cartesianZ"], np.ndarray)
50
-
51
- # other attributes can be read using:
52
- data = e57.read_scan(0, intensity=True, colors=True, row_column=True)
53
- assert isinstance(data["cartesianX"], np.ndarray)
54
- assert isinstance(data["cartesianY"], np.ndarray)
55
- assert isinstance(data["cartesianZ"], np.ndarray)
56
- assert isinstance(data["intensity"], np.ndarray)
57
- assert isinstance(data["colorRed"], np.ndarray)
58
- assert isinstance(data["colorGreen"], np.ndarray)
59
- assert isinstance(data["colorBlue"], np.ndarray)
60
- assert isinstance(data["rowIndex"], np.ndarray)
61
- assert isinstance(data["columnIndex"], np.ndarray)
62
-
63
- # the 'read_scan' method filters points using the 'cartesianInvalidState' field
64
- # if you want to get everything as raw, untransformed data, use:
65
- data_raw = e57.read_scan_raw(0)
66
-
67
- # writing is also possible, but only using raw data for now
68
- e57_write = pye57.E57("e57_file_write.e57", mode='w')
69
- e57_write.write_scan_raw(data_raw)
70
- # you can specify a header to copy information from
71
- e57_write.write_scan_raw(data_raw, scan_header=e57.get_header(0))
72
-
73
- # the ScanHeader object wraps most of the scan information:
74
- header = e57.get_header(0)
75
- print(header.point_count)
76
- print(header.rotation_matrix)
77
- print(header.translation)
78
-
79
- # all the header information can be printed using:
80
- for line in header.pretty_print():
81
- print(line)
82
-
83
- # the scan position can be accessed with:
84
- position_scan_0 = e57.scan_position(0)
85
-
86
- # the binding is very close to the E57Foundation API
87
- # you can modify the nodes easily from python
88
- imf = e57.image_file
89
- root = imf.root()
90
- data3d = root["data3D"]
91
- scan_0 = data3d[0]
92
- translation_x = scan_0["pose"]["translation"]["x"]
93
- ```
94
-
95
- ## Installation
96
-
97
- If you're on linux or Windows, a wheel should be available.
98
-
99
- `python -m pip install pye57`
100
-
101
- ## Building from source
102
-
103
- ### Cloning the repository and required submodules
104
-
105
- Clone a new repository along with the required submodules
106
-
107
- `git clone https://github.com/davidcaron/pye57.git --recursive`
108
-
109
- If the repository has already been previously cloned, but without the --recursive flag
110
-
111
- ```
112
- cd pye57 # go to the cloned repository
113
- git submodule init # this will initialise the submodules in the repository
114
- git submodule update # this will update the submodules in the repository
115
- ```
116
-
117
- ### Dependencies on Linux
118
-
119
- Install libxerces-c-dev first.
120
-
121
- `sudo apt install libxerces-c-dev`
122
-
123
- ### Dependencies on Windows
124
-
125
- To get xerces-c, you can either build from source or if you're using conda:
126
-
127
- `conda install -y xerces-c`
128
-
129
- ### Run `pip install` from the repo source
130
-
131
- ```
132
- cd pye57
133
- python -m pip install .
134
- ```
135
-
136
- ### Uninstalling
137
-
138
- Use pip again
139
-
140
- ```
141
- python -m pip uninstall pye57
142
- ```
143
-
144
-
1
+ Metadata-Version: 2.1
2
+ Name: pye57
3
+ Version: 0.4.2
4
+ Summary: Python .e57 files reader/writer
5
+ Home-page: https://www.github.com/davidcaron/pye57
6
+ Author: David Caron
7
+ Author-email: dcaron05@gmail.com
8
+ License: MIT
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: Implementation :: CPython
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: numpy
22
+ Requires-Dist: pyquaternion
23
+ Provides-Extra: test
24
+ Requires-Dist: pytest ; extra == 'test'
25
+
26
+
27
+ # pye57
28
+
29
+ [![PyPI](https://img.shields.io/pypi/v/pye57.svg)](https://pypi.org/project/pye57)
30
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pye57.svg)](https://pypi.org/project/pye57)
31
+ ![GitHub](https://img.shields.io/github/actions/workflow/status/davidcaron/pye57/build.yml?branch=master)
32
+
33
+ Python wrapper of [LibE57Format](https://github.com/asmaloney/libE57Format) to read and write .e57 point cloud files
34
+
35
+ ## Example usage
36
+
37
+ ```python
38
+ import numpy as np
39
+ import pye57
40
+
41
+ e57 = pye57.E57("e57_file.e57")
42
+
43
+ # read scan at index 0
44
+ data = e57.read_scan(0)
45
+
46
+ # 'data' is a dictionary with the point types as keys
47
+ assert isinstance(data["cartesianX"], np.ndarray)
48
+ assert isinstance(data["cartesianY"], np.ndarray)
49
+ assert isinstance(data["cartesianZ"], np.ndarray)
50
+
51
+ # other attributes can be read using:
52
+ data = e57.read_scan(0, intensity=True, colors=True, row_column=True)
53
+ assert isinstance(data["cartesianX"], np.ndarray)
54
+ assert isinstance(data["cartesianY"], np.ndarray)
55
+ assert isinstance(data["cartesianZ"], np.ndarray)
56
+ assert isinstance(data["intensity"], np.ndarray)
57
+ assert isinstance(data["colorRed"], np.ndarray)
58
+ assert isinstance(data["colorGreen"], np.ndarray)
59
+ assert isinstance(data["colorBlue"], np.ndarray)
60
+ assert isinstance(data["rowIndex"], np.ndarray)
61
+ assert isinstance(data["columnIndex"], np.ndarray)
62
+
63
+ # the 'read_scan' method filters points using the 'cartesianInvalidState' field
64
+ # if you want to get everything as raw, untransformed data, use:
65
+ data_raw = e57.read_scan_raw(0)
66
+
67
+ # writing is also possible, but only using raw data for now
68
+ e57_write = pye57.E57("e57_file_write.e57", mode='w')
69
+ e57_write.write_scan_raw(data_raw)
70
+ # you can specify a header to copy information from
71
+ e57_write.write_scan_raw(data_raw, scan_header=e57.get_header(0))
72
+
73
+ # the ScanHeader object wraps most of the scan information:
74
+ header = e57.get_header(0)
75
+ print(header.point_count)
76
+ print(header.rotation_matrix)
77
+ print(header.translation)
78
+
79
+ # all the header information can be printed using:
80
+ for line in header.pretty_print():
81
+ print(line)
82
+
83
+ # the scan position can be accessed with:
84
+ position_scan_0 = e57.scan_position(0)
85
+
86
+ # the binding is very close to the E57Foundation API
87
+ # you can modify the nodes easily from python
88
+ imf = e57.image_file
89
+ root = imf.root()
90
+ data3d = root["data3D"]
91
+ scan_0 = data3d[0]
92
+ translation_x = scan_0["pose"]["translation"]["x"]
93
+ ```
94
+
95
+ ## Installation
96
+
97
+ If you're on linux or Windows, a wheel should be available.
98
+
99
+ `python -m pip install pye57`
100
+
101
+ ## Building from source
102
+
103
+ ### Cloning the repository and required submodules
104
+
105
+ Clone a new repository along with the required submodules
106
+
107
+ `git clone https://github.com/davidcaron/pye57.git --recursive`
108
+
109
+ If the repository has already been previously cloned, but without the --recursive flag
110
+
111
+ ```
112
+ cd pye57 # go to the cloned repository
113
+ git submodule init # this will initialise the submodules in the repository
114
+ git submodule update # this will update the submodules in the repository
115
+ ```
116
+
117
+ ### Dependencies on Linux
118
+
119
+ Install libxerces-c-dev first.
120
+
121
+ `sudo apt install libxerces-c-dev`
122
+
123
+ ### Dependencies on Windows
124
+
125
+ To get xerces-c, you can either build from source or if you're using conda:
126
+
127
+ `conda install -y xerces-c`
128
+
129
+ ### Run `pip install` from the repo source
130
+
131
+ ```
132
+ cd pye57
133
+ python -m pip install .
134
+ ```
135
+
136
+ ### Uninstalling
137
+
138
+ Use pip again
139
+
140
+ ```
141
+ python -m pip uninstall pye57
142
+ ```
@@ -0,0 +1,13 @@
1
+ pye57/__init__.py,sha256=keWVF2W7Jau5voY0aufr6bayvjfDJSWf_bmawIvvj88,95
2
+ pye57/__version__.py,sha256=6fbhlJpSCHhbEgnXa9Y3-1DhheoIUBV900vpMNv9wnw,23
3
+ pye57/e57.py,sha256=ec9_zxTvZ9TlnIVPMrzzB2wRHQg428F6EtWCCeg05K0,18950
4
+ pye57/exception.py,sha256=9Qgriir0IsSpHhStN5uvI5mlbKrc_P5ZURsi_PIW_q8,50
5
+ pye57/libe57.cp38-win_amd64.pyd,sha256=m0d8HRbUEUlOKQk89eOrgIfbRJUIUSLXp4RMFQsO2co,738304
6
+ pye57/scan_header.py,sha256=39FD40CBcJL5azN_HjVNvSnFrQR3uO-MIQFFNRhUqRU,6036
7
+ pye57/utils.py,sha256=GbuzETqw22KeDpnVc6dB9EUFBAs3gmhstoy67IyJDqU,1418
8
+ pye57/xerces-c_3_2.dll,sha256=uNGJPhQyZPqwjWzp3tijMKE69iRpqUrBf3OAIkT4NG0,2787328
9
+ pye57-0.4.2.dist-info/LICENSE,sha256=Q0K1iCfVm6UmnR4AAyqME5q7flnU6aGh5OarEIa2K6Y,1056
10
+ pye57-0.4.2.dist-info/METADATA,sha256=bTS9FfTB6QmoUz6Z6QWPQDBvSWgOJ4h7gyeycDhBiyw,4359
11
+ pye57-0.4.2.dist-info/WHEEL,sha256=3SeyPJ5-Us2Ct5GSftUVKtLSlm-bNefW4m5qd0GLzww,100
12
+ pye57-0.4.2.dist-info/top_level.txt,sha256=xD9HDzQ3BfGMuz1kI2uNKUR0KXcR-RtNEKigrkh48Nk,6
13
+ pye57-0.4.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.1)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp38-cp38-win_amd64
5
5
 
pye57/libe57_wrapper.cpp DELETED
@@ -1,526 +0,0 @@
1
-
2
- #include <pybind11/pybind11.h>
3
- #include <pybind11/stl_bind.h>
4
- #include <pybind11/numpy.h>
5
-
6
- #include <E57Exception.h>
7
- #include <E57Format.h>
8
- #include <E57Version.h>
9
-
10
- namespace py = pybind11;
11
- using namespace pybind11::literals;
12
-
13
- using namespace e57;
14
-
15
- PYBIND11_MAKE_OPAQUE(std::vector<SourceDestBuffer>);
16
-
17
- auto cast_node (Node &n) {
18
- NodeType type = n.type();
19
- if (type == NodeType::E57_BLOB)
20
- return py::cast(BlobNode(n));
21
- else if (type == NodeType::E57_COMPRESSED_VECTOR)
22
- return py::cast(CompressedVectorNode(n));
23
- else if (type == NodeType::E57_FLOAT)
24
- return py::cast(FloatNode(n));
25
- else if (type == NodeType::E57_INTEGER)
26
- return py::cast(IntegerNode(n));
27
- else if (type == NodeType::E57_SCALED_INTEGER)
28
- return py::cast(ScaledIntegerNode(n));
29
- else if (type == NodeType::E57_STRING)
30
- return py::cast(StringNode(n));
31
- else if (type == NodeType::E57_STRUCTURE)
32
- return py::cast(StructureNode(n));
33
- else if (type == NodeType::E57_VECTOR)
34
- return py::cast(VectorNode(n));
35
- }
36
-
37
- PYBIND11_MODULE(libe57, m) {
38
- m.doc() = "E57 reader/writer for python.";
39
-
40
- static py::exception<E57Exception> exc(m, "E57Exception");
41
- py::register_exception_translator([](std::exception_ptr p) {
42
- try {
43
- if (p) std::rethrow_exception(p);
44
- } catch (const E57Exception &e) {
45
- exc(Utilities::errorCodeToString(e.errorCode()).c_str());
46
- }
47
- });
48
-
49
- m.attr("E57_FORMAT_MAJOR") = E57_FORMAT_MAJOR;
50
- m.attr("E57_FORMAT_MINOR") = E57_FORMAT_MINOR;
51
- m.attr("E57_LIBRARY_ID") = REVISION_ID;
52
- m.attr("E57_V1_0_URI") = "http://www.astm.org/COMMIT/E57/2010-e57-v1.0";
53
- m.attr("CHECKSUM_POLICY_NONE") = CHECKSUM_POLICY_NONE;
54
- m.attr("CHECKSUM_POLICY_SPARSE") = CHECKSUM_POLICY_SPARSE;
55
- m.attr("CHECKSUM_POLICY_HALF") = CHECKSUM_POLICY_HALF;
56
- m.attr("CHECKSUM_POLICY_ALL") = CHECKSUM_POLICY_ALL;
57
- m.attr("E57_INT8_MIN") = E57_INT8_MIN;
58
- m.attr("E57_INT8_MAX") = E57_INT8_MAX;
59
- m.attr("E57_INT16_MIN") = E57_INT16_MIN;
60
- m.attr("E57_INT16_MAX") = E57_INT16_MAX;
61
- m.attr("E57_INT32_MIN") = E57_INT32_MIN;
62
- m.attr("E57_INT32_MAX") = E57_INT32_MAX;
63
- m.attr("E57_INT64_MIN") = E57_INT64_MIN;
64
- m.attr("E57_INT64_MAX") = E57_INT64_MAX;
65
- m.attr("E57_UINT8_MIN") = E57_UINT8_MIN;
66
- m.attr("E57_UINT8_MAX") = E57_UINT8_MAX;
67
- m.attr("E57_UINT16_MIN") = E57_UINT16_MIN;
68
- m.attr("E57_UINT16_MAX") = E57_UINT16_MAX;
69
- m.attr("E57_UINT32_MIN") = E57_UINT32_MIN;
70
- m.attr("E57_UINT32_MAX") = E57_UINT32_MAX;
71
- m.attr("E57_UINT64_MIN") = E57_UINT64_MIN;
72
- m.attr("E57_UINT64_MAX") = E57_UINT64_MAX;
73
- m.attr("E57_FLOAT_MIN") = E57_FLOAT_MIN;
74
- m.attr("E57_FLOAT_MAX") = E57_FLOAT_MAX;
75
- m.attr("E57_DOUBLE_MIN") = E57_DOUBLE_MIN;
76
- m.attr("E57_DOUBLE_MAX") = E57_DOUBLE_MAX;
77
- py::enum_<NodeType>(m, "NodeType")
78
- .value("E57_STRUCTURE", NodeType::E57_STRUCTURE)
79
- .value("E57_VECTOR", NodeType::E57_VECTOR)
80
- .value("E57_COMPRESSED_VECTOR", NodeType::E57_COMPRESSED_VECTOR)
81
- .value("E57_INTEGER", NodeType::E57_INTEGER)
82
- .value("E57_SCALED_INTEGER", NodeType::E57_SCALED_INTEGER)
83
- .value("E57_FLOAT", NodeType::E57_FLOAT)
84
- .value("E57_STRING", NodeType::E57_STRING)
85
- .value("E57_BLOB", NodeType::E57_BLOB)
86
- .export_values();
87
- py::enum_<FloatPrecision>(m, "FloatPrecision")
88
- .value("E57_SINGLE", FloatPrecision::E57_SINGLE)
89
- .value("E57_DOUBLE", FloatPrecision::E57_DOUBLE)
90
- .export_values();
91
- py::enum_<MemoryRepresentation>(m, "MemoryRepresentation")
92
- .value("E57_INT8", MemoryRepresentation::E57_INT8)
93
- .value("E57_UINT8", MemoryRepresentation::E57_UINT8)
94
- .value("E57_INT16", MemoryRepresentation::E57_INT16)
95
- .value("E57_UINT16", MemoryRepresentation::E57_UINT16)
96
- .value("E57_INT32", MemoryRepresentation::E57_INT32)
97
- .value("E57_UINT32", MemoryRepresentation::E57_UINT32)
98
- .value("E57_INT64", MemoryRepresentation::E57_INT64)
99
- .value("E57_BOOL", MemoryRepresentation::E57_BOOL)
100
- .value("E57_REAL32", MemoryRepresentation::E57_REAL32)
101
- .value("E57_REAL64", MemoryRepresentation::E57_REAL64)
102
- .value("E57_USTRING", MemoryRepresentation::E57_USTRING)
103
- .export_values();
104
- py::enum_<ErrorCode>(m, "ErrorCode")
105
- .value("E57_SUCCESS", ErrorCode::E57_SUCCESS)
106
- .value("E57_ERROR_BAD_CV_HEADER", ErrorCode::E57_ERROR_BAD_CV_HEADER)
107
- .value("E57_ERROR_BAD_CV_PACKET", ErrorCode::E57_ERROR_BAD_CV_PACKET)
108
- .value("E57_ERROR_CHILD_INDEX_OUT_OF_BOUNDS", ErrorCode::E57_ERROR_CHILD_INDEX_OUT_OF_BOUNDS)
109
- .value("E57_ERROR_SET_TWICE", ErrorCode::E57_ERROR_SET_TWICE)
110
- .value("E57_ERROR_HOMOGENEOUS_VIOLATION", ErrorCode::E57_ERROR_HOMOGENEOUS_VIOLATION)
111
- .value("E57_ERROR_VALUE_NOT_REPRESENTABLE", ErrorCode::E57_ERROR_VALUE_NOT_REPRESENTABLE)
112
- .value("E57_ERROR_SCALED_VALUE_NOT_REPRESENTABLE", ErrorCode::E57_ERROR_SCALED_VALUE_NOT_REPRESENTABLE)
113
- .value("E57_ERROR_REAL64_TOO_LARGE", ErrorCode::E57_ERROR_REAL64_TOO_LARGE)
114
- .value("E57_ERROR_EXPECTING_NUMERIC", ErrorCode::E57_ERROR_EXPECTING_NUMERIC)
115
- .value("E57_ERROR_EXPECTING_USTRING", ErrorCode::E57_ERROR_EXPECTING_USTRING)
116
- .value("E57_ERROR_INTERNAL", ErrorCode::E57_ERROR_INTERNAL)
117
- .value("E57_ERROR_BAD_XML_FORMAT", ErrorCode::E57_ERROR_BAD_XML_FORMAT)
118
- .value("E57_ERROR_XML_PARSER", ErrorCode::E57_ERROR_XML_PARSER)
119
- .value("E57_ERROR_BAD_API_ARGUMENT", ErrorCode::E57_ERROR_BAD_API_ARGUMENT)
120
- .value("E57_ERROR_FILE_IS_READ_ONLY", ErrorCode::E57_ERROR_FILE_IS_READ_ONLY)
121
- .value("E57_ERROR_BAD_CHECKSUM", ErrorCode::E57_ERROR_BAD_CHECKSUM)
122
- .value("E57_ERROR_OPEN_FAILED", ErrorCode::E57_ERROR_OPEN_FAILED)
123
- .value("E57_ERROR_CLOSE_FAILED", ErrorCode::E57_ERROR_CLOSE_FAILED)
124
- .value("E57_ERROR_READ_FAILED", ErrorCode::E57_ERROR_READ_FAILED)
125
- .value("E57_ERROR_WRITE_FAILED", ErrorCode::E57_ERROR_WRITE_FAILED)
126
- .value("E57_ERROR_LSEEK_FAILED", ErrorCode::E57_ERROR_LSEEK_FAILED)
127
- .value("E57_ERROR_PATH_UNDEFINED", ErrorCode::E57_ERROR_PATH_UNDEFINED)
128
- .value("E57_ERROR_BAD_BUFFER", ErrorCode::E57_ERROR_BAD_BUFFER)
129
- .value("E57_ERROR_NO_BUFFER_FOR_ELEMENT", ErrorCode::E57_ERROR_NO_BUFFER_FOR_ELEMENT)
130
- .value("E57_ERROR_BUFFER_SIZE_MISMATCH", ErrorCode::E57_ERROR_BUFFER_SIZE_MISMATCH)
131
- .value("E57_ERROR_BUFFER_DUPLICATE_PATHNAME", ErrorCode::E57_ERROR_BUFFER_DUPLICATE_PATHNAME)
132
- .value("E57_ERROR_BAD_FILE_SIGNATURE", ErrorCode::E57_ERROR_BAD_FILE_SIGNATURE)
133
- .value("E57_ERROR_UNKNOWN_FILE_VERSION", ErrorCode::E57_ERROR_UNKNOWN_FILE_VERSION)
134
- .value("E57_ERROR_BAD_FILE_LENGTH", ErrorCode::E57_ERROR_BAD_FILE_LENGTH)
135
- .value("E57_ERROR_XML_PARSER_INIT", ErrorCode::E57_ERROR_XML_PARSER_INIT)
136
- .value("E57_ERROR_DUPLICATE_NAMESPACE_PREFIX", ErrorCode::E57_ERROR_DUPLICATE_NAMESPACE_PREFIX)
137
- .value("E57_ERROR_DUPLICATE_NAMESPACE_URI", ErrorCode::E57_ERROR_DUPLICATE_NAMESPACE_URI)
138
- .value("E57_ERROR_BAD_PROTOTYPE", ErrorCode::E57_ERROR_BAD_PROTOTYPE)
139
- .value("E57_ERROR_BAD_CODECS", ErrorCode::E57_ERROR_BAD_CODECS)
140
- .value("E57_ERROR_VALUE_OUT_OF_BOUNDS", ErrorCode::E57_ERROR_VALUE_OUT_OF_BOUNDS)
141
- .value("E57_ERROR_CONVERSION_REQUIRED", ErrorCode::E57_ERROR_CONVERSION_REQUIRED)
142
- .value("E57_ERROR_BAD_PATH_NAME", ErrorCode::E57_ERROR_BAD_PATH_NAME)
143
- .value("E57_ERROR_NOT_IMPLEMENTED", ErrorCode::E57_ERROR_NOT_IMPLEMENTED)
144
- .value("E57_ERROR_BAD_NODE_DOWNCAST", ErrorCode::E57_ERROR_BAD_NODE_DOWNCAST)
145
- .value("E57_ERROR_WRITER_NOT_OPEN", ErrorCode::E57_ERROR_WRITER_NOT_OPEN)
146
- .value("E57_ERROR_READER_NOT_OPEN", ErrorCode::E57_ERROR_READER_NOT_OPEN)
147
- .value("E57_ERROR_NODE_UNATTACHED", ErrorCode::E57_ERROR_NODE_UNATTACHED)
148
- .value("E57_ERROR_ALREADY_HAS_PARENT", ErrorCode::E57_ERROR_ALREADY_HAS_PARENT)
149
- .value("E57_ERROR_DIFFERENT_DEST_IMAGEFILE", ErrorCode::E57_ERROR_DIFFERENT_DEST_IMAGEFILE)
150
- .value("E57_ERROR_IMAGEFILE_NOT_OPEN", ErrorCode::E57_ERROR_IMAGEFILE_NOT_OPEN)
151
- .value("E57_ERROR_BUFFERS_NOT_COMPATIBLE", ErrorCode::E57_ERROR_BUFFERS_NOT_COMPATIBLE)
152
- .value("E57_ERROR_TOO_MANY_WRITERS", ErrorCode::E57_ERROR_TOO_MANY_WRITERS)
153
- .value("E57_ERROR_TOO_MANY_READERS", ErrorCode::E57_ERROR_TOO_MANY_READERS)
154
- .value("E57_ERROR_BAD_CONFIGURATION", ErrorCode::E57_ERROR_BAD_CONFIGURATION)
155
- .value("E57_ERROR_INVARIANCE_VIOLATION", ErrorCode::E57_ERROR_INVARIANCE_VIOLATION)
156
- .export_values();
157
- py::class_<Node> cls_Node(m, "Node");
158
- cls_Node.def("type", &Node::type);
159
- cls_Node.def("isRoot", &Node::isRoot);
160
- cls_Node.def("parent", &Node::parent);
161
- cls_Node.def("pathName", &Node::pathName);
162
- cls_Node.def("elementName", &Node::elementName);
163
- cls_Node.def("destImageFile", &Node::destImageFile);
164
- cls_Node.def("isAttached", &Node::isAttached);
165
- cls_Node.def("checkInvariant", &Node::checkInvariant, "doRecurse"_a=true, "doDowncast"_a=true);
166
- cls_Node.def("__repr__", [](const Node &node) {
167
- return "<Node '" + node.elementName() + "'>";
168
- });
169
-
170
- py::class_<StructureNode> cls_StructureNode(m, "StructureNode");
171
- cls_StructureNode.def(py::init<e57::ImageFile>(), "destImageFile"_a);
172
- cls_StructureNode.def("childCount", &StructureNode::childCount);
173
- cls_StructureNode.def("isDefined", &StructureNode::isDefined, "pathName"_a);
174
- cls_StructureNode.def("get", (Node (StructureNode::*)(int64_t) const) &StructureNode::get, "index"_a);
175
- cls_StructureNode.def("get", (Node (StructureNode::*)(const std::string &) const) &StructureNode::get, "pathName"_a);
176
- // Maybe there is a more elegant way to do this
177
- cls_StructureNode.def("set", [](StructureNode &node, const std::string &pathName, StructureNode &n){
178
- node.set(pathName, n);
179
- }, "pathName"_a, "n"_a);
180
- cls_StructureNode.def("set", [](StructureNode &node, const std::string &pathName, VectorNode &n){
181
- node.set(pathName, n);
182
- }, "pathName"_a, "n"_a);
183
- cls_StructureNode.def("set", [](StructureNode &node, const std::string &pathName, CompressedVectorNode &n){
184
- node.set(pathName, n);
185
- }, "pathName"_a, "n"_a);
186
- cls_StructureNode.def("set", [](StructureNode &node, const std::string &pathName, IntegerNode &n){
187
- node.set(pathName, n);
188
- }, "pathName"_a, "n"_a);
189
- cls_StructureNode.def("set", [](StructureNode &node, const std::string &pathName, ScaledIntegerNode &n){
190
- node.set(pathName, n);
191
- }, "pathName"_a, "n"_a);
192
- cls_StructureNode.def("set", [](StructureNode &node, const std::string &pathName, FloatNode &n){
193
- node.set(pathName, n);
194
- }, "pathName"_a, "n"_a);
195
- cls_StructureNode.def("set", [](StructureNode &node, const std::string &pathName, StringNode &n){
196
- node.set(pathName, n);
197
- }, "pathName"_a, "n"_a);
198
- cls_StructureNode.def(py::init<const e57::Node &>(), "n"_a);
199
- cls_StructureNode.def("isRoot", &StructureNode::isRoot);
200
- cls_StructureNode.def("parent", &StructureNode::parent);
201
- cls_StructureNode.def("pathName", &StructureNode::pathName);
202
- cls_StructureNode.def("elementName", &StructureNode::elementName);
203
- cls_StructureNode.def("destImageFile", &StructureNode::destImageFile);
204
- cls_StructureNode.def("isAttached", &StructureNode::isAttached);
205
- cls_StructureNode.def("checkInvariant", &StructureNode::checkInvariant, "doRecurse"_a=true, "doUpcast"_a=true);
206
- cls_StructureNode.def("__len__", &StructureNode::childCount);
207
- cls_StructureNode.def("__getitem__", [](const StructureNode &node, const std::string &pathName) {
208
- Node n = node.get(pathName);
209
- return cast_node(n);
210
- });
211
- cls_StructureNode.def("__getitem__", [](const StructureNode &node, int64_t index) {
212
- if (index >= node.childCount() || index < 0)
213
- throw py::index_error();
214
- Node n = node.get(index);
215
- return cast_node(n);
216
- });
217
- cls_StructureNode.def("__repr__", [](const StructureNode &node) {
218
- return "<StructureNode '" + node.elementName() + "'>";
219
- });
220
-
221
- py::class_<VectorNode> cls_VectorNode(m, "VectorNode");
222
- cls_VectorNode.def(py::init<e57::ImageFile, bool>(), "destImageFile"_a, "allowHeteroChildren"_a=false);
223
- cls_VectorNode.def("allowHeteroChildren", &VectorNode::allowHeteroChildren);
224
- cls_VectorNode.def("childCount", &VectorNode::childCount);
225
- cls_VectorNode.def("isDefined", &VectorNode::isDefined, "pathName"_a);
226
- cls_VectorNode.def("get", (Node (VectorNode::*)(int64_t) const) &VectorNode::get, "index"_a);
227
- cls_VectorNode.def("get", (Node (VectorNode::*)(const std::string &) const) &VectorNode::get, "pathName"_a);
228
- // Maybe there is a more elegant way to do this
229
- cls_VectorNode.def("append", [](VectorNode &v, StructureNode &node) { v.append(node); });
230
- cls_VectorNode.def("append", [](VectorNode &v, VectorNode &node) { v.append(node); });
231
- cls_VectorNode.def("append", [](VectorNode &v, CompressedVectorNode &node) { v.append(node); });
232
- cls_VectorNode.def("append", [](VectorNode &v, IntegerNode &node) { v.append(node); });
233
- cls_VectorNode.def("append", [](VectorNode &v, ScaledIntegerNode &node) { v.append(node); });
234
- cls_VectorNode.def("append", [](VectorNode &v, FloatNode &node) { v.append(node); });
235
- cls_VectorNode.def("append", [](VectorNode &v, StringNode &node) { v.append(node); });
236
- cls_VectorNode.def(py::init<const e57::Node &>(), "n"_a);
237
- cls_VectorNode.def("isRoot", &VectorNode::isRoot);
238
- cls_VectorNode.def("parent", &VectorNode::parent);
239
- cls_VectorNode.def("pathName", &VectorNode::pathName);
240
- cls_VectorNode.def("elementName", &VectorNode::elementName);
241
- cls_VectorNode.def("destImageFile", &VectorNode::destImageFile);
242
- cls_VectorNode.def("isAttached", &VectorNode::isAttached);
243
- cls_VectorNode.def("checkInvariant", &VectorNode::checkInvariant, "doRecurse"_a=true, "doUpcast"_a=true);
244
- cls_VectorNode.def("__len__", &VectorNode::childCount);
245
- cls_VectorNode.def("__getitem__", [](const VectorNode &node, const std::string &pathName) {
246
- Node n = node.get(pathName);
247
- return cast_node(n);
248
- });
249
- cls_VectorNode.def("__getitem__", [](const VectorNode &node, int64_t index) {
250
- if (index >= node.childCount() || index < 0)
251
- throw py::index_error();
252
- Node n = node.get(index);
253
- return cast_node(n);
254
- });
255
- cls_VectorNode.def("__repr__", [](const VectorNode &node) {
256
- return "<VectorNode '" + node.elementName() + "'>";
257
- });
258
-
259
- py::class_<SourceDestBuffer> cls_SourceDestBuffer(m, "SourceDestBuffer");
260
- cls_SourceDestBuffer.def("__init__", [](SourceDestBuffer &s,
261
- e57::ImageFile imf,
262
- const std::string pathName,
263
- py::buffer np_array,
264
- const size_t capacity,
265
- bool doConversion,
266
- bool doScaling,
267
- size_t stride=0) {
268
- py::buffer_info info = np_array.request();
269
-
270
- if (info.ndim != 1)
271
- throw std::runtime_error("Incompatible buffer dimension!");
272
-
273
- if (info.format == "b")
274
- new (&s) SourceDestBuffer(imf, pathName, static_cast<int8_t *>(info.ptr), capacity, doConversion, doScaling, (stride == 0) ? sizeof(int8_t) : stride);
275
- else if (info.format == "B")
276
- new (&s) SourceDestBuffer(imf, pathName, static_cast<uint8_t *>(info.ptr), capacity, doConversion, doScaling, (stride == 0) ? sizeof(uint8_t) : stride);
277
- else if (info.format == "h")
278
- new (&s) SourceDestBuffer(imf, pathName, static_cast<int16_t *>(info.ptr), capacity, doConversion, doScaling, (stride == 0) ? sizeof(int16_t) : stride);
279
- else if (info.format == "H")
280
- new (&s) SourceDestBuffer(imf, pathName, static_cast<uint16_t *>(info.ptr), capacity, doConversion, doScaling, (stride == 0) ? sizeof(uint16_t) : stride);
281
- else if (info.format == "l")
282
- new (&s) SourceDestBuffer(imf, pathName, static_cast<int32_t *>(info.ptr), capacity, doConversion, doScaling, (stride == 0) ? sizeof(int32_t) : stride);
283
- else if (info.format == "L")
284
- new (&s) SourceDestBuffer(imf, pathName, static_cast<uint32_t *>(info.ptr), capacity, doConversion, doScaling, (stride == 0) ? sizeof(uint32_t) : stride);
285
- else if (info.format == "q")
286
- new (&s) SourceDestBuffer(imf, pathName, static_cast<int64_t *>(info.ptr), capacity, doConversion, doScaling, (stride == 0) ? sizeof(int64_t) : stride);
287
- else if (info.format == "?")
288
- new (&s) SourceDestBuffer(imf, pathName, static_cast<bool *>(info.ptr), capacity, doConversion, doScaling, (stride == 0) ? sizeof(bool) : stride);
289
- else if (info.format == "f")
290
- new (&s) SourceDestBuffer(imf, pathName, static_cast<float *>(info.ptr), capacity, doConversion, doScaling, (stride == 0) ? sizeof(float) : stride);
291
- else if (info.format == "d")
292
- new (&s) SourceDestBuffer(imf, pathName, static_cast<double *>(info.ptr), capacity, doConversion, doScaling, (stride == 0) ? sizeof(double) : stride);
293
- else
294
- throw py::value_error("Incompatible type (integers: bBhHlLq, bool: ?, floats: fd)");
295
- },
296
- "destImageFile"_a, "pathName"_a, "b"_a, "capacity"_a, "doConversion"_a=false, "doScaling"_a=false, "stride"_a=0);
297
- // cls_SourceDestBuffer.def(py::init<e57::ImageFile, const std::string, int8_t *, const size_t, bool, bool, size_t>(), "destImageFile"_a, "pathName"_a, "b"_a, "capacity"_a, "doConversion"_a=false, "doScaling"_a=false, "stride"_a=sizeof(int8_t));
298
- // cls_SourceDestBuffer.def(py::init<e57::ImageFile, const std::string, uint8_t *, const size_t, bool, bool, size_t>(), "destImageFile"_a, "pathName"_a, "b"_a, "capacity"_a, "doConversion"_a=false, "doScaling"_a=false, "stride"_a=sizeof(uint8_t));
299
- // cls_SourceDestBuffer.def(py::init<e57::ImageFile, const std::string, int16_t *, const size_t, bool, bool, size_t>(), "destImageFile"_a, "pathName"_a, "b"_a, "capacity"_a, "doConversion"_a=false, "doScaling"_a=false, "stride"_a=sizeof(int16_t));
300
- // cls_SourceDestBuffer.def(py::init<e57::ImageFile, const std::string, uint16_t *, const size_t, bool, bool, size_t>(), "destImageFile"_a, "pathName"_a, "b"_a, "capacity"_a, "doConversion"_a=false, "doScaling"_a=false, "stride"_a=sizeof(uint16_t));
301
- // cls_SourceDestBuffer.def(py::init<e57::ImageFile, const std::string, int32_t *, const size_t, bool, bool, size_t>(), "destImageFile"_a, "pathName"_a, "b"_a, "capacity"_a, "doConversion"_a=false, "doScaling"_a=false, "stride"_a=sizeof(int32_t));
302
- // cls_SourceDestBuffer.def(py::init<e57::ImageFile, const std::string, uint32_t *, const size_t, bool, bool, size_t>(), "destImageFile"_a, "pathName"_a, "b"_a, "capacity"_a, "doConversion"_a=false, "doScaling"_a=false, "stride"_a=sizeof(uint32_t));
303
- // cls_SourceDestBuffer.def(py::init<e57::ImageFile, const std::string, int64_t *, const size_t, bool, bool, size_t>(), "destImageFile"_a, "pathName"_a, "b"_a, "capacity"_a, "doConversion"_a=false, "doScaling"_a=false, "stride"_a=sizeof(int64_t));
304
- // cls_SourceDestBuffer.def(py::init<e57::ImageFile, const std::string, bool *, const size_t, bool, bool, size_t>(), "destImageFile"_a, "pathName"_a, "b"_a, "capacity"_a, "doConversion"_a=false, "doScaling"_a=false, "stride"_a=sizeof(bool));
305
- // cls_SourceDestBuffer.def(py::init<e57::ImageFile, const std::string, float *, const size_t, bool, bool, size_t>(), "destImageFile"_a, "pathName"_a, "b"_a, "capacity"_a, "doConversion"_a=false, "doScaling"_a=false, "stride"_a=sizeof(float));
306
- // cls_SourceDestBuffer.def(py::init<e57::ImageFile, const std::string, double *, const size_t, bool, bool, size_t>(), "destImageFile"_a, "pathName"_a, "b"_a, "capacity"_a, "doConversion"_a=false, "doScaling"_a=false, "stride"_a=sizeof(double));
307
- // cls_SourceDestBuffer.def(py::init<e57::ImageFile, const std::string, std::vector<ustring> *>(), "destImageFile"_a, "pathName"_a, "b"_a);
308
- cls_SourceDestBuffer.def("pathName", &SourceDestBuffer::pathName);
309
- cls_SourceDestBuffer.def("capacity", &SourceDestBuffer::capacity);
310
- cls_SourceDestBuffer.def("doConversion", &SourceDestBuffer::doConversion);
311
- cls_SourceDestBuffer.def("doScaling", &SourceDestBuffer::doScaling);
312
- cls_SourceDestBuffer.def("stride", &SourceDestBuffer::stride);
313
- cls_SourceDestBuffer.def("checkInvariant", &SourceDestBuffer::checkInvariant, "doRecurse"_a=true);
314
- cls_SourceDestBuffer.def("__repr__", [](const SourceDestBuffer &bf) {
315
- return "<SourceDestBuffer '" + bf.pathName() + "'>";
316
- });
317
-
318
- py::class_<CompressedVectorReader> cls_CompressedVectorReader(m, "CompressedVectorReader");
319
- cls_CompressedVectorReader.def("read", (unsigned (CompressedVectorReader::*)(void)) &CompressedVectorReader::read);
320
- cls_CompressedVectorReader.def("read", (unsigned (CompressedVectorReader::*)(std::vector<SourceDestBuffer> &)) &CompressedVectorReader::read, "dbufs"_a);
321
- cls_CompressedVectorReader.def("seek", &CompressedVectorReader::seek, "recordNumber"_a);
322
- cls_CompressedVectorReader.def("close", &CompressedVectorReader::close);
323
- cls_CompressedVectorReader.def("isOpen", &CompressedVectorReader::isOpen);
324
- cls_CompressedVectorReader.def("compressedVectorNode", &CompressedVectorReader::compressedVectorNode);
325
- cls_CompressedVectorReader.def("checkInvariant", &CompressedVectorReader::checkInvariant, "doRecurse"_a=true);
326
- cls_CompressedVectorReader.def("__del__", [](CompressedVectorReader &r) { r.close(); });
327
-
328
- py::class_<CompressedVectorWriter> cls_CompressedVectorWriter(m, "CompressedVectorWriter");
329
- cls_CompressedVectorWriter.def("write", (void (CompressedVectorWriter::*)(const size_t)) &CompressedVectorWriter::write, "requestedRecordCount"_a);
330
- cls_CompressedVectorWriter.def("write", (void (CompressedVectorWriter::*)(std::vector<SourceDestBuffer> &, const size_t)) &CompressedVectorWriter::write, "sbufs"_a, "requestedRecordCount"_a);
331
- cls_CompressedVectorWriter.def("close", &CompressedVectorWriter::close);
332
- cls_CompressedVectorWriter.def("isOpen", &CompressedVectorWriter::isOpen);
333
- cls_CompressedVectorWriter.def("compressedVectorNode", &CompressedVectorWriter::compressedVectorNode);
334
- cls_CompressedVectorWriter.def("checkInvariant", &CompressedVectorWriter::checkInvariant, "doRecurse"_a=true);
335
- cls_CompressedVectorWriter.def("__del__", [](CompressedVectorWriter &r) { r.close(); });
336
-
337
- py::class_<CompressedVectorNode> cls_CompressedVectorNode(m, "CompressedVectorNode");
338
- cls_CompressedVectorNode.def(py::init<e57::ImageFile, e57::Node, e57::VectorNode>(), "destImageFile"_a, "prototype"_a, "codecs"_a);
339
- cls_CompressedVectorNode.def("__init__", [](CompressedVectorNode &n, e57::ImageFile &imf, e57::StructureNode &node, e57::VectorNode &vector_node) {
340
- new (&n) CompressedVectorNode(imf, node, vector_node);
341
- });
342
- cls_CompressedVectorNode.def("childCount", &CompressedVectorNode::childCount);
343
- cls_CompressedVectorNode.def("prototype", &CompressedVectorNode::prototype);
344
- cls_CompressedVectorNode.def("codecs", &CompressedVectorNode::codecs);
345
- cls_CompressedVectorNode.def("writer", &CompressedVectorNode::writer, "sbufs"_a);
346
- cls_CompressedVectorNode.def("reader", &CompressedVectorNode::reader, "dbufs"_a);
347
- cls_CompressedVectorNode.def(py::init<const e57::Node &>(), "n"_a);
348
- cls_CompressedVectorNode.def("isRoot", &CompressedVectorNode::isRoot);
349
- cls_CompressedVectorNode.def("parent", &CompressedVectorNode::parent);
350
- cls_CompressedVectorNode.def("pathName", &CompressedVectorNode::pathName);
351
- cls_CompressedVectorNode.def("elementName", &CompressedVectorNode::elementName);
352
- cls_CompressedVectorNode.def("destImageFile", &CompressedVectorNode::destImageFile);
353
- cls_CompressedVectorNode.def("isAttached", &CompressedVectorNode::isAttached);
354
- cls_CompressedVectorNode.def("checkInvariant", &CompressedVectorNode::checkInvariant, "doRecurse"_a=true, "doUpcast"_a=true);
355
- cls_CompressedVectorNode.def("__repr__", [](const CompressedVectorNode &node) {
356
- return "<CompressedVectorNode '" + node.elementName() + "'>";
357
- });
358
-
359
- py::class_<IntegerNode> cls_IntegerNode(m, "IntegerNode");
360
- cls_IntegerNode.def(py::init<e57::ImageFile, int64_t, int64_t, int64_t>(), "destImageFile"_a, "value"_a=0, "minimum"_a=E57_INT64_MIN, "maximum"_a=E57_INT64_MAX);
361
- cls_IntegerNode.def("value", &IntegerNode::value);
362
- cls_IntegerNode.def("minimum", &IntegerNode::minimum);
363
- cls_IntegerNode.def("maximum", &IntegerNode::maximum);
364
- cls_IntegerNode.def(py::init<const e57::Node &>(), "n"_a);
365
- cls_IntegerNode.def("isRoot", &IntegerNode::isRoot);
366
- cls_IntegerNode.def("parent", &IntegerNode::parent);
367
- cls_IntegerNode.def("pathName", &IntegerNode::pathName);
368
- cls_IntegerNode.def("elementName", &IntegerNode::elementName);
369
- cls_IntegerNode.def("destImageFile", &IntegerNode::destImageFile);
370
- cls_IntegerNode.def("isAttached", &IntegerNode::isAttached);
371
- cls_IntegerNode.def("checkInvariant", &IntegerNode::checkInvariant, "doRecurse"_a=true, "doUpcast"_a=true);
372
- cls_IntegerNode.def("__repr__", [](const IntegerNode &node) {
373
- return "<IntegerNode '" + node.elementName() + "'>";
374
- });
375
-
376
- py::class_<ScaledIntegerNode> cls_ScaledIntegerNode(m, "ScaledIntegerNode");
377
- cls_ScaledIntegerNode.def(py::init<e57::ImageFile, int64_t, int64_t, int64_t, double, double>(), "destImageFile"_a, "value"_a, "minimum"_a, "maximum"_a, "scale"_a=1.0, "offset"_a=0.0);
378
- cls_ScaledIntegerNode.def(py::init<e57::ImageFile, int, int64_t, int64_t, double, double>(), "destImageFile"_a, "value"_a, "minimum"_a, "maximum"_a, "scale"_a=1.0, "offset"_a=0.0);
379
- cls_ScaledIntegerNode.def(py::init<e57::ImageFile, int, int, int, double, double>(), "destImageFile"_a, "value"_a, "minimum"_a, "maximum"_a, "scale"_a=1.0, "offset"_a=0.0);
380
- cls_ScaledIntegerNode.def(py::init<e57::ImageFile, double, double, double, double, double>(), "destImageFile"_a, "scaledValue"_a, "scaledMinimum"_a, "scaledMaximum"_a, "scale"_a=1.0, "offset"_a=0.0);
381
- cls_ScaledIntegerNode.def("rawValue", &ScaledIntegerNode::rawValue);
382
- cls_ScaledIntegerNode.def("scaledValue", &ScaledIntegerNode::scaledValue);
383
- cls_ScaledIntegerNode.def("minimum", &ScaledIntegerNode::minimum);
384
- cls_ScaledIntegerNode.def("scaledMinimum", &ScaledIntegerNode::scaledMinimum);
385
- cls_ScaledIntegerNode.def("maximum", &ScaledIntegerNode::maximum);
386
- cls_ScaledIntegerNode.def("scaledMaximum", &ScaledIntegerNode::scaledMaximum);
387
- cls_ScaledIntegerNode.def("scale", &ScaledIntegerNode::scale);
388
- cls_ScaledIntegerNode.def("offset", &ScaledIntegerNode::offset);
389
- cls_ScaledIntegerNode.def(py::init<const e57::Node &>(), "n"_a);
390
- cls_ScaledIntegerNode.def("isRoot", &ScaledIntegerNode::isRoot);
391
- cls_ScaledIntegerNode.def("parent", &ScaledIntegerNode::parent);
392
- cls_ScaledIntegerNode.def("pathName", &ScaledIntegerNode::pathName);
393
- cls_ScaledIntegerNode.def("elementName", &ScaledIntegerNode::elementName);
394
- cls_ScaledIntegerNode.def("destImageFile", &ScaledIntegerNode::destImageFile);
395
- cls_ScaledIntegerNode.def("isAttached", &ScaledIntegerNode::isAttached);
396
- cls_ScaledIntegerNode.def("checkInvariant", &ScaledIntegerNode::checkInvariant, "doRecurse"_a=true, "doUpcast"_a=true);
397
- cls_ScaledIntegerNode.def("__repr__", [](const ScaledIntegerNode &node) {
398
- return "<ScaledIntegerNode '" + node.elementName() + "'>";
399
- });
400
-
401
- py::class_<FloatNode> cls_FloatNode(m, "FloatNode");
402
- cls_FloatNode.def(py::init<e57::ImageFile, double, FloatPrecision, double, double>(), "destImageFile"_a, "value"_a=0.0, "precision"_a=E57_DOUBLE, "minimum"_a=E57_DOUBLE_MIN, "maximum"_a=E57_DOUBLE_MAX);
403
- cls_FloatNode.def("value", &FloatNode::value);
404
- cls_FloatNode.def("precision", &FloatNode::precision);
405
- cls_FloatNode.def("minimum", &FloatNode::minimum);
406
- cls_FloatNode.def("maximum", &FloatNode::maximum);
407
- cls_FloatNode.def(py::init<const e57::Node &>(), "n"_a);
408
- cls_FloatNode.def("isRoot", &FloatNode::isRoot);
409
- cls_FloatNode.def("parent", &FloatNode::parent);
410
- cls_FloatNode.def("pathName", &FloatNode::pathName);
411
- cls_FloatNode.def("elementName", &FloatNode::elementName);
412
- cls_FloatNode.def("destImageFile", &FloatNode::destImageFile);
413
- cls_FloatNode.def("isAttached", &FloatNode::isAttached);
414
- cls_FloatNode.def("checkInvariant", &FloatNode::checkInvariant, "doRecurse"_a=true, "doUpcast"_a=true);
415
- cls_FloatNode.def("__repr__", [](const FloatNode &node) {
416
- return "<FloatNode '" + node.elementName() + "'>";
417
- });
418
-
419
- py::class_<StringNode> cls_StringNode(m, "StringNode");
420
- cls_StringNode.def(py::init<e57::ImageFile, const std::string>(), "destImageFile"_a, "value"_a="");
421
- cls_StringNode.def("value", &StringNode::value);
422
- cls_StringNode.def(py::init<const e57::Node &>(), "n"_a);
423
- cls_StringNode.def("isRoot", &StringNode::isRoot);
424
- cls_StringNode.def("parent", &StringNode::parent);
425
- cls_StringNode.def("pathName", &StringNode::pathName);
426
- cls_StringNode.def("elementName", &StringNode::elementName);
427
- cls_StringNode.def("destImageFile", &StringNode::destImageFile);
428
- cls_StringNode.def("isAttached", &StringNode::isAttached);
429
- cls_StringNode.def("checkInvariant", &StringNode::checkInvariant, "doRecurse"_a=true, "doUpcast"_a=true);
430
- cls_StringNode.def("__repr__", [](const StringNode &node) {
431
- return "<StringNode '" + node.elementName() + "'>";
432
- });
433
-
434
- py::class_<BlobNode> cls_BlobNode(m, "BlobNode");
435
- cls_BlobNode.def(py::init<e57::ImageFile, int64_t>(), "destImageFile"_a, "byteCount"_a);
436
- cls_BlobNode.def("byteCount", &BlobNode::byteCount);
437
- cls_BlobNode.def("read", [](BlobNode& node, py::buffer buf, int64_t start, size_t count) {
438
- py::buffer_info info = buf.request();
439
-
440
- if (info.ndim != 1) {
441
- throw std::runtime_error("Incompatible buffer dimension!");
442
- }
443
-
444
- if (info.format != "B") {
445
- throw std::runtime_error("Incompatible buffer type!");
446
- }
447
-
448
- if (static_cast<size_t>(info.shape[0]) < count) {
449
- throw std::runtime_error("Buffer not large enough to read.");
450
- }
451
-
452
- node.read(reinterpret_cast<uint8_t*>(info.ptr), start, count);
453
- });
454
- cls_BlobNode.def("write", [](BlobNode& node, py::buffer buf, int64_t start, size_t count) {
455
- py::buffer_info info = buf.request();
456
-
457
- if (info.ndim != 1) {
458
- throw std::runtime_error("Incompatible buffer dimension!");
459
- }
460
-
461
- if (info.format != "B") {
462
- throw std::runtime_error("Incompatible buffer type!");
463
- }
464
-
465
- if (static_cast<size_t>(info.shape[0]) < count) {
466
- throw std::runtime_error("Buffer not large enough to write.");
467
- }
468
-
469
- node.write(reinterpret_cast<uint8_t*>(info.ptr), start, count);
470
- });
471
- cls_BlobNode.def(py::init<const e57::Node &>(), "n"_a);
472
- cls_BlobNode.def("isRoot", &BlobNode::isRoot);
473
- cls_BlobNode.def("parent", &BlobNode::parent);
474
- cls_BlobNode.def("pathName", &BlobNode::pathName);
475
- cls_BlobNode.def("elementName", &BlobNode::elementName);
476
- cls_BlobNode.def("destImageFile", &BlobNode::destImageFile);
477
- cls_BlobNode.def("isAttached", &BlobNode::isAttached);
478
- cls_BlobNode.def("checkInvariant", &BlobNode::checkInvariant, "doRecurse"_a=true, "doUpcast"_a=true);
479
- cls_BlobNode.def("__repr__", [](const BlobNode &node) {
480
- return "<BlobNode '" + node.elementName() + "'>";
481
- });
482
- cls_BlobNode.def("read_buffer", [](BlobNode &node) -> py::array {
483
- int64_t bufferSizeExpected = node.byteCount();
484
- py::array_t<uint8_t> arr(bufferSizeExpected);
485
- node.read(arr.mutable_data(), 0, bufferSizeExpected);
486
- return arr;
487
- });
488
-
489
- py::class_<ImageFile> cls_ImageFile(m, "ImageFile");
490
- cls_ImageFile.def(py::init<const std::string &, const std::string &, int>(), "fname"_a, "mode"_a, "checksumPolicy"_a=CHECKSUM_POLICY_ALL);
491
- cls_ImageFile.def("root", &ImageFile::root);
492
- cls_ImageFile.def("close", &ImageFile::close);
493
- cls_ImageFile.def("cancel", &ImageFile::cancel);
494
- cls_ImageFile.def("isOpen", &ImageFile::isOpen);
495
- cls_ImageFile.def("isWritable", &ImageFile::isWritable);
496
- cls_ImageFile.def("fileName", &ImageFile::fileName);
497
- cls_ImageFile.def("writerCount", &ImageFile::writerCount);
498
- cls_ImageFile.def("readerCount", &ImageFile::readerCount);
499
- cls_ImageFile.def("extensionsAdd", &ImageFile::extensionsAdd, "prefix"_a, "uri"_a);
500
- cls_ImageFile.def("extensionsLookupPrefix", &ImageFile::extensionsLookupPrefix, "prefix"_a, "uri"_a);
501
- cls_ImageFile.def("extensionsLookupUri", &ImageFile::extensionsLookupUri, "uri"_a, "prefix"_a);
502
- cls_ImageFile.def("extensionsCount", &ImageFile::extensionsCount);
503
- cls_ImageFile.def("extensionsPrefix", &ImageFile::extensionsPrefix, "index"_a);
504
- cls_ImageFile.def("extensionsUri", &ImageFile::extensionsUri, "index"_a);
505
- cls_ImageFile.def("isElementNameExtended", &ImageFile::isElementNameExtended, "elementName"_a);
506
- cls_ImageFile.def("elementNameParse", &ImageFile::elementNameParse, "elementName"_a, "prefix"_a, "localPart"_a);
507
- cls_ImageFile.def("checkInvariant", &ImageFile::checkInvariant, "doRecurse"_a=true);
508
- cls_ImageFile.def("__repr__", [](const ImageFile &im) {
509
- return "<ImageFile '" + im.fileName() + "'>";
510
- });
511
-
512
- // py::class_<E57Exception> cls_E57Exception(m, "E57Exception");
513
- // cls_E57Exception.def("errorCode", &E57Exception::errorCode);
514
- // cls_E57Exception.def("context", &E57Exception::context);
515
- // cls_E57Exception.def("what", &E57Exception::what);
516
- // cls_E57Exception.def("sourceFileName", &E57Exception::sourceFileName);
517
- // cls_E57Exception.def("sourceFunctionName", &E57Exception::sourceFunctionName);
518
- // cls_E57Exception.def("sourceLineNumber", &E57Exception::sourceLineNumber);
519
-
520
- // py::class_<E57Utilities> cls_E57Utilities(m, "E57Utilities");
521
- // cls_E57Utilities.def(py::init<const std::string>(), "&"_a="");
522
- // cls_E57Utilities.def("getVersions", &E57Utilities::getVersions, "astmMajor"_a, "astmMinor"_a, "libraryId"_a);
523
- // cls_E57Utilities.def("errorCodeToString", &E57Utilities::errorCodeToString, "ecode"_a);
524
-
525
- py::bind_vector<std::vector<e57::SourceDestBuffer>>(m, "VectorSourceDestBuffer");
526
- }
@@ -1,14 +0,0 @@
1
- pye57/__init__.py,sha256=keWVF2W7Jau5voY0aufr6bayvjfDJSWf_bmawIvvj88,95
2
- pye57/__version__.py,sha256=075iz_wmJWFZOiHbuinNMyz1WJHo7tp0N817twjxQkQ,23
3
- pye57/e57.py,sha256=ec9_zxTvZ9TlnIVPMrzzB2wRHQg428F6EtWCCeg05K0,18950
4
- pye57/exception.py,sha256=9Qgriir0IsSpHhStN5uvI5mlbKrc_P5ZURsi_PIW_q8,50
5
- pye57/libe57.cp38-win_amd64.pyd,sha256=qASZM56nAX5XaxQCG4L8LdQIfMDk1OGW9zF0dOveolo,735744
6
- pye57/libe57_wrapper.cpp,sha256=zx2z2XuJtsoG2KPoX87qGmUmP-rV_gkn8fsHK5W_KAA,35152
7
- pye57/scan_header.py,sha256=39FD40CBcJL5azN_HjVNvSnFrQR3uO-MIQFFNRhUqRU,6036
8
- pye57/utils.py,sha256=GbuzETqw22KeDpnVc6dB9EUFBAs3gmhstoy67IyJDqU,1418
9
- pye57/xerces-c_3_2.dll,sha256=DGfiCpPVr8KauwtA2YXPkb0pWxTr99MxyispPHP9ZpM,2787328
10
- pye57-0.4.1.dist-info/LICENSE,sha256=Q0K1iCfVm6UmnR4AAyqME5q7flnU6aGh5OarEIa2K6Y,1056
11
- pye57-0.4.1.dist-info/METADATA,sha256=H89DStwI5Qjd-2yD2JBnqzw_5z5Umg9zspoEE3AODwM,4159
12
- pye57-0.4.1.dist-info/WHEEL,sha256=M2GQ3lde8oJhlQPj2wbRvnqE3cuovPJasri5X5aCmck,100
13
- pye57-0.4.1.dist-info/top_level.txt,sha256=xD9HDzQ3BfGMuz1kI2uNKUR0KXcR-RtNEKigrkh48Nk,6
14
- pye57-0.4.1.dist-info/RECORD,,
File without changes