diff --git a/src/lib/tin.cpp b/src/lib/tin.cpp index 85e3ef3..54034a3 100644 --- a/src/lib/tin.cpp +++ b/src/lib/tin.cpp @@ -10,23 +10,6 @@ * Copyright (c) 2021-2031 Yi Zhang (zhangyiss@icloud.com) * All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. */ #include "tin.h" @@ -725,3 +708,19 @@ void dem2tin(const std::vector &dem, double xmin, double xmax, double ym } return; } + +/** + * @brief Generate the TIN from random DEM points + * + * @param dem Input DEM points + * @param out_verts The output vector of vertex's pointers. The user need to destroy the memories allocated by the function before destroy the vector + * @param out_tris The output vector of triangle's pointers. The user need to destroy the memories allocated by the function before destroy the vector + * @param[in] maxi_err Threshold to quit the algorithm. The default is 1e-0 + * @param[in] outline_poly If this pointer is not NULL, Cut triangle outside the polygon. + * @param[in] err_records If this pointer is not NULL, record maximal error values after each insertion of vertex. + */ +void rnd2tin(const std::vector &dem, std::vector &out_verts, std::vector &out_tris, + double maxi_err, std::vector *outline_poly, std::vector *err_records) +{ + return; +} diff --git a/src/lib/tin.h b/src/lib/tin.h index b298fd8..54b0715 100644 --- a/src/lib/tin.h +++ b/src/lib/tin.h @@ -10,23 +10,6 @@ * Copyright (c) 2021-2031 Yi Zhang (zhangyiss@icloud.com) * All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. */ #ifndef _TIN_DELAUNAY_H @@ -220,4 +203,18 @@ void dem2tin(const std::vector &dem, double xmin, double xmax, double ym double dx, double dy, std::vector &out_verts, std::vector &out_tris, double maxi_err = 1e-0, std::vector *err_records = nullptr); +/** + * @brief Generate the TIN from random DEM points + * + * @param dem Input DEM points + * @param out_verts The output vector of vertex's pointers. The user need to destroy the memories allocated by the function before destroy the vector + * @param out_tris The output vector of triangle's pointers. The user need to destroy the memories allocated by the function before destroy the vector + * @param[in] maxi_err Threshold to quit the algorithm. The default is 1e-0 + * @param[in] outline_poly If this pointer is not NULL, Cut triangle outside the polygon. + * @param[in] err_records If this pointer is not NULL, record maximal error values after each insertion of vertex. + */ +void rnd2tin(const std::vector &dem, std::vector &out_verts, + std::vector &out_tris, double maxi_err = 1e-0, std::vector *outline_poly = nullptr, + std::vector *err_records = nullptr); + #endif // _TIN_DELAUNAY_H \ No newline at end of file