Index: /trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env	(revision 607)
+++ /trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env	(revision 612)
@@ -25,5 +25,5 @@
 	type vss
 #	type rss
-	detectEmptyViewSpace false
+	detectEmptyViewSpace true
 }
 
@@ -36,5 +36,5 @@
 	loadInitialSamples  false
 	storeInitialSamples false
-	useViewSpaceBox false
+	useViewSpaceBox true
 #	testBeamSampling true
 }
@@ -176,13 +176,13 @@
 	# samples used for view cell construction
 	Construction {
-		samples 2000000
+		samples 0
 		samplesPerPass 500000
 	}
 
 	#number of active view cells
-	active 2048
+	active 2096
 	maxStaticMemory	40
 
-	exportToFile true
+	exportToFile false
 	loadFromFile false
 
@@ -210,8 +210,8 @@
 		minViewCells 1
 		avgCostMaxDeviation 0.01
-		maxMergesPerPass 500
+		maxMergesPerPass 5000
 		useRaysForMerge false
 		refine false
-		compress false
+		compress true
 		merge true
 	}
@@ -288,5 +288,5 @@
 VspBspTree {
 	Construction {
-		samples 500000
+		samples 300000
 		epsilon 0.005
 		randomize false
@@ -301,10 +301,10 @@
 	# pvs                  = 1024
 	
-	splitPlaneStrategy 1026
+	splitPlaneStrategy 1024
 	
 	# maximal candidates for split planes
-	maxPolyCandidates 200
-
-	
+	maxPolyCandidates 0
+
+	usePolygonSplitIfAvailable false
 	# maximal tested rays for split cost heuristics
 	maxTests 10000
@@ -320,18 +320,16 @@
 	}
 	
-	usePolygonSplitIfAvailable 0
-
 	Termination {
 		# parameters used for autopartition
-		minRays 		500
+		minRays 		-15
 		minPolygons 		-1
 		maxDepth		25
-		minPvs 			-1
-		minProbability		0.0000001
-		maxRayContribution	0.3
-		maxCostRatio		0.9
-		missTolerance		3
-		
-		maxViewCells		30000
+		minPvs 			-15
+		minProbability		0.00000001
+		maxRayContribution	1.8
+		maxCostRatio		1.8
+		missTolerance		6
+		
+		maxViewCells		150000
 		
 		# used for pvs criterium
@@ -339,9 +337,10 @@
 		
 		AxisAligned {
-			minRays 		900000
+			minRays 		50000
 			maxRayContribution	9.9
 		}
 	}
 	
+	useCostHeuristics false
 	splitUseOnlyDrivingAxis false
 	
@@ -414,6 +413,6 @@
 	Termination {
 		# parameters used for autopartition
-		minRays -1
-		minPolygons 1
+		minRays 10
+		minPolygons -1
 		maxDepth 30
 		minPvs -1
@@ -421,5 +420,5 @@
 		maxRayContribution 9999
 		#maxAccRayLength 100
-		maxViewCells	5000
+		maxViewCells	50000
 
 		# used for pvs criterium
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.h
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.h	(revision 611)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.h	(revision 612)
@@ -127,8 +127,8 @@
 		float GetCost() const
 		{
-#if 0
+#if 1
 			return mPvs * mProbability;
 #endif
-#if 1
+#if 0
 			return (float) (-mDepth); // for regular grid
 #endif
@@ -398,5 +398,6 @@
 					 VspBspTraversalData &data,
 					 VspBspTraversalData &frontData,
-					 VspBspTraversalData &backData);
+					 VspBspTraversalData &backData,
+					 int &splitAxis);
 	
 	/** Strategies where the effect of the split plane is tested
@@ -627,4 +628,6 @@
 	/// box around the whole view domain
 	AxisAlignedBox3 mBox;
+
+	bool mUseCostHeuristics;
 
 	/// minimal number of rays before subdivision termination
@@ -721,4 +724,6 @@
 	int mTimeStamp;
 
+	int mCreatedViewCells;
+
 private:
 
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp	(revision 610)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp	(revision 612)
@@ -18,5 +18,4 @@
 {
 public:
-	
 	//bool operator() (HierarchyNode *v1, HierarchyNode *v2) const
 	bool operator() (T v1, T v2) const
@@ -508,9 +507,11 @@
 		   << "#TotalPvs\n" << totalPvs << endl
 		   << "#PvsSizeDecrease\n0" << endl
-		   << "#Volume\n" << endl
-		   << "#Siblings\n" << mergeStats.siblings << endl;
+		   << "#Volume\n0" << endl
+		   //<< "#Siblings\n" << mergeStats.siblings << endl
+		   << endl;
 
 	//-- use priority queue to merge leaf pairs
 // HACK
+
 	//const float maxAvgCost = 350;
 	while (!mMergeQueue.empty())//NumActiveViewCells > mMergeMinViewCells))
@@ -549,5 +550,4 @@
 				ResetMergeQueue();
 
-			
 			Debug << "Values after reset: "  
 				  << " erc: " << mExpectedCost 
@@ -562,5 +562,4 @@
 
 
-	
 		MergeCandidate mc = mMergeQueue.top();
 		mMergeQueue.pop();
@@ -604,6 +603,6 @@
 			mergedVc->SetMergeCost(totalRenderCost);
 
-			if (mViewCellsManager->EqualToSpatialNode(mergedVc))
-				++ mergeStats.siblings;
+			//if (mViewCellsManager->EqualToSpatialNode(mergedVc))
+			//	++ mergeStats.siblings;
 			mergedVc->SetCost(realExpectedCost);
 
@@ -616,5 +615,5 @@
 					<< "#Pass\n" << pass << endl
 					<< "#Merged\n" << mergeStats.merged << endl 
-					<< "#Viewcells\n" << realNumActiveViewCells << endl 
+					<< "#ViewCells\n" << realNumActiveViewCells << endl 
                     << "#RenderCostIncrease\n" << renderCostIncr << endl
 					<< "#TotalRenderCost\n" << totalRenderCost << endl
@@ -625,5 +624,7 @@
 					<< "#TotalPvs\n" << totalPvs << endl
 					<< "#PvsSizeDecrease\n" << -pvsDiff << endl
-					<< "#Volume\n" << mergedVc->GetVolume() << endl;
+					<< "#Volume\n" << mergedVc->GetVolume() << endl
+					<< endl;
+				
 			}
 		}
@@ -638,4 +639,5 @@
 			}
 		}
+		
 	}
 
@@ -659,8 +661,5 @@
 		Debug << "creating root of view cell hierarchy for " 
 			  << (int)activeViewCells.size() << " view cells" << endl;
-		/*for (int i = 0;  i < activeViewCells.size(); ++ i){
-			Debug << "parent " << activeViewCells[i]->GetParent() << endl;
-			Debug << "viewcell " << activeViewCells[i] << endl;
-		}*/
+		
 		ViewCellInterior *root = mViewCellsManager->MergeViewCells(activeViewCells);
 		root->SetMergeCost(totalRenderCost);
@@ -668,4 +667,19 @@
 		root->SetCost(0.0f);
 		
+		mStats 
+			<< "#Pass\n" << pass << endl
+			<< "#Merged\n" << mergeStats.merged << endl 
+			<< "#ViewCells\n" << realNumActiveViewCells << endl 
+            << "#RenderCostIncrease\n" << 0 << endl // TODO
+			<< "#TotalRenderCost\n" << totalRenderCost << endl
+			<< "#CurrentPvs\n" << root->GetPvs().GetSize() << endl
+            << "#ExpectedCost\n" << realExpectedCost << endl
+			<< "#AvgRenderCost\n" << realAvgRenderCost << endl
+			<< "#Deviation\n" << mDeviation << endl
+			<< "#TotalPvs\n" << totalPvs << endl
+			<< "#PvsSizeDecrease\n" << 0 << endl // TODO
+			<< "#Volume\n" << root->GetVolume() << endl
+			<< endl;
+
 		mRoot = root;
 	}
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp	(revision 611)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp	(revision 612)
@@ -124,4 +124,6 @@
 	mSubdivisionStats.open("subdivisionStats.log");
 
