Index: GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 1732)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 1736)
@@ -363,8 +363,10 @@
 	/** Repairs the dirty entries of the subdivision candidate queue. The
 		list of entries is given in the dirty list.
-	*/
-	void RepairQueue(const SubdivisionCandidateContainer &dirtyList, 
-					 SplitQueue &splitQueue,
-					 const bool recomputeSplitPlaneOnRepair);
+
+		@returns number of repaired candidates
+	*/
+	int RepairQueue(const SubdivisionCandidateContainer &dirtyList, 
+					SplitQueue &splitQueue,
+					const bool recomputeSplitPlaneOnRepair);
 
 	/** Collect subdivision candidates which were affected by the splits from the
Index: GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 1733)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 1736)
@@ -320,5 +320,5 @@
 	Debug << "max memory: " << mMaxMemory << endl;
 	Debug << "use cost heuristics: " << mUseCostHeuristics << endl;
-	Debug << "use sah (surface area heuristics: " << mUseSah << endl;
+	Debug << "use surface area heuristics: " << mUseSah << endl;
 	Debug << "subdivision stats log: " << subdivisionStatsLog << endl;
 	Debug << "split borders: " << mSplitBorder << endl;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1732)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1736)
@@ -3730,4 +3730,6 @@
 			exporter->SetWireframe();
 
+			// matt: no kd pvs
+			/*
 			KdPvsMap::iterator kit = object->mKdPvs.mEntries.begin();
 			Intersectable::NewMail();
@@ -3755,5 +3757,5 @@
 			exporter->SetForcedMaterial(m);
 			exporter->ExportIntersectable(object);
-
+*/
 			delete exporter;
 		}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h	(revision 1723)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h	(revision 1736)
@@ -200,7 +200,8 @@
 	/// Map of PVS entries
 	std::map<T, S, LtSample<T> > mEntries;
-
-  /// Number of samples used to create the PVS
-  int mSamples;
+	//vector<pair<T, S> > mEntries; 
+	
+	/// Number of samples used to create the PVS
+	int mSamples;
 };
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp	(revision 1695)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp	(revision 1736)
@@ -303,10 +303,12 @@
     // determine the side of this ray with respect to the plane
     AxisAlignedBox3 box = (*mi)->GetBox();
-		
+	
+	// matt: no more ref
 	// for handling multiple objects: keep track of references
-	if (leaf->IsRoot()) 
-		(*mi)->mReferences = 1; // initialise references at root
+	//if (leaf->IsRoot()) 
+	//	(*mi)->mReferences = 1; // initialise references at root
 	
-	-- (*mi)->mReferences; // remove parent ref
+	// matt: no more ref
+	//-- (*mi)->mReferences; // remove parent ref
 
 
@@ -314,5 +316,5 @@
 	{
       front->mObjects.push_back(*mi);
-	  ++ (*mi)->mReferences;
+	  //++ (*mi)->mReferences;
 	}
 	
@@ -320,5 +322,6 @@
 	{
       back->mObjects.push_back(*mi);
-	  ++ (*mi)->mReferences;
+	// matt: no more ref
+	//  ++ (*mi)->mReferences;
 	}
 
@@ -346,8 +349,9 @@
 		Intersectable *object = *oit;
 		
-		if (object->mReferences > 1)
+		// matt: no more ref
+		/*if (object->mReferences > 1)
 		{
 			leaf->mMultipleObjects.push_back(object);
-		}
+		}*/
 	}
 }
@@ -1044,5 +1048,8 @@
 KdTree::CollectLeafPvs()
 {
-  int totalPvsSize = 0;
+
+	// matt: no more kd pvs
+    int totalPvsSize = 0;
+	/*
   stack<KdNode *> nodeStack;
   
@@ -1076,5 +1083,5 @@
     }
   }
-
+*/
   return totalPvsSize;
 }
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h	(revision 1701)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h	(revision 1736)
@@ -47,18 +47,16 @@
   /// pointer to the containing bvh leaf
   BvhLeaf *mBvhLeaf;
-//BvhNode *mBvhLeaf;
   
   /// # of references to this instance
