| 806 | "); |
| 807 | |
| 808 | static PyObject * |
| 809 | Geom_union(PyObject* self, PyObject* args) |
| 810 | { |
| 811 | auto api = PyUtilApiFunction("sss|d", PyRunTimeErr, __func__); |
| 812 | char *aName; |
| 813 | char *bName; |
| 814 | char *dstName; |
| 815 | double tolerance = 1e-6; |
| 816 | |
| 817 | if (!PyArg_ParseTuple(args, api.format, &aName, &bName, &dstName, &tolerance)) { |
| 818 | return api.argsError(); |
| 819 | } |
| 820 | |
| 821 | // Retrieve operands geometry. |
| 822 | auto srcA = GetRepositoryGeometry(api, aName); |
| 823 | if (srcA == nullptr ) { |
| 824 | return nullptr; |
| 825 | } |
| 826 | auto srcB = GetRepositoryGeometry(api, bName); |
| 827 | if (srcB == nullptr ) { |
| 828 | return nullptr; |
| 829 | } |
| 830 | |
| 831 | if (RepositoryGeometryExists(api, dstName)) { |
| 832 | return nullptr; |
| 833 | } |
| 834 | |
| 835 | cvPolyData *dst; |
| 836 | if (sys_geom_union(srcA, srcB, tolerance, &dst) != SV_OK) { |
| 837 | api.error("Error performing a union operation of geometry '" + std::string(aName) + " with '" + std::string(bName)+ "."); |
| 838 | return nullptr; |
| 839 | } |
| 840 | |
| 841 | if (!AddGeometryToRepository(api, dstName, dst)) { |
| 842 | return nullptr; |
| 843 | } |
| 844 | |
| 845 | return Py_BuildValue("s", dst->GetName()); |
| 846 | } |
| 847 | |
| 848 | //---------------- |
| 849 | // Geom_intersect |
nothing calls this directly
no test coverage detected