Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/run_test2
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/run_test2	(revision 2529)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/run_test2	(revision 2529)
@@ -0,0 +1,52 @@
+#!sh
+
+
+#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_evaluation=5000000 -samples_per_pass=1000000 -total_samples=100000000"
+
+
+#SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d"
+#VIEWCELLS=../data/vienna/vienna-viewcells-5000.xml
+
+
+#SCENE=../data/soda/soda.obj
+#VIEWCELLS=../data/soda/soda5-viewcells-1000.xml
+#VIEWCELLS=../data/soda/soda5-viewcells-single.xml
+
+#SCENE=../data/PowerPlant/selection.plb
+#VIEWCELLS=../data/PowerPlant/power_plant_viewcells1.xml
+
+#SCENE=../data/soda/soda5.dat
+#VIEWCELLS=../data/soda/soda-viewcells-5000.xml
+#VIEWCELLS=../data/soda/soda5-viewcells.xml
+#VIEWCELLS=../data/soda/soda5-viewcells-single.xml
+
+#SCENE=../data/artificial/city.x3d
+#VIEWCELLS=../data/soda/soda5-viewcells2.xml
+#VIEWCELLS=../data/artificial/city-viewcells-1000.xml
+
+#SCENE=../data/test1/test2.x3d
+#VIEWCELLS=../data/test1/test-viewcells.xml
+
+
+SCENE=../data/vienna/vienna_cropped.obj
+VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz
+#VIEWCELLS=../data/vienna/vienna-seq-viewcells-20000.xml.gz
+
+
+# SCENE=../data/Pompeii/PompeiiTen.obj
+# VIEWCELLS=../data/Pompeii/pompeii_big-seq-viewcells.xml.gz
+
+PREFIX=../work/plots/osp-TEST
+
+#SCENE=../data/atlanta/atlanta2.x3d
+#PREFIX=../work/plots/atlanta2-rss9
+
+
+$COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
+-rss_distributions=mutation+object_direction+spatial \
+-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 \
+-preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4a.hlog
+
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo1
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo1	(revision 2529)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo1	(revision 2529)
@@ -0,0 +1,53 @@
+#!sh
+
+
+#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_evaluation=5000000 -samples_per_pass=500000 -total_samples=100000000"
+
+
+#SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d"
+#VIEWCELLS=../data/vienna/vienna-viewcells-5000.xml
+
+
+#SCENE=../data/soda/soda.obj
+#VIEWCELLS=../data/soda/soda5-viewcells-1000.xml
+#VIEWCELLS=../data/soda/soda5-viewcells-single.xml
+
+#SCENE=../data/PowerPlant/selection.plb
+#VIEWCELLS=../data/PowerPlant/power_plant_viewcells1.xml
+
+#SCENE=../data/soda/soda5.dat
+#VIEWCELLS=../data/soda/soda-viewcells-5000.xml
+#VIEWCELLS=../data/soda/soda5-viewcells.xml
+#VIEWCELLS=../data/soda/soda5-viewcells-single.xml
+
+#SCENE=../data/artificial/city.x3d
+#VIEWCELLS=../data/soda/soda5-viewcells2.xml
+#VIEWCELLS=../data/artificial/city-viewcells-1000.xml
+
+#SCENE=../data/test1/test2.x3d
+#VIEWCELLS=../data/test1/test-viewcells.xml
+
+
+SCENE=../data/vienna/vienna_cropped.obj
+VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz
+#VIEWCELLS=../data/vienna/vienna-seq-viewcells-20000.xml.gz
+
+
+# SCENE=../data/Pompeii/PompeiiTen.obj
+# VIEWCELLS=../data/Pompeii/pompeii_big-seq-viewcells.xml.gz
+
+PREFIX=../work/plots/osp-TEST
+
+#SCENE=../data/atlanta/atlanta2.x3d
+#PREFIX=../work/plots/atlanta2-rss9
+
+
+$COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
+-rss_distributions=mutation+object_direction+spatial \
+-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 \
+-preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4a.hlog \
+demo1.env
+
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo2
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo2	(revision 2529)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo2	(revision 2529)
@@ -0,0 +1,55 @@
+#!sh
+
+
+#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_evaluation=5000000 -samples_per_pass=500000 -total_samples=100000000"
+
+
+#SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d"
+#VIEWCELLS=../data/vienna/vienna-viewcells-5000.xml
+
+
+#SCENE=../data/soda/soda.obj
+#VIEWCELLS=../data/soda/soda5-viewcells-1000.xml
+#VIEWCELLS=../data/soda/soda5-viewcells-single.xml
+
+#SCENE=../data/PowerPlant/selection.plb
+#VIEWCELLS=../data/PowerPlant/power_plant_viewcells1.xml
+
+#SCENE=../data/soda/soda5.dat
+#VIEWCELLS=../data/soda/soda-viewcells-5000.xml
+#VIEWCELLS=../data/soda/soda5-viewcells.xml
+#VIEWCELLS=../data/soda/soda5-viewcells-single.xml
+
+#SCENE=../data/artificial/city.x3d
+#VIEWCELLS=../data/soda/soda5-viewcells2.xml
+#VIEWCELLS=../data/artificial/city-viewcells-1000.xml
+
+#SCENE=../data/test1/test2.x3d
+#VIEWCELLS=../data/test1/test-viewcells.xml
+
+
+#SCENE=../data/vienna/vienna_cropped.obj
+#VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz
+#VIEWCELLS=../data/vienna/vienna-seq-viewcells-20000.xml.gz
+
+SCENE=../data/Arena/arena-high-lods.obj
+VIEWCELLS=../data/Arena/viewcells-5000.xml.gz
+
+# SCENE=../data/Pompeii/PompeiiTen.obj
+# VIEWCELLS=../data/Pompeii/pompeii_big-seq-viewcells.xml.gz
+
+PREFIX=../work/plots/osp-TEST
+
+#SCENE=../data/atlanta/atlanta2.x3d
+#PREFIX=../work/plots/atlanta2-rss9
+
+
+$COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
+-rss_distributions=mutation+object_direction+spatial \
+-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 \
+-preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4a.hlog \
+demo1.env
+
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/demo1.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/demo1.env	(revision 2529)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/demo1.env	(revision 2529)
@@ -0,0 +1,513 @@
+############################################################################
+# ERS default configuration file
+# Jiri Bittner 2003
+#############################################################################
+
+Scene {
+
+#filename ../data/Arena/arena-low-lods.obj
+#filename ../data/Arena/arena-high-lods.obj
+# filename ../data/City4M/City4M.obj
+# filename ../data/CityModel/CityModel.obj
+# filename ../data/GrandCanyon/grandcanyon1_RotXmin90.obj
+# filename ../data/glasgow/glasgow1.x3d
+#	filename vienna.x3d
+# filename ../data/vienna/vienna-simple.x3d
+# filename ../data/vienna/vienna-buildings.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/vienna.obj
+
+filename ../data/vienna/vienna_cropped.obj
+
+# filename ../data/vienna/viewcells-25-sel.x3d
+#filename ../data/atlanta/atlanta2.x3d
+#filename ../data/soda/soda.dat
+#filename ../data/test1/test2.x3d
+# filename ../data/soda/soda5.dat
+#filename ../data/PowerPlant/ppsection1/part_a/g0.ply
+#filename ../data/PowerPlant/ppsection1/part_b/g0.ply
+#filename ../data/PowerPlant/ppsection1.plb
+#filename ../data/PowerPlant/all.plb
+#filename ../data/PowerPlant/selection3.plb
+#filename ../data/PowerPlant/section10.plb;../data/PowerPlant/section14.plb
+#filename ../data/PowerPlant/selection.plb
+#filename ../data/PowerPlant/comps/ppsection1/comps.plb
+}
+
+
+Preprocessor {
+	totalSamples 250000000
+#	totalSamples 2000000
+	samplesPerPass 500000
+	samplesPerEvaluation 5000000
+
+
+#	initialSamples 2000000
+
+	exportObj false
+	delayVisibilityComputation false
+	# stored sample rays
+	samplesFilename rays.out
+	useGlRenderer true
+	useGlDebugger false
+# 0 = INTERNAL 		1 = MLRT
+	rayCastMethod 1
+	
+#	type sampling
+#	type vss
+#	type rss
+	type combined
+#	type render
+	detectEmptyViewSpace true
+	pvsRenderErrorSamples 0
+#	pvsRenderErrorSamples 10000
+	quitOnFinish false
+	computeVisibility true
+
+	evaluateFilter false
+
+	applyVisibilityFilter false
+	applyVisibilitySpatialFilter false
+	visibilityFilterWidth	0.01
+	exportVisibility true
+	visibilityFile visibility.xml
+	loadMeshes false
+	loadKdTree	false
+	exportKdTree false
+
+	histogram {
+		intervals 20
+		maxValue  600000
+	    file	histogram.log
+	}
+	Export {
+		rays false
+		numRays 5000
+	}
+
+}
+
+ObjParser {
+	meshGrouping 2
+}
+
+RenderSampler {
+	samples 10000
+}
+
+
+SamplingPreprocessor {
+}
+
+
+RssPreprocessor {
+
+#	distributions rss+spatial+object_direction
+#	distributions rss+object_direction+spatial+object+direction
+	distributions mutation+spatial+object_direction
+#	distributions rss+object_direction
+#	distributions object_direction
+
+	useImportanceSampling true
+
+	Export {
+		pvs false
+		rssTree false
+	}
+
+	useViewcells true
+	updateSubdivision true
+	loadInitialSamples false
+	storeInitialSamples false
+
+	useRssTree true
+}
+
+
+RssTree {
+	epsilon		1e-6
+	perObjectTree false
+
+	maxDepth 	60
+	minPvs		1
+# before vienna test it was:
+#	minRays	50
+#	splitType heuristic
+
+	minRays		200
+	minSize		0.001
+ 	maxCostRatio 1.0
+	maxRayContribution 1.0
+	maxRays		1000000
+	maxTotalMemory	400
+	maxStaticMemory	200
+
+#	splitType regular
+#	splitType heuristic
+	splitType hybrid
+	hybridDepth		10
+	splitUseOnlyDrivingAxis false
+	importanceBasedCost false
+
+	interleaveDirSplits	true
+    dirSplitDepth 0
+
+	ct_div_ci	0.0
+}
+
+Limits {
+
+       threshold	1e-6
+       small		1e-6
+       infinity		1e9
+}
+
+Unigraphics {
+		meshGrouping 1
+}
+
+KdTree {
+	pvsArea   5e-4
+	sahUseFaces false
+	Termination {
+		minCost 1
+		maxDepth 30
+		maxCostRatio 0.98
+		ct_div_ci 0.5
+		maxNodes 50000
+#500000	
+	}
+
+	splitMethod spatialMedian
+#	splitMethod SAH
+	splitBorder 0.01
+}
+
+
+MeshKdTree {
+	Termination {
+		minCost 150
+		maxDepth 18
+		maxCostRatio 0.9
+		ct_div_ci 0.5
+	}
+
+#	splitMethod spatialMedian
+	splitMethod SAH
+	splitBorder 0.01
+}
+
+ViewCells {
+	importRandomViewCells false
+
+	useKdPvs true
+	
+	useKdPvsAfterFiltering true
+	# samples used for view cell construction
+	Construction {
+		samples 0
+		samplesPerPass 1500000
+	}
+
+	#number of active view cells
+	active 200000
+	maxViewCells 200000
+
+	maxStaticMemory	40
+
+	exportToFile true
+	loadFromFile true
+
+	#type kdTree
+	#type vspKdTree
+	#type bspTree
+	type vspBspTree
+	#type vspOspTree
+	#type sceneDependent
+	
+	height 5.0
+
+	#percentage of total visible objects where pvs is considered invalid
+	maxPvsRatio 1.0
+		
+	processOnlyValidViewCells true
+
+	#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
+		compress false
+		merge 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 false
+	evaluateViewCells false
+	
+	Evaluation {
+		samplesPerPass 1000000
+		samples 5000000
+		statsPrefix ../scripts/viewCells
+		#samplingType directional
+		samplingType box
+		histogram true
+		histoStepSize 5000
+	}
+
+#	filename ../data/Arena/viewcells-5000.xml
+filename ../data/Arena/viewcells-20000.xml
+
+#	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 ../scripts/viewcells_atlanta.xml
+#	filename ../scripts/viewcells_soda5-2.xml
+#	filename ../scripts/viewcells_atlanta.xml
+#	filename ../data/soda/soda-viewcells.xml.gz
+#	filename ../data/test1/test-viewcells.xml
+
+
+#	filename ../data/soda/soda5-viewcells.xml
+
+#	filename ../data/soda/soda-viewcells-1000.xml.gz
+
+
+#	filename ../data/CityModel/CityModel-viewcells-5000.xml
+#	filename ../data/City4M/City4M-viewcells-5000.xml
+
+
+#	filename ../data/vienna/vsposp-seq-viewCells.xml.gz
+
+#	filename ../data/atlanta/viewcells_atlanta3.xml
+
+#	filename ../data/vienna/viewcells_vienna.xml
+#	filename ../data/vienna/viewcells_vienna2.xml
+#	filename ../data/vienna/vienna_simple-21-04-avs2-viewCells.xml
+#	filename ../data/vienna/vienna-viewcells-20000.xml.gz
+#	filename ../data/vienna/vienna-viewcells-5000.xml.gz
+#	filename ../data/vienna/vienna-viewcells-1000.xml.zip
+#	filename ../data/vienna/vsposp-seq-viewCells.xml.gz
+
+	filename ../data/vienna/vienna_cropped-gradient-viewcells.xml.gz
+
+#	filename ../data/vienna/vienna_cropped-2-sequential-30000-viewcells.xml.gz
+#	filename ../data/vienna/vienna_cropped-sequential-400000-viewcells.xml.gz
+
+
+#	filename ../data/vienna/city1500_flat_viewcells-1000.xml
+#	filename ../data/vienna/city1500_flat-vsposp.xml
+#	filename ../data/vienna/vienna-simple-vsposp.xml
+
+#	filename ../data/PowerPlant/power_plant_viewcells1.xml
+}
+
+
+Simulation {
+	objRenderCost 1.0
+	vcOverhead 1.0
+	# always between 0 and 1
+	moveSpeed 0.0001
+}
+
+
+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
+		maxViewCells		20000
+	
+
+		# 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
+	}
+}
+
