Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.sh
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.sh	(revision 2073)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.sh	(revision 2530)
@@ -40,5 +40,5 @@
    -hierarchy_subdivision_stats=$LOG_PREFIX-hierarchy-subdivisionStats.log \
    -hierarchy_construction_type=0 \
-   -hierarchy_construction_consider_memory=true
+   -hierarchy_construction_consider_memory=false
 
 #   -bvh_term_max_leaves=10000 \
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna_cropped_gi.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna_cropped_gi.env	(revision 1919)
+++ 	(revision )
@@ -1,345 +1,0 @@
-##############################################################################
-# ERS default configuration file
-# Jiri Bittner 2003
-#############################################################################
-
-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
-#	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-high-lods.obj
-}
-
-
-Preprocessor {
-	samplesFilename rays.out
-#	useGlRenderer true
-	useGlRenderer false
-	type vss
-	detectEmptyViewSpace true
-	loadMeshes false
-	# internal raycaster
-	#rayCastMethod 0
-	# intel raycaster
-	rayCastMethod 1
-	exportVisibility false
-	loadKdTree false
-	exportKdTree false 
-	applyVisibilityFilter false
-	applyVisibilitySpatialFilter false
-
-	histogram {
-		intervals 20
-	}
-}
-
-
-VssPreprocessor {
-	initialSamples 0
-	vssSamples 0
-	useImportanceSampling true
-	loadInitialSamples  false
-	storeInitialSamples false
-}
-
-
-VssTree {
-	useRss    false
-	epsilon		1e-6
-	
-	maxDepth 	2
-	minPvs		30
-	minRays		800
-	minSize		0.001
- 	maxCostRatio	1.5
-	maxRayContribution 0.5
-		
-	maxTotalMemory	50
-	maxStaticMemory	20
-	
-	splitType regular
-	#	splitType heuristic
-	#	splitType hybrid
-	splitUseOnlyDrivingAxis true
-	
-	interleaveDirSplits	true
-    	dirSplitDepth 0
-	
-	numberOfEndPointDomains	10000
-	ct_div_ci	0.0
-	randomize	false
-	
-	refDirBoxMaxSize	0.1
-}
-
-
-Limits {
-       threshold	1e-6
-       small		1e-6
-       infinity		1e9
-}
-
-
-Unigraphics {
-	meshGrouping 1
-}
-
-
-KdTree {
-	sahUseFaces true
-
-	Termination {
-		minCost 0
-		maxDepth 20
-		
-		maxCostRatio 1.5
-		ct_div_ci 0.5
-	}
-
-#	splitMethod spatialMedian
-	splitMethod SAH
-	splitBorder 0.01
-}
-
-MeshKdTree {
-	Termination {
-		minCost 1
-		maxDepth 18
-		maxCostRatio 0.9
-		ct_div_ci 0.5
-	}
-
-#	splitMethod spatialMedian
-	splitMethod SAH
-	splitBorder 0.01
-}
-
-
-ViewCells {
-	
-	# samples used for view cell construction 
-	# (after the sampling used for the hierarchy)
-	Construction {
-		samples 0
-		samplesPerPass 1000000
-	}
-
-	# number of active view cells
-	active 25000
-	maxStaticMemory	40
-
-	exportToFile true
-	loadFromFile false
-
-	exportPvs false
-
-	# type of view cells
-	type vspOspTree
-	
-	compressObjects true
-
-	#percentage of total visible objects where pvs is considered invalid
-	maxPvsRatio 1.0
-		
-	processOnlyValidViewCells false
-
-	#samplingType object_directional
-	#samplingType directional
-	samplingType box
-	#samplingType reverse_object
-	#samplingType object
-
-	PostProcess {
-		# how much samples are used for post processing
-		samples 0
-		maxMergesPerPass 5000
-		useRaysForMerge false
-		refine false
-		compress true
-		merge false
-	}
-
-	Visualization {
-		# how much samples we use for visualization
-		samples 200
-		exportRays true
-		exportGeometry true
-		exportMergedViewCells false
-		useClipPlane true
-		clipPlaneAxis 1
-		clipPlanePos 0.3
-		maxOutput 0
-	}
-
-	showVisualization true
-	#showVisualization false
-	evaluateViewCells true
-	
-	Evaluation {
-		samples         160000000
-		samplesForStats 80000000
-
-		#samples         60000000
-		#samplesForStats 20000000
-
-		samplesPerPass  1000000
-		
-		stepSize	500
-
-		#samplingType object_directional
-		#samplingType reverse_object
-		#samplingType object
-		samplingType box
-
-		histogram true
-		histoStepSize 200
-		histoMem 60
-
-		statsPrefix ../scripts/viewCells
-	}
-}
-
-
-################################
-#
-# View space partitioning kd tree
-#
-
-VspTree {
-	Construction {
-		renderCostDecreaseWeight 0.999
-	}
-
-	Termination {
-		minPvs 0
-		maxViewCells 500000
-	}
-
-	#useCostHeuristics true
-	#splitUseOnlyDrivingAxis true
-
-	useCostHeuristics false
-	splitUseOnlyDrivingAxis false
-
-	# maximum number of tests per node
-	maxTests 500000
-}
-
-
-##########################
-#
-# The bounding volume hierarchy
-#
-
-BvHierarchy {
-
-	Construction {		
-		renderCostDecreaseWeight 0.999
-	}
-
-	Termination {
-		maxLeaves 50000000
-	}
-
-	minRaysForVisibility 15
-
-	# use only surface area heuristic	
-	useCostHeuristics true
-	#useCostHeuristics false
-	useSah true
-
-	#splitUseOnlyDrivingAxis true
-	splitUseOnlyDrivingAxis false
-
-	maxTests 500000
-}
-
-
-###############################################################
-#
-# 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 6000000
-
-		# type 0 = sequential computation, 1 = interleaved, 2 = gradient
-		type 1
-
-		# if the object space should be subdivided first (if false, the view space is subdivided first)
-		startWithObjectSpace true
-
-		###############################
-		# only for interleaved method
-
-		# if dirty split candidates are reevaluated 
-		repairQueue true
-
-		# recompute split plane when "repairing" a candidate
-		recomputeSplitPlaneOnRepair true
-
-		###################################################
-
-		# iterative construction of vs partititon and os partition
-		useMultiLevel false
-
-		# number of iteration steps
-		levels 3
-
-		# minimal steps of same type: for interleaved, this is only valid for the first few splits
-		minStepsOfSameType 100
-		maxStepsOfSameType 900
-
-		maxAvgRayContri 9999
-		minAvgRayContri 9900
-
-		maxRepairs 2000
-	}
-
-	Termination {
-		# maximal number of leaves
-		maxLeaves 300000
-		# maximal memory in MB
-		#maxMemory 20
-		maxMemory 35
-		# minimum ratio of global cost decrease
-		minGlobalCostRatio -1
-	}
-}
-
-
-VspBspTree {
-	Construction {
-		samples 100000
-	}
-
-	Termination {
-		minPvs 0
-		maxViewCells 1000
-	}
-
-	useCostHeuristics true
-	splitUseOnlyDrivingAxis false
-
-	# maximum number of tests per node
-	maxTests 100000
-}
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/vsposp_typical.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/vsposp_typical.env	(revision 1727)
+++ 	(revision )
@@ -1,295 +1,0 @@
-##############################################################################
-# ERS default configuration file
-# Jiri Bittner 2003
-#############################################################################
-
-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
-#;../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
-}
-
-
-Preprocessor {
-	samplesFilename rays.out
-#	useGlRenderer true
-	useGlRenderer false
-	type vss
-	detectEmptyViewSpace true
-	loadMeshes false
-	# internal raycaster
-	rayCastMethod 0
-	exportVisibility false
-	loadKdTree false
-	exportKdTree false 
-}
-
-
-VssPreprocessor {
-	initialSamples 0
-	vssSamples 0
-	useImportanceSampling true
-	loadInitialSamples  false
-	storeInitialSamples false
-	useViewSpaceBox false
-}
-
-
-VssTree {
-	useRss    false
-	epsilon		1e-6
-	
-	maxDepth 	2
-	minPvs		30
-	minRays		800
-	minSize		0.001
- 	maxCostRatio	1.5
-	maxRayContribution 0.5
-		
-	maxTotalMemory	50
-	maxStaticMemory	20
-	
-	splitType regular
-	#	splitType heuristic
-	#	splitType hybrid
-	splitUseOnlyDrivingAxis true
-	
-	interleaveDirSplits	true
-    dirSplitDepth 0
-	
-	numberOfEndPointDomains	10000
-	ct_div_ci	0.0
-	randomize	false
-	
-	refDirBoxMaxSize	0.1
-}
-
-
-Limits {
-       threshold	1e-6
-       small		1e-6
-       infinity		1e9
-}
-
-
-Unigraphics {
-	meshGrouping 1
-}
-
-
-KdTree {
-	sahUseFaces true
-
-	Termination {
-		minCost 0
-		maxDepth 20
-		
-		maxCostRatio 1.5
-		ct_div_ci 0.5
-	}
-
-#	splitMethod spatialMedian
-	splitMethod SAH
-	splitBorder 0.01
-}
-
-MeshKdTree {
-	Termination {
-		minCost 1
-		maxDepth 18
-		maxCostRatio 0.9
-		ct_div_ci 0.5
-	}
-
-#	splitMethod spatialMedian
-	splitMethod SAH
-	splitBorder 0.01
-}
-
-
-ViewCells {
-	
-	# samples used for view cell construction 
-	# (after the sampling used for the hierarchy)
-	Construction {
-		samples 0
-		samplesPerPass 1000000
-	}
-
-	# number of active view cells
-	active 25000
-	maxStaticMemory	40
-
-	exportToFile false
-	loadFromFile false
-
-	type vspOspTree
-	
-	#percentage of total visible objects where pvs is considered invalid
-	maxPvsRatio 1.0
-		
-	processOnlyValidViewCells false
-
-	#stats viewCellStats.log
-	#samplingType directional
-	samplingType box
-
-	PostProcess {
-		# how much samples are used for post processing
-		samples 0
-		maxMergesPerPass 5000
-		useRaysForMerge false
-		refine false
-		compress false
-		merge false
-	}
-
-	Visualization {
-		# how much samples we use for visualization
-		samples 200
-		exportRays true
-		exportGeometry true
-		exportMergedViewCells false
-		useClipPlane true
-		clipPlaneAxis 1
-		clipPlanePos 0.3
-		maxOutput 2
-	}
-
-	showVisualization true
-	evaluateViewCells true
-	
-	Evaluation {
-		samplesPerPass 10000
-		samples 50000
-		statsPrefix ../scripts/viewCells
-	}
-}
-
-
-################################
-#
-# View space partitioning kd tree
-#
-
-VspTree {
-	Construction {
-	}
-
-	Termination {
-		minPvs 0
-		maxViewCells 500000
-	}
-
-	useCostHeuristics true
-	splitUseOnlyDrivingAxis false
-
-	# maximum number of tests per node
-	maxTests 30000
-}
-
-
-##########################
-#
-# The bounding volume hierarchy
-#
-
-BvHierarchy {
-
-	Construction {
-		
-	}
-
-	Termination {
-		maxLeaves 500000
-	}
-
-	useCostHeuristics true
-	splitUseOnlyDrivingAxis false
-
-	maxTests 30000
-}
-
-
-###############################################################
-#
-# 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 20000
-
-		# type 0 = sequential computation, 1 = interleaved, 2 = gradient
-		type 1
-
-		# if the object space should be subdivided first (if false, the view space is subdivided first)
-		startWithObjectSpace true
-
-		###############################
-		# only for interleaved method
-
-		# if dirty split candidates are reevaluated 
-		repairQueue true
-
-		# recompute split plane when "repairing" a candidate
-		recomputeSplitPlaneOnRepair true
-
-		###################################################
-
-		# iterative construction of vs partititon and os partition
-		useMultiLevel false
-
-		# number of iteration steps
-		levels 3
-
-		# minimal steps of same type: for interleaved, this is only valid for the first few splits
-		minStepsOfSameType 100
-
-		# maximal number of repairs
-		maxRepairs 1000
-	}
-
-	Termination {
-		# maximal number of leaves
-		maxLeaves 2000000
-		# maximal memory in MB
-		maxMemory 1
-		# minimum ratio of global cost decrease
-		minGlobalCostRatio -1
-	}
-}
-
-
-VspBspTree {
-	Construction {
-		samples 100000
-	}
-
-	Termination {
-		minPvs 0
-		maxViewCells 1000
-	}
-
-	useCostHeuristics true
-	splitUseOnlyDrivingAxis false
-
-	# maximum number of tests per node
-	maxTests 100000
-}
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna_simple.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna_simple.env	(revision 955)
+++ 	(revision )
@@ -1,484 +1,0 @@
-#############################################################################
-# ERS default configuration file
-# Jiri Bittner 2003
-#############################################################################
-
-Scene {
-#	filename glasgow1.x3d
-#	filename vienna.x3d
-#	filename ../data/vienna/vienna-simple.x3d
-#	filename ../data/vienna/vienna-buildings.x3d
-	filename ../data/vienna/city1500_flat_1.x3d
-#	filename ../data/vienna/vienna-buildings.x3d;../data/vienna-roads.x3d;../data/vienna/vienna-roofs.x3d
-#filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d
-filename ../data/vienna/city1500_flat_1.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.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/city1500_flat_1.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
-}
-
-Preprocessor {
-	# stored sample rays
-	samplesFilename rays.out
-	useGlRenderer false
-#	type sampling
-	type vss
-#	type rss
-	detectEmptyViewSpace true
-	loadPolygonsAsMeshes false
-	applyVisibilityFilter false
-	applyVisibilitySpatialFilter false
-}
-
-VssPreprocessor {
-	samplesPerPass  100000
-	initialSamples 0
-	vssSamples 0
-	vssSamplesPerPass 500000
-	useImportanceSampling true
-	loadInitialSamples  false
-	storeInitialSamples false
-	useViewSpaceBox false
-#	testBeamSampling true
-}
-
-
-SamplingPreprocessor {
-	totalSamples 500000
-	samplesPerPass  3
-}
-
-
-VssTree {
-	useRss    false
-	epsilon		1e-6
-	
-	maxDepth 	40
-	minPvs		30
-	minRays		800
-	minSize		0.001
- 	maxCostRatio	1.5
-	maxRayContribution 0.5
-		
-	maxTotalMemory	50
-	maxStaticMemory	20
-	
-	splitType regular
-	#	splitType heuristic
-	#	splitType hybrid
-	splitUseOnlyDrivingAxis true
-	
-	interleaveDirSplits	true
-    dirSplitDepth 0
-	
-	numberOfEndPointDomains	10000
-	ct_div_ci	0.0
-	randomize	false
-	
-	refDirBoxMaxSize	0.1
-}
-
-RssPreprocessor {
-	samplesPerPass  100000
-	#initialSamples 500000
-	#vssSamples 10000000
-	#for view cell construction
-	initialSamples 0
-	vssSamples 0
-	vssSamplesPerPass 500000
-	useImportanceSampling true
-
-	directionalSampling true
-	objectBasedSampling false
-
-	Export {
-		pvs false
-		rssTree false
-		rays true
-		numRays 5000
-	}
-
-	useViewcells true
-	updateSubdivision true
-	loadInitialSamples false
-	storeInitialSamples false
-}
-
-
-RssTree {
-
-	epsilon		1e-6
-
-	maxDepth 	40
-	minPvs		3
-	minRays		30
-	minSize		0.001
- 	maxCostRatio 1.0
-	maxRayContribution 0.5
-	maxRays		1000000
-	maxTotalMemory	200
-	maxStaticMemory	100
-
-#	splitType regular
-#	splitType heuristic
-	splitType hybrid
-	splitUseOnlyDrivingAxis true
-	importanceBasedCost false
-
-	interleaveDirSplits	true
-    dirSplitDepth 0
-
-	numberOfEndPointDomains	10000
-	ct_div_ci	0.0
-	randomize	false
-
-	refDirBoxMaxSize	0.1
-}
-
-Limits {
-
-       threshold	1e-6
-       small		1e-6
-       infinity		1e9
-}
-
-Unigraphics {
-		meshGrouping 1
-}
-
-KdTree {
-	sahUseFaces true
-	Termination {
-		minCost 1
-		maxDepth 18
-		maxCostRatio 0.9
-		ct_div_ci 0.5
-	}
-
-#	splitMethod spatialMedian
-	splitMethod SAH
-	splitBorder 0.01
-}
-
-MeshKdTree {
-	Termination {
-		minCost 1
-		maxDepth 18
-		maxCostRatio 0.9
-		ct_div_ci 0.5
-	}
-
-#	splitMethod spatialMedian
-	splitMethod SAH
-	splitBorder 0.01
-}
-
-
-
-ViewCells {
-	# samples used for view cell construction
-	Construction {
-		samples 0
-		samplesPerPass 1500000
-	}
-
-	#number of active view cells
-	active 200000
-	maxStaticMemory	40
-
-	exportToFile true
-	loadFromFile false
-
-	#type kdTree
-	#type vspKdTree
-	#type bspTree
-	type vspBspTree
-	#type sceneDependent
-	
-	height 5.0
-	maxViewCells 3000
-
-	#percentage of total visible objects where pvs is considered invalid
-	maxPvsRatio 1.0
-		
-	pruneEmptyViewCells false
-	processOnlyValidViewCells false
-
-	#stats viewCellStats.log
-
-	#samplingType directional
-	samplingType box
-
-	PostProcess {
-		# how much samples are used for post processing
-		samples 0
-		renderCostWeight 1.0
-		maxCostRatio 0.1
-		minViewCells 1
-		avgCostMaxDeviation 0.01
-		maxMergesPerPass 5000
-		useRaysForMerge false
-		refine false
-		compress false
-		merge true
-		emptyViewCellsMerge false
-	}
-
-	Visualization {
-		# how much samples we use for visualization
-		samples 0
-		#colorCode PVS
-		#colorCode MergedLeaves
-		#colorCode MergedTreeDiff
-		colorCode Random
-		exportRays false
-		exportGeometry true
-		exportMergedViewCells false
-		useClipPlane true
-		clipPlaneAxis 1
-		clipPlanePos  0.3
-	}
-
-	showVisualization true
-	evaluateViewCells false
-	
-	Evaluation {
-		samplesPerPass 1000000
-		samples 1000000
-		statsPrefix ../scripts/viewCells
-		#samplingType directional
-		samplingType box
-		histogram true
-		histoPasses 5000
-	}
-
-#	filename ../data/atlanta/atlanta_viewcells_large.x3d
-#	filename ../data/vienna/viewcells-25-sel.x3d
-#	filename ../data/vienna/viewcells-25.x3d
-#	filename ../data/vienna/viewcells-large-sel.x3d
-#	filename ../scripts/viewcells_vienna.xml
-	filename D:/svn/gametools/GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna_visibility.xml
-}
-
-
-Simulation {
-	objRenderCost 1.0
-	vcOverhead 1.0
-	# always between 0 and 1
-	moveSpeed 0.0001
-}
-
-
-VspKdTree {
-	epsilon		1e-6
-
-	Construction {
-		samples 500000
-	}
-	
-	Termination {
-		maxDepth	 	40
-		minPvs			0
-		minRays			1
-		minSize			0.001
-		maxCostRatio		5.9
-		maxViewCells		169
-		missTolerance		4
-		maxRayContribution 	2.5
-	}
-	
-	maxTotalMemory	100
-	maxStaticMemory	40
-
-	splitType 	regular
-	#splitType 	heuristics
-	splitUseOnlyDrivingAxis true
-	ct_div_ci	0.0
-	
-	PostProcess {
-		maxCostRatio 0.005
-		minViewCells 10000
-		maxPvsSize   5000
-	}
-	
-	
-	Visualization {
-	}
-}
-
-VspBspTree {
-	Construction {
-		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 {
-		# parameters used for autopartition
-		minRays 		-15
-		minPolygons 		-1
-		maxDepth		25
-		minPvs 			0
-		minProbability		0.000001
-		maxRayContribution	1
-		maxCostRatio		0.9
-		missTolerance		6
-		globalCostMissTolerance 4
-		minGlobalCostRatio      0.0000001
-		#minGlobalCostRatio      0.0001
-		maxViewCells		5000
-	
-
-		# used for pvs criterium
-		ct_div_ci 0.0
-		
-		AxisAligned {
-			minRays 		50000
-			maxRayContribution	9.9
-		}
-	}
-	
-	useSplitCostQueue true
-	useCostHeuristics false
-
-	splitUseOnlyDrivingAxis false
-	simulateOctree false
-	useRandomAxis false
-	usePolygonSplitIfAvailable false
-	nodePriorityQueueType 0
-
-	Visualization {
-		# x3d visualization of the split planes
-		exportSplits false
-	}
-}
-
-BspTree {
-	Construction {
-		samples 100000
-		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 50000
-
-		# 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/scripts/vienna_cropped.sh
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna_cropped.sh	(revision 2075)
+++ 	(revision )
@@ -1,208 +1,0 @@
-<<<<<<< .mine
-#!/bin/sh
-
-# add bin to path
-export PATH=../bin:$PATH
-
-#TARGET=debug
-TARGET=release
-
-PROGRAM=../bin/$TARGET/Preprocessor.exe
-
-SCENE=vienna_cropped_gi
-LOG_PREFIX=../scripts/tests/gi/$SCENE-35MB
-ENVIRONMENT=$SCENE.env
-
-echo "starting $TARGET mode for $SCENE scene"
-
-############################################################################
-
- METHOD=gradient-full
- echo "$SCENE $METHOD"
-
-$PROGRAM $ENVIRONMENT \
-  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
-  -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
-  -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
-  -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 \
-  -hierarchy_construction_multilevel=false \
-  -bvh_use_sah=false \
-  -vsp_use_cost_heuristics=true \
-  -hierarchy_construction_recompute_split_on_repair=true
-
-sh movefiles.sh $LOG_PREFIX-$METHOD
-
-#######################################################
-
-NODES=50000
-USE_HEUR=true
-
-  METHOD=sequential-$NODES-$USE_HEUR
-  echo "$SCENE $METHOD"
-
-$PROGRAM $ENVIRONMENT \
-  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
- -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
- -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
- -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 \
- -vsp_use_cost_heuristics=$USE_HEUR \
- -bvh_term_max_leaves=$NODES
-
-sh movefiles.sh $LOG_PREFIX-$METHOD
-
-
-#######################################################
-
-NODES=10000
-USE_HEUR=true
-
-  METHOD=sequential-$NODES-$USE_HEUR
-  echo "$SCENE $METHOD"
-
-$PROGRAM $ENVIRONMENT \
-  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
- -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
- -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
- -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 \
- -vsp_use_cost_heuristics=$USE_HEUR \
- -bvh_term_max_leaves=$NODES
-
-sh movefiles.sh $LOG_PREFIX-$METHOD
-
-#######################################################
-
- METHOD=gradient-full-corr
- echo "$SCENE $METHOD"
-
-$PROGRAM $ENVIRONMENT \
-  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
-  -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
-  -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
-  -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 \
-  -hierarchy_construction_multilevel=false \
-  -bvh_use_sah=false \
-  -vsp_use_cost_heuristics=true \
-  -hierarchy_construction_min_avg_raycontri=0.01 \
-  -hierarchy_construction_max_avg_raycontri=0.5 \
-  -hierarchy_construction_recompute_split_on_repair=true
-
-sh movefiles.sh $LOG_PREFIX-$METHOD
-=======
-#!/bin/sh
-
-# add bin to path
-export PATH=../bin:$PATH
-
-#TARGET=debug
-TARGET=release
-
-PROGRAM=../bin/$TARGET/Preprocessor.exe
-
-SCENE=vienna_cropped_gi
-LOG_PREFIX=../scripts/tests/gi/$SCENE-35MB
-ENVIRONMENT=$SCENE.env
-
-echo "starting $TARGET mode for $SCENE scene"
-
-############################################################################
-
- METHOD=gradient-full
- echo "$SCENE $METHOD"
-
-$PROGRAM $ENVIRONMENT \
-  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
-  -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
-  -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
-  -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 \
-  -hierarchy_construction_multilevel=false \
-  -bvh_use_sah=false \
-  -vsp_use_cost_heuristics=true \
-  -hierarchy_construction_recompute_split_on_repair=true
-
-sh movefiles.sh $LOG_PREFIX-$METHOD
-
-#######################################################
-
-NODES=10000
-USE_HEUR=true
-
-  METHOD=sequential-$NODES-$USE_HEUR
-  echo "$SCENE $METHOD"
-
-$PROGRAM $ENVIRONMENT \
-  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
- -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
- -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
- -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 \
- -vsp_use_cost_heuristics=$USE_HEUR \
- -bvh_term_max_leaves=$NODES
-
-sh movefiles.sh $LOG_PREFIX-$METHOD
-
-#######################################################
-
- METHOD=gradient-full-corr
- echo "$SCENE $METHOD"
-
-$PROGRAM $ENVIRONMENT \
-  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
-  -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
-  -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
-  -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 \
-  -hierarchy_construction_multilevel=false \
-  -bvh_use_sah=false \
-  -vsp_use_cost_heuristics=true \
-  -hierarchy_construction_min_avg_raycontri=0.01 \
-  -hierarchy_construction_max_avg_raycontri=0.5 \
-  -hierarchy_construction_recompute_split_on_repair=true
-
-sh movefiles.sh $LOG_PREFIX-$METHOD
-
-#######################################################
-
-NODES=50000
-USE_HEUR=true
-
-  METHOD=sequential-$NODES-$USE_HEUR
-  echo "$SCENE $METHOD"
-
-$PROGRAM $ENVIRONMENT \
-  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
- -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
- -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
- -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 \
- -vsp_use_cost_heuristics=$USE_HEUR \
- -bvh_term_max_leaves=$NODES
-
-sh movefiles.sh $LOG_PREFIX-$METHOD
-
-
-#######################################################>>>>>>> .r2034
Index: GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 2381)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 2530)
@@ -145,5 +145,5 @@
 				OptimizeForWindowsApplication="TRUE"
 				AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include&quot;;QtInterface;..\src\sparsehash\src\;..\src\ootl\src\include\ootl;..\src\ootl\src\include\ootl\sandbox;$(NOINHERIT)"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG;USE_HASH_PV"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG;USE_VERBOSE_PV"
 				StringPooling="TRUE"
 				MinimalRebuild="TRUE"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 2394)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 2530)
