mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-10-04 01:36:46 +08:00
make some functions pass by reference
This commit is contained in:
parent
6a11cf9aac
commit
52306da16d
@ -117,13 +117,13 @@ void TransformationMatrix::translate(double x, double y, double z)
|
|||||||
this->applyLeft(mat);
|
this->applyLeft(mat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransformationMatrix::translate(Vectorf3 vector)
|
void TransformationMatrix::translate(Vectorf3 const &vector)
|
||||||
{
|
{
|
||||||
TransformationMatrix mat = mat_translation(x, y, z);
|
TransformationMatrix mat = mat_translation(vector.x, vector.y, vector.z);
|
||||||
this->applyLeft(mat);
|
this->applyLeft(mat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransformationMatrix::translateXY(Vectorf vector)
|
void TransformationMatrix::translateXY(Vectorf const &vector)
|
||||||
{
|
{
|
||||||
TransformationMatrix mat = mat_translation(vector.x, vector.y, 0.0);
|
TransformationMatrix mat = mat_translation(vector.x, vector.y, 0.0);
|
||||||
this->applyLeft(mat);
|
this->applyLeft(mat);
|
||||||
@ -140,6 +140,12 @@ void TransformationMatrix::scale(double x, double y, double z)
|
|||||||
this->applyLeft(mat);
|
this->applyLeft(mat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TransformationMatrix::scale(Vectorf3 const &vector)
|
||||||
|
{
|
||||||
|
TransformationMatrix mat = mat_scale(vector.x, vector.y, vector.z);
|
||||||
|
this->applyLeft(mat);
|
||||||
|
}
|
||||||
|
|
||||||
void TransformationMatrix::mirror(const Axis &axis)
|
void TransformationMatrix::mirror(const Axis &axis)
|
||||||
{
|
{
|
||||||
TransformationMatrix mat = mat_mirror(axis);
|
TransformationMatrix mat = mat_mirror(axis);
|
||||||
|
@ -37,8 +37,8 @@ public:
|
|||||||
|
|
||||||
/// performs translation
|
/// performs translation
|
||||||
void translate(double x, double y, double z);
|
void translate(double x, double y, double z);
|
||||||
void translate(Vectorf3 vector);
|
void translate(Vectorf3 const &vector);
|
||||||
void translateXY(Vectorf vector);
|
void translateXY(Vectorf const &vector);
|
||||||
|
|
||||||
/// performs uniform scale
|
/// performs uniform scale
|
||||||
void scale(double factor);
|
void scale(double factor);
|
||||||
@ -46,6 +46,9 @@ public:
|
|||||||
/// performs per-axis scale
|
/// performs per-axis scale
|
||||||
void scale(double x, double y, double z);
|
void scale(double x, double y, double z);
|
||||||
|
|
||||||
|
/// performs per-axis scale via vector
|
||||||
|
void scale(Vectorf3 const &vector);
|
||||||
|
|
||||||
/// performs mirroring along given axis
|
/// performs mirroring along given axis
|
||||||
void mirror(const Axis &axis);
|
void mirror(const Axis &axis);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user