Index: GTP/trunk/App/Demos/Vis/CHC_revisited/Matrix4x4.h
===================================================================
--- GTP/trunk/App/Demos/Vis/CHC_revisited/Matrix4x4.h	(revision 2746)
+++ GTP/trunk/App/Demos/Vis/CHC_revisited/Matrix4x4.h	(revision 2751)
@@ -5,5 +5,7 @@
 
 
-//namespace GtpVisibilityPreprocessor {
+namespace CHCDemo 
+{
+
 
 class Vector3;
@@ -14,18 +16,21 @@
 {
 public:
-	float x[4][4]; // first index is column [x], the second is row [y]
-
-	Matrix4x4() { }
-
-	// here xXY - 'X' is row, and 'Y' is column - classical mathematical notation
+	/** Default constructor initialising nothig.
+	*/
+	Matrix4x4();
+	/** here xXY - 'X' is row, and 'Y' is column - classical mathematical notation
+	*/
 	Matrix4x4(float x11, float x12, float x13, float x14,
-		float x21, float x22, float x23, float x24,
-		float x31, float x32, float x33, float x34,
-		float x41, float x42, float x43, float x44);
-
+  		      float x21, float x22, float x23, float x24,
+			  float x31, float x32, float x33, float x34,
+			  float x41, float x42, float x43, float x44);
+	/** Constructor setting the columns of the 3x3 part of the matrix.
+	*/
 	Matrix4x4(const Vector3 &a, const Vector3 &b, const Vector3 &c);
 
 
-	// Assignment operators
+	////////////////
+	//-- Assignment operators
+
 	Matrix4x4& operator+= (const Matrix4x4 &A); 	// add-to
 	Matrix4x4& operator-= (const Matrix4x4 &A); 	// subtract-from
@@ -33,27 +38,38 @@
 	Matrix4x4& operator*= (float A); 		// scale by scalar
 
-	// Fundamental operations
-	/// Invert the matrix .. returns 0 = regular
+
+	////////////////
+	//-- Fundamental operations
+
+	/** Invert the matrix .. returns 0 = regular
+	*/
 	int Invert();		
-	/// Transpose the matrix
+	/** Transpose the matrix
+	*/
 	void Transpose();	
+	/** Sets the columns of the 3x3 part of the matrix.
+	*/
+	void SetColumns(const Vector3 &a, const Vector3 &b, const Vector3 &c);
 
-	void
-		SetColumns(const Vector3 &a, const Vector3 &b, const Vector3 &c);
-
-	float Det3x3() const {
-		return (x[0][0]*x[1][1]*x[2][2] + \
-			x[1][0]*x[2][1]*x[0][2] + \
-			x[2][0]*x[0][1]*x[1][2] - \
-			x[2][0]*x[1][1]*x[0][2] - \
-			x[0][0]*x[2][1]*x[1][2] - \
-			x[1][0]*x[0][1]*x[2][2]);
-	}
+	float Det3x3() const;
 
 
-	friend Matrix4x4 Invert(const Matrix4x4 &M);	// Invert a given matrix
-	friend Matrix4x4 Transpose(const Matrix4x4 &M);	// Transpose a given matrix
+	////////////
+	//-- members
 
-	// Create various types of matrix.
+	float x[4][4]; // first index is column [x], the second is row [y]
+
+
+	////////////////////
+
+	// Invert a given matrix
+	friend Matrix4x4 Invert(const Matrix4x4 &M);
+	// Transpose a given matrix
+	friend Matrix4x4 Transpose(const Matrix4x4 &M);	
+
+
+	///////////
+	//-- Create various types of matrix.
+
 	friend Matrix4x4 IdentityMatrix();
 	friend Matrix4x4 ZeroMatrix();
@@ -94,19 +110,16 @@
 	friend Vector3 GetTranslation(const Matrix4x4 &M);
 
-	// Construct rotation description according VRML'97 specification
-	//  const CVector4D SFRotation(void) const;
-
-
-
 	// Overloaded output operator.
 	friend std::ostream& operator<< (std::ostream &s, const Matrix4x4 &M);
 };
 
-// forward declaration
+
+/////////
+//-- forward declaration
+
+
 Matrix4x4 IdentityMatrix();
-Matrix4x4 Invert(const Matrix4x4 &M);	// Invert a given matrix
-Matrix4x4 Transpose(const Matrix4x4 &M);	// Transpose a given matrix
-
-// Create various types of matrix.
+Matrix4x4 Invert(const Matrix4x4 &M);	
+Matrix4x4 Transpose(const Matrix4x4 &M);	
 Matrix4x4 IdentityMatrix();
 Matrix4x4 ZeroMatrix();
@@ -116,10 +129,7 @@
 Matrix4x4 RotationZMatrix(float Angle);
 Matrix4x4 RotationYPRMatrix(float Yaw, float Pitch, float Roll);
-// about axis 'axis' by angle 'Angle'
 Matrix4x4 RotationAxisMatrix(const Vector3 &axis, float Angle);
-// create the rotation matrix that rotates 'vecFrom' to 'vecTo'
 Matrix4x4 RotationVectorsMatrix(const Vector3 &vecFrom,
 								const Vector3 &vecTo);
-
 Matrix4x4 ScaleMatrix(float X, float Y, float Z);
 Matrix4x4 GenRotation(const Vector3 &x, const Vector3 &y,
@@ -127,19 +137,13 @@
 Matrix4x4 QuadricMatrix(float a, float b, float c, float d, float e,
 						float f, float g, float h, float j, float k);
-// returns matrix for transforming normal
 Matrix4x4 NormalTransformMatrix(const Matrix4x4 &M);
-
 Matrix4x4 MirrorX();
 Matrix4x4 MirrorY();
 Matrix4x4 MirrorZ();
 Matrix4x4 RotationOnly(const Matrix4x4 &x);
-
-// Binary operators
 Matrix4x4 operator+ (const Matrix4x4 &A, const Matrix4x4 &B);
 Matrix4x4 operator- (const Matrix4x4 &A, const Matrix4x4 &B);
 Matrix4x4 operator* (const Matrix4x4 &A, float B);
 Matrix4x4 operator* (const Matrix4x4 &A, const Matrix4x4 &B);
-
-// friends returning Vector3
 Vector3 operator*(const Matrix4x4 &M, const Vector3 &v);
 Vector3 RotateOnly(const Matrix4x4 &M, const Vector3 &v);
@@ -148,6 +152,5 @@
 
 
-//}
-
+}
 
 