@@ -1326,27 +1326,24 @@
 
 	virtual void CompressViewCells();
-
 	/** Prepare view cells for use after loading them from disc.
 	*/
 	void PrepareLoadedViewCells();
-
 	/** Constructs merge hierarchy which corresponds to the spatial hierarchy.
 	*/
 	ViewCell *ConstructSpatialMergeTree(VspNode *root);
-
 	/** Exports visualization of the PVS.
 	*/
 	void ExportPvs(const ObjectContainer &objects, const VssRayContainer &rays);
-
 	/** Returns a hierarchy manager of the given name.
 	*/
 	static HierarchyManager *CreateHierarchyManager(const string &name);
-
 	/** collect objects intersecting a given spatial box 
 	*/
 	virtual void CollectObjects(const AxisAlignedBox3 &box, ObjectContainer &objects);
 
-
-	/////////////////////////////////////////
+	static void PrintCompressionStats(HierarchyManager *hm, const int pvsEntries);
+
+
+	////////////////////
 
 	bool mCompressObjects;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 2524)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 2530)
@@ -1132,5 +1132,4 @@
 				 "kd_split_method=",
 				 "spatialMedian");
-
   
   RegisterOption("KdTree.pvsArea",
Index: GTP/trunk/Lib/Vis/Preprocessing/src/HashPvs.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/HashPvs.h	(revision 2206)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/HashPvs.h	(revision 2530)
@@ -93,10 +93,9 @@
 public:
 
-	HashPvs()//: mEntries(1009)
+	HashPvs()
 	{
 		 mEntries.set_deleted_key(-1);
 		 mEntries.set_empty_key(-2);
 	};
-	//virtual ~HashPvs() {};
 
 	int GetSize() const;
@@ -107,20 +106,16 @@
 	*/
 	float AddSample(T sample, const float pdf);
-
 	/** Adds sample to PVS without checking for presence of the sample
 		warning: pvs remains unsorted!
 	*/
 	void AddSampleDirty(T sample, const float pdf);
-
 	/** Adds sample dirty (on the end of the vector) but
 		first checks if sample is already in clean part of the pvs.
 	*/
 	bool AddSampleDirtyCheck(T sample, const float pdf);
-
 	/** Sort pvs entries - this should always be called after a
 		sequence of AddSampleDirty calls 
 	*/
 	void Sort();
-
 	/** Clears the pvs.
 	*/
@@ -130,5 +125,4 @@
 
 	inline bool RequiresResort() const;
-
 	/** Finds sample in PVS.
 		@param checkDirty if dirty part of the pvs should be checked for entry 
@@ -140,5 +134,4 @@
 
 	typename HashPvsIterator<T, S> GetIterator() const;
-
 	/** Compute continuous PVS difference 
 	*/
@@ -156,7 +149,5 @@
 							   float &contribution);
 
