[KSP] inlining functions (#8806)

## Summary of Changes

inlining functions to prevent multiple definition

## Release Management

* Affected package(s): KSP
* Issue(s) solved (if any): fix #8804
This commit is contained in:
Sebastien Loriot 2025-03-31 09:37:33 +02:00 committed by GitHub
commit 10ee028ee4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 14 deletions

View File

@ -40,7 +40,7 @@ namespace CGAL {
namespace KSP_3 { namespace KSP_3 {
namespace internal { namespace internal {
const std::tuple<unsigned char, unsigned char, unsigned char> inline const std::tuple<unsigned char, unsigned char, unsigned char>
get_idx_color(std::size_t idx) { get_idx_color(std::size_t idx) {
CGAL::Random rand(static_cast<unsigned int>(idx)); CGAL::Random rand(static_cast<unsigned int>(idx));
@ -50,7 +50,7 @@ get_idx_color(std::size_t idx) {
static_cast<unsigned char>(rand.get_int(32, 192))); static_cast<unsigned char>(rand.get_int(32, 192)));
} }
CGAL::IO::Color get_color(std::size_t idx) { inline CGAL::IO::Color get_color(std::size_t idx) {
CGAL::Random rand(static_cast<unsigned int>(idx)); CGAL::Random rand(static_cast<unsigned int>(idx));
return CGAL::IO::Color(rand.get_int(32, 192), rand.get_int(32, 192), rand.get_int(32, 192)); return CGAL::IO::Color(rand.get_int(32, 192), rand.get_int(32, 192), rand.get_int(32, 192));
} }
@ -929,7 +929,7 @@ void dump_polygon(const std::vector<typename K::Point_3>& pts, const std::string
saver.export_polygon_soup_3(pts2, filename); saver.export_polygon_soup_3(pts2, filename);
} }
void dump_polygon(const std::vector<CGAL::Epick::Point_3>& pts, const std::string& filename) { inline void dump_polygon(const std::vector<CGAL::Epick::Point_3>& pts, const std::string& filename) {
Saver<CGAL::Epick> saver; Saver<CGAL::Epick> saver;
std::vector<std::vector<CGAL::Epick::Point_3> > pts2; std::vector<std::vector<CGAL::Epick::Point_3> > pts2;
pts2.push_back(pts); pts2.push_back(pts);
@ -937,7 +937,7 @@ void dump_polygon(const std::vector<CGAL::Epick::Point_3>& pts, const std::strin
saver.export_polygon_soup_3(pts2, filename); saver.export_polygon_soup_3(pts2, filename);
} }
void dump_polygona(const std::vector<CGAL::Epick::Point_3>& pts, const std::string& filename) { inline void dump_polygona(const std::vector<CGAL::Epick::Point_3>& pts, const std::string& filename) {
Saver<CGAL::Epick> saver; Saver<CGAL::Epick> saver;
std::vector<std::vector<CGAL::Epick::Point_3> > pts2; std::vector<std::vector<CGAL::Epick::Point_3> > pts2;
pts2.push_back(pts); pts2.push_back(pts);
@ -945,30 +945,31 @@ void dump_polygona(const std::vector<CGAL::Epick::Point_3>& pts, const std::stri
saver.export_polygon_soup_3(pts2, filename); saver.export_polygon_soup_3(pts2, filename);
} }
void dump_polygons(const std::vector<std::vector<CGAL::Epick::Point_3> >& pts, const std::string& filename) { inline void dump_polygons(const std::vector<std::vector<CGAL::Epick::Point_3> >& pts, const std::string& filename) {
Saver<CGAL::Epick> saver;
saver.export_polygon_soup_3(pts, filename);
}
void dump_polygons(const std::vector<std::vector<std::vector<CGAL::Epick::Point_3> > >& pts, const std::string& filename) {
Saver<CGAL::Epick> saver; Saver<CGAL::Epick> saver;
saver.export_polygon_soup_3(pts, filename); saver.export_polygon_soup_3(pts, filename);
} }
void dump_indexed_triangles(const std::vector<CGAL::Epick::Point_3>& pts, const std::vector<std::size_t>& tris, const std::string& filename) { inline void dump_polygons(const std::vector<std::vector<std::vector<CGAL::Epick::Point_3> > >& pts, const std::string& filename) {
Saver<CGAL::Epick> saver;
saver.export_polygon_soup_3(pts, filename);
}
inline void dump_indexed_triangles(const std::vector<CGAL::Epick::Point_3>& pts, const std::vector<std::size_t>& tris, const std::string& filename) {
Saver<CGAL::Epick> saver; Saver<CGAL::Epick> saver;
saver.export_indexed_triangles_3(pts, tris, filename); saver.export_indexed_triangles_3(pts, tris, filename);
} }
void dump_indexed_polygons(const std::vector<CGAL::Epick::Point_3>& pts, const std::vector<std::vector<std::size_t> >& polys, const std::string& filename) { inline void dump_indexed_polygons(const std::vector<CGAL::Epick::Point_3>& pts, const std::vector<std::vector<std::size_t> >& polys, const std::string& filename) {
Saver<CGAL::Epick> saver; Saver<CGAL::Epick> saver;
saver.export_indexed_polygons_3(pts, polys, filename); saver.export_indexed_polygons_3(pts, polys, filename);
} }
void dump_polygons(const std::vector<std::vector<CGAL::Epick::Point_3> >& pts, const std::vector<CGAL::IO::Color>& colors, const std::string& filename) { inline void dump_polygons(const std::vector<std::vector<CGAL::Epick::Point_3> >& pts, const std::vector<CGAL::IO::Color>& colors, const std::string& filename) {
Saver<CGAL::Epick> saver; Saver<CGAL::Epick> saver;
saver.export_polygon_soup_3(pts, colors, filename); saver.export_polygon_soup_3(pts, colors, filename);
@ -1013,7 +1014,7 @@ void dump_polygons(
saver.export_polygon_soup_3(polygons, name); saver.export_polygon_soup_3(polygons, name);
} }
void dump_points(const std::vector<CGAL::Epick::Point_3>& pts, const std::vector<CGAL::Epick::Vector_3>& normals, const std::vector<CGAL::IO::Color>& colors, const std::string& filename) { inline void dump_points(const std::vector<CGAL::Epick::Point_3>& pts, const std::vector<CGAL::Epick::Vector_3>& normals, const std::vector<CGAL::IO::Color>& colors, const std::string& filename) {
Saver<CGAL::Epick> saver; Saver<CGAL::Epick> saver;
saver.export_points_3(pts, normals, colors, filename); saver.export_points_3(pts, normals, colors, filename);
} }