+	environment->GetBoolValue("VspBspTree.useCostHeuristics", mUseCostHeuristics);
+
 
 	//-- debug output
@@ -393,5 +395,5 @@
 
 
-// return memory usage in MB
+// TODO: return memory usage in MB
 float VspBspTree::GetMemUsage(/*const VspBspTraversalQueue &tstack*/) const
 {
@@ -454,4 +456,6 @@
 
 	long startTime = GetTime();	
+	int nLeaves = 0;
+	int nViewCells = 0;
 
 	// used for intermediate time measurements and progress
@@ -460,6 +464,6 @@
 	mOutOfMemory = false;
 
-	int nleaves = 500;
-
+	mCreatedViewCells = 0;
+	
 	while (!tQueue.empty())
 	{
@@ -485,13 +489,20 @@
 				  << TimeDiff(startTime, GetTime())*1e-3 << "s" << endl;
 
-		if (mBspStats.Leaves() >= nleaves)
-		{
-			nleaves += 500;
-				
+		if (mBspStats.Leaves() == nLeaves)
+		{
+			nLeaves += 500;
+
 			cout << "leaves=" << mBspStats.Leaves() << endl;
 			Debug << "needed "
 				  << TimeDiff(interTime, GetTime())*1e-3 
-				  << " secs to create 500 leaves" << endl;
+				  << " secs to create 500 view cells" << endl;
 			interTime = GetTime();
+		}
+
+		if (mCreatedViewCells == nViewCells)
+		{
+			nViewCells += 500;
+
+			cout << "generated " << mCreatedViewCells << " viewcells" << endl;
 		}
 	}
@@ -530,7 +541,7 @@
 		VspBspTraversalData tFrontData;
 		VspBspTraversalData tBackData;
+
 #if OCTREE_HACK
 		//Debug << "new axis:" << (tData.mAxis + 1) % 3 << endl;
-
 		tFrontData.mAxis = (tData.mAxis + 1) % 3;
 		tBackData.mAxis = (tData.mAxis + 1) % 3;
@@ -593,4 +604,5 @@
 				leaf->mVssRays.push_back((*it).mRay);
 		}
+
 		// should I check here?
 		if (0 && !mViewCellsManager->CheckValidity(viewCell, 0, mViewCellsManager->GetMaxPvsSize()))
@@ -634,6 +646,8 @@
 	int maxCostMisses = tData.mMaxCostMisses;
 
+	int splitAxis;
+
 	const bool success = 
-		SelectPlane(splitPlane, leaf, tData, frontData, backData);
+		SelectPlane(splitPlane, leaf, tData, frontData, backData, splitAxis);
 
 	if (!success)
@@ -648,4 +662,10 @@
 		}
 	}