-	int GetSamples() const
-	{
-		return mSamples;
+	inline int GetSamples() const	{ return mSamples; }
 	}
 
@@ -166,20 +157,11 @@
 	}
 
-	bool RequiresResortLog() const
-	{
-		return false;
-	}
-
-	void Reserve(const int n) 
-	{ 
-		// not necessary
-	}
+	inline bool RequiresResortLog() const {	return false; }
+
+	void Reserve(const int n) { // not necessary }
 
 	/** Sort pvs entries assume that the pvs contains unique entries
 	*/
-	void SimpleSort()
-	{
-		// not necessary
-	}
+	void SimpleSort() {	// not necessary }
 
 	int SubtractPvs(const HashPvs<T, S> &pvs)
@@ -188,5 +170,4 @@
 		return 0;
 	}
-
 	/** Compute continuous PVS difference 
 	*/
@@ -197,4 +178,6 @@
 		cerr << "not yet implemented" << endl;
 	}
+
+
 protected:
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 2353)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 2530)
@@ -126,5 +126,5 @@
 				OptimizeForWindowsApplication="TRUE"
 				AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(CG_INC_PATH)&quot;;Timer;..\src\sparsehash\src\google\sparsehash;..\src\sparsehash\src\windows;..\src\sparsehash\src\google;..\src\sparsehash\src;..\src\ootl\;..\src\ootl\src\;..\src\ootl\src\cpp;..\src\ootl\src\cpp\include\;..\src\ootl\src\include\ootl;..\src\ootl\src\include\ootl\sandbox;..\src\ootl\src\cpp\include\ootl\mswin"
