Index: /GTP/trunk/Lib/Vis/Preprocessing/src/run_test2
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/run_test2	(revision 2583)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/run_test2	(revision 2588)
@@ -46,7 +46,8 @@
 #PREFIX=../work/plots/atlanta2-rss9
 
+#-rss_distributions=direction+spatial+mutation \
 
 $COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
--rss_distributions=direction+spatial+mutation \
+-rss_distributions=direction+spatial \
 -view_cells_use_kd_pvs+ -af_use_kd_pvs+ -view_cells_filter_width=1.0 \
 -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4a.xml \
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2586)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2588)
@@ -1102,4 +1102,6 @@
   
   KdTreeStatistics(cout);
+  sceneBox = mKdTree->GetBox();
+
   cout << mKdTree->GetBox() << endl;
   
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/default.env
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/default.env	(revision 2583)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/default.env	(revision 2588)
@@ -53,5 +53,5 @@
 	useGlDebugger false
 # 0 = INTERNAL 	1 = MLRT 2 = HAVRAN
-	rayCastMethod 2
+	rayCastMethod 1
 	
 #	type sampling
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 2582)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 2588)
@@ -208,5 +208,5 @@
 	/// kD-tree organizing the scene graph (occluders + occludees) + viewcells
 	KdTree *mKdTree;
-        AxisAlignedBox3 sceneBox;
+  AxisAlignedBox3 sceneBox;
 	/// View space partition bsp tree
 	VspBspTree *mVspBspTree;
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h	(revision 2575)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h	(revision 2588)
@@ -12,7 +12,7 @@
 #include "SubdivisionCandidate.h"
 #include "HierarchyManager.h"
-#ifdef PERFTIMER
+#ifdef USE_PERFTIMER
 #include "Timer/PerfTimer.h"
-#endif // PERFTIMER
+#endif // USE_PERFTIMER
 
 
@@ -672,5 +672,5 @@
 	////////////
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	PerfTimer mSortTimer;
 	PerfTimer mSplitTimer;
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 2575)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 2588)
@@ -525,5 +525,5 @@
 	//TestEvaluation(sc);
 
-#ifdef PERFTIMER   
+#ifdef USE_PERFTIMER   
 	// fill view cells cache
 	mNodeTimer.Entry();
@@ -636,5 +636,5 @@
 	UpdateViewCells(sc);
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mNodeTimer.Exit();
 #endif
@@ -651,5 +651,5 @@
 								)
 {
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mSubdivTimer.Entry();
 #endif
@@ -724,5 +724,5 @@
 	}
 	
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mSubdivTimer.Exit();
 #endif
@@ -788,5 +788,5 @@
 										   const bool preprocessViewCells)
 {
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
   mPlaneTimer.Entry();
 #endif
@@ -834,5 +834,5 @@
 	}
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mPlaneTimer.Exit();
 #endif
@@ -840,5 +840,5 @@
 	///////////////////
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mEvalTimer.Entry();
 #endif
@@ -997,5 +997,5 @@
 #endif
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mEvalTimer.Exit();
 #endif
@@ -1691,5 +1691,5 @@
 													const int axis)											
 {
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mSortTimer.Entry();
 #endif	
@@ -1700,5 +1700,5 @@
 	CreateLocalSubdivisionCandidates(*objects, &mSubdivisionCandidates, !mUseGlobalSorting, axis);
 	
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mSortTimer.Exit();
 #endif
@@ -1858,5 +1858,5 @@
 										 bool useVisibilityBasedHeuristics)
 {
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mSplitTimer.Entry();
 #endif
@@ -1945,5 +1945,5 @@
 	backObjects = nBackObjects[bestAxis];
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mSplitTimer.Exit();
 #endif
@@ -2298,5 +2298,5 @@
 	//-- use view cells cache
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mCollectTimer.Entry();
 #endif
@@ -2332,5 +2332,5 @@
 	}
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mCollectTimer.Exit();
 #endif
