Index: /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2615)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2617)
@@ -1367,4 +1367,5 @@
 	float renderCost = 0;
 
+#ifndef USE_BIT_PVS
 	if (mShowDistanceWeightedPvs)
 	{
@@ -1379,4 +1380,7 @@
 		return vc->GetPvs().mStats.mWeightedTriangles;
 	}
+#else
+	return 0.0f;
+#endif
 }
 #endif
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2615)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2617)
@@ -2403,8 +2403,9 @@
 
 	const int numTriangles = kdObj->ComputeNumTriangles();
-
+#ifndef USE_BIT_PVS
 	vc->GetPvs().mStats.mDistanceWeightedTriangles += f * numTriangles; 
 	vc->GetPvs().mStats.mDistanceWeightedPvs += f ;
 	vc->GetPvs().mStats.mWeightedTriangles += numTriangles;
+#endif
 }
 
@@ -2595,8 +2596,10 @@
 	if (1) 
 		// tmp matt: don't use when origin objects are not accounted for, currently the second ray is lost!!
-		//!lastVssRay ||
-		//!(ray.mOrigin == lastVssRay->mTermination) ||
-		//!(ray.mTermination == lastVssRay->mOrigin)) 
-	{
+	  // $$JB: reenabled again - should use the same viewcells for the next ray ray if
+	  // it goes in the oposite direction
+// 	if (!lastVssRay ||
+// 		!(ray.mOrigin == lastVssRay->mTermination) ||
+// 		!(ray.mTermination == lastVssRay->mOrigin)) 
+	  {
 		viewCells.clear();
 
@@ -2604,5 +2607,5 @@
 		CastLineSegment(origin, termination, viewCells);
 		lastVssRay = &ray;
-	}
+	  } 
 
 #ifdef USE_PERFTIMER  
@@ -2628,5 +2631,5 @@
 
 #ifdef USE_PERFTIMER  
-	objTimer.Entry();
+	//	objTimer.Entry();
 #endif
 	// obtain pvs entry (can be different from hit object)
@@ -2634,6 +2637,5 @@
 
 #ifdef USE_PERFTIMER  
-	objTimer.Exit();
-
+	//	objTimer.Exit();
 	pvsTimer.Entry();
 #endif
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 2616)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 2617)
@@ -1,5 +1,5 @@
 #############################################################################
 # Makefile for building: preprocessor
-# Generated by qmake (2.00a) (Qt 4.1.2) on: ne 20. I 00:34:03 2008
+# Generated by qmake (2.00a) (Qt 4.1.2) on: ne 20. I 00:39:42 2008
 # Project:  preprocessor.pro
 # Template: app
@@ -63,5 +63,5 @@
 	$(MAKE) -f $(MAKEFILE).Debug uninstall
 
-Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc.net\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \
+Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc2005\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \
 		C:\Qt\4.1.2\mkspecs\features\qt_config.prf \
 		C:\Qt\4.1.2\mkspecs\features\exclusive_builds.prf \
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/SG08/run_test_arena
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/SG08/run_test_arena	(revision 2610)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/SG08/run_test_arena	(revision 2617)
@@ -2,5 +2,10 @@
 
 #COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+"
-COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -preprocessor_detect_empty_viewspace+ -total_samples=1000000000"
+
+# NORMAL TEST
+#COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -preprocessor_detect_empty_viewspace+ -total_samples=1000000000  -samples_per_pass=1000000 -total_samples=1000000000 -view_cells_use_kd_pvs+ -af_use_kd_pvs+ -kd_pvs_area=1e-5"
+
+#TIME TERMINATION
+COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -preprocessor_detect_empty_viewspace+ -total_samples=1000000000  -samples_per_pass=1000000 -total_samples=4000000000 -total_time=7200 -view_cells_use_kd_pvs+ -af_use_kd_pvs+ -kd_pvs_area=1e-5"
 
 
@@ -8,5 +13,5 @@
 VIEWCELLS=../data/Arena/viewcells-5000.xml.gz
 
-PREFIX=../work/plots/osp-arena-SG08a
+PREFIX=../work/plots/osp-arena-SG08a-TIME
 
 # $COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
@@ -18,8 +23,4 @@
 # # n - no origin mutation, q=2, reverse samples
 
-$COMMAND -preprocessor=sampling -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
--preprocessor_visibility_file=$PREFIX-r-reference.xml \
--view_cells_filter_max_size=1 -preprocessor_stats=$PREFIX-r-reference.log \
--preprocessor_histogram_file=$PREFIX-r-reference.hlog
 
 $COMMAND -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
@@ -28,4 +29,9 @@
  -preprocessor_stats=$PREFIX-r-reference-global.log \
  -preprocessor_histogram_file=$PREFIX-r-reference-global.hlog
+
+$COMMAND -preprocessor=sampling -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
+-preprocessor_visibility_file=$PREFIX-r-reference.xml \
+-view_cells_filter_max_size=1 -preprocessor_stats=$PREFIX-r-reference.log \
+-preprocessor_histogram_file=$PREFIX-r-reference.hlog
 
 # -total_samples=500000000000 -total_time=12208 \
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/PvsDefinitions.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/PvsDefinitions.h	(revision 2616)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/PvsDefinitions.h	(revision 2617)
@@ -7,4 +7,6 @@
 ////////////
 //-- typedefs
+//$$ 19.1. 2008 test for speed
+#define USE_BIT_PVS
 
 