-				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT;USE_HASH_PV"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT;USE_VERBOSE_PV"
 				StringPooling="TRUE"
 				MinimalRebuild="TRUE"
@@ -1041,8 +1041,8 @@
 			</File>
 			<File
+				RelativePath=".\sparsehash\src\google\sparsehash\hash_fun.h">
+			</File>
+			<File
 				RelativePath=".\sparsehash\src\windows\hash_fun.h">
-			</File>
-			<File
-				RelativePath=".\sparsehash\src\google\sparsehash\hash_fun.h">
 			</File>
 			<File
Index: GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 2353)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 2530)
@@ -197,14 +197,11 @@
 	*/
 	HierarchyManager(const int objectSpaceHierarchyType);
-	
 	/** Hack: OspTree will copy the content from this kd tree.
 		Only view space hierarchy will be constructed.
 	*/
 	HierarchyManager(KdTree *kdTree);
-
 	/** Deletes space partition and view space partition.
 	*/
 	~HierarchyManager();
-
 	/** Constructs the view space and object space subdivision from a given set of rays
 		and a set of objects.
@@ -233,33 +230,25 @@
 	*/
 	int GetObjectSpaceSubdivisionType() const;	
-	
 	/** The type of view space space subdivison
 	*/
 	int GetViewSpaceSubdivisionType() const;
