Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.h	(revision 1006)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.h	(revision 1008)
@@ -410,4 +410,5 @@
 };
 
+
 /** Implementation of the view cell BSP tree. 
 */
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp	(revision 1006)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp	(revision 1008)
@@ -46,4 +46,172 @@
 
 
+int VspNode::sMailId = 1;
+
+
+/******************************************************************/
+/*                  class VspNode implementation                  */
+/******************************************************************/
+
+
+VspNode::VspNode(): 
+mParent(NULL), mTreeValid(true), mTimeStamp(0)
+{}
+
+
+VspNode::VspNode(VspInterior *parent): 
+mParent(parent), mTreeValid(true)
+{}
+
+
+bool VspNode::IsRoot() const 
+{
+	return mParent == NULL;
+}
+
+
+VspInterior *VspNode::GetParent() 
+{ 
+	return mParent; 
+}
+
+
+void VspNode::SetParent(VspInterior *parent)
+{
+	mParent = parent;
+}
+
+
+bool VspNode::IsSibling(VspNode *n) const
+{
+	return  ((this != n) && mParent && 
+			 (mParent->GetFront() == n) || (mParent->GetBack() == n));
+}
+
+
+int VspNode::GetDepth() const
+{
+	int depth = 0;
+	VspNode *p = mParent;
+	
+	while (p)
+	{
+		p = p->mParent;
+		++ depth;
+	}
+
+	return depth;
+}
+
+
+bool VspNode::TreeValid() const
+{
+	return mTreeValid;
+}
+
+
+void VspNode::SetTreeValid(const bool v)
+{
+	mTreeValid = v;
+}
+
+
+/****************************************************************/
+/*              class VspInterior implementation                */
+/****************************************************************/
+
+
+VspInterior::VspInterior(const AxisAlignedPlane &plane): 
+mPlane(plane), mFront(NULL), mBack(NULL)
+{}
+
+VspInterior::~VspInterior() 
+{ 
+	DEL_PTR(mFront); 
+	DEL_PTR(mBack);
+}
+
+bool VspInterior::IsLeaf() const
+{ 
+	return false; 
+}
+
+VspNode *VspInterior::GetBack() 
+{
+	return mBack;
+}
+
+VspNode *VspInterior::GetFront() 
+{
+	return mFront;
+}
+
+AxisAlignedPlane VspInterior::GetPlane() const
+{
+	return mPlane;
+}
+
+void VspInterior::ReplaceChildLink(VspNode *oldChild, VspNode *newChild) 
+{
+	if (mBack == oldChild)
+		mBack = newChild;
+	else
+		mFront = newChild;
+}
+
+void VspInterior::SetupChildLinks(VspNode *b, VspNode *f) 
+{
+    mBack = b;
+    mFront = f;
+}
+
+
+/****************************************************************/
+/*                  class VspLeaf implementation                */
+/****************************************************************/
+
+
+VspLeaf::VspLeaf(): mViewCell(NULL), mPvs(NULL)
+{
+}
+
+
+VspLeaf::~VspLeaf()
+{
+	DEL_PTR(mPvs);
+}
+
+
+VspLeaf::VspLeaf(ViewCellLeaf *viewCell): 
+mViewCell(viewCell)
+{
+}
+
+
+VspLeaf::VspLeaf(VspInterior *parent): 
+VspNode(parent), mViewCell(NULL), mPvs(NULL)
+{}
+
+
+
+VspLeaf::VspLeaf(VspInterior *parent, ViewCellLeaf *viewCell): 
+VspNode(parent), mViewCell(viewCell), mPvs(NULL)
+{
+}
+
+ViewCellLeaf *VspLeaf::GetViewCell() const
+{
+	return mViewCell;
+}
+
+void VspLeaf::SetViewCell(ViewCellLeaf *viewCell)
+{
+	mViewCell = viewCell;
+}
+
+
+bool VspLeaf::IsLeaf() const 
+{ 
+	return true; 
+}
 
 
@@ -140,5 +308,5 @@
 
 
-BspViewCell *VspOspTree::GetOutOfBoundsCell()
+VspViewCell *VspOspTree::GetOutOfBoundsCell()
 {
 	return mOutOfBoundsCell;
@@ -146,9 +314,9 @@
 
 
-BspViewCell *VspOspTree::GetOrCreateOutOfBoundsCell()
+VspViewCell *VspOspTree::GetOrCreateOutOfBoundsCell()
 {
 	if (!mOutOfBoundsCell)
 	{
-		mOutOfBoundsCell = new BspViewCell();
+		mOutOfBoundsCell = new VspViewCell();
 		mOutOfBoundsCell->SetId(-1);
 		mOutOfBoundsCell->SetValid(false);
@@ -159,7 +327,7 @@
 
 
-const BspTreeStatistics &VspOspTree::GetStatistics() const
-{
-	return mBspStats;
+const VspTreeStatistics &VspOspTree::GetStatistics() const
+{
+	return mVspStats;
 }
 
@@ -171,8 +339,9 @@
 }
 
+
 void VspOspTree::Construct(const VssRayContainer &sampleRays,
 						   AxisAlignedBox3 *forcedBoundingBox)
 {
-	mBspStats.nodes = 1;
+	mVspStats.nodes = 1;
 	mBox.Initialize(); 	// initialise BSP tree bounding box
 
@@ -231,9 +400,9 @@
 	return (float)
 		 (sizeof(VspOspTree) + 
-		  mBspStats.Leaves() * sizeof(BspLeaf) + 
+		  mVspStats.Leaves() * sizeof(VspLeaf) + 
 		  mCreatedViewCells * sizeof(BspViewCell) +
-		  mBspStats.pvs * sizeof(ObjectPvsData) +
-		  mBspStats.Interior() * sizeof(BspInterior) +
-		  mBspStats.accumRays * sizeof(RayInfo)) / (1024.0f * 1024.0f);
+		  mVspStats.pvs * sizeof(ObjectPvsData) +
+		  mVspStats.Interior() * sizeof(VspInterior) +
+		  mVspStats.accumRays * sizeof(RayInfo)) / (1024.0f * 1024.0f);
 }
 
@@ -243,5 +412,5 @@
 	VspOspSplitQueue tQueue;
 
-	mRoot = new BspLeaf();
+	mRoot = new VspLeaf();
 
 	const float prop = mBox.GetVolume();
@@ -274,5 +443,5 @@
 	
 	
-	mBspStats.Start();
+	mVspStats.Start();
 	cout << "Constructing vsp bsp tree ... \n";
 
@@ -313,5 +482,5 @@
 
 		// subdivide leaf node
-		BspNode *r = Subdivide(tQueue, splitCandidate);
+		VspNode *r = Subdivide(tQueue, splitCandidate);
 
 		if (r == mRoot)
@@ -319,9 +488,9 @@
 				  << TimeDiff(startTime, GetTime())*1e-3 << "s" << endl;
 
-		if (mBspStats.Leaves() >= nLeaves)
+		if (mVspStats.Leaves() >= nLeaves)
 		{
 			nLeaves += 500;
 
-			cout << "leaves=" << mBspStats.Leaves() << endl;
+			cout << "leaves=" << mVspStats.Leaves() << endl;
 			Debug << "needed "
 				  << TimeDiff(interTime, GetTime())*1e-3 
@@ -341,5 +510,5 @@
 	cout << "finished\n";
 
-	mBspStats.Stop();
+	mVspStats.Stop();
 }
 
@@ -360,5 +529,5 @@
 	return
 		(mOutOfMemory 
-		|| (mBspStats.Leaves() >= mMaxViewCells) 
+		|| (mVspStats.Leaves() >= mMaxViewCells) 
 		|| (mGlobalCostMisses >= mTermGlobalCostMissTolerance)
 		 );
@@ -367,10 +536,10 @@
 
 // subdivide using a split plane queue
-BspNode *VspOspTree::Subdivide(VspOspSplitQueue &tQueue,
+VspNode *VspOspTree::Subdivide(VspOspSplitQueue &tQueue,
 							   VspOspSplitCandidate &splitCandidate)
 {
 	VspOspTraversalData &tData = splitCandidate.mParentData;
 
-	BspNode *newNode = tData.mNode;
+	VspNode *newNode = tData.mNode;
 
 	if (!LocalTerminationCriteriaMet(tData) && !GlobalTerminationCriteriaMet(tData))
@@ -382,7 +551,6 @@
 		
 		// create new interior node and two leaf node
-		//TODO
-		const Plane3 splitPlane;// = splitCandidate.mSplitPlane;
-				
+		const AxisAlignedPlane splitPlane = splitCandidate.mSplitPlane;
+
 		newNode = SubdivideNode(splitPlane, tData, tFrontData, tBackData);
 	
@@ -409,9 +577,9 @@
 
 			mSubdivisionStats 
-					<< "#ViewCells\n" << mBspStats.Leaves() << endl
+					<< "#ViewCells\n" << mVspStats.Leaves() << endl
 					<< "#RenderCostDecrease\n" << -costDecr << endl
 					<< "#SplitCandidateCost\n" << splitCandidate.GetCost() << endl
 					<< "#TotalRenderCost\n" << mTotalCost << endl
-					<< "#AvgRenderCost\n" << (float)mTotalPvsSize / (float)mBspStats.Leaves() << endl;
+					<< "#AvgRenderCost\n" << (float)mTotalPvsSize / (float)mVspStats.Leaves() << endl;
 		}
 
@@ -435,5 +603,5 @@
 	if (newNode->IsLeaf())
 	{
-		BspLeaf *leaf = dynamic_cast<BspLeaf *>(newNode);
+		VspLeaf *leaf = dynamic_cast<VspLeaf *>(newNode);
 		BspViewCell *viewCell = new BspViewCell();
 
@@ -448,6 +616,6 @@
 		mViewCellsManager->SetScalarPvsSize(viewCell, viewCell->GetPvs().GetSize());
 
-		mBspStats.contributingSamples += conSamp;
-		mBspStats.sampleContributions +=(int) sampCon;
+		mVspStats.contributingSamples += conSamp;
+		mVspStats.sampleContributions +=(int) sampCon;
 
 		//-- store additional info
@@ -484,13 +652,14 @@
 	VspOspTraversalData backData;
 
-	BspLeaf *leaf = dynamic_cast<BspLeaf *>(tData.mNode);
+	VspLeaf *leaf = dynamic_cast<VspLeaf *>(tData.mNode);
 
 	// compute locally best split plane
-	// TODO
-    const bool success =0;/// SelectPlane(splitData.mSplitPlane, tData, 
-//									 frontData, backData);
+	const bool success = 
+		SelectPlane(tData, splitData.mSplitPlane,
+					frontData.mProbability, backData.mProbability);
+
 	//TODO
 	// compute global decrease in render cost
-	splitData.mRenderCost = 0;//EvalRenderCostDecrease(splitData.mSplitPlane, tData);
+	splitData.mRenderCost = EvalRenderCostDecrease(splitData.mSplitPlane, tData);
 	splitData.mParentData = tData;
 	splitData.mMaxCostMisses = success ? tData.mMaxCostMisses : tData.mMaxCostMisses + 1;
@@ -498,10 +667,10 @@
 
 
-BspInterior *VspOspTree::SubdivideNode(const Plane3 &splitPlane,
+VspInterior *VspOspTree::SubdivideNode(const AxisAlignedPlane &splitPlane,
 									   VspOspTraversalData &tData,
 									   VspOspTraversalData &frontData,
 									   VspOspTraversalData &backData)
 {
-	BspLeaf *leaf = dynamic_cast<BspLeaf *>(tData.mNode);
+	VspLeaf *leaf = dynamic_cast<VspLeaf *>(tData.mNode);
 	
 	//-- the front and back traversal data is filled with the new values
@@ -514,9 +683,10 @@
 
 	//-- subdivide rays
+#if TODO	
 	SplitRays(splitPlane,
 			  *tData.mRays,
 			  *frontData.mRays,
 			  *backData.mRays);
-
+#endif
 
 	// compute pvs
@@ -543,14 +713,14 @@
 
 	// store maximal and minimal depth
-	if (tData.mDepth > mBspStats.maxDepth)
-	{
-		Debug << "max depth increases to " << tData.mDepth << " at " << mBspStats.Leaves() << " leaves" << endl;
-		mBspStats.maxDepth = tData.mDepth;
-	}
-
-	mBspStats.nodes += 2;
+	if (tData.mDepth > mVspStats.maxDepth)
+	{
+		Debug << "max depth increases to " << tData.mDepth << " at " << mVspStats.Leaves() << " leaves" << endl;
+		mVspStats.maxDepth = tData.mDepth;
+	}
+
+	mVspStats.nodes += 2;
 
     
-	BspInterior *interior = new BspInterior(splitPlane);
+	VspInterior *interior = new VspInterior(splitPlane);
 
 #ifdef _DEBUG
@@ -561,5 +731,5 @@
 	//-- create front and back leaf
 
-	BspInterior *parent = leaf->GetParent();
+	VspInterior *parent = leaf->GetParent();
 
 	// replace a link from node's parent
@@ -575,5 +745,5 @@
 
 	// and setup child links
-	interior->SetupChildLinks(new BspLeaf(interior), new BspLeaf(interior));
+	interior->SetupChildLinks(new VspLeaf(interior), new VspLeaf(interior));
 
 	frontData.mNode = interior->GetFront();
@@ -586,5 +756,5 @@
 
 
-void VspOspTree::AddToPvs(BspLeaf *leaf,
+void VspOspTree::AddToPvs(VspLeaf *leaf,
 						  const RayInfoContainer &rays,
 						  float &sampleContributions,
@@ -946,5 +1116,5 @@
 
 
-float VspOspTree::EvalRenderCostDecrease(const Plane3 &candidatePlane,
+float VspOspTree::EvalRenderCostDecrease(const AxisAlignedPlane &candidatePlane,
 										 const VspOspTraversalData &data) const
 {
@@ -968,5 +1138,7 @@
 		float t;
 		VssRay *ray = rayInf.mRay;
-		const int cf = rayInf.ComputeRayIntersection(candidatePlane, t);
+		const int cf = 
+			rayInf.ComputeRayIntersection(candidatePlane.mAxis, 
+										  candidatePlane.mPosition, t);
 
 		// find front and back pvs for origing and termination object
@@ -1116,14 +1288,14 @@
 
 
-void VspOspTree::CollectLeaves(vector<BspLeaf *> &leaves, 
+void VspOspTree::CollectLeaves(vector<VspLeaf *> &leaves, 
 							   const bool onlyUnmailed,
 							   const int maxPvsSize) const
 {
-	stack<BspNode *> nodeStack;
+	stack<VspNode *> nodeStack;
 	nodeStack.push(mRoot);
 
 	while (!nodeStack.empty())
 	{
-		BspNode *node = nodeStack.top();
+		VspNode *node = nodeStack.top();
 		nodeStack.pop();
 		
@@ -1131,5 +1303,5 @@
 		{
 			// test if this leaf is in valid view space
-			BspLeaf *leaf = dynamic_cast<BspLeaf *>(node);
+			VspLeaf *leaf = dynamic_cast<VspLeaf *>(node);
 			if (leaf->TreeValid() && 
 				(!onlyUnmailed || !leaf->Mailed()) &&
@@ -1141,5 +1313,5 @@
 		else
 		{
-			BspInterior *interior = dynamic_cast<BspInterior *>(node);
+			VspInterior *interior = dynamic_cast<VspInterior *>(node);
 
 			nodeStack.push(interior->GetBack());
@@ -1156,5 +1328,5 @@
 
 
-BspNode *VspOspTree::GetRoot() const
+VspNode *VspOspTree::GetRoot() const
 {
 	return mRoot;
@@ -1165,42 +1337,42 @@
 {
 	// the node became a leaf -> evaluate stats for leafs
-	BspLeaf *leaf = dynamic_cast<BspLeaf *>(data.mNode);
-
-
-	if (data.mPvs > mBspStats.maxPvs)
-	{
-		mBspStats.maxPvs = data.mPvs;
-	}
-
-	mBspStats.pvs += data.mPvs;
-
-	if (data.mDepth < mBspStats.minDepth)
-	{
-		mBspStats.minDepth = data.mDepth;
+	VspLeaf *leaf = dynamic_cast<VspLeaf *>(data.mNode);
+
+
+	if (data.mPvs > mVspStats.maxPvs)
+	{
+		mVspStats.maxPvs = data.mPvs;
+	}
+
+	mVspStats.pvs += data.mPvs;
+
+	if (data.mDepth < mVspStats.minDepth)
+	{
+		mVspStats.minDepth = data.mDepth;
 	}
 	
 	if (data.mDepth >= mTermMaxDepth)
 	{
-        ++ mBspStats.maxDepthNodes;
-		//Debug << "new max depth: " << mBspStats.maxDepthNodes << endl;
+        ++ mVspStats.maxDepthNodes;
+		//Debug << "new max depth: " << mVspStats.maxDepthNodes << endl;
 	}
 
 	// accumulate rays to compute rays /  leaf
-	mBspStats.accumRays += (int)data.mRays->size();
+	mVspStats.accumRays += (int)data.mRays->size();
 
 	if (data.mPvs < mTermMinPvs)
-		++ mBspStats.minPvsNodes;
+		++ mVspStats.minPvsNodes;
 
 	if ((int)data.mRays->size() < mTermMinRays)
-		++ mBspStats.minRaysNodes;
+		++ mVspStats.minRaysNodes;
 
 	if (data.GetAvgRayContribution() > mTermMaxRayContribution)
-		++ mBspStats.maxRayContribNodes;
+		++ mVspStats.maxRayContribNodes;
 
 	if (data.mProbability <= mTermMinProbability)
-		++ mBspStats.minProbabilityNodes;
+		++ mVspStats.minProbabilityNodes;
 	
 	// accumulate depth to compute average depth
-	mBspStats.accumDepth += data.mDepth;
+	mVspStats.accumDepth += data.mDepth;
 
 	++ mCreatedViewCells;
@@ -1221,5 +1393,5 @@
 {
 	int hits = 0;
-
+#if TODO
 	stack<BspRayTraversalData> tQueue;
 
@@ -1234,6 +1406,6 @@
 	Vector3 extp = ray.Extrap(maxt);
 
-	BspNode *node = mRoot;
-	BspNode *farChild = NULL;
+	VspNode *node = mRoot;
+	VspNode *farChild = NULL;
 
 	while (1)
@@ -1241,5 +1413,5 @@
 		if (!node->IsLeaf())
 		{
-			BspInterior *in = dynamic_cast<BspInterior *>(node);
+			VspInterior *in = dynamic_cast<VspInterior *>(node);
 
 			Plane3 splitPlane = in->GetPlane();
@@ -1274,5 +1446,5 @@
 
 			// push data for far child
-			tQueue.push(BspRayTraversalData(farChild, extp, maxt));
+			tQueue.push(VspRayTraversalData(farChild, extp, maxt));
 
 			// find intersection of ray segment with plane
@@ -1283,5 +1455,5 @@
 		} else // reached leaf => intersection with view cell
 		{
-			BspLeaf *leaf = dynamic_cast<BspLeaf *>(node);
+			VspLeaf *leaf = dynamic_cast<VspLeaf *>(node);
 
 			if (!leaf->GetViewCell()->Mailed())
@@ -1311,5 +1483,5 @@
 		}
 	}
-
+#endif
 	return hits;
 }
@@ -1328,5 +1500,5 @@
 // TODO
 #if HAS_TO_BE_REDONE
-	stack<BspNode *> nodeStack;
+	stack<VspNode *> nodeStack;
 
 	if (!mRoot)
@@ -1337,14 +1509,14 @@
 	while (!nodeStack.empty()) 
 	{
-		BspNode *node = nodeStack.top();
+		VspNode *node = nodeStack.top();
 		nodeStack.pop();
 		
 		if (node->IsLeaf())
         {
-			BspViewCell *viewCell = dynamic_cast<BspLeaf *>(node)->GetViewCell();
+			BspViewCell *viewCell = dynamic_cast<VspLeaf *>(node)->GetViewCell();
 
 			if (!viewCell->GetValid())
 			{
-				BspViewCell *viewCell = dynamic_cast<BspLeaf *>(node)->GetViewCell();
+				BspViewCell *viewCell = dynamic_cast<VspLeaf *>(node)->GetViewCell();
 	
 				ViewCellContainer leaves;
@@ -1355,7 +1527,7 @@
 				for (it = leaves.begin(); it != it_end; ++ it)
 				{
-					BspLeaf *l = dynamic_cast<BspViewCell *>(*it)->mLeaf;
+					VspLeaf *l = dynamic_cast<BspViewCell *>(*it)->mLeaf;
 					l->SetViewCell(GetOrCreateOutOfBoundsCell());
-					++ mBspStats.invalidLeaves;
+					++ mVspStats.invalidLeaves;
 				}
 
@@ -1367,5 +1539,5 @@
 		else
 		{
-			BspInterior *interior = dynamic_cast<BspInterior *>(node);
+			VspInterior *interior = dynamic_cast<VspInterior *>(node);
 		
 			nodeStack.push(interior->GetFront());
@@ -1374,5 +1546,5 @@
 	}
 
-	Debug << "invalid leaves: " << mBspStats.invalidLeaves << endl;
+	Debug << "invalid leaves: " << mVspStats.invalidLeaves << endl;
 #endif
 }
@@ -1381,11 +1553,11 @@
 void VspOspTree::CollectRays(VssRayContainer &rays)
 {
-	vector<BspLeaf *> leaves;
-
-	vector<BspLeaf *>::const_iterator lit, lit_end = leaves.end();
+	vector<VspLeaf *> leaves;
+
+	vector<VspLeaf *>::const_iterator lit, lit_end = leaves.end();
 
 	for (lit = leaves.begin(); lit != lit_end; ++ lit)
 	{
-		BspLeaf *leaf = *lit;
+		VspLeaf *leaf = *lit;
 		VssRayContainer::const_iterator rit, rit_end = leaf->mVssRays.end();
 
@@ -1398,5 +1570,5 @@
 void VspOspTree::ValidateTree()
 {
-	stack<BspNode *> nodeStack;
+	stack<VspNode *> nodeStack;
 
 	if (!mRoot)
@@ -1405,16 +1577,16 @@
 	nodeStack.push(mRoot);
 	
-	mBspStats.invalidLeaves = 0;
+	mVspStats.invalidLeaves = 0;
 	while (!nodeStack.empty()) 
 	{
-		BspNode *node = nodeStack.top();
+		VspNode *node = nodeStack.top();
 		nodeStack.pop();
 		
 		if (node->IsLeaf())
 		{
-			BspLeaf *leaf = dynamic_cast<BspLeaf *>(node);
+			VspLeaf *leaf = dynamic_cast<VspLeaf *>(node);
 
 			if (!leaf->GetViewCell()->GetValid())
-				++ mBspStats.invalidLeaves;
+				++ mVspStats.invalidLeaves;
 
 			// validity flags don't match => repair
@@ -1427,5 +1599,5 @@
 		else
 		{
-			BspInterior *interior = dynamic_cast<BspInterior *>(node);
+			VspInterior *interior = dynamic_cast<VspInterior *>(node);
 		
 			nodeStack.push(interior->GetFront());
@@ -1434,15 +1606,15 @@
 	}
 
-	Debug << "invalid leaves: " << mBspStats.invalidLeaves << endl;
-}
-
-
-
-void VspOspTree::CollectViewCells(BspNode *root,
+	Debug << "invalid leaves: " << mVspStats.invalidLeaves << endl;
+}
+
+
+
+void VspOspTree::CollectViewCells(VspNode *root,
 								  bool onlyValid,
 								  ViewCellContainer &viewCells,
 								  bool onlyUnmailed) const
 {
-	stack<BspNode *> nodeStack;
+	stack<VspNode *> nodeStack;
 
 	if (!root)
@@ -1453,5 +1625,5 @@
 	while (!nodeStack.empty()) 
 	{
-		BspNode *node = nodeStack.top();
+		VspNode *node = nodeStack.top();
 		nodeStack.pop();
 		
@@ -1460,5 +1632,5 @@
 			if (!onlyValid || node->TreeValid())
 			{
-				ViewCellLeaf *leafVc = dynamic_cast<BspLeaf *>(node)->GetViewCell();
+				ViewCellLeaf *leafVc = dynamic_cast<VspLeaf *>(node)->GetViewCell();
 
 				ViewCell *viewCell = mViewCellsTree->GetActiveViewCell(leafVc);
@@ -1473,5 +1645,5 @@
 		else
 		{
-			BspInterior *interior = dynamic_cast<BspInterior *>(node);
+			VspInterior *interior = dynamic_cast<VspInterior *>(node);
 		
 			nodeStack.push(interior->GetFront());
@@ -1538,5 +1710,5 @@
 
 
-int VspOspTree::FindNeighbors(BspNode *n, vector<BspLeaf *> &neighbors,
+int VspOspTree::FindNeighbors(VspNode *n, vector<VspLeaf *> &neighbors,
 							  const bool onlyUnmailed) const
 {
@@ -1546,8 +1718,8 @@
 
 
-BspLeaf *VspOspTree::GetRandomLeaf(const Plane3 &halfspace)
+VspLeaf *VspOspTree::GetRandomLeaf(const Plane3 &halfspace)
 {
 #if TODO
-    stack<BspNode *> nodeStack;
+    stack<VspNode *> nodeStack;
   	nodeStack.push(mRoot);
 
@@ -1556,15 +1728,15 @@
 	while (!nodeStack.empty())
 	{
-		BspNode *node = nodeStack.top();
+		VspNode *node = nodeStack.top();
 		nodeStack.pop();
 
 		if (node->IsLeaf())
 		{
-			return dynamic_cast<BspLeaf *>(node);
+			return dynamic_cast<VspLeaf *>(node);
 		}
 		else
 		{
-			BspInterior *interior = dynamic_cast<BspInterior *>(node);
-			BspNode *next;
+			VspInterior *interior = dynamic_cast<VspInterior *>(node);
+			VspNode *next;
 			BspNodeGeometry geom;
 
@@ -1598,7 +1770,7 @@
 
 
-BspLeaf *VspOspTree::GetRandomLeaf(const bool onlyUnmailed)
-{
-	stack<BspNode *> nodeStack;
+VspLeaf *VspOspTree::GetRandomLeaf(const bool onlyUnmailed)
+{
+	stack<VspNode *> nodeStack;
 
 	nodeStack.push(mRoot);
@@ -1608,5 +1780,5 @@
 	while (!nodeStack.empty())
 	{
-		BspNode *node = nodeStack.top();
+		VspNode *node = nodeStack.top();
 		nodeStack.pop();
 
@@ -1614,9 +1786,9 @@
 		{
 			if ( (!onlyUnmailed || !node->Mailed()) )
-				return dynamic_cast<BspLeaf *>(node);
+				return dynamic_cast<VspLeaf *>(node);
 		}
 		else
 		{
-			BspInterior *interior = dynamic_cast<BspInterior *>(node);
+			VspInterior *interior = dynamic_cast<VspInterior *>(node);
 
 			// random decision
@@ -1680,4 +1852,5 @@
 {
 	int hits = 0;
+#if TODO
 	stack<BspRayTraversalData> tStack;
 
@@ -1690,6 +1863,6 @@
 	Vector3 extp = termination;
 
-	BspNode *node = mRoot;
-	BspNode *farChild = NULL;
+	VspNode *node = mRoot;
+	VspNode *farChild = NULL;
 
 	float t;
@@ -1700,5 +1873,5 @@
 		if (!node->IsLeaf())
 		{
-			BspInterior *in = dynamic_cast<BspInterior *>(node);
+			VspInterior *in = dynamic_cast<VspInterior *>(node);
 
 			Plane3 splitPlane = in->GetPlane();
@@ -1738,5 +1911,5 @@
 
 			// push data for far child
-			tStack.push(BspRayTraversalData(farChild, extp));
+			tStack.push(VspRayTraversalData(farChild, extp));
 
 			// find intersection of ray segment with plane
@@ -1746,5 +1919,5 @@
 		{
 			// reached leaf => intersection with view cell
-			BspLeaf *leaf = dynamic_cast<BspLeaf *>(node);
+			VspLeaf *leaf = dynamic_cast<VspLeaf *>(node);
 			ViewCell *viewCell;
 			
@@ -1775,5 +1948,5 @@
 		}
 	}
-
+#endif
 	return hits;
 }
@@ -1781,5 +1954,5 @@
 
 
-BspNode *VspOspTree::CollapseTree(BspNode *node, int &collapsed)
+VspNode *VspOspTree::CollapseTree(VspNode *node, int &collapsed)
 {
 // TODO
@@ -1788,13 +1961,13 @@
 		return node;
 
-	BspInterior *interior = dynamic_cast<BspInterior *>(node);
-
-	BspNode *front = CollapseTree(interior->GetFront(), collapsed);
-	BspNode *back = CollapseTree(interior->GetBack(), collapsed);
+	VspInterior *interior = dynamic_cast<VspInterior *>(node);
+
+	VspNode *front = CollapseTree(interior->GetFront(), collapsed);
+	VspNode *back = CollapseTree(interior->GetBack(), collapsed);
 
 	if (front->IsLeaf() && back->IsLeaf())
 	{
-		BspLeaf *frontLeaf = dynamic_cast<BspLeaf *>(front);
-		BspLeaf *backLeaf = dynamic_cast<BspLeaf *>(back);
+		VspLeaf *frontLeaf = dynamic_cast<VspLeaf *>(front);
+		VspLeaf *backLeaf = dynamic_cast<VspLeaf *>(back);
 
 		//-- collapse tree
@@ -1803,5 +1976,5 @@
 			BspViewCell *vc = frontLeaf->GetViewCell();
 
-			BspLeaf *leaf = new BspLeaf(interior->GetParent(), vc);
+			VspLeaf *leaf = new VspLeaf(interior->GetParent(), vc);
 			leaf->SetTreeValid(frontLeaf->TreeValid());
 
@@ -1842,5 +2015,5 @@
 #if HAS_TO_BE_REDONE
 	// list not valid anymore => clear
-	stack<BspNode *> nodeStack;
+	stack<VspNode *> nodeStack;
 	nodeStack.push(mRoot);
 
@@ -1849,10 +2022,10 @@
 	while (!nodeStack.empty())
 	{
-		BspNode *node = nodeStack.top();
+		VspNode *node = nodeStack.top();
 		nodeStack.pop();
 
 		if (node->IsLeaf())
 		{
-			BspLeaf *leaf = dynamic_cast<BspLeaf *>(node);
+			VspLeaf *leaf = dynamic_cast<VspLeaf *>(node);
 
 			BspViewCell *viewCell = leaf->GetViewCell();
@@ -1869,5 +2042,5 @@
 		else
 		{
-			BspInterior *interior = dynamic_cast<BspInterior *>(node);
+			VspInterior *interior = dynamic_cast<VspInterior *>(node);
 
 			nodeStack.push(interior->GetFront());
@@ -1883,8 +2056,9 @@
 ViewCell *VspOspTree::GetViewCell(const Vector3 &point, const bool active)
 {
+#if TODO
 	if (mRoot == NULL)
 		return NULL;
 
-	stack<BspNode *> nodeStack;
+	stack<VspNode *> nodeStack;
 	nodeStack.push(mRoot);
   
@@ -1893,15 +2067,15 @@
 	while (!nodeStack.empty())  
 	{
-		BspNode *node = nodeStack.top();
+		VspNode *node = nodeStack.top();
 		nodeStack.pop();
 	
 		if (node->IsLeaf()) 
 		{
-			viewcell = dynamic_cast<BspLeaf *>(node)->GetViewCell();
+			viewcell = dynamic_cast<VspLeaf *>(node)->GetViewCell();
 			break;
 		} 
 		else 	
 		{	
-			BspInterior *interior = dynamic_cast<BspInterior *>(node);
+			VspInterior *interior = dynamic_cast<VspInterior *>(node);
         
 			// random decision
@@ -1917,4 +2091,5 @@
 	else
 		return viewcell;
+#endif
 }
 
@@ -1922,5 +2097,6 @@
 bool VspOspTree::ViewPointValid(const Vector3 &viewPoint) const
 {
-	BspNode *node = mRoot;
+#if TODO
+	VspNode *node = mRoot;
 
 	while (1)
@@ -1933,5 +2109,5 @@
 			return false;
 			
-		BspInterior *in = dynamic_cast<BspInterior *>(node);
+		VspInterior *in = dynamic_cast<VspInterior *>(node);
 					
 		if (in->GetPlane().Side(viewPoint) <= 0) 
@@ -1944,5 +2120,5 @@
 		}
 	}
-
+#endif
 	// should never come here
 	return false;
@@ -1950,5 +2126,5 @@
 
 
-void VspOspTree::PropagateUpValidity(BspNode *node)
+void VspOspTree::PropagateUpValidity(VspNode *node)
 {
 	const bool isValid = node->TreeValid();
@@ -1969,5 +2145,5 @@
 		{
             node = node->GetParent();
-			BspInterior *interior = dynamic_cast<BspInterior *>(node);
+			VspInterior *interior = dynamic_cast<VspInterior *>(node);
 			
 			// the parent is valid iff both leaves are valid
@@ -1991,12 +2167,12 @@
 
 #if ZIPPED_VIEWCELLS
-void VspOspTree::ExportNode(BspNode *node, ogzstream &stream)
+void VspOspTree::ExportNode(VspNode *node, ogzstream &stream)
 #else
-void VspOspTree::ExportNode(BspNode *node, ofstream &stream)
+void VspOspTree::ExportNode(VspNode *node, ofstream &stream)
 #endif
 {
 	if (node->IsLeaf())
 	{
-		BspLeaf *leaf = dynamic_cast<BspLeaf *>(node);
+		VspLeaf *leaf = dynamic_cast<VspLeaf *>(node);
 		ViewCell *viewCell = mViewCellsTree->GetActiveViewCell(leaf->GetViewCell());
 
@@ -2009,5 +2185,6 @@
 	else
 	{
-		BspInterior *interior = dynamic_cast<BspInterior *>(node);
+#if TODO	
+		VspInterior *interior = dynamic_cast<VspInterior *>(node);
 	
 		Plane3 plane = interior->GetPlane();
@@ -2018,5 +2195,5 @@
 		ExportNode(interior->GetBack(), stream);
 		ExportNode(interior->GetFront(), stream);
-
+#endif
 		stream << "</Interior>" << endl;
 	}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h	(revision 1006)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h	(revision 1008)
@@ -9,6 +9,5 @@
 #include "VssRay.h"
 #include "RayInfo.h"
-#include "ViewCellBsp.h"
-
+#include "gzstream.h"
 
 
@@ -16,9 +15,6 @@
 
 class ViewCellLeaf;
-//class BspViewCell;
+class VspViewCell;
 class Plane3;
-class VspBspTree;  
-class BspInterior;
-class BspNode;
 class AxisAlignedBox3;
 class Ray;
@@ -29,4 +25,259 @@
 class ViewCellsTree;
 class Environment;
+class VspInterior;
+class VspLeaf;
+class VspNode;
+
+
+/** A definition for an axis aligned plane.
+*/
+struct AxisAlignedPlane
+{
+public:
+	int mAxis;
+	float mPosition;
+};
+
+
+class VspTreeStatistics: public StatisticsBase
+{
+public:
+	// total number of nodes
+	int nodes;
+	// number of splits
+	int splits[3];
+	
+	// totals number of rays
+	int rays;
+	// maximal reached depth
+	int maxDepth;
+	// minimal depth
+	int minDepth;
+	
+	// max depth nodes
+	int maxDepthNodes;
+	// minimum depth nodes
+	int minDepthNodes;
+	// max depth nodes
+	int minPvsNodes;
+	// nodes with minimum PVS
+	int minRaysNodes;
+	// max ray contribution nodes
+	int maxRayContribNodes;
+	// minimum area nodes
+	int minProbabilityNodes;
+	/// nodes termination because of max cost ratio;
+	int maxCostNodes;
+	// max number of rays per node
+	int maxObjectRefs;
+	/// samples contributing to pvs
+	int contributingSamples;
+	/// sample contributions to pvs
+	int sampleContributions;
+	/// largest pvs
+	int maxPvs;
+	/// number of invalid leaves
+	int invalidLeaves;
+	/// accumulated number of rays refs
+	int accumRays;
+	int pvs;
+	// accumulated depth (used to compute average)
+	int accumDepth;
+
+	// Constructor
+	VspTreeStatistics() 
+	{
+		Reset();
+	}
+
+	int Nodes() const {return nodes;}
+	int Interior() const { return nodes / 2; }
+	int Leaves() const { return (nodes / 2) + 1; }
+	
+	// TODO: computation wrong
+	double AvgDepth() const { return accumDepth / (double)Leaves();}; 
+	double AvgRays() const { return accumRays / (double)Leaves();}; 
+
+	void Reset() 
+	{
+		nodes = 0;
+		for (int i = 0; i < 3; ++ i)
+			splits[i] = 0;
+		
+		maxDepth = 0;
+		minDepth = 99999;
+		accumDepth = 0;
+        pvs = 0;
+		maxDepthNodes = 0;
+		minPvsNodes = 0;
+		minRaysNodes = 0;
+		maxRayContribNodes = 0;
+		minProbabilityNodes = 0;
+		maxCostNodes = 0;
+
+		contributingSamples = 0;
+		sampleContributions = 0;
+
+		maxPvs = 0;
+		invalidLeaves = 0;
+		accumRays = 0;
+	}
+
+	void Print(ostream &app) const;
+
+	friend ostream &operator<<(ostream &s, const VspTreeStatistics &stat) 
+	{
+		stat.Print(s);
+		return s;
+	} 
+};
+
+/**
+    VspNode abstract class serving for interior and leaf node implementation
+*/
+class VspNode 
+{
+
+public:
+	VspNode();
+	virtual ~VspNode(){};
+	VspNode(VspInterior *parent);
+
+	/** Determines whether this node is a leaf or not
+	@return true if leaf
+	*/
+	virtual bool IsLeaf() const = 0;
+
+	/** Determines whether this node is a root
+	@return true if root
+	*/
+	virtual bool IsRoot() const;
+
+	/** Returns parent node.
+	*/
+	VspInterior *GetParent();
+
+	/** Sets parent node.
+	*/
+	void SetParent(VspInterior *parent);
+
+	/** Returns true if this node is a sibling of node n.
+	*/
+	bool IsSibling(VspNode *n) const;
+
+	/** returns depth of the node.
+	*/
+	int GetDepth() const;
+
+	/** returns true if the whole subtree is valid
+	*/
+	bool TreeValid() const;
+
+	void SetTreeValid(const bool v);
+
+	//-- mailing options
+
+	void Mail() { mMailbox = sMailId; }
+	static void NewMail() { ++ sMailId; }
+	bool Mailed() const { return mMailbox == sMailId; }
+
+	static int sMailId;
+	int mMailbox;
+
+	int mTimeStamp;
+
+protected:
+
+	/// if this sub tree is a completely valid view space region
+	bool mTreeValid;
+	/// parent of this node
+	VspInterior *mParent;
+};
+
+
+/** BSP interior node implementation 
+*/
+class VspInterior: public VspNode 
+{
+public:
+	/** Standard contructor taking split plane as argument.
+	*/
+	VspInterior(const AxisAlignedPlane &plane);
+	~VspInterior();
+	/** @return false since it is an interior node 
+	*/
+	bool IsLeaf() const;
+
+	VspNode *GetBack();
+	VspNode *GetFront();
+
+	/** Returns split plane.
+	*/
+	AxisAlignedPlane GetPlane() const;
+
+	/** Replace front or back child with new child.
+	*/
+	void ReplaceChildLink(VspNode *oldChild, VspNode *newChild);
+	/** Replace front and back child.
+	*/
+	void SetupChildLinks(VspNode *b, VspNode *f);
+
+	friend ostream &operator<<(ostream &s, const VspInterior &A)
+	{
+		return s << A.mPlane.mAxis << " " << A.mPlane.mPosition;
+	}
+
+protected:
+
+	/// Splitting plane corresponding to this node
+	AxisAlignedPlane mPlane;
+
+	/// back node
+	VspNode *mBack;
+	/// front node
+	VspNode *mFront;
+};
+
+
+/** BSP leaf node implementation.
+*/
+class VspLeaf: public VspNode 
+{
+
+public:
+	VspLeaf();
+	VspLeaf(ViewCellLeaf *viewCell);
+	VspLeaf(VspInterior *parent);
+	VspLeaf(VspInterior *parent, ViewCellLeaf *viewCell);
+
+	~VspLeaf();
+
+	/** @return true since it is an interior node 
+	*/
+	bool IsLeaf() const;
+	
+	/** Returns pointer of view cell.
+	*/
+	ViewCellLeaf *GetViewCell() const;
+
+	/** Sets pointer to view cell.
+	*/
+	void SetViewCell(ViewCellLeaf *viewCell);
+
+	/// Rays piercing this leaf.
+	VssRayContainer mVssRays;
+	
+	/// leaf pvs
+	ObjectPvs *mPvs;
+
+	/// Probability that the view point lies in this leaf
+	float mProbability;
+
+protected:
+	
+	/// if NULL this does not correspond to feasible viewcell
+	ViewCellLeaf *mViewCell;
+};
+
 
 /**
@@ -57,17 +308,8 @@
 {
 	friend class ViewCellsParseHandlers;
-	friend class VspBspViewCellsManager;
+	friend class VspVspViewCellsManager;
 
 public:
 	
-	/** A definition for an axis aligned plane.
-	*/
-	struct AxisAlignedPlane
-	{
-	public:
-		int mAxis;
-		float mPosition;
-	};
-
 	/** Additional data which is passed down the BSP tree during traversal.
 	*/
@@ -76,5 +318,5 @@
 	public:
 		/// the current node
-		BspNode *mNode;
+		VspNode *mNode;
 		/// current depth
 		int mDepth;
@@ -114,5 +356,5 @@
 		{}
 		
-		VspOspTraversalData(BspNode *node, 
+		VspOspTraversalData(VspNode *node, 
 							const int depth, 
 							RayInfoContainer *rays,
@@ -193,6 +435,5 @@
 #if 1
 			return mRenderCost;
-#endif
-#if 0
+#else
 			return (float) (-mDepth); // for kd tree
 #endif
@@ -217,5 +458,5 @@
 	/** Returns BSP Tree statistics.
 	*/
-	const BspTreeStatistics &GetStatistics() const; 
+	const VspTreeStatistics &GetStatistics() const; 
   
 
@@ -233,5 +474,5 @@
 		@param maxPvs the maximal pvs (-1 means unlimited)
 	*/
-	void CollectLeaves(vector<BspLeaf *> &leaves, 
+	void CollectLeaves(vector<VspLeaf *> &leaves, 
 					   const bool onlyUnmailed = false,
 					   const int maxPvs = -1) const;
@@ -241,7 +482,7 @@
 	AxisAlignedBox3 GetBoundingBox()const;
 
-	/** Returns root of BSP tree.
-	*/
-	BspNode *GetRoot() const;
+	/** Returns root of the view space partitioning tree.
+	*/
+	VspNode *GetRoot() const;
 
 	/** Collects the leaf view cells of the tree
@@ -259,6 +500,6 @@
 	/** finds neighbouring leaves of this tree node.
 	*/
-	int FindNeighbors(BspNode *n, 
-					  vector<BspLeaf *> &neighbors, 
+	int FindNeighbors(VspNode *n, 
+					  vector<VspLeaf *> &neighbors, 
 					  const bool onlyUnmailed) const;
 
@@ -266,10 +507,10 @@
 		@param halfspace defines the halfspace from which the leaf is taken.
 	*/
-	BspLeaf *GetRandomLeaf(const Plane3 &halfspace);
+	VspLeaf *GetRandomLeaf(const Plane3 &halfspace);
 
 	/** Returns random leaf of BSP tree.
 		@param onlyUnmailed if only unmailed leaves should be returned.
 	*/
-	BspLeaf *GetRandomLeaf(const bool onlyUnmailed = false);
+	VspLeaf *GetRandomLeaf(const bool onlyUnmailed = false);
 
 	/** Returns epsilon of this tree.
@@ -291,7 +532,4 @@
 	void SetViewCellsManager(ViewCellsManager *vcm);
 
-	/** Returns distance from node 1 to node 2.
-	*/
-	int TreeDistance(BspNode *n1, BspNode *n2) const;
 
 	/** Collapses the tree with respect to the view cell partition.
@@ -316,5 +554,5 @@
 		the invalid view space.
 	*/
-	BspViewCell *GetOutOfBoundsCell();
+	VspViewCell *GetOutOfBoundsCell();
 
 	/** Writes tree to output stream
@@ -332,10 +570,4 @@
 	int CastBeam(Beam &beam);
 
-	/** Finds approximate neighbours, i.e., finds correct neighbors
-		in most cases but sometimes more.
-	*/
-	int FindApproximateNeighbors(BspNode *n, 
-							     vector<BspLeaf *> &neighbors,
-								 const bool onlyUnmailed) const;
 
 	/** Checks if tree validity-flags are right 
@@ -410,5 +642,5 @@
 	/** Evaluates render cost decrease of next split.
 	*/
-	float EvalRenderCostDecrease(const Plane3 &candidatePlane,
+	float EvalRenderCostDecrease(const AxisAlignedPlane &candidatePlane,
 								 const VspOspTraversalData &data) const;
 
@@ -419,5 +651,5 @@
 	/** Collects view cells in the subtree under root.
 	*/
-	void CollectViewCells(BspNode *root, 
+	void CollectViewCells(VspNode *root, 
 						  bool onlyValid, 
 						  ViewCellContainer &viewCells,
@@ -427,5 +659,5 @@
 		the invalid view space. If it does not exist, it is created.
 	*/
-	BspViewCell *GetOrCreateOutOfBoundsCell();
+	VspViewCell *GetOrCreateOutOfBoundsCell();
 
 	/** Collapses the tree with respect to the view cell partition,
@@ -436,5 +668,5 @@
 		this node otherwise
 	*/
-	BspNode *CollapseTree(BspNode *node, int &collapsed);
+	VspNode *CollapseTree(VspNode *node, int &collapsed);
 
 	/** Helper function revalidating the view cell leaf list after merge.
@@ -451,5 +683,5 @@
 		@returns new root of the subtree
 	*/
-	BspNode *Subdivide(VspOspSplitQueue &tQueue,
+	VspNode *Subdivide(VspOspSplitQueue &tQueue,
 					   VspOspSplitCandidate &splitCandidate);
 
@@ -469,5 +701,5 @@
 	*/
 
-	BspInterior *SubdivideNode(const Plane3 &splitPlane,
+	VspInterior *SubdivideNode(const AxisAlignedPlane &splitPlane,
 							   VspOspTraversalData &tData,
 							   VspOspTraversalData &frontData,
@@ -546,5 +778,5 @@
 		
 	*/
-	void AddToPvs(BspLeaf *leaf,
+	void AddToPvs(VspLeaf *leaf,
 				  const RayInfoContainer &rays, 
 				  float &sampleContributions,
@@ -553,5 +785,5 @@
 	/** Propagates valid flag up the tree.
 	*/
-	void PropagateUpValidity(BspNode *node);
+	void PropagateUpValidity(VspNode *node);
 
 	/** Writes the node to disk
@@ -559,7 +791,7 @@
 	*/
 #if ZIPPED_VIEWCELLS
-	void ExportNode(BspNode *node, ogzstream &stream);
+	void ExportNode(VspNode *node, ogzstream &stream);
 #else
-	void ExportNode(BspNode *node, ofstream &stream);
+	void ExportNode(VspNode *node, ofstream &stream);
 #endif
 
@@ -575,10 +807,10 @@
 
 	/// Pointer to the root of the tree
-	BspNode *mRoot;
-		
-	BspTreeStatistics mBspStats;
+	VspNode *mRoot;
+		
+	VspTreeStatistics mVspStats;
 	
 	/// View cell corresponding to the space outside the valid view space
-	BspViewCell *mOutOfBoundsCell;
+	VspViewCell *mOutOfBoundsCell;
 
 	/// box around the whole view domain
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h	(revision 1006)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h	(revision 1008)
@@ -8,5 +8,5 @@
 #include "Material.h"
 #include "gzstream.h"
-
+#include "VspOspTree.h"
 
 namespace GtpVisibilityPreprocessor {
@@ -17,5 +17,5 @@
 class BspPvs;
 class BspLeaf;
-class VspKdLeaf;
+class VspLeaf;
 class KdLeaf;
 class ViewCellInterior;
@@ -97,10 +97,4 @@
 	friend class ViewCellsTree;
 	friend class ViewCellsManager;
-	//friend class VspBspViewCellsManager;
-	//friend class BspViewCellsManager;
-	//friend class VspBspTree;
-	//friend class FromPointVisibilityTree;
-	//friend class BspTree;
-
 
 public:
@@ -380,7 +374,8 @@
 
 
+//typedef HierarchyLeafViewCell<VspLeaf *> VspViewCell;
 typedef HierarchyLeafViewCell<BspLeaf *> BspViewCell;
 typedef HierarchyLeafViewCell<KdLeaf *> KdViewCell;
-typedef HierarchyLeafViewCell<VspKdLeaf *> VspKdViewCell;
+
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h	(revision 1006)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h	(revision 1008)
@@ -259,6 +259,5 @@
 public:
   signals:
-	UpdatePvsErrorItem(int i,
-					   GlRendererBuffer::PvsErrorEntry &);
+	void UpdatePvsErrorItem(int i, GlRendererBuffer::PvsErrorEntry &);
 };
 
