src/linetypes/modelobject.h

changeset 1403
7a2d84112983
parent 1402
8bbf2af8c3f5
child 1406
37fffb682d2f
--- a/src/linetypes/modelobject.h	Sun Jun 10 23:25:08 2018 +0300
+++ b/src/linetypes/modelobject.h	Sun Jun 17 13:53:33 2018 +0300
@@ -72,7 +72,7 @@
 	bool isHidden() const;
 	virtual bool isRasterizable() const { return false; } // Can this object be rasterized?
 	virtual bool isScemantic() const; // Does this object have meaning in the part model?
-	void move (const QVector3D vector);
+	void move (const QVector3D& vector);
 	virtual int numVertices() const;
 	virtual int numPolygonVertices() const;
 	virtual QString objectListText() const;
@@ -117,22 +117,20 @@
 {
 public:
 	LDMatrixObject() = default;
-	LDMatrixObject(const Matrix& transformationMatrix, const Vertex& pos);
+	LDMatrixObject(const QMatrix4x4& matrix);
 
 	bool hasMatrix() const override { return true; }
-	const Vertex& position() const;
-	void setCoordinate (const Axis ax, double value);
-	void setPosition (const Vertex& a);
-	void setTransformationMatrix (const Matrix& value);
-	const Matrix& transformationMatrix() const;
+	Vertex position() const;
+	void setTransformationMatrix(const QMatrix4x4& newMatrix);
+	const QMatrix4x4& transformationMatrix() const;
+	void translate(const QVector3D& offset);
 	void serialize(class Serializer& serializer) override;
 
 protected:
 	bool shouldInvert(Winding winding, DocumentManager* context);
 
 private:
-	Vertex m_position;
-	Matrix m_transformationMatrix = Matrix::identity;
+	QMatrix4x4 m_transformationMatrix;
 };
 
 /*
@@ -171,7 +169,7 @@
 	static const LDObjectType SubclassType = LDObjectType::SubfileReference;
 
 	LDSubfileReference() = default;
-	LDSubfileReference(QString referenceName, const Matrix& transformationMatrix, const Vertex& position);
+	LDSubfileReference(QString referenceName, const QMatrix4x4& matrix = {});
 
 	virtual LDObjectType type() const override
 	{

mercurial