mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 10:45:52 +08:00
Replaced redundant constructor and pushed the raw pointer constructor into private scope.
This commit is contained in:
parent
f0fd8240da
commit
238e32666a
@ -28,7 +28,6 @@ TriangleMesh::TriangleMesh()
|
|||||||
stl_initialize(&this->stl);
|
stl_initialize(&this->stl);
|
||||||
}
|
}
|
||||||
|
|
||||||
TriangleMesh::TriangleMesh(const Pointf3s &points, const std::vector<Point3>& facets ) : TriangleMesh(points.data(), facets.data(), facets.size()) {}
|
|
||||||
TriangleMesh::TriangleMesh(const Pointf3* points, const Point3* facets, size_t n_facets)
|
TriangleMesh::TriangleMesh(const Pointf3* points, const Point3* facets, size_t n_facets)
|
||||||
: repaired(false)
|
: repaired(false)
|
||||||
{
|
{
|
||||||
|
@ -36,10 +36,10 @@ class TriangleMesh
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TriangleMesh();
|
TriangleMesh();
|
||||||
TriangleMesh(const Pointf3* points, const Point3* facets, size_t n_facets);
|
|
||||||
TriangleMesh(const Pointf3s &points, const std::vector<Point3> &facets);
|
|
||||||
|
|
||||||
/// Templated constructor to adapt containers that offer .data() and .size()
|
/// Templated constructor to adapt containers that offer .data() and .size()
|
||||||
|
/// First argument is a container (either vector or array) of Pointf3 for the vertex data.
|
||||||
|
/// Second argument is container of facets (currently Point3).
|
||||||
template <typename Vertex_Cont, typename Facet_Cont>
|
template <typename Vertex_Cont, typename Facet_Cont>
|
||||||
TriangleMesh(const Vertex_Cont& vertices, const Facet_Cont& facets) : TriangleMesh(vertices.data(), facets.data(), facets.size()) {}
|
TriangleMesh(const Vertex_Cont& vertices, const Facet_Cont& facets) : TriangleMesh(vertices.data(), facets.data(), facets.size()) {}
|
||||||
|
|
||||||
@ -143,6 +143,12 @@ class TriangleMesh
|
|||||||
bool repaired;
|
bool repaired;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/// Private constructor that is called from the public sphere.
|
||||||
|
/// It doesn't do any bounds checking on points and operates on raw pointers, so we hide it.
|
||||||
|
/// Other constructors can call this one!
|
||||||
|
TriangleMesh(const Pointf3* points, const Point3* facets, size_t n_facets);
|
||||||
|
|
||||||
friend class TriangleMeshSlicer<X>;
|
friend class TriangleMeshSlicer<X>;
|
||||||
friend class TriangleMeshSlicer<Y>;
|
friend class TriangleMeshSlicer<Y>;
|
||||||
friend class TriangleMeshSlicer<Z>;
|
friend class TriangleMeshSlicer<Z>;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user