Index: trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.cpp
===================================================================
--- trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.cpp	(revision 469)
+++ trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.cpp	(revision 470)
@@ -2163,5 +2163,4 @@
 
 	//Debug << mMinViewCells << " " << mMaxCostRatio << endl;
-
 	// use priority queue to merge leaves
 	while (!mergeQueue.empty() &&
Index: trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.h
===================================================================
--- trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.h	(revision 469)
+++ trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.h	(revision 470)
@@ -189,4 +189,16 @@
 				  VssRayContainer &savedRays) const;
 
+  /** Returns total area of view cells.
+  */
+  float GetTotalArea();
+
+  /** Returns area of one view cell.
+  */
+  float GetArea(ViewCell *viewCell) const;
+
+  /** Returns volume of view cells.
+  */
+  float GetVolume(ViewCell *viewCell) const;
+
 protected:
 		
@@ -209,4 +221,7 @@
 	int mMinPvs;
 	int mMaxPvs;
+
+	float mTotalAreaValid;
+	float mTotalArea;
 };
 
@@ -248,4 +263,6 @@
 	float GetProbability(ViewCell *viewCell) const;
 	float GetRendercost(ViewCell *viewCell, float objRendercost) const;
+
+	float GetArea(ViewCell *viewCell) const;
 
 protected:
Index: trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h
===================================================================
--- trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h	(revision 469)
+++ trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h	(revision 470)
@@ -84,25 +84,6 @@
 typedef HierarchyViewCell<VspKdLeaf *> VspKdViewCell;
 
-/*class BspViewCell: public ViewCell
-{
-public:
-	BspViewCell(): mBspLeaves(0) {}
-	BspViewCell(Mesh *mesh): 
-		ViewCell(mesh), mBspLeaves(0) {}
 
-	/// Leaves of the hierarchy which are part of this view cell.
-	std::vector<BspLeaf *> mBspLeaves;
-};
-*/
-/*class VspKdViewCell: public ViewCell
-{
-public:
-	VspKdViewCell(): mLeaves(0) {}
-	VspKdViewCell(Mesh *mesh): 
-		ViewCell(mesh), mLeaves(0) {}
-
-	/// Leaves of the hierarchy which are part of this view cell.
-	std::vector<VspKdLeaf *> mLeaves;
-};
+/** Statistics for a view cell partition.
 */
 class ViewCellsStatistics: public StatisticsBase
Index: trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
===================================================================
--- trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp	(revision 469)
+++ trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp	(revision 470)
@@ -17,5 +17,7 @@
 mConstructionSamples(0),
 mPostProcessSamples(0),
-mVisualizationSamples(0)
+mVisualizationSamples(0),
+mTotalAreaValid(false),
+mTotalArea(0.0f)
 {
 	// post processing stuff
@@ -277,4 +279,35 @@
 }
 
+float ViewCellsManager::GetVolume(ViewCell *viewCell) const
+{
+	return viewCell->GetVolume();
+}
+
+
+
+float ViewCellsManager::GetArea(ViewCell *viewCell) const
+{
+	return 0.0f;
+}
+
+
+
+float ViewCellsManager::GetTotalArea()
+{
+	// if already computed
+	if (mTotalAreaValid)
+		return mTotalArea;
+
+	mTotalArea = 0;
+	ViewCellContainer::const_iterator it, it_end = mViewCells.end();
+
+	for (it = mViewCells.begin(); it != it_end; ++ it)
+        mTotalArea += GetArea(*it);
+	
+	mTotalAreaValid = true;
+
+	return mTotalArea;
+}
+
 /**********************************************************************/
 /*                   BspViewCellsManager implementation               */
@@ -349,6 +382,5 @@
 }
 
-
-float BspViewCellsManager::GetProbability(ViewCell *viewCell) const
+float BspViewCellsManager::GetArea(ViewCell *viewCell) const
 {
 	PolygonContainer geom;
@@ -358,11 +390,24 @@
 	
 	const float area = Polygon3::GetArea(geom);
-	const float accArea = mBspTree->GetBoundingBox().SurfaceArea();
-
 	CLEAR_CONTAINER(geom);
 
-	return area / accArea;
-}
-
+	return area;
+}
+
+
+float BspViewCellsManager::GetProbability(ViewCell *viewCell) const
+{
+	PolygonContainer geom;
+
+	// compute view cell area
+	mBspTree->ConstructGeometry(dynamic_cast<BspViewCell *>(viewCell), geom);
+	
+	const float area = Polygon3::GetArea(geom);
+	const float viewspaceArea = GetTotalArea();// mBspTree->GetBoundingBox().SurfaceArea();
+
+	CLEAR_CONTAINER(geom);
+
+	return area / viewspaceArea;
+}
 
 float BspViewCellsManager::GetRendercost(ViewCell *viewCell, float objRendercost) const