-	
 	/** Sets a pointer to the view cells manager.
 	*/		
 	void SetViewCellsManager(ViewCellsManager *vcm);
-	
 	/** Sets a pointer to the view cells tree.
 	*/
 	void SetViewCellsTree(ViewCellsTree *vcTree);
-
 	/** Exports the object hierarchy to disc.
 	*/
 	void ExportObjectSpaceHierarchy(OUT_STREAM &stream);
-	
 	/** Print out statistics.
 	*/
 	void PrintHierarchyStatistics(std::ostream &stream) const;
-
 	/** Returns the view space partition tree.
 	*/
 	VspTree *GetVspTree();
-
 	/** Returns object space bounding box.
 	*/
 	AxisAlignedBox3 GetObjectSpaceBox() const;
-
 	/** Exports object space hierarchy for visualization.
 	*/
@@ -275,5 +264,4 @@
   
 	Intersectable *GetIntersectable(Intersectable *obj, const Vector3 &point) const;
-
 	/** Export object space partition bounding boxes.
 	*/
@@ -306,6 +294,4 @@
 						   const float totalPvs,
 						   const float raysPerObjects) const;
-
-
 	/** Casts line segment into the view cells tree.
 		@param origin the origin of the line segment
@@ -346,6 +332,6 @@
 
 
-	//////////////////////////////
-	// the main loop
+	//////////////
+	// these functions implement the main loop
 
 	/** This is for interleaved construction / sequential construction.
@@ -355,5 +341,4 @@
 						 const ObjectContainer &objects,
 						 AxisAlignedBox3 *forcedViewSpace);
-	
 	/** This is for interleaved construction using some objects 
 		and some view space splits.
@@ -365,5 +350,4 @@
 						const int minSteps,
 						const int maxSteps);
-
 	/** Default subdivision method.
 	*/
