Index: GTP/trunk/Lib/Vis/Preprocessing/src/run_test2
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/run_test2	(revision 2013)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/run_test2	(revision 2014)
@@ -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-"
+COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -samples_per_pass=1000000"
 
 #SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d"
@@ -55,9 +55,9 @@
  -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 \
- -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4i.xml \
- -preprocessor_stats=$PREFIX-i-mixed-b1-n4i.log \
- -preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4i.hlog
+#$COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
+# -rss_distributions=mutation+object_direction+spatial -view_cells_filter_max_size=1 \
+# -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4i.xml \
+# -preprocessor_stats=$PREFIX-i-mixed-b1-n4i.log \
+# -preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4i.hlog
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h	(revision 2013)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h	(revision 2014)
@@ -5,4 +5,5 @@
 #include <string>
 #include "Vector3.h"
+#include "VssRay.h"
 
 using namespace std;
@@ -68,18 +69,24 @@
   // pool of vss rays to be used in one pass of the sampling
   struct VssRayPool {
-	VssRayPool():mRays(), mIndex(0) {}
-
+	VssRayPool():mRays(NULL), mIndex(0) {}
+	~VssRayPool() {
+	  if (mRays)
+		delete mRays;
+	}
+	
 	void Reserve(const int number) {
-	  mRays.reserve(number);
+	  if (mRays)
+		delete mRays;
+	  mRays = new VssRay[number];
 	}
+	
 	void Clear() {
 	  mIndex = 0;
 	}
 	VssRay *Alloc() {
-	  VssRay *result = &mRays[mIndex];
-	  mIndex++;
-	  return result;
+	  return mRays + mIndex++;
 	}
-	vector<VssRay> mRays;
+
+	VssRay *mRays;
 	int mIndex;
   };
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2004)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2014)
@@ -25,4 +25,5 @@
 #include "SceneGraph.h"
 
+#include "PerfTimer.h"
 
 
@@ -2366,6 +2367,7 @@
 		return 0.0f;
 
-	ViewCellContainer viewCells;
-
+	static ViewCellContainer viewCells;
+
+	  
 	static Ray hray;
 	hray.Init(ray);
@@ -2383,4 +2385,6 @@
 	ViewCell::NewMail();
 
+	viewCells.clear();
+	
 	// traverse the view space subdivision
 	CastLineSegment(origin, termination, viewCells);
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 2013)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 2014)
@@ -1,5 +1,5 @@
 #############################################################################
 # Makefile for building: preprocessor
-# Generated by qmake (2.00a) (Qt 4.1.2) on: po 22. I 16:06:29 2007
+# Generated by qmake (2.00a) (Qt 4.1.2) on: po 22. I 16:16:03 2007
 # Project:  preprocessor.pro
 # Template: app
Index: GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp	(revision 2003)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp	(revision 2014)
@@ -767,5 +767,5 @@
 		if (!node->IsLeaf())
 		{
-			KdInterior *in = dynamic_cast<KdInterior *>(node);
+			KdInterior *in = (KdInterior *)node;
 			position = in->mPosition;
 			axis = in->mAxis;
@@ -812,5 +812,5 @@
 		{
 			// compute intersection with all objects in this leaf
-			KdLeaf *leaf = dynamic_cast<KdLeaf *>(node);
+		  KdLeaf *leaf = (KdLeaf *)node;
 
 			// add view cell to intersections
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.h	(revision 1989)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.h	(revision 2014)
@@ -93,5 +93,6 @@
   KdNode *mOriginNode;
 
-
+  VssRay() {}
+  
   VssRay(
 		 const Vector3 &origin,
Index: GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.cpp	(revision 2013)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.cpp	(revision 2014)
@@ -235,4 +235,5 @@
   int hits = 0;
 
+
 #if DEBUG_RAYCAST
   static int id=0;
@@ -291,6 +292,13 @@
 
 	  if (!pruneInvalidRays || hitA.mObject) {
+#if DEBUG_RAYCAST
+		Debug<<"PR2a"<<flush;
+#endif
+		
 		VssRay *vssRay = mVssRayPool.Alloc();
-		cerr<<vssRay<<endl;
+
+#if DEBUG_RAYCAST
+		Debug<<"PR2b"<<flush;
+#endif
 		*vssRay = VssRay(
 						 !castDoubleRay ? simpleRay.mOrigin : clipB,
@@ -301,4 +309,7 @@
 						 simpleRay.mPdf
 						 );
+#if DEBUG_RAYCAST
+		Debug<<"PR2c"<<flush;
+#endif
 
 		if (validA)
@@ -320,5 +331,4 @@
 		{
 		  VssRay *vssRay = mVssRayPool.Alloc();
-		  cerr<<vssRay<<endl;
 				
 		  *vssRay = VssRay(
Index: GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro	(revision 1989)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro	(revision 2014)
@@ -25,5 +25,5 @@
 unix:INCLUDEPATH += ../support/src/xerces-c-src_2_7_0/include
 
-INCLUDEPATH += ../src ../src/QtInterface $$NONGTP/Xerces/xerces/include  $$NONGTP/Zlib/include $$NONGTP/Boost $$NONGTP/Devil/include
+INCLUDEPATH += ../src ../src/Timer ../src/QtInterface $$NONGTP/Xerces/xerces/include  $$NONGTP/Zlib/include $$NONGTP/Boost $$NONGTP/Devil/include
 
 win32:LIBPATH += GL $$NONGTP/Xerces/xerces/lib $$NONGTP/Devil/lib \