+
+	//! error also computed if cost ratio is missed
+	if (splitAxis < 3)
+		++ mBspStats.splits[splitAxis];
+	else
+		++ mBspStats.polySplits;
 
 	mBspStats.nodes += 2;
@@ -792,5 +812,5 @@
 	// creates a sorted split candidates array
 	if (mSplitCandidates->capacity() > 500000 &&
-		requestedSize < (int)(mSplitCandidates->capacity()/10) )
+		requestedSize < (int)(mSplitCandidates->capacity()  / 10) )
 	{
     	delete mSplitCandidates;
@@ -801,7 +821,7 @@
 
 	// insert all queries
-	for(RayInfoContainer::const_iterator ri = rays.begin();	ri < rays.end(); ++ ri)
-	{
-		bool positive = (*ri).mRay->HasPosDir(axis);
+	for (RayInfoContainer::const_iterator ri = rays.begin(); ri < rays.end(); ++ ri)
+	{
+		const bool positive = (*ri).mRay->HasPosDir(axis);
 		mSplitCandidates->push_back(SortableEntry(positive ? SortableEntry::ERayMin : SortableEntry::ERayMax,
 												  (*ri).ExtrapOrigin(axis), (*ri).mRay));
@@ -821,9 +841,4 @@
                                           float &position)
 {
-	int raysBack;
-	int raysFront;
-	int pvsBack;
-	int pvsFront;
-
 	SortSplitCandidates(rays, axis);
 
@@ -832,6 +847,8 @@
 	// C = ct_div_ci  + (ql*rl + qr*rr)/queries
 
-	int rl = 0, rr = (int)rays.size();
-	int pl = 0, pr = pvsSize;
+	int pvsl = 0, pvsr = pvsSize;
+
+	int pvsBack = pvsl;
+	int pvsFront = pvsr;
 
 	float minBox = box.Min(axis);
@@ -839,28 +856,42 @@
 	float sizeBox = maxBox - minBox;
 
-	float minBand = minBox + 0.1f*(maxBox - minBox);
-	float maxBand = minBox + 0.9f*(maxBox - minBox);
-
-	float sum = rr*sizeBox;
+	float minBand = minBox + 0.1f * (maxBox - minBox);
+	float maxBand = minBox + 0.9f * (maxBox - minBox);
+
+	float sum = (float)pvsSize * sizeBox;
 	float minSum = 1e20f;
 
 	Intersectable::NewMail();
 
-	// set all object as belonging to the fron pvs
-	for(RayInfoContainer::const_iterator ri = rays.begin(); ri != rays.end(); ++ ri)
-	{
-		if ((*ri).mRay->IsActive())
-		{
-			Intersectable *object = (*ri).mRay->mTerminationObject;
-
-			if (object)
-			{
-				if (!object->Mailed())
-				{
-					object->Mail();
-					object->mCounter = 1;
-				}
-				else
-					++ object->mCounter;
+   	RayInfoContainer::const_iterator ri, ri_end = rays.end();
+
+	// set all object as belonging to the front pvs
+	for(ri = rays.begin(); ri != ri_end; ++ ri)
+	{
+		Intersectable *oObject = (*ri).mRay->mOriginObject;
+		Intersectable *tObject = (*ri).mRay->mTerminationObject;
+
+		if (oObject)
+		{
+			if (!oObject->Mailed())
+			{
+				oObject->Mail();
+				oObject->mCounter = 1;
+			}
+			else
+			{
+				++ oObject->mCounter;
+			}
+		}
+		if (tObject)
+		{
+			if (!tObject->Mailed())
+			{
+				tObject->Mail();
+				tObject->mCounter = 1;
+			}
+			else
+			{
+				++ tObject->mCounter;
 			}
 		}
@@ -869,8 +900,14 @@
 	Intersectable::NewMail();
 
-	for (vector<SortableEntry>::const_iterator ci = mSplitCandidates->begin();
-		ci < mSplitCandidates->end(); ++ ci)
+	vector<SortableEntry>::const_iterator ci, ci_end = mSplitCandidates->end();
+
+	for (ci = mSplitCandidates->begin(); ci < ci_end; ++ ci)
 	{
 		VssRay *ray;
+		ray = (*ci).ray;
+		
+		Intersectable *oObject = ray->mOriginObject;
+		Intersectable *tObject = ray->mTerminationObject;
+		
 
 		switch ((*ci).type)
@@ -878,13 +915,13 @@
 			case SortableEntry::ERayMin:
 				{
-					++ rl;
-					ray = (VssRay *) (*ci).ray;
-
-					Intersectable *object = ray->mTerminationObject;
-
-					if (object && !object->Mailed())
+					if (oObject && !oObject->Mailed())
 					{
-						object->Mail();
-						++ pl;
+						oObject->Mail();
+						++ pvsl;
+					}
+					if (tObject && !tObject->Mailed())
+					{
+						tObject->Mail();
+						++ pvsl;
 					}
 					break;
@@ -892,13 +929,14 @@
 			case SortableEntry::ERayMax:
 				{
-					-- rr;
-					ray = (VssRay *) (*ci).ray;
-
-					Intersectable *object = ray->mTerminationObject;
-
-					if (object)
+					if (oObject)
 					{
-						if (-- object->mCounter == 0)
-							-- pr;
+						if (-- oObject->mCounter == 0)
+							-- pvsr;
+					}
+
+					if (tObject)
+					{
+						if (-- tObject->mCounter == 0)
+							-- pvsr;
 					}
 
@@ -910,5 +948,5 @@
 		if ((*ci).value > minBand && (*ci).value < maxBand)
 		{
-			sum = pl*((*ci).value - minBox) + pr*(maxBox - (*ci).value);
+			sum = pvsl * ((*ci).value - minBox) + pvsr * (maxBox - (*ci).value);
 
 			//  cout<<"pos="<<(*ci).value<<"\t q=("<<ql<<","<<qr<<")\t r=("<<rl<<","<<rr<<")"<<endl;
@@ -920,17 +958,28 @@
 				position = (*ci).value;
 
-				raysBack = rl;
-				raysFront = rr;
-
-				pvsBack = pl;
-				pvsFront = pr;
-
-			}
-		}
-	}
-
-	float oldCost = (float)pvsSize;
-	float newCost = mCtDivCi + minSum / sizeBox;
-	float ratio = newCost / oldCost;
+				pvsBack = pvsl;
+				pvsFront = pvsr;
+			}
+		}
+	}
+
+	// -- compute cost
+
+	const int lowerPvsLimit = mViewCellsManager->GetMinPvsSize();
+	const int upperPvsLimit = mViewCellsManager->GetMaxPvsSize();
+
+	const float pOverall = sizeBox;
+
+	const float pBack = position - minBox;
+	const float pFront = maxBox - position;
+	
+	const float penaltyOld = EvalPvsPenalty(pvsSize, lowerPvsLimit, upperPvsLimit);
+    const float penaltyFront = EvalPvsPenalty(pvsFront, lowerPvsLimit, upperPvsLimit);
+	const float penaltyBack = EvalPvsPenalty(pvsBack, lowerPvsLimit, upperPvsLimit);
+	
+	const float oldRenderCost = penaltyOld * pOverall;
+	const float newRenderCost = penaltyFront * pFront + penaltyBack * pBack;
+
+	float ratio = mPvsFactor * newRenderCost / (oldRenderCost + Limits::Small);
 
 	//Debug << "costRatio=" << ratio << " pos=" << position << " t=" << (position - minBox) / (maxBox - minBox)
@@ -950,7 +999,4 @@
 										 const bool useKdSplit)
 {
-	const bool useCostHeuristics = false;
-
-	//-- regular split
 	float nPosition[3];
 	float nCostRatio[3];
@@ -960,4 +1006,10 @@
 	BspNodeGeometry *nFrontGeom[3];
 	BspNodeGeometry *nBackGeom[3];
+
+	for (int i = 0; i < 3; ++ i)
+	{
+		nFrontGeom[i] = NULL;
+		nBackGeom[i] = NULL;
+	}
 
 	int bestAxis = -1;
@@ -990,11 +1042,11 @@
 	for (axis = 0; axis < 3; ++ axis)
 	{
-		nFrontGeom[axis] = new BspNodeGeometry();
-		nBackGeom[axis] = new BspNodeGeometry();
-
 		if (!mOnlyDrivingAxis || (axis == sAxis))
 		{
-			if (!useCostHeuristics)
-			{
+			if (!mUseCostHeuristics)
+			{
+				nFrontGeom[axis] = new BspNodeGeometry();
+				nBackGeom[axis] = new BspNodeGeometry();
+
 				nPosition[axis] = (box.Min()[axis] + box.Max()[axis]) * 0.5f;
 				Vector3 normal(0,0,0); normal[axis] = 1.0f;
@@ -1042,5 +1094,4 @@
 				bestAxis = axis;
 			}
-
 			else if (nCostRatio[axis] < nCostRatio[bestAxis])
 			{
@@ -1061,6 +1112,6 @@
 
 	// and delete other geometry
-	delete nFrontGeom[(bestAxis + 1) % 3];
-	delete nBackGeom[(bestAxis + 2) % 3];
+	DEL_PTR(nFrontGeom[(bestAxis + 1) % 3]);
+	DEL_PTR(nBackGeom[(bestAxis + 2) % 3]);
 
 	//-- split plane
@@ -1076,5 +1127,6 @@
 							 VspBspTraversalData &data,
 							 VspBspTraversalData &frontData,
-							 VspBspTraversalData &backData)
+							 VspBspTraversalData &backData,
+							 int &splitAxis)
 {
 	// simplest strategy: just take next polygon
@@ -1150,10 +1202,14 @@
 	float pFront, pBack;
 
-	candidateCost = SelectAxisAlignedPlane(plane, data, axis,
-										   &fGeom, &bGeom, 
-										   pFront, pBack,
+	candidateCost = SelectAxisAlignedPlane(plane, 
+										   data, 
+										   axis,
+										   &fGeom, 
+										   &bGeom, 
+										   pFront, 
+										   pBack,
 										   data.mIsKdNode);	 
 
-	bool isAxisAlignedSplit = false;
+	splitAxis = 3;
 
 	if (candidateCost < lowestCost)
@@ -1161,17 +1217,16 @@
 		bestPlane = plane;
 		lowestCost = candidateCost;
-
+		splitAxis = axis;
 		// assign already computed values
 		// we can do this because we always save the
 		// computed values from the axis aligned splits		
-		frontData.mGeometry = fGeom;
-		backData.mGeometry = bGeom;
-	
-		frontData.mProbability = pFront;
-		backData.mProbability = pBack;
-		
-		//! error also computed if cost ratio is missed
-		++ mBspStats.splits[axis];
-		isAxisAlignedSplit = true;
+		if (fGeom && bGeom)
+		{
+			frontData.mGeometry = fGeom;
+			backData.mGeometry = bGeom;
+	
+			frontData.mProbability = pFront;
+			backData.mProbability = pBack;
+		}
 	}
 	else
@@ -1181,5 +1236,6 @@
 	}
 
-	frontData.mIsKdNode = backData.mIsKdNode = (data.mIsKdNode && isAxisAlignedSplit);
+	frontData.mIsKdNode = backData.mIsKdNode = 
+		(data.mIsKdNode && splitAxis < 3);
 
 #ifdef _DEBUG
@@ -1401,5 +1457,5 @@
 		const float penaltyBack = EvalPvsPenalty(pvsBack, lowerPvsLimit, upperPvsLimit);
 			
-		const float oldRenderCost = pOverall * (float)penaltyOld + Limits::Small;
+		const float oldRenderCost = pOverall * penaltyOld;
 		const float newRenderCost = penaltyFront * pFront + penaltyBack * pBack;
 
@@ -1420,5 +1476,5 @@
 				fabs(penaltyFront - expectedCost) + fabs(penaltyBack - expectedCost);
 
-			const float oldDeviation = penaltyOld + Limits::Small;
+			const float oldDeviation = penaltyOld;
 
 			newCost = mRenderCostWeight * newRenderCost + (1.0f - mRenderCostWeight) * newDeviation;
@@ -1426,5 +1482,5 @@
 		}
 
-		cost += mPvsFactor * newCost / oldCost;
+		cost += mPvsFactor * newCost / (oldCost + Limits::Small);
 		
 	}
@@ -1656,4 +1712,5 @@
 	mBspStats.accumDepth += data.mDepth;
 
+	++ mCreatedViewCells;
 #ifdef _DEBUG
 	Debug << "BSP stats: "
@@ -1666,4 +1723,5 @@
 #endif
 }
+
 
 int VspBspTree::CastRay(Ray &ray)
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/Environment.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/Environment.cpp	(revision 611)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/Environment.cpp	(revision 612)
@@ -1856,4 +1856,9 @@
 		"1.5");
 
+	RegisterOption("VspBspTree.useCostHeuristics",
+		optBool,
+		"-vsp_bsp_use_cost_heuristics=",
+		"false");
+
 	RegisterOption("VspBspTree.Termination.maxViewCells",
 		optInt,
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp	(revision 610)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp	(revision 612)
@@ -16,5 +16,5 @@
 #include "RssPreprocessor.h"
 
-#define SAMPLE_AFTER_SUBDIVISION 1
+#define SAMPLE_AFTER_SUBDIVISION 0
 
 
@@ -2502,5 +2502,5 @@
 	Debug << "\nView cells after construction:\n" << mViewCellsStats << endl;
 
-	if (1) // export initial view cells
+	if (0) // export initial view cells
 	{
 		cout << "exporting initial view cells (=leaves) ... ";
@@ -2580,5 +2580,5 @@
 	
 	//BspLeaf::NewMail();
-	if (1) // export merged view cells
+	if (0) // export merged view cells
 	{
 		mColorCode = 0;
@@ -2617,5 +2617,5 @@
 	}
 
-	if (1) // export merged view cells
+	if (0) // export merged view cells using pvs coding
 	{
 		mColorCode = 1;
@@ -2909,6 +2909,6 @@
 
 	
-	if (1) // export view cells
-	{// hack pvs
+	if (0) // export view cells
+	{	// hack pvs
 		int savedColorCode = mColorCode;
 		mColorCode = 1;