@@ -2345,5 +2345,5 @@
 										  const bool onlyUnmailedRays)
 {
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mCollectTimer.Entry();
 #endif
@@ -2389,5 +2389,5 @@
 	}
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mCollectTimer.Exit();
 #endif
@@ -2465,5 +2465,5 @@
 								  const bool onlyUnmailedRays)
 {
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mCollectTimer.Entry();
 #endif
@@ -2509,5 +2509,5 @@
 	}
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mCollectTimer.Exit();
 #endif
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2586)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2588)
@@ -25,7 +25,7 @@
 #include "SceneGraph.h"
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 #include "Timer/PerfTimer.h"
-#endif // PERFTIMER
+#endif // USE_PERFTIMER
 
 #define USE_RAY_LENGTH_AS_CONTRIBUTION 0
@@ -43,5 +43,5 @@
 
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 PerfTimer viewCellCastTimer;
 PerfTimer pvsTimer;
@@ -1083,5 +1083,5 @@
 	int id;
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	PerfTimer boxTimer;
 
@@ -1099,5 +1099,5 @@
 
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	boxTimer.Exit();
 
@@ -2128,5 +2128,5 @@
 	}
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	cout << "view cell cast time: " << viewCellCastTimer.TotalTime() << " s" << endl;
 	Debug << "view cell cast time: " << viewCellCastTimer.TotalTime() << " s" << endl;
@@ -2896,5 +2896,5 @@
 	ViewCell::NewMail();
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	viewCellCastTimer.Entry();
 #endif
@@ -2917,5 +2917,5 @@
 	}
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	viewCellCastTimer.Exit();
 #endif
@@ -2938,5 +2938,5 @@
 	Intersectable *terminationObj;
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	objTimer.Entry();
 #endif
@@ -2944,5 +2944,5 @@
 	terminationObj = ray.mTerminationObject;
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	objTimer.Exit();
 
@@ -2972,9 +2972,9 @@
 	{
 		if (rand() < (RAND_MAX / 10))
-			cout << "rayd: " /*<< ray.GetOrigin() << " " << ray.GetTermination() << " "*/ << Normalize(ray.GetDir()) << " " << endl;
+		  //			cout << "rayd: " /*<< ray.GetOrigin() << " " << ray.GetTermination() << " "*/ << Normalize(ray.GetDir()) << " " << endl;
 		mVizBuffer.AddRay(&ray);
 	}
 #endif
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	pvsTimer.Exit();
 #endif
@@ -7223,5 +7223,5 @@
 	CLEAR_CONTAINER(tmpRays);
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	cout << "view cell cast time: " << viewCellCastTimer.TotalTime() << " s" << endl;
 	Debug << "view cell cast time: " << viewCellCastTimer.TotalTime() << " s" << endl;
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2587)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2588)
@@ -84,8 +84,11 @@
 	mSceneGraph->CollectObjects(&mObjects);
 
+#if 1
 	viewCellsManager->GetViewPoint(mViewPoint);
-
 	mViewDirection = Vector3(0,0,1);
-
+#else
+	mViewPoint = Vector3(1099.9,183.0,-387);
+	mViewDirection = Vector3(-0.6,0,-0.8);
+#endif
 	mFrame = 0;
 	mWireFrame = false;
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/common.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/common.h	(revision 2585)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/common.h	(revision 2588)
@@ -30,5 +30,5 @@
 #if defined(_MSC_VER)
 // use perftimer only on msvc
-#define PERFTIMER
+#define USE_PERFTIMER
 
 // define __SSE__ macro as it is not defined under MSVC
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/HavranRayCaster.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/HavranRayCaster.cpp	(revision 2585)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/HavranRayCaster.cpp	(revision 2588)
@@ -190,6 +190,7 @@
 
 #if 0