-  int mReferences;
+  //int mReferences;
 
   //////////////////
   // note matt: delete these, they are only taking memory
 
-
   /// object based pvs
-  KdPvs mKdPvs;
+  //KdPvs mKdPvs;
 
   /// view cell based pvs per object
-  ViewCellPvs mViewCellPvs;
+  //ViewCellPvs mViewCellPvs;
 	
   ///////////////////////
@@ -75,5 +73,9 @@
 		};
   
-  Intersectable(): mMailbox(0), mReferences(0), mBvhLeaf(0), mVssRays(NULL) {}
+  Intersectable(): 
+  mMailbox(0), 
+  //mReferences(0), 
+  mBvhLeaf(0), 
+  mVssRays(NULL) {}
 
   virtual Intersectable::~Intersectable() {DEL_PTR(mVssRays);}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 1733)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 1736)
@@ -151,4 +151,5 @@
 	Environment::GetSingleton()->GetIntValue(
 		"Hierarchy.Construction.maxRepairs", mMaxRepairs);
+
 	// compare to bytes
 	mTermMaxMemory *= (1024.0f * 1024.0f);
@@ -504,7 +505,7 @@
 			/// Repair split queue, i.e., affected view space candidates
 			cout << "repairing queue ... " << endl;
-			RepairQueue(dirtyVspList, viewSpaceQueue, true);
+			const int repaired = RepairQueue(dirtyVspList, viewSpaceQueue, true);
             
-			cout << "\nrepaired " << (int)dirtyVspList.size() << " candidates" << endl;
+			cout << "\nrepaired " << repaired << " candidates from " << (int)dirtyVspList.size() << " dirtied candidates" << endl;
 		}
 		else
@@ -534,7 +535,7 @@
 			/// Repair split queue
 			cout << "repairing queue ... " << endl;
-			RepairQueue(dirtyOspList, objectSpaceQueue, true);
-
-			cout << "repaired " << (int)dirtyOspList.size() << " candidates" << endl;
+			const int repaired = RepairQueue(dirtyOspList, objectSpaceQueue, true);
+
+			cout << "\nrepaired " << repaired << " candidates from " << (int)dirtyOspList.size() << " dirtied candidates" << endl;
 		}
 	}
@@ -1310,7 +1311,7 @@
 
 
-void HierarchyManager::RepairQueue(const SubdivisionCandidateContainer &dirtyList, 
-								   SplitQueue &splitQueue,
-								   const bool recomputeSplitPlaneOnRepair)
+int HierarchyManager::RepairQueue(const SubdivisionCandidateContainer &dirtyList,
+								  SplitQueue &splitQueue,
+								  const bool recomputeSplitPlaneOnRepair)
 {
 	// for each update of the view space partition:
@@ -1330,4 +1331,6 @@
 	// split candidate
 
+	int repaired = 0;
+
 	// collect list of "dirty" candidates
 	const long startTime = GetTime();
@@ -1356,5 +1359,6 @@
 		 // reinsert
 		splitQueue.Push(sc);
-
+		
+		++ repaired;
 		cout << ".";
 
@@ -1371,5 +1375,5 @@
 	mHierarchyStats.mRepairTime += timeDiff;
 
-	if (0) cout << "repaired in " << timeDiff * 1e-3f << " secs" << endl;
+	return repaired;
 }
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/OspTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/OspTree.cpp	(revision 1715)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/OspTree.cpp	(revision 1736)
@@ -39,5 +39,6 @@
 										  bool checkOnlyMailed)
 {
-	MailablePvsData *vdata = obj->mViewCellPvs.Find(vc);
+	// no view cell pvs!!
+/*	MailablePvsData *vdata = obj->mViewCellPvs.Find(vc);
 
 	if (vdata)
@@ -52,5 +53,5 @@
 				return true;
 		}
-	}
+	}*/
 
 	return false;
@@ -250,9 +251,11 @@
 		if (parent->IsRoot())
 		{
-			object->mReferences = 1;
+			// matt: no more parent ref
+			//object->mReferences = 1;
 		}
 
 		// remove parent ref
-		-- object->mReferences;
+		// matt: no more parent ref
+		//-- object->mReferences;
 
 		// determine the side of this ray with respect to the plane
@@ -262,5 +265,6 @@
 		{
             front.push_back(object);
-			++ object->mReferences;
+			// matt: no more ref
+			//++ object->mReferences;
 		}
 
@@ -268,5 +272,6 @@
 		{
 			back.push_back(object);
-			++ object->mReferences;
+			// matt: no more ref
+			//++ object->mReferences;
 		}
 	}
