Index: GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp	(revision 2021)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp	(revision 2022)
@@ -20,6 +20,5 @@
 #define USE_SILHOUETTE_MUTATIONS 0
 
-#define USE_SIL_TERMINATION_MUTATION 1
-#define MUTATE_ORIGIN 0
+#define SIL_TERMINATION_MUTATION_PROB 0.9f
 
 #define EVALUATE_MUTATION_STATS 1
@@ -31,5 +30,5 @@
 // use avg ray contribution as importance
 // if 0 the importance is evaluated from the succ of mutations
-#define USE_AVG_CONTRIBUTION 1
+#define USE_AVG_CONTRIBUTION 0
 
 MutationBasedDistribution::RayEntry &
@@ -461,5 +460,4 @@
 																const Vector3 &U,
 																const Vector3 &V,
-																const Vector2 vr2,
 																const float radius
 																)
@@ -646,5 +644,4 @@
   VssRay *ray = mRays[index].mRay;
 
-  mRays[index].mHalton.GetNext(4, rr);
   //  rr[0] = RandomValue(0.0f,0.99999f);
   //  rr[1] = RandomValue(0.0f,0.99999f);
@@ -655,5 +652,5 @@
   Vector3 d = ray->GetDir();
   
-  float objectRadius = 0.5f*Magnitude(box.Diagonal());
+  float objectRadius = box.Radius();
   //  cout<<objectRadius<<endl;
   if (objectRadius < Limits::Small)
@@ -671,5 +668,5 @@
   // optimal for Vienna 0.5f
   
-  float radiusExtension = 0.1f;
+  float radiusExtension = 0.5f;
   //  + mRays[index].mMutations/50.0f;
   
@@ -679,22 +676,25 @@
   //  mutationRadius = 0.22f;
 
-#if MUTATE_ORIGIN
-  origin += ComputeOriginMutation(*ray, U, V,
-								  Vector2(rr[0], rr[1]),
-								  mutationRadius);
-#endif
-  
-#if USE_SIL_TERMINATION_MUTATION
-  termination += ComputeSilhouetteTerminationMutation(*ray,
-													  origin,
-													  box,
-													  U, V,
-													  Vector2(rr[2], rr[3]),
-													  2.0f*objectRadius);
-#else
-  termination += ComputeTerminationMutation(*ray, U, V,
-											Vector2(rr[2], rr[3]),
-											mutationRadius);
-#endif
+  // use probabilitistic approach to decide for the type of mutation
+  float a = RandomValue(0.0f,1.0f);
+
+  if (a < SIL_TERMINATION_MUTATION_PROB) {
+	termination += ComputeSilhouetteTerminationMutation(*ray,
+														origin,
+														box,
+														U, V,
+														2.0f*objectRadius);
+  } else {
+	mRays[index].mHalton.GetNext(4, rr);
+	// fuzzy random mutation
+	origin += ComputeOriginMutation(*ray, U, V,
+									Vector2(rr[0], rr[1]),
+									mutationRadius);
+	
+	termination += ComputeTerminationMutation(*ray, U, V,
+											  Vector2(rr[2], rr[3]),
+											  mutationRadius);
+  }
+
   Vector3 direction = termination - origin;
   
Index: GTP/trunk/Lib/Vis/Preprocessing/src/run_test2
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/run_test2	(revision 2021)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/run_test2	(revision 2022)
@@ -3,5 +3,5 @@
 
 #COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+"
-COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_pass=1000000"
+COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -samples_per_pass=1000000 -total_samples=1000000000"
 
 #SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d"
