src/types.cpp

changeset 261
c4ad4e3c6839
parent 230
43d722c255d3
child 268
778eed342ee4
--- a/src/types.cpp	Mon May 27 13:49:07 2013 +0300
+++ b/src/types.cpp	Mon May 27 18:17:21 2013 +0300
@@ -109,6 +109,26 @@
 	return *this;
 }
 
+int vertex::operator< (const vertex& other) const {
+	if (operator== (other))
+		return false;
+	
+	if (coord (X) < other[X])
+		return true;
+	
+	if (coord (X) > other[X])
+		return false;
+	
+	if (coord (Y) < other[Y])
+		return true;
+	
+	if (coord (Y) > other[Y])
+		return false;
+	
+	return coord (Z) < other[Z];
+}
+
+// =============================================================================
 matrix::matrix (double vals[]) {
 	for (short i = 0; i < 9; ++i)
 		m_vals[i] = vals[i];
@@ -123,8 +143,6 @@
 	assert (vals.size() == 9);
 	memcpy (&m_vals[0], &(*vals.begin ()), sizeof m_vals);
 }
-
-// =============================================================================
 void matrix::puts () const {
 	for (short i = 0; i < 3; ++i) {
 		for (short j = 0; j < 3; ++j)

mercurial