| 757 | "); |
| 758 | |
| 759 | static PyObject * |
| 760 | Geom_reduce(PyObject* self, PyObject* args) |
| 761 | { |
| 762 | auto api = PyUtilApiFunction("ssd", PyRunTimeErr, __func__); |
| 763 | char *srcName; |
| 764 | char *dstName; |
| 765 | double tol; |
| 766 | |
| 767 | if (!PyArg_ParseTuple(args, api.format, &srcName, &dstName, &tol)) { |
| 768 | return api.argsError(); |
| 769 | } |
| 770 | |
| 771 | // Retrieve source object. |
| 772 | auto src = GetRepositoryGeometry(api, srcName); |
| 773 | if (src == NULL) { |
| 774 | return nullptr; |
| 775 | } |
| 776 | |
| 777 | // Check that the repository dstName object does not already exist. |
| 778 | if (RepositoryGeometryExists(api, dstName)) { |
| 779 | return nullptr; |
| 780 | } |
| 781 | |
| 782 | cvPolyData *dst; |
| 783 | if (sys_geom_Reduce(src, tol, &dst) != SV_OK) { |
| 784 | api.error("Error merging points for geometry '" + std::string(srcName) + "."); |
| 785 | return nullptr; |
| 786 | } |
| 787 | |
| 788 | if (!AddGeometryToRepository(api, dstName, dst)) { |
| 789 | return nullptr; |
| 790 | } |
| 791 | |
| 792 | return Py_BuildValue("s",dst->GetName()); |
| 793 | } |
| 794 | |
| 795 | //------------ |
| 796 | // Geom_union |
nothing calls this directly
no test coverage detected