Skip to content

Commit

Permalink
Pass more parameters by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
GilesBathgate committed Jul 27, 2024
1 parent ed2f8b2 commit db37389
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/cgalprimitive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ CGAL::NefPolyhedron3* CGALPrimitive::createPolyline(const CGAL::Segment3& s)
return createPolyline(pl);
}

CGAL::NefPolyhedron3* CGALPrimitive::createPolyline(QVector<CGAL::Point3> pl)
CGAL::NefPolyhedron3* CGALPrimitive::createPolyline(const QVector<CGAL::Point3>& pl)
{
using PointRange = QPair<CGAL::Point3*,CGAL::Point3*>;
using PointRange = QPair<const CGAL::Point3*,const CGAL::Point3*>;
using PolyLine = QVector<PointRange>;

const PointRange p(&*pl.begin(),&*pl.end());
Expand Down Expand Up @@ -1361,7 +1361,7 @@ Primitive* CGALPrimitive::hull(bool concave)
return this;
}

Primitive* CGALPrimitive::hull(QList<CGAL::Point3> pts)
Primitive* CGALPrimitive::hull(const QList<CGAL::Point3>& pts)
{
CGAL::Object o;
CGAL::convex_hull_3(pts.begin(),pts.end(),o);
Expand Down
4 changes: 2 additions & 2 deletions src/cgalprimitive.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CGALPrimitive : public Primitive
Primitive* glide(Primitive*) override;
Primitive* group(Primitive*) override;
Primitive* hull(bool) override;
Primitive* hull(QList<CGAL::Point3>) override;
Primitive* hull(const QList<CGAL::Point3>&) override;
Primitive* inset(const CGAL::Scalar&) override;
Primitive* intersection(Primitive*) override;
Primitive* join(Primitive*) override;
Expand Down Expand Up @@ -116,7 +116,7 @@ class CGALPrimitive : public Primitive
CGAL::NefPolyhedron3* createPolyline();
static CGAL::NefPolyhedron3* createPolyline(CGALPolygon*);
static CGAL::NefPolyhedron3* createPolyline(const CGAL::Segment3&);
static CGAL::NefPolyhedron3* createPolyline(QVector<CGAL::Point3>);
static CGAL::NefPolyhedron3* createPolyline(const QVector<CGAL::Point3>&);
CGAL::NefPolyhedron3* createPoints();
bool detectHoles(QList<CGALPolygon*>,bool);
bool hasHoles();
Expand Down
2 changes: 1 addition & 1 deletion src/polyhedron.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Polyhedron : public Primitive
Primitive* glide(Primitive*) override { return this; }
Primitive* group(Primitive*) override;
Primitive* hull(bool) override { return this; }
Primitive* hull(QList<Point>) override { return this; }
Primitive* hull(const QList<Point>&) override { return this; }
Primitive* inset(const decimal&) override { return this; }
Primitive* intersection(Primitive*) override;
Primitive* join(Primitive*) override;
Expand Down
2 changes: 1 addition & 1 deletion src/primitive.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Primitive
virtual Primitive* glide(Primitive*)=0;
virtual Primitive* group(Primitive*)=0;
virtual Primitive* hull(bool)=0;
virtual Primitive* hull(QList<Point>)=0;
virtual Primitive* hull(const QList<Point>&)=0;
virtual Primitive* inset(const decimal&)=0;
virtual Primitive* intersection(Primitive*)=0;
virtual Primitive* join(Primitive*)=0;
Expand Down

0 comments on commit db37389

Please sign in to comment.