@@ -371,5 +355,5 @@
 	
 	
-	////////////////////////////////////////////////
+	//////////////////////////
 
 	/** Evaluates the subdivision candidate and executes the split.
@@ -380,13 +364,10 @@
 								   std::vector<SubdivisionCandidate *> &dirtyList
 								   );
-
 	/** Tests if hierarchy construction is finished.
 	*/
 	bool FinishedConstruction() const;
-
 	/** Returns next subdivision candidate from the split queue.
 	*/
 	SubdivisionCandidate *NextSubdivisionCandidate(SplitQueue &splitQueue);
-
 	/** Repairs the dirty entries of the subdivision candidate queue. The
 		list of entries is given in the dirty list.
@@ -397,5 +378,4 @@
 					SplitQueue &splitQueue,
 					const bool recomputeSplitPlaneOnRepair);
-
 	/** Collect subdivision candidates which were affected by the splits from the
 		chosenCandidates list.
@@ -403,5 +383,4 @@
 	void CollectDirtyCandidates(const SubdivisionCandidateContainer &chosenCandidates, 
 								SubdivisionCandidateContainer &dirtyList);
-
 	/** Print subdivision stats for log.
 	*/
@@ -420,15 +399,12 @@
 	void CollectViewSpaceDirtyList(SubdivisionCandidate *sc,
 								   SubdivisionCandidateContainer &dirtyList);
-
 	/** Collect affected object space candidates.
 	*/
 	void CollectObjectSpaceDirtyList(SubdivisionCandidate *sc,
 									 SubdivisionCandidateContainer &dirtyList);
-		
 	/** Export object space partition tree.
 	*/
 	void ExportOspTree(Exporter *exporter, 
 					   const ObjectContainer &objects) const;
-
 	/** Parse the environment variables.
 	*/
@@ -463,27 +439,21 @@
 	*/
 	bool ObjectSpaceSubdivisionConstructed() const;
-	
 	/** Was view space subdivision already constructed?
 	*/
 	bool ViewSpaceSubdivisionConstructed() const;
-
 	/** Reset the split queue, i.e., reevaluate the split candidates.
 	*/
     void ResetQueue(SplitQueue &splitQueue, const bool recomputeSplitPlane);
