Index: /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 1787)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 1830)
@@ -528,4 +528,6 @@
 	void GetPvsEfficiently(ViewCell *vc, ObjectPvs &pvs) const;
 
+	float EvalFullMem() const;
+
 protected:
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 1827)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 1830)
@@ -2541,4 +2541,5 @@
 	SplitQueue tempQueue;
 	tempQueue.Push(firstCandidate);
+
 	while (!tempQueue.Empty())
 	{
@@ -2549,8 +2550,8 @@
 			dynamic_cast<BvhSubdivisionCandidate *>(candidate);
 
-		const bool globalCriteriaMet = GlobalTerminationCriteriaMet(bsc->mParentData);
-
 		if (!InitialTerminationCriteriaMet(bsc->mParentData))
 		{
+			const bool globalCriteriaMet = GlobalTerminationCriteriaMet(bsc->mParentData);
+		
 			BvhNode *node = Subdivide(tempQueue, bsc, globalCriteriaMet);
 
@@ -2560,5 +2561,5 @@
 		else // initial preprocessing  finished for this candidate
 		{
-			// add to "real" traversal queue
+			// add to candidate container
 			candidateContainer.push_back(bsc);
 		}
@@ -2575,14 +2576,9 @@
 	ObjectContainer::const_iterator oit, oit_end = objects->end();
    
-	/*for (oit = objects->begin(); oit != objects->end(); ++ oit)
-	{
-		cout << (*oit)->GetBox().SurfaceArea() << " ";
-	}*/
-
 	float maxAreaDiff = -1.0f;
 
 	ObjectContainer::const_iterator backObjectsStart = objects->begin();
-int dummy = 0;
-    for (oit = objects->begin(); oit != (objects->end() - 1); ++ oit, ++ dummy)
+
+    for (oit = objects->begin(); oit != (objects->end() - 1); ++ oit)
 	{
 		Intersectable *objS = *oit;
@@ -2595,5 +2591,4 @@
 		{
 			maxAreaDiff = areaDiff;
-			//cout << "maxAreaDiff : " << maxAreaDiff << " " << dummy << " " << objects->size() - dummy <<  endl;
 			backObjectsStart = oit + 1;
 		}
@@ -2612,5 +2607,6 @@
 	}
 	
-	cout << "front: " << (int)frontObjects.size() << " back " << (int)backObjects.size() << " " << backObjects.front()->GetBox().SurfaceArea() - frontObjects.back()->GetBox().SurfaceArea() << endl;
+	cout << "front: " << (int)frontObjects.size() << " back: " << (int)backObjects.size() << " " 
+		 << backObjects.front()->GetBox().SurfaceArea() - frontObjects.back()->GetBox().SurfaceArea() << endl;
 }
 
@@ -2621,5 +2617,5 @@
 	const float areaLarge = largeObj->GetBox().SurfaceArea();
 
-	return areaSmall / (areaLarge - areaSmall + Limits::Small);
+	return areaLarge / (areaLarge - areaSmall + Limits::Small);
 }
 
@@ -2627,9 +2623,16 @@
 bool BvHierarchy::InitialTerminationCriteriaMet(const BvhTraversalData &tData) const
 {
-	return (0
+	const bool terminationCriteriaMet =
+			(0
 		    || ((int)tData.mNode->mObjects.size() < mInitialMinObjects)
 			|| (tData.mNode->mObjects.back()->GetBox().SurfaceArea() < mInitialMinArea)
 			|| (AreaRatio(tData.mNode->mObjects.front(), tData.mNode->mObjects.back()) > mInitialMaxAreaRatio)
 			);
+
+	cout << "criteria met: " << terminationCriteriaMet << " " << (int)tData.mNode->mObjects.size() << " " << mInitialMinObjects << endl
+		 << AreaRatio(tData.mNode->mObjects.front(), tData.mNode->mObjects.back()) << " " << mInitialMaxAreaRatio << endl
+		 << tData.mNode->mObjects.back()->GetBox().SurfaceArea() << " " << mInitialMinArea << endl;
+
+	return terminationCriteriaMet;
 }
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1826)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1830)
@@ -122,5 +122,6 @@
 	{
 		mStrategies.push_back(SamplingStrategy::OBJECT_BASED_DISTRIBUTION);
-		mStrategies.push_back(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION);
+		//mStrategies.push_back(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION);
+		mStrategies.push_back(SamplingStrategy::REVERSE_VIEWSPACE_BORDER_BASED_DISTRIBUTION);
 		mStrategies.push_back(SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION);
 	}