-  SimpleRayContainer::const_iterator sit, sit_end = rays.end();
-
+  SimpleRayContainer::const_iterator sit = rays.begin() + offset;
+  SimpleRayContainer::const_iterator sit_end = sit + 16;
+  
   // no acceleration for ray bundles implemented right now
   for (sit = rays.begin(); sit != sit_end; ++ sit) 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp	(revision 2575)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp	(revision 2588)
@@ -15,5 +15,5 @@
 #include "BvHierarchy.h"
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 #include "Timer/PerfTimer.h"
 #endif
@@ -25,5 +25,5 @@
 #define TYPE_LEAF -3
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 static PerfTimer sPvsTimer;
 static PerfTimer sSearchTimer;
@@ -2688,5 +2688,5 @@
 	Intersectable *obj;
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	sPvsTimer.Entry();
 #endif
@@ -2706,5 +2706,5 @@
 	}
 
-#ifdef PERFTIMER
+#ifdef USE_PERFTIMER
 	sPvsTimer.Exit();
 #endif	
@@ -2743,5 +2743,5 @@
 	queue<ViewCell *> tStack;
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	sPvsTimer.Start();
 #endif
@@ -2781,5 +2781,5 @@
 	}
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	Debug << "needed " << sPvsTimer.TotalTime() << " secs for pvs loading" << endl;
 #endif
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/SimpleRay.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/SimpleRay.h	(revision 2575)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/SimpleRay.h	(revision 2588)
@@ -54,9 +54,9 @@
   
   SimpleRay(const Vector3 &o,
-	    const Vector3 &d,
-	    const unsigned char distribution,
-	    const float weight,
-	    const unsigned char flags = F_BIDIRECTIONAL
-	    ):
+			const Vector3 &d,
+			const unsigned char distribution,
+			const float weight,
+			const unsigned char flags = F_BIDIRECTIONAL
+			):
     mOrigin(o),
     mDirection(d),
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h	(revision 2575)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h	(revision 2588)
@@ -15,7 +15,7 @@
 #include "HierarchyManager.h"
 
-#ifdef PERFTIMER
+#ifdef USE_PERFTIMER
 #include "Timer/PerfTimer.h"
-#endif // PERFTIMER
+#endif // USE_PERFTIMER
 
 namespace GtpVisibilityPreprocessor {
@@ -681,5 +681,5 @@
 	void CreateUniqueObjectIds();
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	PerfTimer mNodeTimer;
 	PerfTimer mSubdivTimer;
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 2585)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 2588)
@@ -1,5 +1,5 @@
 #############################################################################
 # Makefile for building: preprocessor
-# Generated by qmake (2.00a) (Qt 4.1.2) on: st 9. I 14:48:54 2008
+# Generated by qmake (2.00a) (Qt 4.1.2) on: ?t 10. I 11:42:01 2008
 # Project:  preprocessor.pro
 # Template: app
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/DifferenceSampling.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/DifferenceSampling.cpp	(revision 2575)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/DifferenceSampling.cpp	(revision 2588)
@@ -6,5 +6,5 @@
 #include "ViewCellsManager.h"
 #include "Preprocessor.h"
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 #include "Timer/PerfTimer.h"
 #endif
@@ -15,5 +15,5 @@
 
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 PerfTimer sFilterTimer;
 #endif
@@ -68,5 +68,5 @@
 
 	
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	sFilterTimer.Entry();
 #endif
@@ -78,5 +78,5 @@
 										filteredPvs);
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	sFilterTimer.Exit();
 #endif
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Halton.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Halton.cpp	(revision 2575)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Halton.cpp	(revision 2588)
@@ -1,7 +1,9 @@
+#include "common.h"
 #include "Halton.h"
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 #include "Timer/PerfTimer.h"
 #endif
+
 
 #define PREGENERATE_HALTON 0