-
 	/** After the suddivision has ended, do some final tasks.
 	*/
 	void FinishObjectSpaceSubdivision(const ObjectContainer &objects, 
 									  const bool removeRayRefs = true) const;
-
 	/** Returns depth of object space subdivision.
 	*/
 	int GetObjectSpaceSubdivisionDepth() const;
-
 	/** Returns number of leaves in object space subdivision.
 	*/
 	int GetObjectSpaceSubdivisionLeaves() const;
 	int GetObjectSpaceSubdivisionNodes() const;
-
 	/** Construct object space partition interleaved with view space partition.
 		Each time the best object or view space candidate is selected
@@ -493,5 +463,4 @@
 							  const ObjectContainer &objects,
 							  AxisAlignedBox3 *forcedViewSpace);
-
 	/** Construct object space partition interleaved with view space partition.
 		The method chooses a number candidates of each type for subdivision.
@@ -505,5 +474,4 @@
 										  const ObjectContainer &objects,
 										  AxisAlignedBox3 *forcedViewSpace);
-
 	/** Use iteration to construct the object space hierarchy.
 	*/
@@ -511,5 +479,4 @@
 							 const ObjectContainer &objects,
 							 AxisAlignedBox3 *forcedViewSpace);
-
 	/** Based on a given subdivision, we try to optimize using an
 		multiple iteration over view and object space.
@@ -518,5 +485,4 @@
 							const ObjectContainer &objects,
 							AxisAlignedBox3 *forcedViewSpace);
-
 	/** Reset the object space subdivision. 
 		E.g., deletes hierarchy and resets stats.
@@ -533,4 +499,5 @@
 
 	void CreateTraversalTree();
+
 
 	///////////////////////////
@@ -570,4 +537,10 @@
 protected:
 
+	friend VspTree;
+	friend OspTree;
+	friend BvHierarchy;
+	friend ViewCellsParseHandlers;
+
+
 	/** construction types
 		sequential: construct first view space, then object space
@@ -580,5 +553,4 @@
 	/// type of hierarchy construction
 	int mConstructionType;
-
 	/// Type of object space partition
 	int mObjectSpaceSubdivisionType;
@@ -586,14 +558,6 @@
     int mViewSpaceSubdivisionType;
 
-	/// the traversal queue
+	/// the queue maintains the split candidates during traversal
 	SplitQueue mTQueue;
-	
-	////////////
-	//-- helper variables
-	
-	// the original osp type
-	int mSavedObjectSpaceSubdivisionType;
-	// the original vsp type
-	int mSavedViewSpaceSubdivisionType;
 	
 
@@ -601,4 +565,6 @@
 	// Hierarchies
 
+	/// the bounding volume hierarchy
+	BvHierarchy *mBvHierarchy;
 	/// view space hierarchy
 	VspTree *mVspTree;
@@ -608,20 +574,10 @@
 	float mInitialRenderCost;
 	
-	//float mMaxAvgRayContri;
-	//float mMinAvgRayContri;
-
 	float mMaxAvgRaysPerObject;
 	float mMinAvgRaysPerObject;
 
-	// quick hack:
-public:
-	/// bounding volume hierarchy
-	BvHierarchy *mBvHierarchy;
-	
+
+	/// an internal tree optimized for view cell traversal
 	bool mUseTraversalTree;
-
-	float mMinRenderCost;
-
-protected:
 
 
@@ -638,4 +594,6 @@
 	float mTermMaxMemory;
 
+	float mMinRenderCost;
+
 
 	////////////////////
@@ -651,29 +609,23 @@
 	int mMinDepthForViewSpaceSubdivion;
 	
-	//int mMinRenderCostDecrease;
-
-	std::ofstream mSubdivisionStats;
-
 	/// if the queue should be repaired after a subdivision steps
 	bool mRepairQueue;
 
 	bool mStartWithObjectSpace;
-	/** if multi level construction method should be used
-		where we iterate over both hierarchies until we
-		converge to the optimum.
+	/** multi level construction method  means that
+		we iterate over both hierarchies until we
+		converge to the optimum. 
 	*/
 	bool mUseMultiLevelConstruction;
-
 	/// number of iteration steps for multilevel approach	
 	int mNumMultiLevels;
-
 	/** if split plane should be recomputed for the repair.
 		Otherwise only the priority is recomputed, the
-		split plane itself stays the same
+		split plane itself stays the same. 
 	*/
 	bool mRecomputeSplitPlaneOnRepair;
 
 	/** If memory should be considered during choosing
-		of the next split type during gradient method.
+		of the next split type during gradient method. 
 	*/
 	bool mConsiderMemory;
@@ -684,13 +636,21 @@
 
 	int mTimeStamp;
-	friend VspTree;
-	friend OspTree;
-	friend BvHierarchy;
 
 	float mPriority;
 
-	friend ViewCellsParseHandlers;
-
+
+	////////////
+	//-- helper variables
+	
+	// the original osp type
+	int mSavedObjectSpaceSubdivisionType;
+	// the original vsp type
+	int mSavedViewSpaceSubdivisionType;
+	
+
+	/// this is just a cache used during evaluation
 	ViewCellContainer mOldViewCells;
+
+	std::ofstream mSubdivisionStats;
 };
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2529)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2530)
@@ -134,7 +134,5 @@
   Intersectable::NewMail();
   for (; it.HasMoreEntries(); ) {
-	ObjectPvsEntry entry = it.Next();
-	Intersectable *object = entry.mObject;
-	RenderIntersectable(object);
+	RenderIntersectable(it.Next());
   }
 
@@ -208,7 +206,5 @@
 	ObjectPvsIterator it = pvs.GetIterator();
 	for (; it.HasMoreEntries(); ) {
-	  ObjectPvsEntry entry = it.Next();
-	  Intersectable *object = entry.mObject;
-	  RenderIntersectable(object);
+	  RenderIntersectable(it.Next());
 	}
 	
@@ -402,4 +398,6 @@
 	Intersectable::NewMail();
 