@@ -5664,6 +5665,6 @@
 	Exporter *exporter = Exporter::GetExporter("final_view_cells.wrl");
 
-	//Vector3 scale(0.9f, 0.9f, 0.9f);
-	Vector3 scale(1.0f, 1.0f, 1.0f);
+	Vector3 scale(0.9f, 0.9f, 0.9f);
+	//Vector3 scale(1.0f, 1.0f, 1.0f);
 
 	if (exporter)
@@ -6214,5 +6215,6 @@
 	{
 		evalStrats.push_back(SamplingStrategy::OBJECT_BASED_DISTRIBUTION);
-		evalStrats.push_back(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION);
+		//evalStrats.push_back(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION);
+		evalStrats.push_back(SamplingStrategy::REVERSE_VIEWSPACE_BORDER_BASED_DISTRIBUTION);
 		evalStrats.push_back(SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION);
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 1789)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 1830)
@@ -274,10 +274,17 @@
 
 
+float HierarchyManager::EvalFullMem() const
+{
+	// question: should I also add the mem usage of the hierarchies?
+	const float objectSpaceMem = 16;//GetObjectSpaceMemUsage();
+	const float viewSpaceMem = 16;//mVspTree->GetMemUsage();
+	// HACK: the same value is used for view and object space
+	return mHierarchyStats.mMemory + mHierarchyStats.Leaves() * objectSpaceMem;
+}
+
+
 void HierarchyManager::EvalSubdivisionStats()
 {
-	// question: should I also add the mem usage of the hierarchies?
-	const float objectSpaceMem = GetObjectSpaceMemUsage();
-	const float viewSpaceMem = mVspTree->GetMemUsage();
-		
+	
 	HierarchySubdivisionStats stats;
 
@@ -286,6 +293,5 @@
 	stats.mEntriesInPvs = mHierarchyStats.mPvsEntries;
 	stats.mMemoryCost = mHierarchyStats.mMemory  / float(1024 * 1024);
-	stats.mFullMemory = mHierarchyStats.mMemory  / float(1024 * 1024)
-						+ objectSpaceMem + viewSpaceMem;
+	stats.mFullMemory = EvalFullMem() / float(1024 * 1024);
 	stats.mViewSpaceSplits = mVspTree->mVspStats.Leaves();
 	stats.mObjectSpaceSplits = GetObjectSpaceSubdivisionLeaves();
@@ -322,5 +328,6 @@
 		(0
 		|| (mHierarchyStats.Leaves() >= mTermMaxLeaves) 
-		|| (mHierarchyStats.mMemory >= mTermMaxMemory)
+		//|| (mHierarchyStats.mMemory >= mTermMaxMemory)
+		|| (EvalFullMem() >= mTermMaxMemory)
 		|| candidate->GlobalTerminationCriteriaMet()
 		//|| (mHierarchyStats.mRenderCostDecrease < mMinRenderCostDecrease)
@@ -335,4 +342,5 @@
 		Debug << "cost misses: " << mHierarchyStats.mGlobalCostMisses << " " << mTermGlobalCostMissTolerance << endl;
 		Debug << "memory: " << mHierarchyStats.mMemory << " " << mTermMaxMemory << endl;
+		Debug << "full memory: " << EvalFullMem() << " " << mTermMaxMemory << endl;
 	}
 #endif