@@ -10,5 +12,5 @@
 
   
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER
 PerfTimer haltonTimer;
 #endif
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp	(revision 2575)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp	(revision 2588)
@@ -709,5 +709,5 @@
 							const bool globalCriteriaMet)
 {
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mSubdivTimer.Entry();
 #endif
@@ -790,5 +790,5 @@
 	}
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mSubdivTimer.Exit();
 #endif
@@ -800,5 +800,5 @@
 									   bool computeSplitPlane)
 {
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mPlaneTimer.Entry();
 #endif
@@ -823,5 +823,5 @@
 	}
 	
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mPlaneTimer.Exit();
 	mEvalTimer.Entry();
@@ -924,5 +924,5 @@
 
 	//cout << "vsp render cost decrease=" << renderCostDecr << endl;
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mEvalTimer.Exit();
 #endif
@@ -957,5 +957,5 @@
 									VspTraversalData &backData)
 {
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mNodeTimer.Entry();
 #endif	
@@ -1052,5 +1052,5 @@
 	interior->mTimeStamp = mHierarchyManager->mTimeStamp ++;
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mNodeTimer.Exit();
 #endif
@@ -1114,5 +1114,5 @@
 										float maxBand)
 {
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mSortTimer.Entry();
 #endif
@@ -1166,5 +1166,5 @@
 		sort(mLocalSubdivisionCandidates->begin(), mLocalSubdivisionCandidates->end());
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mSortTimer.Exit();
 #endif
@@ -1587,5 +1587,5 @@
 								float &pBack)
 {
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mSplitTimer.Entry();
 #endif
@@ -1685,5 +1685,5 @@
 	pBack = nProbBack[bestAxis];
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mSplitTimer.Exit();
 #endif
@@ -3174,5 +3174,5 @@
 void VspTree::GetViewCells(const VssRay &ray, ViewCellContainer &viewCells)
 {
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mViewCellsTimer.Entry();
 #endif
@@ -3193,5 +3193,5 @@
 	CastLineSegment(origin, termination, viewCells, false);
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mViewCellsTimer.Exit();
 #endif
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h	(revision 2575)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h	(revision 2588)
@@ -15,5 +15,5 @@
 #endif
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 #include "Timer/PerfTimer.h"
 #endif
@@ -168,5 +168,5 @@
   int nObjects;
   
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
   PerfTimer mBoxTimer;
   PerfTimer mPvsTimer;
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 2575)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 2588)
@@ -409,5 +409,5 @@
 	double sortTime, evalTime, nodeTime, splitTime, subdTime, planeTime, collectTime, viewCellsTime;
 
-#ifdef PERFTIMER  	
+#ifdef USE_PERFTIMER  	
 	sortTime = mBvHierarchy->mSortTimer.TotalTime();
 	evalTime = mBvHierarchy->mEvalTimer.TotalTime();
@@ -417,5 +417,5 @@
 	planeTime = mBvHierarchy->mPlaneTimer.TotalTime();
 	collectTime = mBvHierarchy->mCollectTimer.TotalTime();
-#endif // #ifdef PERFTIMER 
+#endif // #ifdef USE_PERFTIMER 
 	
 	cout << "bvh times"
@@ -439,5 +439,5 @@
 		 << endl;
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	sortTime = mVspTree->mSortTimer.TotalTime();
 	evalTime = mVspTree->mEvalTimer.TotalTime();
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 2575)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 2588)
@@ -147,5 +147,5 @@
 		EndObjectSpaceHierarchy();
 		Debug << "object space hierarchy parsed" << endl;
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 		mObjectTimer.Exit();
 #endif
@@ -156,5 +156,5 @@
 		CreateViewCellsManager();
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 		Debug << "pvs time: " << mPvsTimer.TotalTime() << endl;
 		Debug << "object time: " << mObjectTimer.TotalTime() << endl;
@@ -301,5 +301,5 @@
 	const long startTime = GetTime();
 	
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mBoxTimer.Entry();
 #endif