+	PvsData pvsData;
+
 	// Render PVS
 	if (mUseSpatialFilter && mRenderBoxes) {
@@ -411,12 +409,11 @@
 	  mPvsSize = mPvsCache.mPvs.GetSize();
 	  for (; it.HasMoreEntries(); ) {
-		ObjectPvsEntry entry = it.Next();
-		Intersectable *object = entry.mObject;
+		Intersectable *object = it.Next(pvsData);
 		
 		if (mRenderVisibilityEstimates) {
 		  //float visibility = mTransferFunction*log10(entry.mData.mSumPdf + 1); // /5.0f
 		  //		  glColor3f(visibility, 0.0f, 0.0f);
-			cerr << "sumpdf: " << entry.mData.mSumPdf << endl;
-		  RgbColor color = RainbowColorMapping(mTransferFunction*log10(entry.mData.mSumPdf + 1));
+			//cerr << "sumpdf: " << pvsData.mSumPdf << endl;
+		  RgbColor color = RainbowColorMapping(mTransferFunction*log10(pvsData.mSumPdf + 1));
 		  glColor3f(color.r, color.g, color.b);
 		  
Index: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtInterface.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtInterface.vcproj	(revision 2017)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtInterface.vcproj	(revision 2530)
@@ -166,5 +166,5 @@
 				Name="VCCLCompilerTool"
 				AdditionalIncludeDirectories="..\..\src;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\..\..\..\..\..\..\NonGTP\Zlib\include;&quot;$(CG_INC_PATH)&quot;"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;QTGLRENDERER_EXPORTS"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;QTGLRENDERER_EXPORTS;USE_VERBOSE_PVS"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="0"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 2350)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 2530)
@@ -761,7 +761,5 @@
 		
 		if (mHierarchyManager->mConsiderMemory)
-		{
 			priority /= ((float)splitCandidate.GetPvsEntriesIncr() + mMemoryConst);
-		}
 	}
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2529)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2530)
@@ -6746,7 +6746,7 @@
 
 
-static void PrintCompressionStats(HierarchyManager *hm, const int pvsEntries)
-{
-	float mem = (float)pvsEntries * ObjectPvs::GetEntrySize();
+void VspOspViewCellsManager::PrintCompressionStats(HierarchyManager *hm, const int pvsEntries)
+{
+	const float mem = (float)pvsEntries * ObjectPvs::GetEntrySize();
 		
 	float fullmem = mem + 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2116)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2530)
@@ -63,5 +63,6 @@
 					   KdTree *tree):
   Renderer(sceneGraph, viewCellsManager),
-  mKdTree(tree)
+  mKdTree(tree),
+  mUseFalseColors(false)
 {
   mSceneGraph->CollectObjects(&mObjects);
@@ -231,8 +232,7 @@
 
 
-void
-GlRenderer::RenderMeshInstance(MeshInstance *mi)
-{
-  RenderMesh(mi->GetMesh());
+void GlRenderer::RenderMeshInstance(MeshInstance *mi)
+{
+	RenderMesh(mi->GetMesh());
 }
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/BitVectorPvs.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/BitVectorPvs.h	(revision 2206)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/BitVectorPvs.h	(revision 2530)
@@ -267,6 +267,5 @@
 
 template <typename T, typename S>
-bool BitVectorPvs<T, S>::AddSampleDirtyCheck(T sample, 
-										const float pdf)
+bool BitVectorPvs<T, S>::AddSampleDirtyCheck(T sample, const float pdf)
 {
 	if (Find(sample))
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h	(revision 2529)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h	(revision 2530)
@@ -8,9 +8,10 @@
 
 
-//
 
 namespace GtpVisibilityPreprocessor {
 
 
+/** Iterator over the pvs.
+*/
 template<typename T, typename S>
 class PvsIterator
@@ -24,21 +25,16 @@
 	}
 
-	bool HasMoreEntries() const 
-	{
-		return (mItCurrent != mItEnd);
-	}
-
-	T Next(S &pdf)
-	{
+	inline bool HasMoreEntries() const { return (mItCurrent != mItEnd);	}
+
+	inline T Next(S &pdf) {
 		pdf = (*mItCurrent).mData;
 		return (*(mItCurrent ++)).mObject;
 	}
 
-	T Next()
-	{
-		return (*(mItCurrent ++)).mObject;
-	}
+	inline T Next() { return (*(mItCurrent ++)).mObject; }
+
 
 private:
+	
 	typename vector<PvsEntry<T, S> >::const_iterator mItCurrent;
 	typename vector<PvsEntry<T, S> >::const_iterator mItEnd;
@@ -56,5 +52,6 @@
 public:
 
-	VerbosePvs(): mSamples(0), mEntries(), mLastSorted(0), mQueriesSinceSort(0) {}
+	VerbosePvs(): mSamples(0), mEntries(), mLastSorted(0), mQueriesSinceSort(0) 
+	{}
 
 	/** creates pvs and initializes it with the given entries. 
@@ -619,7 +616,5 @@
 
 template <typename T, typename S> 
-bool VerbosePvs<T, S>::AddSampleDirtyCheck(T sample,
-									const float pdf)
-									//,float &contribution)
+bool VerbosePvs<T, S>::AddSampleDirtyCheck(T sample, const float pdf)
 {
 	++ mSamples;
@@ -633,6 +628,4 @@
 	  
 		data.mSumPdf += pdf;
-		//contribution = pdf / data.mSumPdf;
-
         return false;
 	}
@@ -640,6 +633,4 @@
 	{
 		AddSampleDirty(sample, pdf);
-		//contribution = 1.0f;
-		
 		return true;
 	}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/PvsBase.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/PvsBase.h	(revision 2529)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/PvsBase.h	(revision 2530)
@@ -5,9 +5,8 @@
 #include "Containers.h"
 
-//
+
 
 namespace GtpVisibilityPreprocessor {
 
-//class Intersectable;
 
 /** Information stored with a PVS entry. Consists of the number
Index: GTP/trunk/Lib/Vis/Preprocessing/src/PvsDefinitions.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/PvsDefinitions.h	(revision 2176)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/PvsDefinitions.h	(revision 2530)
@@ -31,7 +31,5 @@
 		}
 
-	#else
-
-		//#ifdef USE_VERBOSE_PVS
+	#else // USE_VERBOSE_PVS
 		#include "Pvs.h"
 
