src/ldtypes.h

changeset 268
778eed342ee4
parent 267
95fde37e1f00
child 269
2d71227f35cb
--- a/src/ldtypes.h	Sat Jun 01 20:31:33 2013 +0300
+++ b/src/ldtypes.h	Sat Jun 01 21:36:03 2013 +0300
@@ -57,13 +57,21 @@
 // Common code for objects with matrices
 // =============================================================================
 class LDMatrixObject {
+	PROPERTY (matrix, transform, setTransform)
+	PROPERTY (vertex, position, setPosition)
+	
 public:
 	LDMatrixObject () {}
 	LDMatrixObject (const matrix& transform, const vertex& pos) :
-		transform (transform), pos (pos) {}
+		PROP_NAME (transform) (transform), PROP_NAME (position) (pos) {}
 	
-	matrix transform;
-	vertex pos;
+	const double& setCoordinate (const Axis ax, double value) {
+		vertex v = position ();
+		v[ax] = value;
+		setPosition (v);
+		
+		return position ()[ax];
+	}
 };
 
 // =============================================================================

mercurial