@@ -324,5 +324,5 @@
 		  << TimeDiff(startTime, GetTime()) * 1e-6 << " secs" << endl;
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mBoxTimer.Exit();
 #endif
@@ -487,5 +487,5 @@
 
 		mCurrentState = PARSE_OBJECTSPACE_HIERARCHY;
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 		mObjectTimer.Entry();
 #endif
@@ -547,5 +547,5 @@
 	}
 
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mPvsTimer.Entry();
 #endif
@@ -591,5 +591,5 @@
 	}
 	
-#ifdef PERFTIMER  
+#ifdef USE_PERFTIMER  
 	mPvsTimer.Exit();
 #endif
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp	(revision 2586)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp	(revision 2588)
@@ -8,11 +8,9 @@
 #include "RssTree.h"
 #include "Mutation.h"
-#if TODO
 #include "FilterBasedDistribution.h"
-#endif
 #include "DifferenceSampling.h"
 
 
-#ifdef PERFTIMER
+#ifdef USE_PERFTIMER
 #include "Timer/PerfTimer.h"
 #endif
@@ -21,5 +19,5 @@
 
 
-#ifdef PERFTIMER
+#ifdef USE_PERFTIMER
 extern PerfTimer haltonTimer;
 extern PerfTimer pvsTimer;
@@ -216,33 +214,41 @@
 
 
-bool SpatialBoxBasedDistribution::GenerateSample(SimpleRay &ray)
-{
-
-	Vector3 origin, direction; 
-
-	float r[6];
-	sHalton.GetNext(6, r);
-	
-	mPreprocessor.mViewCellsManager->GetViewPoint(origin, Vector3(r[0],
-																  r[1],
-																  r[2]));
-
-	direction = mPreprocessor.sceneBox.GetRandomPoint(Vector3(r[3],
-													  r[4],
-													  r[5])) - origin;
-	
-	const float c = Magnitude(direction);
-	
-	if (c <= Limits::Small) 
-		return false;
-
-	const float pdf = 1.0f;
-
-	direction *= 1.0f / c;
-	ray = SimpleRay(origin, direction, SPATIAL_BOX_BASED_DISTRIBUTION, pdf);
-  
-	//cout << "d " << direction << " o: " << origin;
-	
-	return true;
+bool
+SpatialBoxBasedDistribution::GenerateSample(SimpleRay &ray)
+{
+  
+  Vector3 origin, direction; 
+  
+  float r[6];
+  sHalton.GetNext(6, r);
+  
+  //  mPreprocessor.mViewCellsManager->GetViewPoint(origin, Vector3(r[0],
+  //																r[1],
+  //																r[2]));
+
+  origin = mPreprocessor.sceneBox.GetRandomPoint(Vector3(r[0],
+														 r[1],
+														 r[2]));
+  
+  direction = mPreprocessor.sceneBox.GetRandomPoint(Vector3(r[3],
+															r[4],
+															r[5])) - origin;
+
+  //  cout<<mPreprocessor.sceneBox<<endl;
+  //  cout<<r[0]<<" "<<r[1]<<" "<<r[2]<<" "<<r[3]<<" "<<r[4]<<" "<<r[5]<<endl;
+  //  cout << " o: " << origin << "d " << direction << endl;
+
+  const float c = Magnitude(direction);
+  
+  if (c <= Limits::Small) 
+	return false;
+  
+  const float pdf = 1.0f;
+  
+  direction *= 1.0f / c;
+  ray = SimpleRay(origin, direction, SPATIAL_BOX_BASED_DISTRIBUTION, pdf);
+  
+  
+  return true;
 }
 
@@ -250,37 +256,37 @@
 bool ReverseObjectBasedDistribution::GenerateSample(SimpleRay &ray)
 {
-	Vector3 origin, direction; 
-
-	mPreprocessor.mViewCellsManager->GetViewPoint(origin);
-
-	Vector3 point;
-	Vector3 normal;
-	
-	const int i = (int)RandomValue(0, (float)mPreprocessor.mObjects.size() - 0.5f);
-
-	Intersectable *object = mPreprocessor.mObjects[i];
-
-	object->GetRandomSurfacePoint(point, normal);
-	
-	direction = origin - point;
-	
-	// $$ jb the pdf is yet not correct for all sampling methods!
-	const float c = Magnitude(direction);
-	
-	if ((c <= Limits::Small) || (DotProd(direction, normal) < 0))
+  Vector3 origin, direction; 
+  
+  mPreprocessor.mViewCellsManager->GetViewPoint(origin);
+  
+  Vector3 point;
+  Vector3 normal;
+  
+  const int i = (int)RandomValue(0, (float)mPreprocessor.mObjects.size() - 0.5f);
+  
+  Intersectable *object = mPreprocessor.mObjects[i];
+  
+  object->GetRandomSurfacePoint(point, normal);
+  
+  direction = origin - point;
+  
+  // $$ jb the pdf is yet not correct for all sampling methods!
+  const float c = Magnitude(direction);
+  
+  if ((c <= Limits::Small) || (DotProd(direction, normal) < 0))
 	{
-		return false;
-	}
-
-	// $$ jb the pdf is yet not correct for all sampling methods!
-	const float pdf = 1.0f;
-	
-	direction *= 1.0f / c;
-	// a little offset
-	point += direction * 0.001f;
-
-	ray = SimpleRay(point, direction, REVERSE_OBJECT_BASED_DISTRIBUTION, pdf);
-	
-	return true;
+	  return false;
+	}
+  
+  // $$ jb the pdf is yet not correct for all sampling methods!
+  const float pdf = 1.0f;
+  
+  direction *= 1.0f / c;
+  // a little offset
+  point += direction * 0.001f;
+  
+  ray = SimpleRay(point, direction, REVERSE_OBJECT_BASED_DISTRIBUTION, pdf);
+  
+  return true;
 }
 
