Index: GTP/trunk/Lib/Vis/Preprocessing/include/Containers.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/include/Containers.h	(revision 68)
+++ GTP/trunk/Lib/Vis/Preprocessing/include/Containers.h	(revision 863)
@@ -9,4 +9,5 @@
   class ViewCell;
   class HierarchyNode;
+
   /** Container for Mesh pointers primarily for the use within the kDTree and
       BSP hierarchies */
@@ -18,6 +19,6 @@
       BSP hierarchies */
   typedef vector<HierarchyNode *> NodeContainer;
+
 };
-
 
 #endif // _Container_H__
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/Preprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/Preprocessor.vcproj	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/Preprocessor.vcproj	(revision 863)
@@ -76,5 +76,5 @@
 				RuntimeTypeInfo="TRUE"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="2"
 				Detect64BitPortabilityProblems="TRUE"
 				DebugInformationFormat="3"/>
Index: GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.h	(revision 863)
@@ -3,5 +3,4 @@
 
 #include <string>
-using namespace std;
 #include "Parser.h"
 
@@ -16,5 +15,5 @@
   UnigraphicsParser(): Parser() {}
   
-  virtual bool ParseFile(const string filename, SceneGraphNode **root, const bool loadPolygonsAsMeshes = false);
+  virtual bool ParseFile(const std::string filename, SceneGraphNode **root, const bool loadPolygonsAsMeshes = false);
   
 };
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h	(revision 863)
@@ -10,4 +10,6 @@
 #include "RayInfo.h"
 #include "ViewCellBsp.h"