@@ -885,5 +890,6 @@
 		{
 			ViewCell *vc = *vit;
-			MailablePvsData *vdata = obj->mViewCellPvs.Find(vc);
+			// no view cel pvs!!
+			/*MailablePvsData *vdata = obj->mViewCellPvs.Find(vc);
 
 			if (!vdata) // should never happen
@@ -894,5 +900,5 @@
 				vdata->Mail();
 				renderCost += vc->GetVolume();
-			}
+			}*/
 		}
 	}
@@ -1383,7 +1389,6 @@
 		{
 			ViewCell *vc = *vit;
-			
-			MailablePvsData *vdata = obj->mViewCellPvs.Find(vc);
-
+			// no more view cell pvs!!
+			/*MailablePvsData *vdata = obj->mViewCellPvs.Find(vc);
 			if (!vdata)
 			{
@@ -1406,5 +1411,5 @@
 					newRc += vc->GetVolume();
 				}
-			}
+			}*/
 		}
 	}
@@ -1464,8 +1469,9 @@
 		Intersectable *object = *oit;
 		
-		if (object->mReferences > 1)
+		// matt: no more ref
+		/*if (object->mReferences > 1)
 		{
 			leaf->mMultipleObjects.push_back(object);
-		}
+		}*/
 	}
 }
@@ -1529,6 +1535,6 @@
 	{
 		Intersectable *obj = *oit;
-
-		ViewCellPvsMap::const_iterator vit, vit_end = obj->mViewCellPvs.mEntries.end();
+		// no more view cell pvs!!
+		/*ViewCellPvsMap::const_iterator vit, vit_end = obj->mViewCellPvs.mEntries.end();
 
 		for (vit = obj->mViewCellPvs.mEntries.begin(); vit != vit_end; ++ vit)
@@ -1541,5 +1547,5 @@
 				viewCells.push_back(vc);
 			}
-		}
+		}*/
 	}
 }
@@ -1804,5 +1810,6 @@
 	for (it = touchedObjects.begin(); it != it_end; ++ it)
 	{
-		Debug << "\nobj: " << (*it) << " vc pvs size: " << (*it)->mViewCellPvs.GetSize() << endl << endl;
+		// no more view cell pvs!!
+		/*Debug << "\nobj: " << (*it) << " vc pvs size: " << (*it)->mViewCellPvs.GetSize() << endl << endl;
 		ViewCellPvsMap::const_iterator mit, mit_end = (*it)->mViewCellPvs.mEntries.end();
 
@@ -1810,5 +1817,5 @@
 		{
 			Debug << "new sumpdf: " << (*mit).second.mSumPdf << endl;
-		}
+		}*/
 	}
 
@@ -1976,6 +1983,7 @@
 {	
 	contribution = 0; // todo
-	MailablePvsData *vdata = obj->mViewCellPvs.Find(vc);
-
+	
+	// no more view cell pvs!!
+	/*MailablePvsData *vdata = obj->mViewCellPvs.Find(vc);
 	if (!vdata)
 	{
@@ -1986,5 +1994,7 @@
 		obj->mViewCellPvs.AddSample(vc, 1);
 	}
+
 	vdata->Mail();
+	*/
 
 	return true;
@@ -2077,5 +2087,5 @@
 			ViewCell *vc = *vit;
 			
-			MailablePvsData *vdata = obj->mViewCellPvs.Find(vc);
+			/*MailablePvsData *vdata = obj->mViewCellPvs.Find(vc);
 
 			if (vdata && !vdata->Mailed())
@@ -2083,5 +2093,5 @@
 				vdata->Mail();
 				obj->mViewCellPvs.RemoveSample(vc, 1);
-			}
+			}*/
 		}
 	}
