Index: GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h	(revision 610)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h	(revision 677)
@@ -108,8 +108,28 @@
   bool RemoveSample(T sample, const float pdf);
 
+  /** Compute continuous PVS difference */
+  void ComputeContinuousPvsDifference(const Pvs<T> &pvs,
+									  float &pvsReduction,
+									  float &pvsEnlargement);
+  
+
+					  
+					  
   /// Map of PVS entries
   std::map<T, PvsData<T>, LtSample<T> > mEntries;
 };
 
+
+
+/** Compute continuous PVS difference */
+template <typename T>
+void
+Pvs<T>::ComputeContinuousPvsDifference(const Pvs<T> &pvs,
+									   float &pvsReduction,
+									   float &pvsEnlargement)
+{
+  
+
+}
 
 template <typename T>
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 589)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 677)
@@ -1,5 +1,5 @@
 #############################################################################
 # Makefile for building: preprocessor
-# Generated by qmake (2.00a) (Qt 4.1.0) on: so 4. II 09:57:31 2006
+# Generated by qmake (2.00a) (Qt 4.1.0) on: út 14. II 10:13:02 2006
 # Project:  preprocessor.pro
 # Template: app
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 676)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 677)
@@ -33,4 +33,19 @@
 struct BspRay;
 
+
+/** Probably Visible Set */
+class PrVs {
+  /// viewcells
+  ViewCellContainer mVviewCells;
+  /// aggregatred pvs
+  ObjectPvs mPvs;
+
+  // input parameter is the render budget for the PrVS
+  float mRenderBudget;
+
+  /// some characteristic values could be here
+  
+};
+
 /**
 	Manages different higher order operations on the view cells.
@@ -203,5 +218,9 @@
 	virtual void GetPvsStatistics(PvsStatistics &stat);
 
-	/** Get a viewcell containing the specified point */
+  virtual void GetPrVS(const Vector3 &viewPoint,
+					   PrVs &prvs
+					   ) {}
+  
+  /** Get a viewcell containing the specified point */
 	virtual ViewCell *GetViewCell(const Vector3 &point) const = 0;
   
Index: GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp	(revision 608)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp	(revision 677)
@@ -472,6 +472,15 @@
   // if not already loaded, construct view cells from file
   if (!mLoadViewCells) {	
-	
+
+	if (0) 
 	  mViewCellsManager->SetViewSpaceBox(mKdTree->GetBox());
+	else {
+	  AxisAlignedBox3 box = mKdTree->GetBox();
+	  float s = box.Size(0);
+	  box.Scale(0.1f);
+	  box.SetMin(0, box.Min(0) + s);
+	  box.SetMax(0, box.Max(0) + s);
+	  mViewCellsManager->SetViewSpaceBox(box);
+	}
 
 	  // construct view cells using it's own set of samples
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp	(revision 675)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp	(revision 677)
@@ -565,4 +565,6 @@
 		// HACK: enlarge in y directon
 		mViewSpaceBox = new AxisAlignedBox3(mKdTree->GetBox());
+
+		if (0) {
 		//Vector3 pmin = mViewSpaceBox->Min();
 		Vector3 size = mViewSpaceBox->Size();
@@ -571,6 +573,15 @@
 
 		mViewSpaceBox->Enlarge(enlarge);
+		} else {
+		  // $$ JB temporary
+		  AxisAlignedBox3 box = *mViewSpaceBox;
+		  float s = box.Size(0);
+		  box.Scale(0.8f);
+		  box.SetMax(0, box.Max(0) + s*0.8f);
+		  box.SetMin(0, box.Min(0) + s*0.8f);
+		  *mViewSpaceBox = box;
+		}
+		
 	  }
-
 	  //Debug << "view space box: " << *mViewSpaceBox << endl;
   }
@@ -695,6 +706,6 @@
 
   
-  //int numExportRays = 5000;
-  int numExportRays = 0;
+  int numExportRays = 2000;
+  //int numExportRays = 0;
 
   if (numExportRays) {
Index: GTP/trunk/Lib/Vis/Preprocessing/src/default.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/default.env	(revision 608)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/default.env	(revision 677)
@@ -23,6 +23,6 @@
 	useGlRenderer true
 #	type sampling
-#	type vss
-	type rss
+	type vss
+#	type rss
 	detectEmptyViewSpace true
 	pvsRenderErrorSamples 10000
@@ -39,4 +39,6 @@
 	loadInitialSamples  false
 	storeInitialSamples false
+	useViewSpaceBox true
+	enlargeViewSpace true
 }
 
@@ -72,6 +74,6 @@
 
 RssPreprocessor {
-	samplesPerPass 500
-	initialSamples 100
+	samplesPerPass 100000
+	initialSamples 100000
 	vssSamples 100
 	vssSamplesPerPass 100
@@ -169,24 +171,23 @@
 	# samples used for view cell construction
 	Construction {
-		samples 600000
+		samples 100000
 		samplesPerPass 200000
 	}
 
 	#number of active view cells
-	active 10000
+	active 1024
 	maxStaticMemory	40
 
-	exportToFile false
+	exportToFile true
 	loadFromFile false
 
 	#type kdTree
 	#type vspKdTree
-	#type bspTree
-	type vspBspTree
-	
+	type bspTree
+	#type vspBspTree
 	#type sceneDependent
 	
 	height 5.0
-	maxViewCells 100000
+	maxViewCells 3000
 
 	#percentage of total visible objects where pvs is considered invalid
@@ -195,17 +196,22 @@
 	pruneEmptyViewCells false
 	processOnlyValidViewCells false
-	
+
+	#stats viewCellStats.log
+
+	samplingType directional
+	#samplingType box
+
 	PostProcess {
 		# how much samples are used for post processing
-		samples 300000
+		samples 100000
 		renderCostWeight 1.0
 		maxCostRatio 0.1
 		minViewCells 1
-		avgCostMaxDeviation 0.8
-		maxMergesPerPass 500 
+		avgCostMaxDeviation 0.01
+		maxMergesPerPass 5000
 		useRaysForMerge false
 		refine false
 		compress false
-		merge true
+		merge false
 	}
 
@@ -217,11 +223,20 @@
 		#colorCode MergedTreeDiff
 		colorCode Random
-		exportRays true
-		exportGeometry true
+		exportRays false
+		exportGeometry false
 		exportMergedViewCells false
-		useCuttingPlane false
-		cuttingPlaneAxis 1
-	}
-	
+		useClipPlane true
+		clipPlaneAxis 1
+	}
+
+	showVisualization false	
+	evaluateViewCells false
+	
+	Evaluation {
+		samplesPerPass 80000
+		samples 1000000
+		statsPrefix ../scripts/viewCells
+	}
+
 #	filename ../data/atlanta/atlanta_viewcells_large.x3d
 #	filename ../data/vienna/viewcells-25-sel.x3d
@@ -229,5 +244,6 @@
 #	filename ../data/vienna/viewcells-large-sel.x3d
 #	filename ../scripts/viewcells_vienna.xml
-	filename ../scripts/viewcells_atlanta.xml
+#	filename ../scripts/viewcells_atlanta.xml
+	filename ../scripts/viewcells_soda5.xml
 }
 
@@ -241,24 +257,24 @@
 
 
-
 VspKdTree {
 	epsilon		1e-6
 
 	Construction {
-		samples 300000
+		samples 500000
 	}
 	
 	Termination {
 		maxDepth	 	40
-		minPvs			50
-		minRays			300
+		minPvs			0
+		minRays			1
 		minSize			0.001
-		maxCostRatio		0.9
+		maxCostRatio		5.9
+		maxViewCells		169
 		missTolerance		4
-		maxRayContribution 	0.5
+		maxRayContribution 	2.5
 	}
 	
 	maxTotalMemory	100
-	maxStaticMemory	50
+	maxStaticMemory	40
 
 	splitType 	regular
@@ -270,6 +286,6 @@
 	PostProcess {
 		maxCostRatio 0.005
-		minViewCells 200
-		maxPvsSize   50000
+		minViewCells 10000
+		maxPvsSize   5000
 	}
 	
@@ -278,11 +294,9 @@
 	}
 }
-
-
 
 VspBspTree {
 	Construction {
-		samples 1000000
-		epsilon 0.005
+		samples 800000
+		epsilon 0.0005
 		randomize false
 		renderCostWeight 1.0
@@ -296,10 +310,11 @@
 	# pvs                  = 1024
 	
-	splitPlaneStrategy 1024
+	splitPlaneStrategy 1026
 	
 	# maximal candidates for split planes
-	maxPolyCandidates 0
-
-	
+	maxPolyCandidates 150
+
+	usePolygonSplitIfAvailable false
+
 	# maximal tested rays for split cost heuristics
 	maxTests 10000
@@ -307,5 +322,7 @@
 	maxTotalMemory	50
 	maxStaticMemory	50
-	
+
+	subdivisionStats ../subdivisionStats.log
+
 	# factors for evaluating split plane costs
 	Factor {
@@ -317,33 +334,136 @@
 	Termination {
 		# parameters used for autopartition
-		minRays 		-150
+		minRays 		-15
 		minPolygons 		-1
-		maxDepth		30
-		minPvs 			-10
-		#minProbability		0.0001
-		minProbability 		-1
-#		maxRayContribution	0.3
-		maxRayContribution	2.3
-#		maxCostRatio		0.9
-		maxCostRatio		3.9
-		missTolerance		3
-
-		
-		maxViewCells		50000
-		
+		maxDepth		25
+		minPvs 			-15
+		minProbability		0.00000001
+		maxRayContribution	1.8
+		maxCostRatio		1.8
+		missTolerance		6
+		globalCostMissTolerance 4
+		minGlobalCostRatio      0.0000001
+#		minGlobalCostRatio      0.0001
+		maxViewCells		20000
+	
+
 		# used for pvs criterium
 		ct_div_ci 0.0
 		
 		AxisAligned {
-			minRays 		1
+			minRays 		50000
 			maxRayContribution	9.9
 		}
 	}
 	
-	splitUseOnlyDrivingAxis true
-	
+	useSplitCostQueue true
+	useCostHeuristics true
+
+	splitUseOnlyDrivingAxis false
+	simulateOctree false
+	useRandomAxis false
+	usePolygonSplitIfAvailable false
+	useBreathFirstSplits false
+
 	Visualization {
 		# x3d visualization of the split planes
-		exportSplits true
-	}
-}
+		exportSplits false
+	}
+}
+
+BspTree {
+	Construction {
+		samples 300000
+		epsilon 0.005
+	}
+
+
+	# random polygon       = 1
+	# axis aligned         = 2
+	# least splits         = 4
+	# balanced polygons    = 8
+	# balanced view cells  = 16
+	# largest polygon area = 32
+	# vertical axis        = 64
+	# blocked rays         = 128
+	# least ray splits     = 256
+	# balanced rays        = 512
+	# pvs                  = 1024
+
+	# least splits + balanced polygons
+	#splitPlaneStrategy 12
+	
+	#axis aligned + vertical axis
+	#splitPlaneStrategy 66
+	
+	# axis aligned + balanced view cells
+	# splitPlaneStrategy 18
+	
+	# largest polygon area
+	#splitPlaneStrategy 32
+	
+	# axus aligned + balanced polygons
+	#splitPlaneStrategy 72
+	
+	# axis aligned + blocked rays
+	#splitPlaneStrategy 130
+	
+	#splitPlaneStrategy 384
+	#splitPlaneStrategy 130
+	
+	splitPlaneStrategy 32
+	
+	maxPolyCandidates 100
+	maxRayCandidates 0
+	
+	maxTests 10000
+	
+	subdivisionStats ../subDivisionStats.log
+
+	# factors for evaluating split plane costs
+	Factor {
+		verticalSplits 1.0
+	  	largestPolyArea 1.0
+	  	blockedRays 1.0
+	  	leastRaySplits 1.0
+	  	balancedRays 1.0
+	  	pvs 1.0
+	  	leastSplits 1.0
+	  	balancedPolys 1.0
+	  	balancedViewCells 1.0
+	}
+	
+	Termination {
+		# parameters used for autopartition
+		minRays -1
+		minPolygons 0
+		maxDepth 30
+		minPvs -1
+		minProbability 0.00001
+		maxRayContribution 9999
+		maxViewCells 20000
+
+		# used for pvs criterium
+		ct_div_ci 0.0
+	
+		maxCostRatio 0.9
+		
+		# axis aligned splits
+		AxisAligned {
+			minPolys 5000
+			minRays 500
+			minObjects 10
+			ct_div_ci 0.5
+		}
+	}
+	
+	AxisAligned {
+		splitBorder 0.01
+	}
+	
+	
+	Visualization {
+		# x3d visualization of the split planes
+		exportSplits false
+	}
+}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro	(revision 563)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro	(revision 677)
@@ -2,4 +2,6 @@
 
 TARGET = preprocessor
+
+NONGTP = ../../../../../../NonGTP
 
 #win32:INCLUDEPATH += c:/STLport-4.6.2/stlport
@@ -8,8 +10,8 @@
 unix:INCLUDEPATH += ../support/src/xerces-c-src_2_7_0/include
 
-INCLUDEPATH += ../src  ../support/xerces/include  ../support/zlib/include ../support/boost ../support/devil/include
+INCLUDEPATH += ../src  $$NONGTP/Xerces/xerces/include  $$NONGTP/Zlib/include $$NONGTP/Boost $$NONGTP/Devil/include
 
 
-win32:LIBPATH += ../support/xerces/lib ../support/devil/lib "d:/Programs/NVIDIA Corporation/Cg/lib"
+win32:LIBPATH += $$NONGTP/Xerces/xerces/lib $$NONGTP/Devil/lib "d:/Programs/NVIDIA Corporation/Cg/lib"
 unix:LIBPATH += ../support/src/xerces-c-src_2_7_0/lib ../support/devil/lib /usr/lib/qt3/lib64
 