+
+namespace GtpVisibilityPreprocessor {
 
 class ViewCell;
@@ -25,5 +27,4 @@
 class ViewCellsTree;
 
-namespace GtpVisibilityPreprocessor {
 
 /**
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Beam.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Beam.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Beam.cpp	(revision 863)
@@ -4,5 +4,5 @@
 #include "Polygon3.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 void
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspKdTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspKdTree.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspKdTree.cpp	(revision 863)
@@ -28,5 +28,5 @@
 #include "ViewCellBsp.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 // Static variables
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp	(revision 863)
@@ -3,5 +3,5 @@
 #include "VrmlExporter.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 Exporter *
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp	(revision 863)
@@ -15,5 +15,5 @@
 #include "Beam.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp	(revision 863)
@@ -13,5 +13,5 @@
 #include <stack>
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp	(revision 863)
@@ -30,5 +30,5 @@
 #include "ViewCellsManager.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Plane3.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Plane3.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Plane3.cpp	(revision 863)
@@ -3,5 +3,5 @@
 
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.h	(revision 863)
@@ -8,18 +8,20 @@
 #include "Containers.h"
 
+namespace GtpVisibilityPreprocessor {
+
 class Ray;
 class Polygon3;
 class Mesh;
 
-// --------------------------------------------------------
-// CAABox class.
-//  This is a box in 3-space, defined by min and max
-//  corner vectors.  Many useful operations are defined
-//  on this
-// --------------------------------------------------------
+/**
+	CAABox class.
+	This is a box in 3-space, defined by min and max
+	corner vectors.  Many useful operations are defined
+	on this
+*/
 class AxisAlignedBox3
 {
 protected:
-  Vector3 mMin, mMax;
+	Vector3 mMin, mMax;
 public:
   // Constructors.
@@ -34,5 +36,6 @@
   //						      max(center + Vector3(radius)) {}
 
-  // initialization to the non existing bounding box
+  /** initialization to the non existing bounding box
+  */
   void Initialize() {
     mMin = Vector3(MAXFLOAT);
@@ -40,8 +43,10 @@
   }
 
-  // The center of the box
+  /** The center of the box
+  */
   Vector3 Center() const { return 0.5 * (mMin + mMax); }
   
-  // The diagonal of the box
+  /** The diagonal of the box
+  */
   Vector3 Diagonal() const { return (mMax -mMin); }
 
@@ -110,5 +115,7 @@
   void Include (const PolygonContainer &polys);
   void Include(Mesh *mesh);
-  // Expand the axis-aligned box to include given values in particular axis
+
+  /** Expand the axis-aligned box to include given values in particular axis.
+  */
   void Include(const int &axis, const float &newBound);
 
@@ -123,29 +130,42 @@
   friend inline bool OverlapS(const AxisAlignedBox3 &,const AxisAlignedBox3 &);
 
-  // Overlap returns 1 if the two axis-aligned boxes overlap for a given
-  // epsilon. If eps > 0.0, then the boxes has to have the real intersection
-  // box, if eps < 0.0, then the boxes need not intersect really, they
-  // can be at eps distance in the projection
+  /** Overlap returns 1 if the two axis-aligned boxes overlap for a given
+	  epsilon. If eps > 0.0, then the boxes has to have the real intersection
+	  box, if eps < 0.0, then the boxes need not intersect really, they
+	  can be at eps distance in the projection.
+	  */
   friend inline bool Overlap(const AxisAlignedBox3 &,
-			     const AxisAlignedBox3 &,
-			     float eps);
-
-  // Includes returns true if a includes b (completely
+							 const AxisAlignedBox3 &,
+							 float eps);
+
+  /** Returns 'factor' of overlap of first box with the second box. i.e., a number
+	between 0 (no overlap) and 1 (same box).
+  */
+  friend inline float FactorOfOverlap(const AxisAlignedBox3 &, const AxisAlignedBox3 &);
+
+  /** Includes returns true if a includes b (completely)
+  */
   bool Includes(const AxisAlignedBox3 &b) const;
 
   virtual int IsInside(const Vector3 &v) const;
   
-  // Test if the box is really sensefull
+  /** Test if the box makes sense.
+  */
   virtual bool IsCorrect();
 
-  // To answer true requires the box of real volume of non-zero value
+  /** To answer true requires the box of real volume of non-zero value.
+  */
   bool IsSingularOrIncorrect() const;
 
-  // When the box is not of non-zero or negative surface area
+  /** When the box is not of non-zero or negative surface area.
+  */
   bool IsCorrectAndNotPoint() const;
 
-  // Returns true when the box degenerates to a point
+  /** Returns true when the box degenerates to a point.
+  */
   bool IsPoint() const;
 
+  /** Scales the box with the factor.
+  */
   void Scale(const float scale) {
 	Vector3 newSize = Size()*(scale*0.5f);
@@ -155,4 +175,7 @@
   }
   
+  /** Returns the square of the minimal and maximal distance to 
+	a point on the box.
+	*/
   void
   GetSqrDistances(const Vector3 &point,
@@ -348,7 +371,5 @@
 	  @returns true if ray hits the bounding box.
   */
-  bool GetRaySegment(const Ray &ray, 
-				float &minT, 
-				float &maxT) const;
+  bool GetRaySegment(const Ray &ray, float &minT, float &maxT) const;
 
   /** If the boxes are intersecting on a common face, this function 
@@ -519,4 +540,9 @@
 }
 
+inline float FactorOfOverlap(const AxisAlignedBox3 &box1, const AxisAlignedBox3 &box2)
+{
+	const AxisAlignedBox3 isect = Intersect(box1, box2);
+	return isect.GetVolume() / box1.GetVolume();
+}
 
 inline int operator==(const AxisAlignedBox3 &A, const AxisAlignedBox3 &B)
@@ -526,5 +552,5 @@
 
   
-
+}
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp	(revision 863)
@@ -13,5 +13,5 @@
 #include "Environment.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 #define ROTATE_SCENE 0
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Vector3.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Vector3.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Vector3.h	(revision 863)
@@ -7,4 +7,5 @@
 #include "common.h"
 
+
 namespace GtpVisibilityPreprocessor {
 
@@ -12,4 +13,5 @@
 class Matrix4x4;
 class Vector2;
+
 
 // HACK of returning vector components as array fields.
Index: GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.h	(revision 863)
@@ -1081,6 +1081,6 @@
 };
 
-}
-
-#endif // __LSDS_KDTREE_H__
-
+};
+
+#endif // __RSSTREE_H__
+
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Camera.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Camera.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Camera.h	(revision 863)
@@ -76,5 +76,5 @@
 };
 
-}
+};
 
 #endif
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp	(revision 863)
@@ -18,5 +18,5 @@
 #include "Beam.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 #define USE_FIXEDPOINT_T 0
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.h	(revision 863)
@@ -924,10 +924,9 @@
 
   int
-  CollectRays(VssRayContainer &rays
-			  );
+  CollectRays(VssRayContainer &rays);
   
 };
 
-}
+};
 
 #endif // __LSDS_KDTREE_H__
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.h	(revision 863)
@@ -9,4 +9,6 @@
 #include "AxisAlignedBox3.h"
 #include "Material.h"
+#include "Containers.h"
+
 
 namespace GtpVisibilityPreprocessor {
@@ -51,4 +53,12 @@
   VertexIndexContainer mVertexIndices;  
 };
+
+
+
+/// default vertex container for Mesh
+typedef vector<Vector3> VertexContainer;
+
+/// vertex index container
+typedef vector<short> VertexIndexContainer;
 
 /// default patch container for Mesh
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Parser.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Parser.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Parser.h	(revision 863)
@@ -3,5 +3,4 @@
 
 #include <string>
-using namespace std;
 
 namespace GtpVisibilityPreprocessor {
@@ -16,5 +15,5 @@
   Parser() {}
 
-  virtual bool ParseFile(const string filename, 
+  virtual bool ParseFile(const std::string filename, 
 						 SceneGraphNode **root, 
 						 const bool loadPolygonsAsMeshes = false) {return false;};
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Tetrahedron3.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Tetrahedron3.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Tetrahedron3.cpp	(revision 863)
@@ -2,5 +2,5 @@
 
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 863)
@@ -20,6 +20,9 @@
 #include "Vector3.h"
 
-  
-using namespace GtpVisibilityPreprocessor {
+using namespace std;
+  
+namespace GtpVisibilityPreprocessor {
+
+
 
 Environment *environment = NULL;
@@ -269,12 +272,12 @@
   // new option
   options[numOptions].type = type;
-  options[numOptions].name = strdup(name);
+  options[numOptions].name = ::strdup(name);
   // assign abbreviation, if requested
   if (abbrev != NULL) {
-    options[numOptions].abbrev = strdup(abbrev);
+	  options[numOptions].abbrev = ::strdup(abbrev);
   }
   // assign default value, if requested
   if (defValue != NULL) {
-    options[numOptions].defaultValue = strdup(defValue);
+	  options[numOptions].defaultValue = ::strdup(defValue);
     if (!CheckType(defValue, type)) {
       Debug << "Internal error: Inconsistent type and default value in option "
@@ -610,5 +613,5 @@
   if (options[i].type == optString) {
     delete options[i].value;
-    options[i].value = strdup(value);
+	options[i].value = ::strdup(value);
   }
   else {
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Beam.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Beam.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Beam.h	(revision 863)
@@ -8,9 +8,10 @@
 using namespace std;
 
+namespace GtpVisibilityPreprocessor {
+
 class KdNode;
 class Intersectable;
 class Mesh;
 
-namespace GtpVisibilityPreprocessor {
 
 // the values need for rss tree update computed already inside the glrendererbuffer
Index: GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.h	(revision 863)
@@ -14,5 +14,4 @@
 
 class ViewCell;
-//class BspViewCell;
 class Plane3;
 class FromPointVisibilityTree;  
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.h	(revision 863)
@@ -6,9 +6,11 @@
 using namespace std;
 
-namespace GtpVisibilityPreprocessor {
+
 
 #include "Material.h"
 #include "Containers.h"
 #include "VssRay.h"
+
+namespace GtpVisibilityPreprocessor {
 
 class KdTree;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp	(revision 863)
@@ -8,8 +8,9 @@
 #include "Beam.h"
 
+
+
+namespace GtpVisibilityPreprocessor {
+
 int KdNode::mailID = 1;
-
-using namespace GtpVisibilityPreprocessor {
-
 
 KdNode::KdNode(KdInterior *parent):mParent(parent), mailbox(0)
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp	(revision 863)
@@ -15,5 +15,5 @@
 #include <stack>
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp	(revision 863)
@@ -7,5 +7,5 @@
 
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/MutualVisibility.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/MutualVisibility.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/MutualVisibility.cpp	(revision 863)
@@ -11,5 +11,5 @@
 #include "SceneGraph.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 void
Index: GTP/trunk/Lib/Vis/Preprocessing/src/RenderSimulator.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/RenderSimulator.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/RenderSimulator.cpp	(revision 863)
@@ -8,5 +8,5 @@
 
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ExactPreprocessor.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ExactPreprocessor.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ExactPreprocessor.h	(revision 863)
@@ -2,7 +2,10 @@
 #define _ExactPreprocessor_H__
 
+
+#include "Preprocessor.h"
+
+
 namespace GtpVisibilityPreprocessor {
 
-#include "Preprocessor.h"
 
   /** Exact visibility preprocessing. The implementation is based on 6D BSP and
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Vector3.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Vector3.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Vector3.cpp	(revision 863)
@@ -3,5 +3,5 @@
 #include "Halton.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 // Given min a vector to minimize and a candidate vector, replace
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Halton.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Halton.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Halton.cpp	(revision 863)
@@ -2,5 +2,5 @@
 #include "Halton.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 // global halton generator
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 863)
@@ -14,5 +14,5 @@
 #include "PlyParser.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp	(revision 863)
@@ -30,5 +30,5 @@
 
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Triangle3.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Triangle3.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Triangle3.cpp	(revision 863)
@@ -1,5 +1,5 @@
 #include "Triangle3.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 float
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.cpp	(revision 863)
@@ -25,5 +25,5 @@
 #include "Ray.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 #define DEBUG_SPLIT_COST 0
@@ -1836,5 +1836,5 @@
   if (1) {
 	//	return GetAvgRayContribution();
-	return GetPvsSize();
+	return (float)GetPvsSize();
   } else {
 	// return GetAvgRayContribution()*mEntropyImportance;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Ray.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Ray.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Ray.cpp	(revision 863)
@@ -3,5 +3,5 @@
 #include "VssRay.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 // =========================================================
Index: GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.h	(revision 863)
@@ -147,5 +147,5 @@
 };
 
-}
+};
 
 #endif
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.h	(revision 863)
@@ -320,5 +320,5 @@
 };
 
-}
+};
 
 #endif
Index: GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.cpp	(revision 863)
@@ -18,5 +18,5 @@
 #include "Beam.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 #define USE_FIXEDPOINT_T 0
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ExactPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ExactPreprocessor.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ExactPreprocessor.cpp	(revision 863)
@@ -1,5 +1,5 @@
 #include "ExactPreprocessor.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 bool
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Polytope.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Polytope.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Polytope.cpp	(revision 863)
@@ -1,5 +1,5 @@
 #include "Polytope.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 /************************************************
Index: GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp	(revision 863)
@@ -13,5 +13,5 @@
 #include "GlRenderer.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp	(revision 863)
@@ -15,5 +15,5 @@
 #include "ViewCellBsp.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 bool use2dSampling = false;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 840)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 863)
@@ -24,5 +24,5 @@
 #include <crtdbg.h>
 
-
+using namespace GtpVisibilityPreprocessor;
 
 int
Index: GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.h	(revision 863)
@@ -5,5 +5,5 @@
 #include "Containers.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 class ViewCellsManager;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.cpp	(revision 863)
@@ -2,5 +2,5 @@
 #include "AxisAlignedBox3.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 // Static variables
@@ -106,6 +106,6 @@
 bool
 VssRay::Intersects(const AxisAlignedBox3 &box,
-													float &tmin,
-													float &tmax) const
+				   float &tmin,
+				   float &tmax) const
 {
   if (!ComputeMinMaxT(box, tmin, tmax))
@@ -124,7 +124,7 @@
 bool
 VssRay::IntersectsSphere(const Vector3 &center,
-																const float sqrRadius,
-																Vector3 &point,
-																float &t) const
+						 const float sqrRadius,
+						 Vector3 &point,
+						 float &t) const
 {
   // compute ray/plane intersection
@@ -141,5 +141,5 @@
   point = GetOrigin() + t*dir;
   
-  return ::SqrDistance(point, center) < sqrRadius;
+  return GtpVisibilityPreprocessor::SqrDistance(point, center) < sqrRadius;
 }
 
@@ -239,5 +239,5 @@
 	  selected.push_back(*it);
   
-  return selected.size();
+  return (int)selected.size();
 }
 
@@ -255,6 +255,6 @@
 	  selected.push_back(ray);
   }
-  return selected.size();
-}
-
-}
+  return (int)selected.size();
+}
+
+}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp	(revision 863)
@@ -15,5 +15,5 @@
 #include "Beam.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/common.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/common.cpp	(revision 542)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/common.cpp	(revision 863)
@@ -23,4 +23,5 @@
 #endif
 
+namespace GtpVisibilityPreprocessor {
 
 
@@ -46,5 +47,5 @@
 Real Limits::Threshold = 1e-6f;
 Real Limits::Small = 0.01f;
-Real Limits::Infinity = 1e20;
+Real Limits::Infinity = 1e20f;
 
 
@@ -284,3 +285,6 @@
   return false;
 }
-#endif
+
+#endif
+
+}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Rectangle3.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Rectangle3.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Rectangle3.h	(revision 863)
@@ -1,4 +1,5 @@
 #ifndef __RECTANGLE3_H
 #define __RECTANGLE3_H
+
 #include <iostream>
 using namespace std;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h	(revision 863)
@@ -11,4 +11,6 @@
 #include "Renderer.h"
 #include "Beam.h"
+
+class QWidget;
 
 namespace GtpVisibilityPreprocessor {
@@ -22,5 +24,4 @@
 class Beam;
 class KdTree;
-class QWidget;
 class GlRendererBuffer;
 class BeamSampleStatistics;
@@ -428,5 +429,5 @@
 extern GlDebuggerWidget *debuggerWidget;
 
-}
+};
 
 #endif
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Material.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Material.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Material.cpp	(revision 863)
@@ -2,5 +2,5 @@
 #include "Material.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Matrix4x4.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Matrix4x4.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Matrix4x4.cpp	(revision 863)
@@ -6,5 +6,5 @@
 using namespace std;
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Renderer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Renderer.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Renderer.cpp	(revision 863)
@@ -1,5 +1,5 @@
 #include "Renderer.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.cpp	(revision 863)
@@ -4,5 +4,5 @@
 #include "Plane3.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 RayInfo::RayInfo(): mRay(NULL), mMinT(0),
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.cpp	(revision 863)
@@ -2,5 +2,5 @@
 #include "Pvs.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 int
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.cpp	(revision 863)
@@ -6,5 +6,5 @@
 
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Containers.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Containers.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Containers.h	(revision 863)
@@ -18,6 +18,6 @@
 
 struct IndexedBoundingBox;
+struct VisibilityPoint;
 
-struct VisibilityPoint;
 
 /** Container storing polygons used during BSP tree construction.
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 863)
@@ -31,5 +31,5 @@
 #include "ViewCellsManager.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
@@ -132,5 +132,5 @@
 }
 
-inline bool vlt(ViewCell *v1, ViewCell *v2)
+inline static bool vlt(ViewCell *v1, ViewCell *v2)
 {
 	return v1->mId < v2->mId;
@@ -297,5 +297,5 @@
 
 				ObjectContainer::iterator oit =
-				  lower_bound(mObjects->begin(), mObjects->end(), &dummyInst, ilt);
+				  lower_bound(mObjects->begin(), mObjects->end(), (Intersectable *)&dummyInst, ilt);
 				
 				Intersectable *obj = *oit;
@@ -444,4 +444,5 @@
 	else
 	{
+		// add to invalid view space
 		if (mViewCellsManager->GetType() == ViewCellsManager::VSP_BSP)
 		{
Index: GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorThread.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorThread.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorThread.cpp	(revision 863)
@@ -8,5 +8,5 @@
 
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.h	(revision 863)
@@ -12,16 +12,14 @@
 {
 public:
-  X3dParser():Parser(), mViewCellHeight(5.0f) {}
+	X3dParser():Parser(), mViewCellHeight(5.0f) {}
   
-  bool ParseFile(const string filename, SceneGraphNode **root, const bool loadPolygonsAsMeshes = false);
-  bool ParseFile(const string filename, ViewCellsManager &viewCells);
+	bool ParseFile(const string filename, SceneGraphNode **root, const bool loadPolygonsAsMeshes = false);
+	bool ParseFile(const string filename, ViewCellsManager &viewCells);
  
-
-
-  /// height of a loaded view cell
-  float mViewCellHeight;
+	/// height of a loaded view cell
+	float mViewCellHeight;
 };
 
-}
+};
 
 #endif
Index: GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp	(revision 863)
@@ -11,5 +11,5 @@
 
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp	(revision 863)
@@ -9,5 +9,5 @@
 #include "Mesh.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 // int facesPerMesh = 100000000;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.h	(revision 863)
@@ -5,11 +5,13 @@
 using namespace std;
 
-
 #include "Preprocessor.h"
 #include "VssRay.h"
+
+namespace GtpVisibilityPreprocessor {
+
+
 class RssTree;
 class RssTreeLeaf;
 
-namespace GtpVisibilityPreprocessor {
 
 /** Sampling based visibility preprocessing. The implementation is based on heuristical
@@ -141,5 +143,5 @@
 
 
-}
+};
 
 #endif
Index: GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp	(revision 863)
@@ -9,5 +9,5 @@
 #include "Mesh.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 #define FATAL Debug
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Rectangle3.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Rectangle3.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Rectangle3.cpp	(revision 863)
@@ -1,5 +1,5 @@
 #include "Rectangle3.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Camera.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Camera.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Camera.cpp	(revision 863)
@@ -14,5 +14,5 @@
 
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 863)
@@ -16,5 +16,5 @@
 #include "RssPreprocessor.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 863)
@@ -16,5 +16,5 @@
 #include <QVBoxLayout>
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 static CGcontext sCgContext = NULL;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/MeshKdTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/MeshKdTree.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/MeshKdTree.cpp	(revision 863)
@@ -6,5 +6,5 @@
 #include "MeshKdTree.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp	(revision 863)
@@ -4,5 +4,5 @@
 #include "Triangle3.h"
 
-using namespace GtpVisibilityPreprocessor {
+namespace GtpVisibilityPreprocessor {
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/common.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/common.h	(revision 860)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/common.h	(revision 863)
@@ -19,8 +19,12 @@
 #include <iostream>
 #include <fstream>
+#include <limits.h>
 
 using namespace std;
 
-#include <limits.h>
+
+
+namespace GtpVisibilityPreprocessor {
+
 
 
@@ -475,14 +479,16 @@
 GetPath(const char *s);
 
-#endif
-
-
-
-
-
-
-
-
-
-
-
+}
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