@@ -607,19 +613,19 @@
   if (1)
   {
-#ifdef PERFTIMER
-	  const float vcTime = viewCellCastTimer.TotalTime();
-	  const float pvsTime = pvsTimer.TotalTime();
-	  const float haltonTime = haltonTimer.TotalTime();
-	  
-	  cout << "view cell cast time: " << vcTime << " s" << endl;
-	  cout << "pvs time: " << pvsTime << " s" << endl;
-	  cout << "halton time: "<< haltonTime << " s" << endl;
-
-	  Debug << "view cell cast time: " << vcTime << " s" << endl;
-	  Debug << "pvs time: " << pvsTime << " s" << endl;
-	  Debug << "halton time: "<< haltonTime << " s" << endl;
+#ifdef USE_PERFTIMER
+	const float vcTime = viewCellCastTimer.TotalTime();
+	const float pvsTime = pvsTimer.TotalTime();
+	const float haltonTime = haltonTimer.TotalTime();
+	
+	cout << "view cell cast time: " << vcTime << " s" << endl;
+	cout << "pvs time: " << pvsTime << " s" << endl;
+	cout << "halton time: "<< haltonTime << " s" << endl;
+	
+	Debug << "view cell cast time: " << vcTime << " s" << endl;
+	Debug << "pvs time: " << pvsTime << " s" << endl;
+	Debug << "halton time: "<< haltonTime << " s" << endl;
 #else
-	  cout << "Timers not supported" << endl;
-	  Debug << "Timers for PVS,Halton,Viewcell not supported" << endl;
+	cout << "Timers not supported" << endl;
+	Debug << "Timers for PVS,Halton,Viewcell not supported" << endl;
 #endif
   }
@@ -735,7 +741,5 @@
 					} else
 					  if (strcmp(curr, "filter_based")==0) {
-#if TODO
 						mDistributions.push_back(new FilterBasedDistribution(mPreprocessor));
-#endif
 					  }
 					else if (strcmp(curr, "difference")==0) {
