Don't pass Eigen vectors by value. See also http://eigen.tuxfamily.org/dox/group__TopicPassingByValue.html
This commit is contained in:
parent
5ca85f0965
commit
5ec7b39999
8 changed files with 19 additions and 19 deletions
|
|
@ -93,7 +93,7 @@ PolySet *CGAL_Nef_polyhedron::convertToPolyset() const
|
|||
}
|
||||
#endif
|
||||
|
||||
void CGAL_Nef_polyhedron::resize(Vector3d newsize,
|
||||
void CGAL_Nef_polyhedron::resize(const Vector3d &newsize,
|
||||
const Eigen::Matrix<bool,3,1> &autosize)
|
||||
{
|
||||
// Based on resize() in Giles Bathgate's RapCAD (but not exactly)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public:
|
|||
// FIXME: Deprecated by CGALUtils::createPolySetFromNefPolyhedron3
|
||||
// class PolySet *convertToPolyset() const;
|
||||
void transform( const Transform3d &matrix );
|
||||
void resize(Vector3d newsize, const Eigen::Matrix<bool,3,1> &autosize);
|
||||
void resize(const Vector3d &newsize, const Eigen::Matrix<bool,3,1> &autosize);
|
||||
|
||||
shared_ptr<CGAL_Nef_polyhedron3> p3;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@
|
|||
#include "Polygon2d.h"
|
||||
#include "DrawingCallback.h"
|
||||
|
||||
DrawingCallback::DrawingCallback(unsigned long fn) : fn(fn),
|
||||
pen(Vector2d(0, 0)), offset(Vector2d(0, 0)), advance(Vector2d(0, 0))
|
||||
DrawingCallback::DrawingCallback(unsigned long fn) :
|
||||
pen(Vector2d(0, 0)), offset(Vector2d(0, 0)), advance(Vector2d(0, 0)), fn(fn)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -74,12 +74,12 @@ void DrawingCallback::add_glyph_advance(double advance_x, double advance_y)
|
|||
advance += Vector2d(advance_x, advance_y);
|
||||
}
|
||||
|
||||
void DrawingCallback::add_vertex(Vector2d v)
|
||||
void DrawingCallback::add_vertex(const Vector2d &v)
|
||||
{
|
||||
this->outline.vertices.push_back(v + offset + advance);
|
||||
}
|
||||
|
||||
void DrawingCallback::move_to(Vector2d to)
|
||||
void DrawingCallback::move_to(const Vector2d &to)
|
||||
{
|
||||
if (this->outline.vertices.size() > 0) {
|
||||
this->polygon->addOutline(this->outline);
|
||||
|
|
@ -89,14 +89,14 @@ void DrawingCallback::move_to(Vector2d to)
|
|||
pen = to;
|
||||
}
|
||||
|
||||
void DrawingCallback::line_to(Vector2d to)
|
||||
void DrawingCallback::line_to(const Vector2d &to)
|
||||
{
|
||||
add_vertex(to);
|
||||
pen = to;
|
||||
}
|
||||
|
||||
// Quadric Bezier curve
|
||||
void DrawingCallback::curve_to(Vector2d c1, Vector2d to)
|
||||
void DrawingCallback::curve_to(const Vector2d &c1, const Vector2d &to)
|
||||
{
|
||||
for (unsigned long idx = 1;idx <= fn;idx++) {
|
||||
const double a = idx * (1.0 / (double)fn);
|
||||
|
|
@ -108,7 +108,7 @@ void DrawingCallback::curve_to(Vector2d c1, Vector2d to)
|
|||
}
|
||||
|
||||
// Cubic Bezier curve
|
||||
void DrawingCallback::curve_to(Vector2d c1, Vector2d c2, Vector2d to)
|
||||
void DrawingCallback::curve_to(const Vector2d &c1, const Vector2d &c2, const Vector2d &to)
|
||||
{
|
||||
for (unsigned long idx = 1;idx <= fn;idx++) {
|
||||
const double a = idx * (1.0 / (double)fn);
|
||||
|
|
|
|||
|
|
@ -41,19 +41,19 @@ public:
|
|||
void add_glyph_advance(double advance_x, double advance_y);
|
||||
std::vector<const Geometry *> get_result();
|
||||
|
||||
void move_to(Vector2d to);
|
||||
void line_to(Vector2d to);
|
||||
void curve_to(Vector2d c1, Vector2d to);
|
||||
void curve_to(Vector2d c1, Vector2d c2, Vector2d to);
|
||||
void move_to(const Vector2d &to);
|
||||
void line_to(const Vector2d &to);
|
||||
void curve_to(const Vector2d &c1, const Vector2d &to);
|
||||
void curve_to(const Vector2d &c1, const Vector2d &c2, const Vector2d &to);
|
||||
private:
|
||||
unsigned long fn;
|
||||
Vector2d pen;
|
||||
Vector2d offset;
|
||||
Vector2d advance;
|
||||
unsigned long fn;
|
||||
|
||||
Outline2d outline;
|
||||
class Polygon2d *polygon;
|
||||
std::vector<const class Geometry *> polygons;
|
||||
|
||||
void add_vertex(Vector2d v);
|
||||
void add_vertex(const Vector2d &v);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ void Polygon2d::transform(const Transform2d &mat)
|
|||
}
|
||||
}
|
||||
|
||||
void Polygon2d::resize(Vector2d newsize, const Eigen::Matrix<bool,2,1> &autosize)
|
||||
void Polygon2d::resize(const Vector2d &newsize, const Eigen::Matrix<bool,2,1> &autosize)
|
||||
{
|
||||
BoundingBox bbox = this->getBoundingBox();
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public:
|
|||
const Outlines2d &outlines() const { return theoutlines; }
|
||||
|
||||
void transform(const Transform2d &mat);
|
||||
void resize(Vector2d newsize, const Eigen::Matrix<bool,2,1> &autosize);
|
||||
void resize(const Vector2d &newsize, const Eigen::Matrix<bool,2,1> &autosize);
|
||||
|
||||
bool isSanitized() const { return this->sanitized; }
|
||||
void setSanitized(bool s) { this->sanitized = s; }
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ bool PolySet::is_convex() const {
|
|||
return PolysetUtils::is_approximately_convex(*this);
|
||||
}
|
||||
|
||||
void PolySet::resize(Vector3d newsize, const Eigen::Matrix<bool,3,1> &autosize)
|
||||
void PolySet::resize(const Vector3d &newsize, const Eigen::Matrix<bool,3,1> &autosize)
|
||||
{
|
||||
BoundingBox bbox = this->getBoundingBox();
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public:
|
|||
void render_edges(Renderer::csgmode_e csgmode) const;
|
||||
|
||||
void transform(const Transform3d &mat);
|
||||
void resize(Vector3d newsize, const Eigen::Matrix<bool,3,1> &autosize);
|
||||
void resize(const Vector3d &newsize, const Eigen::Matrix<bool,3,1> &autosize);
|
||||
|
||||
bool is_convex() const;
|
||||
boost::tribool convexValue() const { return this->convex; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue