Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.sh
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.sh	(revision 1982)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.sh	(revision 2064)
@@ -9,5 +9,7 @@
 PROGRAM=../bin/$TARGET/Preprocessor.exe
 
-SCENE=vienna_cropped
+#SCENE=vienna_cropped
+SCENE=soda5
+
 LOG_PREFIX=../scripts/$SCENE
 ENVIRONMENT=generate_viewcells.env
@@ -15,31 +17,23 @@
 echo "starting $TARGET mode for $SCENE scene"
 
-############################################################################
+#!/bin/sh
 
- METHOD=interleaved
- echo "$SCENE $METHOD"
+PROGRAM=../bin/release/Preprocessor.exe
+SCENE=generate_viewcells
 
- $PROGRAM $ENVIRONMENT \
- -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
-  -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
-  -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \
-  -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \
-  -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \
-  -hierarchy_construction_type=2 \
-  -hierarchy_construction_consider_memory=true
+LOG_PREFIX=../scripts/vienna
 
-############################################################################
+ENVIRONMENT=$SCENE.env
 
-#  METHOD=fast
-#  echo "$SCENE $METHOD"
 
-#  $PROGRAM $ENVIRONMENT \
-#  -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
-#   -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
-#   -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \
-#   -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \
-#   -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \
-#   -hierarchy_construction_type=0 \
-#   -hierarchy_construction_consider_memory=true \
-#   -bvh_term_max_leaves=10000 \
-#   -hierarchy_term_max_leaves=20000 
+###############################################
+
+METHOD=avs
+echo "$SCENE $METHOD"
+
+$PROGRAM $ENVIRONMENT \
+-view_cells_type=vspBspTree \
+-view_cells_filename=$LOG_PREFIX-visibility.xml.zip
+
+mv debug.log $LOG_PREFIX-$METHOD-debug.log
+
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env	(revision 1969)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env	(revision 2064)
@@ -5,23 +5,6 @@
 
 Scene {
-
-#	filename glasgow1.x3d
-#	filename vienna.x3d
-#	filename ../data/vienna/vienna-simple.x3d
-#	filename ../data/vienna/vienna-buildings.x3d
-#	filename ../data/vienna/vienna-roofs.x3d
-#	filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d
-#	filename ../data/vienna/vienna-buildings_vienna-roofs_vienna-roads_vienna-plane_cropped.obj
-	filename ../data/vienna/vienna_cropped.obj
-#;../data/vienna/vienna-plane.x3d
-#	filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d;../data/vienna/vienna-plane.x3d
-#	filename ../data/vienna/viewcells-25-sel.x3d
-#	filename ../data/atlanta/atlanta2.x3d
-#	filename ../data/soda/soda.dat
-#	filename ../data/soda/soda5.dat
-#	filename ../data/artificial/cube_test.x3d
-#	filename ../data/grandcanyon1_RotXmin90.obj
-#	filename ../data/CityModel.obj
-#	filename ../data/arena/arena-low-lods.obj
+#	filename ../data/vienna/vienna_cropped.obj
+	filename ../data/soda/soda5.dat
 }
 
@@ -143,5 +126,5 @@
 
 	# type of view cells
-	type vspOspTree
+	type vspBspTree
 	
 	#percentage of total visible objects where pvs is considered invalid
@@ -168,5 +151,5 @@
 	Visualization {
 		# how much samples we use for visualization
-		samples 200
+		samples 0
 		exportRays true
 		exportGeometry true
@@ -199,89 +182,79 @@
 
 
-################################
-#
-# View space partitioning kd tree
-#
-
-VspTree {
+VspBspTree {
 	Construction {
-		renderCostDecreaseWeight 1.0
-	}
-
+		samples 500000
+		epsilon 0.0000001
+		randomize false
+		renderCostWeight 1.0
+	}
+
+
+	# random polygon       = 1
+	# axis aligned         = 2
+	# least ray splits     = 256
+	# balanced rays        = 512
+	# pvs                  = 1024
+	
+	splitPlaneStrategy 1026
+	
+	# maximal candidates for split planes
+	maxPolyCandidates 0
+
+	usePolygonSplitIfAvailable false
+
+	# maximal tested rays for split cost heuristics
+	maxTests 10000
+	
+	maxTotalMemory	50
+	maxStaticMemory	50
+
+	subdivisionStats ../subdivisionStats.log
+
+	# factors for evaluating split plane costs
+	Factor {
+		leastRaySplits 1.0
+	  	balancedRays 1.0
+	  	pvs 1.0
+	}
+	
 	Termination {
-		minPvs 0
-		maxViewCells 500000
-	}
+		# parameters used for autopartition
+		minRays 		-1
+		minPolygons 		-1
+		maxDepth		25
+		minPvs 			0
+		minProbability		0.000001
+		maxRayContribution	1
+		maxCostRatio		0.9
+		missTolerance		6
+		globalCostMissTolerance 4
+		minGlobalCostRatio      0.0001
+
+		maxViewCells		200
+	
+
+		# used for pvs criterium
+		ct_div_ci 0.0
+		
+		AxisAligned {
+			minRays 		50000
+			maxRayContribution	9.9
+		}
+	}
+	
+	useSplitCostQueue true
+
+	splitUseOnlyDrivingAxis false
+	simulateOctree false
+	useRandomAxis false
+	usePolygonSplitIfAvailable false
+	nodePriorityQueueType 0
 
 	useCostHeuristics true
-	splitUseOnlyDrivingAxis false
-
-	# maximum number of tests per node
-	maxTests 50000
-}
-
-
-##########################
-#
-# The bounding volume hierarchy
-#
-
-BvHierarchy {
-
-	Construction {		
-		renderCostDecreaseWeight 1.0
-	}
-
-	Termination {
-		maxLeaves 50000000
-	}
-
-	minRaysForVisibility 15
-
-	# use only surface area heuristic	
-	useCostHeuristics true
-	useSah false
-
-	splitUseOnlyDrivingAxis false
-
-	maxTests 50000
-}
-
-
-###############################################################
-#
-# Manages the construction of view space and object space partition
-#
-
-Hierarchy {
-	# the type of object space partition: view space is always vsp (=kd) partition
-	type bvh
-	
-	Construction {
-
-		samples 3000000
-
-		# type 0 = sequential computation, 1 = interleaved, 2 = gradient
-		type 2
-
-		###############################
-		# only for interleaved method
-
-		# minimal steps of same type for gradient method
-		minStepsOfSameType 100
-		# maximum steps of same type for gradient method
-		maxStepsOfSameType 900
-
-		# maximum number of repair steps per gradient step
-		maxRepairs 1000
-	}
-
-	Termination {
-		# maximal number of leaves
-		maxLeaves 100000
-		# maximal memory in MB
-		maxMemory 18
-		# minimum ratio of global cost decrease
-		minGlobalCostRatio -1
-	}
-}
+
+	Visualization {
+		# x3d visualization of the split planes
+		exportSplits false
+	}
+}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2053)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2064)
@@ -352,48 +352,4 @@
 
 
-/*bool ViewCellsManager::GenerateRandomViewCells(vector<ViewCellPoints *> &viewCells,
-											   const int nViewCells,
-											   const int nViewPoints)
-{
-	ViewCellContainer rViewCells;
-
-	cout << "generating " << nViewCells << " random view cells" << endl;
-	GenerateRandomViewCells(rViewCells, nViewCells);
-
-	cout << "finished" << endl;
-
-	//for (int i = 0; i < viewCells.size(); ++ i)
-	//	cout << "vc " << i << ": " << viewCells[i]->GetId() << endl;
-
-	cout << "generating " << nViewPoints << " view points per view cell" << endl;
-	ViewCellContainer::const_iterator vit, vit_end = rViewCells.end();
-    
-	int i = 0;
-    for (vit = rViewCells.begin(); vit != vit_end; ++ vit, ++ i)
-	{
-		ViewCell *vc = *vit;
-
-		ViewCellPoints *vcPts = new ViewCellPoints();
-		viewCells.push_back(vcPts);
-
-		vcPts->first = vc;
-
-		SimpleRayContainer viewPoints;
-		cout << "processing view cell " << i << endl;
-		// generate random view points
-		GenerateViewPoints(vc, nViewPoints, viewPoints);
-		
-		SimpleRayContainer::const_iterator pit, pit_end = viewPoints.end();
-
-		for (pit = viewPoints.begin(); pit != pit_end; ++ pit)
-		{
-			vcPts->second.push_back(*pit);	
-		}
-	}
-
-	return true;
-}*/
-
-
 bool ViewCellsManager::GenerateRandomViewCells(vector<ViewCellPoints *> &viewCells,
 											   const int nViewCells,
@@ -429,5 +385,5 @@
 
 			SimpleRayContainer viewPoints;
-			cout<<"here18"<<endl;
+			
 			// generate random view points
 			if (IsValidViewSpace(viewCell) && 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp	(revision 2020)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp	(revision 2064)
@@ -2387,4 +2387,5 @@
 			VspLeaf *leaf = static_cast<VspLeaf *>(node);
 			ViewCell *viewCell;
+
 			if (0)
 				viewCell = mViewCellsTree->GetActiveViewCell(leaf->GetViewCell());