@@ -37,15 +37,42 @@
 
 
+$COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
+-rss_distributions=mutation+object_direction+spatial -view_cells_filter_max_size=1 \
+-view_cells_use_kd_pvs+ -af_use_kd_pvs+ \
+-preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4k.xml \
+-preprocessor_stats=$PREFIX-i-mixed-b1-n4k.log \
+-preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4k.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
+$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 \
-#  -rss_distributions=direction -view_cells_filter_max_size=1 \
-#  -preprocessor_visibility_file=$PREFIX-r-reference-global.xml \
-#  -preprocessor_stats=$PREFIX-r-reference-global.log \
-#  -preprocessor_histogram_file=$PREFIX-r-reference-global.hlog
+$COMMAND -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
+ -rss_distributions=direction -view_cells_filter_max_size=1 \
+ -preprocessor_visibility_file=$PREFIX-r-reference-global.xml \
+ -preprocessor_stats=$PREFIX-r-reference-global.log \
+ -preprocessor_histogram_file=$PREFIX-r-reference-global.hlog
+
+
+$COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
+-rss_distributions=mutation+object_direction+spatial -view_cells_filter_max_size=1 \
+-view_cells_use_kd_pvs- -af_use_kd_pvs+ \
+-preprocessor_visibility_file=$PREFIX-i-mixed-bvh-n4k.xml \
+-preprocessor_stats=$PREFIX-i-mixed-bvh-n4k.log \
+-preprocessor_histogram_file=$PREFIX-i-mixed-bvh-n4k.hlog
+
+$COMMAND -preprocessor=sampling -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
+-view_cells_use_kd_pvs- -af_use_kd_pvs+ \
+-preprocessor_visibility_file=$PREFIX-r-bvh-reference.xml \
+-view_cells_filter_max_size=1 -preprocessor_stats=$PREFIX-r-bvh-reference.log \
+-preprocessor_histogram_file=$PREFIX-r-bvh-reference.hlog
+
+$COMMAND -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
+-view_cells_use_kd_pvs- -af_use_kd_pvs+ \
+ -rss_distributions=direction -view_cells_filter_max_size=1 \
+ -preprocessor_visibility_file=$PREFIX-r-bvh-reference-global.xml \
+ -preprocessor_stats=$PREFIX-r-bvh-reference-global.log \
+ -preprocessor_histogram_file=$PREFIX-r-bvh-reference-global.hlog
 
 # $COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
@@ -56,10 +83,4 @@
 #  -preprocessor_histogram_file=$PREFIX-i-mixed-bvh-n4i.hlog
 
-$COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
--rss_distributions=mutation+object_direction+spatial -view_cells_filter_max_size=1 \
--view_cells_use_kd_pvs+ -af_use_kd_pvs+ \
--preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4j.xml \
--preprocessor_stats=$PREFIX-i-mixed-b1-n4j.log \
--preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4j.hlog
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp	(revision 1966)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp	(revision 2022)
@@ -138,9 +138,9 @@
 	  // 	  }
 
-	  rssSamples+=vssRays.size();
+	  rssSamples += vssRays.size();
 	  for (int j=0; j < vssRays.size(); j++)
 		if (vssRays[j]->mFlags & VssRay::Valid) {
-		  Intersectable *obj = mViewCellsManager->GetIntersectable(*(vssRays[j]),
-																   true);
+		  Intersectable *obj = vssRays[j]->mTerminationObject;
+		  
 		  if (obj) {
 			// if ray not outside of view space
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 2021)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 2022)
@@ -1,5 +1,5 @@
 #############################################################################
 # Makefile for building: preprocessor
-# Generated by qmake (2.00a) (Qt 4.1.2) on: út 23. I 00:22:45 2007
+# Generated by qmake (2.00a) (Qt 4.1.2) on: út 23. I 01:10:24 2007
 # 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/Mutation.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.h	(revision 2011)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.h	(revision 2022)
@@ -110,5 +110,4 @@
 									   const Vector3 &U,
 									   const Vector3 &V,
-									   const Vector2 vr2,
 									   const float radius
 									   );
Index: GTP/trunk/Lib/Vis/Preprocessing/src/run_test_powerplant
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/run_test_powerplant	(revision 2020)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/run_test_powerplant	(revision 2022)
@@ -2,5 +2,5 @@
 
 #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+"
+COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -preprocessor_detect_empty_viewspace-"
 
 
@@ -14,5 +14,5 @@
 $COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
  -rss_distributions=mutation+object_direction+spatial -view_cells_filter_max_size=1 \
- -view_cells_use_kd_pvs- -af_use_kd_pvs- \
+ -view_cells_use_kd_pvs+ -af_use_kd_pvs+ \
  -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4a.xml \
  -preprocessor_stats=$PREFIX-i-mixed-b1-n4a.log \
