Index: /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 1895)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 1899)
@@ -45,5 +45,5 @@
 
 #define COUNT_ORIGIN_OBJECTS 1
-
+#define USE_AVGRAYCONTRI 1
 /** View space / object space hierarchy statistics.
 */
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h	(revision 1898)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h	(revision 1899)
@@ -84,5 +84,4 @@
 
 	Preprocessor &mPreprocessor;
-	static HaltonSequence sHalton;
 };
 
@@ -91,5 +90,5 @@
 {
  public:
-  //HaltonSequence mHalton;
+ 
   
   ObjectBasedDistribution(Preprocessor &preprocessor):
@@ -100,4 +99,6 @@
 private:
   virtual bool GenerateSample(SimpleRay &ray);
+
+   static HaltonSequence sHalton;
 };
 
@@ -119,5 +120,4 @@
 class ObjectDirectionBasedDistribution: public SamplingStrategy
 {
-  //HaltonSequence mHalton;
   
 public:
@@ -126,5 +126,8 @@
 	   mType = OBJECT_DIRECTION_BASED_DISTRIBUTION;
 	 }
-private:
+
+private:
+
+	static HaltonSequence sHalton;
 	virtual bool GenerateSample(SimpleRay &ray);
 };
@@ -159,6 +162,6 @@
 {
  public:
-  //HaltonSequence mHalton;
-  SpatialBoxBasedDistribution(Preprocessor &preprocessor):
+	 
+	 SpatialBoxBasedDistribution(Preprocessor &preprocessor):
 	SamplingStrategy(preprocessor){
 	mType = SPATIAL_BOX_BASED_DISTRIBUTION;
@@ -167,4 +170,6 @@
 private:
 	   virtual bool GenerateSample(SimpleRay &ray);
+
+	   static HaltonSequence sHalton;
 };
 
@@ -196,6 +201,4 @@
 
 
-
-
 class ViewCellBorderBasedDistribution: public SamplingStrategy
 {
@@ -206,5 +209,6 @@
 
   }
-  
+
+private:
   virtual bool GenerateSample(SimpleRay &ray);
 };
@@ -213,7 +217,5 @@
 {
 public:
-  //Halton<4> halton;
-  //HaltonSequence mHalton;
-
+ 
   GlobalLinesDistribution(Preprocessor &preprocessor):
 	SamplingStrategy(preprocessor) {
@@ -221,5 +223,9 @@
   }
   
-  virtual bool GenerateSample(SimpleRay &ray);
+private:
+
+  virtual bool GenerateSample(SimpleRay &ray);
+
+   static HaltonSequence sHalton;
 };
 
@@ -238,10 +244,8 @@
 */
 
-class MixtureDistribution : public SamplingStrategy 
-{
-public:
-  // halton sequence generator for deciding between distributions
-  //HaltonSequence mHalton;
-  
+class MixtureDistribution: public SamplingStrategy 
+{
+public:
+   
   // container for the distributions
   vector<SamplingStrategy *> mDistributions;
@@ -259,7 +263,4 @@
   Reset();
   
-  // Generate a new sample according to a mixture distribution
-  virtual bool GenerateSample(SimpleRay &ray);
-
   // add contributions of the sample to the strategies
   void ComputeContributions(VssRayContainer &vssRays);
@@ -272,4 +273,11 @@
   Construct(char *str);
 
+private:
+
+   // Generate a new sample according to a mixture distribution
+  virtual bool GenerateSample(SimpleRay &ray);
+
+// halton sequence generator for deciding between distributions
+  static HaltonSequence sHalton;
   
 };
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 1895)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 1899)
@@ -646,5 +646,5 @@
 								  renderCostDecr);
 	
-	if (0)
+	if (USE_AVGRAYCONTRI)
 	{
 		// this leaf is a pvs entry in all the view cells
@@ -657,6 +657,6 @@
 			AvgRayContribution(pvs, splitCandidate.mParentData.mNumRays);
 
-		Debug << "bvh avgRayContri: " << avgRayContri << " #pvs: " << pvs << " #rays: " << splitCandidate.mParentData.mNumRays << endl;
-		cout << "bvh avgRayContri: " << avgRayContri << endl;
+		//Debug << "bvh avgRayContri: " << avgRayContri << " #pvs: " << pvs << " #rays: " << splitCandidate.mParentData.mNumRays << endl;
+		//cout << "bvh avgRayContri: " << avgRayContri << endl;
 
 		// high avg ray contri, the result is influenced by undersampling
@@ -665,6 +665,4 @@
 		{
 			const float factor = 1.0f + avgRayContri - mHierarchyManager->mMaxAvgRayContri;
-			cout << "here5 " << factor << endl;
-
 			priority /= factor;
 		}
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp	(revision 1895)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp	(revision 1899)
@@ -860,11 +860,11 @@
 	// avg ray contri
 
-	if (0)
+	if (USE_AVGRAYCONTRI)
 	{
 		const int pvs = EvalPvsEntriesSize(*splitCandidate.mParentData.mRays);
 		const float avgRayContri = (float)pvs / ((float)splitCandidate.mParentData.mRays->size() + Limits::Small);
 
-		Debug << "vsp avgRayContri: " << avgRayContri << " #pvs: " << pvs << " #rays: " << splitCandidate.mParentData.mRays->size() << endl;
-		cout << "vsp avgRayContri: " << avgRayContri << endl;
+		//Debug << "vsp avgRayContri: " << avgRayContri << " #pvs: " << pvs << " #rays: " << splitCandidate.mParentData.mRays->size() << endl;
+		//cout << "vsp avgRayContri: " << avgRayContri << endl;
 
 		// high avg ray contri very, the result is influenced by undersampling
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 1895)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 1899)
@@ -780,8 +780,8 @@
 	// high avg ray contri, the result is influenced by undersampling
 	// => decrease priority
-	if (0 && (sc->GetAvgRayContribution() > mMaxAvgRayContri))
+	if (USE_AVGRAYCONTRI && (sc->GetAvgRayContribution() > mMaxAvgRayContri))
 	{
 		const float factor = 1.0f + sc->GetAvgRayContribution() - mMaxAvgRayContri;
-		cout << "here5 " << factor << endl;
+		cout << "h " << factor << endl;
 
 		mem *= factor;
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp	(revision 1898)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp	(revision 1899)
@@ -9,5 +9,11 @@
 namespace GtpVisibilityPreprocessor {
 
-HaltonSequence SamplingStrategy::sHalton;
+
+HaltonSequence ObjectBasedDistribution::sHalton;
+HaltonSequence MixtureDistribution::sHalton;
+HaltonSequence GlobalLinesDistribution::sHalton;
+HaltonSequence SpatialBoxBasedDistribution::sHalton;
+HaltonSequence ObjectDirectionBasedDistribution::sHalton;
+
 
 SamplingStrategy::SamplingStrategy(Preprocessor &preprocessor): 
@@ -132,5 +138,5 @@
   direction = Normalize(CosineRandomVector(r[2], r[3], normal));
   
-  origin += 1e-2*direction;
+  origin += 1e-2f*direction;
   
   // $$ jb the pdf is yet not correct for all sampling methods!
