Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp	(revision 1012)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp	(revision 1016)
@@ -482,9 +482,9 @@
 
 
-
 void VspBspTree::Construct(const PolygonContainer &polys, RayInfoContainer *rays)
 {
 	VspBspTraversalQueue tQueue;
 
+	/// create new vsp tree
 	mRoot = new BspLeaf();
 
@@ -493,4 +493,6 @@
 	ConstructGeometry(mRoot, *geom);
 
+	/// we use the overall probability as normalizer
+	/// either the overall area or the volume
 	const float prop = mUseAreaForPvs ? geom->GetArea() : geom->GetVolume();
 
@@ -518,4 +520,5 @@
 	mTotalPvsSize = tData.mPvs;
 	
+	// first stats
 	mSubdivisionStats 
 			<< "#ViewCells\n1" <<  endl
@@ -525,18 +528,17 @@
 
 	Debug << "total cost: " << mTotalCost << endl;
-	
-	
+
+
 	mBspStats.Start();
 	cout << "Constructing vsp bsp tree ... \n";
 
-	long startTime = GetTime();	
+	const long startTime = GetTime();	
+	// used for intermediate time measurements and progress
+	long interTime = GetTime();
+
 	int nLeaves = 500;
 	int nViewCells = 500;
 
-	// used for intermediate time measurements and progress
-	long interTime = GetTime();	
-
 	mOutOfMemory = false;
-
 	mCreatedViewCells = 0;
 	
@@ -558,5 +560,5 @@
 
 		// subdivide leaf node
-		BspNode *r = Subdivide(tQueue, tData);
+		const BspNode *r = Subdivide(tQueue, tData);
 
 		if (r == mRoot)
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp	(revision 1004)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp	(revision 1016)
@@ -1709,7 +1709,7 @@
 inline void BspTree::GenerateUniqueIdsForPvs()
 {
-	ViewCell::NewMail(); sBackId = ViewCell::sMailId;
-	ViewCell::NewMail(); sFrontId = ViewCell::sMailId;
-	ViewCell::NewMail(); sFrontAndBackId = ViewCell::sMailId;
+	Intersectable::NewMail(); sBackId = Intersectable::sMailId;
+	Intersectable::NewMail(); sFrontId = Intersectable::sMailId;
+	Intersectable::NewMail(); sFrontAndBackId = Intersectable::sMailId;
 }
 
@@ -1736,4 +1736,5 @@
 	const bool pvsUseLen = false;
 
+	
 	if (mSplitPlaneStrategy & PVS)
 	{
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp	(revision 1015)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp	(revision 1016)
@@ -24,7 +24,7 @@
 //-- static members
 
-int VspOspTree::sFrontId = 0;
-int VspOspTree::sBackId = 0;
-int VspOspTree::sFrontAndBackId = 0;
+int VspTree::sFrontId = 0;
+int VspTree::sBackId = 0;
+int VspTree::sFrontAndBackId = 0;
 
 
@@ -184,13 +184,13 @@
 
 
-AxisAlignedBox3 VspInterior::GetBox() const
-{
-	return mBox;
-}
-
-
-void VspInterior::SetBox(const AxisAlignedBox3 &box)
-{
-	mBox = box;
+AxisAlignedBox3 VspInterior::GetBoundingBox() const
+{
+	return mBoundingBox;
+}
+
+
+void VspInterior::SetBoundingBox(const AxisAlignedBox3 &box)
+{
+	mBoundingBox = box;
 }
 
@@ -258,9 +258,9 @@
 
 /******************************************************************************/
-/*                       class VspOspTree implementation                      */
+/*                       class VspTree implementation                      */
 /******************************************************************************/
 
 
-VspOspTree::VspOspTree():
+VspTree::VspTree():
 mRoot(NULL),
 mOutOfBoundsCell(NULL),
@@ -270,49 +270,49 @@
 {
 	bool randomize = false;
-	Environment::GetSingleton()->GetBoolValue("VspOspTree.Construction.randomize", randomize);
+	Environment::GetSingleton()->GetBoolValue("VspTree.Construction.randomize", randomize);
 	if (randomize)
 		Randomize(); // initialise random generator for heuristics
 
 	//-- termination criteria for autopartition
-	Environment::GetSingleton()->GetIntValue("VspOspTree.Termination.maxDepth", mTermMaxDepth);
-	Environment::GetSingleton()->GetIntValue("VspOspTree.Termination.minPvs", mTermMinPvs);
-	Environment::GetSingleton()->GetIntValue("VspOspTree.Termination.minRays", mTermMinRays);
-	Environment::GetSingleton()->GetFloatValue("VspOspTree.Termination.minProbability", mTermMinProbability);
-	Environment::GetSingleton()->GetFloatValue("VspOspTree.Termination.maxRayContribution", mTermMaxRayContribution);
-	Environment::GetSingleton()->GetFloatValue("VspOspTree.Termination.maxCostRatio", mTermMaxCostRatio);
-	Environment::GetSingleton()->GetIntValue("VspOspTree.Termination.missTolerance", mTermMissTolerance);
-	Environment::GetSingleton()->GetIntValue("VspOspTree.Termination.maxViewCells", mMaxViewCells);
+	Environment::GetSingleton()->GetIntValue("VspTree.Termination.maxDepth", mTermMaxDepth);
+	Environment::GetSingleton()->GetIntValue("VspTree.Termination.minPvs", mTermMinPvs);
+	Environment::GetSingleton()->GetIntValue("VspTree.Termination.minRays", mTermMinRays);
+	Environment::GetSingleton()->GetFloatValue("VspTree.Termination.minProbability", mTermMinProbability);
+	Environment::GetSingleton()->GetFloatValue("VspTree.Termination.maxRayContribution", mTermMaxRayContribution);
+	Environment::GetSingleton()->GetFloatValue("VspTree.Termination.maxCostRatio", mTermMaxCostRatio);
+	Environment::GetSingleton()->GetIntValue("VspTree.Termination.missTolerance", mTermMissTolerance);
+	Environment::GetSingleton()->GetIntValue("VspTree.Termination.maxViewCells", mMaxViewCells);
 
 	//-- max cost ratio for early tree termination
-	Environment::GetSingleton()->GetFloatValue("VspOspTree.Termination.maxCostRatio", mTermMaxCostRatio);
-
-	Environment::GetSingleton()->GetFloatValue("VspOspTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio);
-	Environment::GetSingleton()->GetIntValue("VspOspTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance);
+	Environment::GetSingleton()->GetFloatValue("VspTree.Termination.maxCostRatio", mTermMaxCostRatio);
+
+	Environment::GetSingleton()->GetFloatValue("VspTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio);
+	Environment::GetSingleton()->GetIntValue("VspTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance);
 
 	// HACK//mTermMinPolygons = 25;
 
 	//-- factors for bsp tree split plane heuristics
-	Environment::GetSingleton()->GetFloatValue("VspOspTree.Termination.ct_div_ci", mCtDivCi);
+	Environment::GetSingleton()->GetFloatValue("VspTree.Termination.ct_div_ci", mCtDivCi);
 
 	//-- partition criteria
-	Environment::GetSingleton()->GetFloatValue("VspOspTree.Construction.epsilon", mEpsilon);
+	Environment::GetSingleton()->GetFloatValue("VspTree.Construction.epsilon", mEpsilon);
 
 	// if only the driving axis is used for axis aligned split
-	Environment::GetSingleton()->GetBoolValue("VspOspTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis);
-	
-	//Environment::GetSingleton()->GetFloatValue("VspOspTree.maxTotalMemory", mMaxTotalMemory);
-	Environment::GetSingleton()->GetFloatValue("VspOspTree.maxStaticMemory", mMaxMemory);
-
-	Environment::GetSingleton()->GetBoolValue("VspOspTree.useCostHeuristics", mUseCostHeuristics);
-	Environment::GetSingleton()->GetBoolValue("VspOspTree.simulateOctree", mCirculatingAxis);
-	Environment::GetSingleton()->GetBoolValue("VspOspTree.useRandomAxis", mUseRandomAxis);
-	Environment::GetSingleton()->GetIntValue("VspOspTree.nodePriorityQueueType", mNodePriorityQueueType);
+	Environment::GetSingleton()->GetBoolValue("VspTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis);
+	
+	//Environment::GetSingleton()->GetFloatValue("VspTree.maxTotalMemory", mMaxTotalMemory);
+	Environment::GetSingleton()->GetFloatValue("VspTree.maxStaticMemory", mMaxMemory);
+
+	Environment::GetSingleton()->GetBoolValue("VspTree.useCostHeuristics", mUseCostHeuristics);
+	Environment::GetSingleton()->GetBoolValue("VspTree.simulateOctree", mCirculatingAxis);
+	Environment::GetSingleton()->GetBoolValue("VspTree.useRandomAxis", mUseRandomAxis);
+	Environment::GetSingleton()->GetIntValue("VspTree.nodePriorityQueueType", mNodePriorityQueueType);
 	
 	char subdivisionStatsLog[100];
-	Environment::GetSingleton()->GetStringValue("VspOspTree.subdivisionStats", subdivisionStatsLog);
+	Environment::GetSingleton()->GetStringValue("VspTree.subdivisionStats", subdivisionStatsLog);
 	mSubdivisionStats.open(subdivisionStatsLog);
 
-	Environment::GetSingleton()->GetFloatValue("VspOspTree.Construction.minBand", mMinBand);
-	Environment::GetSingleton()->GetFloatValue("VspOspTree.Construction.maxBand", mMaxBand);
+	Environment::GetSingleton()->GetFloatValue("VspTree.Construction.minBand", mMinBand);
+	Environment::GetSingleton()->GetFloatValue("VspTree.Construction.maxBand", mMaxBand);
 	
 
@@ -349,5 +349,5 @@
 
 
-VspViewCell *VspOspTree::GetOutOfBoundsCell()
+VspViewCell *VspTree::GetOutOfBoundsCell()
 {
 	return mOutOfBoundsCell;
@@ -355,5 +355,5 @@
 
 
-VspViewCell *VspOspTree::GetOrCreateOutOfBoundsCell()
+VspViewCell *VspTree::GetOrCreateOutOfBoundsCell()
 {
 	if (!mOutOfBoundsCell)
@@ -368,5 +368,5 @@
 
 
-const VspTreeStatistics &VspOspTree::GetStatistics() const
+const VspTreeStatistics &VspTree::GetStatistics() const
 {
 	return mVspStats;
@@ -374,5 +374,5 @@
 
 
-VspOspTree::~VspOspTree()
+VspTree::~VspTree()
 {
 	DEL_PTR(mRoot);
@@ -381,5 +381,5 @@
 
 
-void VspOspTree::Construct(const VssRayContainer &sampleRays,
+void VspTree::Construct(const VssRayContainer &sampleRays,
 						   AxisAlignedBox3 *forcedBoundingBox)
 {
@@ -437,8 +437,8 @@
 
 // TODO: return memory usage in MB
-float VspOspTree::GetMemUsage() const
+float VspTree::GetMemUsage() const
 {
 	return (float)
-		 (sizeof(VspOspTree) + 
+		 (sizeof(VspTree) + 
 		  mVspStats.Leaves() * sizeof(VspLeaf) + 
 		  mCreatedViewCells * sizeof(VspViewCell) +
@@ -449,22 +449,23 @@
 
 
-void VspOspTree::Construct(RayInfoContainer *rays)
-{
-	VspOspSplitQueue tQueue;
-
+void VspTree::Construct(RayInfoContainer *rays)
+{
+#if TODO
+	VspSplitQueue tQueue;
+	/// create new vsp tree
 	mRoot = new VspLeaf();
-
+	/// we use the overall probability as normalizer
 	const float prop = mBox.GetVolume();
 
-	VspOspTraversalData tData(mRoot,
-							  0,
-							  rays,
-                              ComputePvsSize(*rays),
-							  prop,
-							  mBox);
+	VspTraversalData tData(mRoot,
+						  0,
+						  rays,
+                          ComputePvsSize(*rays),
+						  prop,
+						  mBox);
 
 
 	// compute first split candidate
-	VspOspSplitCandidate splitCandidate;
+	VspSplitCandidate splitCandidate;
 	EvalSplitCandidate(tData, splitCandidate);
 
@@ -552,8 +553,9 @@
 
 	mVspStats.Stop();
-}
-
-
-bool VspOspTree::LocalTerminationCriteriaMet(const VspOspTraversalData &data) const
+#endif
+}
+
+
+bool VspTree::LocalTerminationCriteriaMet(const VspTraversalData &data) const
 {
 	return
@@ -566,5 +568,5 @@
 
 
-bool VspOspTree::GlobalTerminationCriteriaMet(const VspOspTraversalData &data) const
+bool VspTree::GlobalTerminationCriteriaMet(const VspTraversalData &data) const
 {
 	return
@@ -576,8 +578,8 @@
 
 // subdivide using a split plane queue
-VspNode *VspOspTree::Subdivide(VspOspSplitQueue &tQueue,
-							   VspOspSplitCandidate &splitCandidate)
-{
-	VspOspTraversalData &tData = splitCandidate.mParentData;
+VspNode *VspTree::Subdivide(SplitQueue &tQueue,
+							VspSplitCandidate &splitCandidate)
+{
+	VspTraversalData &tData = splitCandidate.mParentData;
 
 	VspNode *newNode = tData.mNode;
@@ -585,6 +587,6 @@
 	if (!LocalTerminationCriteriaMet(tData) && !GlobalTerminationCriteriaMet(tData))
 	{	
-		VspOspTraversalData tFrontData;
-		VspOspTraversalData tBackData;
+		VspTraversalData tFrontData;
+		VspTraversalData tBackData;
 
 		//-- continue subdivision
@@ -619,5 +621,5 @@
 					<< "#ViewCells\n" << mVspStats.Leaves() << endl
 					<< "#RenderCostDecrease\n" << -costDecr << endl
-					<< "#SplitCandidateCost\n" << splitCandidate.GetCost() << endl
+					<< "#SplitCandidateCost\n" << splitCandidate.GetPriority() << endl
 					<< "#TotalRenderCost\n" << mTotalCost << endl
 					<< "#AvgRenderCost\n" << (float)mTotalPvsSize / (float)mVspStats.Leaves() << endl;
@@ -626,13 +628,13 @@
 	
 		//-- push the new split candidates on the stack
-		VspOspSplitCandidate frontCandidate;
-		VspOspSplitCandidate backCandidate;
+		VspSplitCandidate frontCandidate;
+		VspSplitCandidate backCandidate;
 
 		EvalSplitCandidate(tFrontData, frontCandidate);
 		EvalSplitCandidate(tBackData, backCandidate);
-	
+#if TODO
 		tQueue.push(frontCandidate);
 		tQueue.push(backCandidate);
-	
+#endif
 		// delete old leaf node
 		DEL_PTR(tData.mNode);
@@ -686,9 +688,9 @@
 
 
-void VspOspTree::EvalSplitCandidate(VspOspTraversalData &tData,
-									VspOspSplitCandidate &splitData)
-{
-	VspOspTraversalData frontData;
-	VspOspTraversalData backData;
+void VspTree::EvalSplitCandidate(VspTraversalData &tData,
+								 VspSplitCandidate &splitData)
+{
+	VspTraversalData frontData;
+	VspTraversalData backData;
 
 	VspLeaf *leaf = dynamic_cast<VspLeaf *>(tData.mNode);
@@ -701,5 +703,5 @@
 	//TODO
 	// compute global decrease in render cost
-	splitData.mRenderCost = EvalRenderCostDecrease(splitData.mSplitPlane, tData);
+	splitData.mPriority = EvalRenderCostDecrease(splitData.mSplitPlane, tData);
 	splitData.mParentData = tData;
 	splitData.mMaxCostMisses = success ? tData.mMaxCostMisses : tData.mMaxCostMisses + 1;
@@ -707,8 +709,8 @@
 
 
-VspInterior *VspOspTree::SubdivideNode(const AxisAlignedPlane &splitPlane,
-									   VspOspTraversalData &tData,
-									   VspOspTraversalData &frontData,
-									   VspOspTraversalData &backData)
+VspInterior *VspTree::SubdivideNode(const AxisAlignedPlane &splitPlane,
+									VspTraversalData &tData,
+									VspTraversalData &frontData,
+									VspTraversalData &backData)
 {
 	VspLeaf *leaf = dynamic_cast<VspLeaf *>(tData.mNode);
@@ -777,4 +779,6 @@
 	// and setup child links
 	interior->SetupChildLinks(new VspLeaf(interior), new VspLeaf(interior));
+	// add bounding box
+	interior->SetBoundingBox(tData.mBoundingBox);
 
 	frontData.mNode = interior->GetFront();
@@ -786,6 +790,85 @@
 }
 
-
-void VspOspTree::AddToPvs(VspLeaf *leaf,
+/*
+KdNode *VspOpsTree::SubdivideSpatialNode(KdLeaf *leaf,
+										 const AxisAlignedPlane &splitPlane,
+										 const AxisAlignedBox3 &box,
+										 AxisAlignedBox3 &backBBox,
+										 AxisAlignedBox3 &frontBBox)
+{
+	float position;
+
+#if TODO
+    mSpatialStat.nodes += 2;
+	mSpatialStat.splits[axis];
+#endif
+
+	// add the new nodes to the tree
+	KdInterior *node = new KdInterior(leaf->mParent);
+
+	node->mAxis = splitPlane.mAxis;
+	node->mPosition = splitPlane.mPosition;
+	node->mBox = box;
+
+    backBBox = box;
+	frontBBox = box;
+  
+	// first count ray sides
+	int objectsBack = 0;
+	int objectsFront = 0;
+  
+	backBBox.SetMax(axis, position);
+	frontBBox.SetMin(axis, position);
+
+	SplitObjects(leaf->m
+	ObjectContainer::const_iterator mi, mi_end = leaf->mObjects.end();
+
+	for ( mi = leaf->mObjects.begin(); mi != mi_end; ++ mi) 
+	{
+		// determine the side of this ray with respect to the plane
+		AxisAlignedBox3 box = (*mi)->GetBox();
+		
+		if (box.Max(axis) > position ) 
+			++ objectsFront;
+    
+		if (box.Min(axis) < position )
+      objectsBack++;
+  }
+
+  
+  KdLeaf *back = new KdLeaf(node, objectsBack);
+  KdLeaf *front = new KdLeaf(node, objectsFront);
+
+  // replace a link from node's parent
+  if (  leaf->mParent )
+    leaf->mParent->ReplaceChildLink(leaf, node);
+
+  // and setup child links
+  node->SetupChildLinks(back, front);
+  
+  for (mi = leaf->mObjects.begin();
+       mi != leaf->mObjects.end();
+       mi++) {
+    // determine the side of this ray with respect to the plane
+    AxisAlignedBox3 box = (*mi)->GetBox();
+
+    if (box.Max(axis) >= position )
+      front->mObjects.push_back(*mi);
+    
+    if (box.Min(axis) < position )
+      back->mObjects.push_back(*mi);
+    
+    mStat.objectRefs -= (int)leaf->mObjects.size();
+    mStat.objectRefs += objectsBack + objectsFront;
+  }
+  
+  delete leaf;
+  return node;
+}
+*/
+
+
+
+void VspTree::AddToPvs(VspLeaf *leaf,
 						  const RayInfoContainer &rays,
 						  float &sampleContributions,
@@ -832,5 +915,5 @@
 
 
-void VspOspTree::SortSplitCandidates(const RayInfoContainer &rays, 
+void VspTree::SortSplitCandidates(const RayInfoContainer &rays, 
 									 const int axis, 
 									 float minBand, 
@@ -883,5 +966,5 @@
 
 
-float VspOspTree::BestCostRatioHeuristics(const RayInfoContainer &rays,
+float VspTree::BestCostRatioHeuristics(const RayInfoContainer &rays,
 										  const AxisAlignedBox3 &box,
 										  const int pvsSize,
@@ -1055,8 +1138,8 @@
 
 
-float VspOspTree::SelectPlane(const VspOspTraversalData &tData,
-							  AxisAlignedPlane &plane,
-							  float &pFront,
-							  float &pBack)
+float VspTree::SelectPlane(const VspTraversalData &tData,
+						   AxisAlignedPlane &plane,
+						   float &pFront,
+						   float &pBack)
 {
 	float nPosition[3];
@@ -1134,5 +1217,5 @@
 
 
-inline void VspOspTree::GenerateUniqueIdsForPvs()
+inline void VspTree::GenerateUniqueIdsForPvs()
 {
 	Intersectable::NewMail(); sBackId = Intersectable::sMailId;
@@ -1142,6 +1225,6 @@
 
 
-float VspOspTree::EvalRenderCostDecrease(const AxisAlignedPlane &candidatePlane,
-										 const VspOspTraversalData &data) const
+float VspTree::EvalRenderCostDecrease(const AxisAlignedPlane &candidatePlane,
+									  const VspTraversalData &data) const
 {
 	float pvsFront = 0;
@@ -1158,7 +1241,7 @@
 	GenerateUniqueIdsForPvs();
 	
-	RayInfoContainer::const_iterator rit, rit_end = data.mRays.end();
-
-	for (rit = data.mRays.begin(); rit != rit_end; ++ rit)
+	RayInfoContainer::const_iterator rit, rit_end = data.mRays->end();
+
+	for (rit = data.mRays->begin(); rit != rit_end; ++ rit)
 	{
 		RayInfo rayInf = *rit;
@@ -1210,11 +1293,10 @@
 
 
-
-float VspOspTree::EvalSplitCost(const VspOspTraversalData &data,
-								const AxisAlignedBox3 &box,
-								const int axis,
-								const float &position,										  
-								float &pFront,
-								float &pBack) const
+float VspTree::EvalSplitCost(const VspTraversalData &data,
+							 const AxisAlignedBox3 &box,
+							 const int axis,
+							 const float &position,										  
+							 float &pFront,
+							 float &pBack) const
 {
 	float pvsTotal = 0;
@@ -1263,5 +1345,5 @@
 
 
-void VspOspTree::AddObjToPvs(Intersectable *obj,
+void VspTree::AddObjToPvs(Intersectable *obj,
 							 const int cf,
 							 float &frontPvs,
@@ -1316,5 +1398,5 @@
 
 
-void VspOspTree::CollectLeaves(vector<VspLeaf *> &leaves, 
+void VspTree::CollectLeaves(vector<VspLeaf *> &leaves, 
 							   const bool onlyUnmailed,
 							   const int maxPvsSize) const
@@ -1350,5 +1432,5 @@
 
 
-AxisAlignedBox3 VspOspTree::GetBoundingBox() const
+AxisAlignedBox3 VspTree::GetBoundingBox() const
 {
 	return mBox;
@@ -1356,5 +1438,5 @@
 
 
-VspNode *VspOspTree::GetRoot() const
+VspNode *VspTree::GetRoot() const
 {
 	return mRoot;
@@ -1362,5 +1444,5 @@
 
 
-void VspOspTree::EvaluateLeafStats(const VspOspTraversalData &data)
+void VspTree::EvaluateLeafStats(const VspTraversalData &data)
 {
 	// the node became a leaf -> evaluate stats for leafs
@@ -1418,5 +1500,5 @@
 
 
-void VspOspTree::CollectViewCells(ViewCellContainer &viewCells, bool onlyValid) const
+void VspTree::CollectViewCells(ViewCellContainer &viewCells, bool onlyValid) const
 {
 	ViewCell::NewMail();
@@ -1425,5 +1507,5 @@
 
 
-void VspOspTree::CollapseViewCells()
+void VspTree::CollapseViewCells()
 {
 // TODO
@@ -1480,5 +1562,5 @@
 
 
-void VspOspTree::CollectRays(VssRayContainer &rays)
+void VspTree::CollectRays(VssRayContainer &rays)
 {
 	vector<VspLeaf *> leaves;
@@ -1497,5 +1579,5 @@
 
 
-void VspOspTree::ValidateTree()
+void VspTree::ValidateTree()
 {
 	stack<VspNode *> nodeStack;
@@ -1540,5 +1622,5 @@
 
 
-void VspOspTree::CollectViewCells(VspNode *root,
+void VspTree::CollectViewCells(VspNode *root,
 								  bool onlyValid,
 								  ViewCellContainer &viewCells,
@@ -1584,5 +1666,5 @@
 
 
-int VspOspTree::FindNeighbors(VspLeaf *n,
+int VspTree::FindNeighbors(VspLeaf *n,
 							  vector<VspLeaf *> &neighbors,
 							  const bool onlyUnmailed) const
@@ -1631,5 +1713,5 @@
 
 // Find random neighbor which was not mailed
-VspLeaf *VspOspTree::GetRandomLeaf(const Plane3 &plane)
+VspLeaf *VspTree::GetRandomLeaf(const Plane3 &plane)
 {
 	stack<VspNode *> nodeStack;
@@ -1676,5 +1758,5 @@
 
 
-VspLeaf *VspOspTree::GetRandomLeaf(const bool onlyUnmailed)
+VspLeaf *VspTree::GetRandomLeaf(const bool onlyUnmailed)
 {
 	stack<VspNode *> nodeStack;
@@ -1712,5 +1794,5 @@
 
 
-int VspOspTree::ComputePvsSize(const RayInfoContainer &rays) const
+int VspTree::ComputePvsSize(const RayInfoContainer &rays) const
 {
 	int pvsSize = 0;
@@ -1746,5 +1828,5 @@
 
 
-float VspOspTree::GetEpsilon() const
+float VspTree::GetEpsilon() const
 {
 	return mEpsilon;
@@ -1752,5 +1834,5 @@
 
 
-int VspOspTree::CastLineSegment(const Vector3 &origin,
+int VspTree::CastLineSegment(const Vector3 &origin,
 								const Vector3 &termination,
 								ViewCellContainer &viewcells)
@@ -1855,5 +1937,5 @@
 
 
-int VspOspTree::CastRay(Ray &ray)
+int VspTree::CastRay(Ray &ray)
 {
 	int hits = 0;
@@ -1961,5 +2043,5 @@
 
 
-VspNode *VspOspTree::CollapseTree(VspNode *node, int &collapsed)
+VspNode *VspTree::CollapseTree(VspNode *node, int &collapsed)
 {
 // TODO
@@ -2003,5 +2085,5 @@
 
 
-int VspOspTree::CollapseTree()
+int VspTree::CollapseTree()
 {
 	int collapsed = 0;
@@ -2017,5 +2099,5 @@
 
 
-void VspOspTree::RepairViewCellsLeafLists()
+void VspTree::RepairViewCellsLeafLists()
 {
 // TODO
@@ -2061,5 +2143,5 @@
 
 
-ViewCell *VspOspTree::GetViewCell(const Vector3 &point, const bool active)
+ViewCell *VspTree::GetViewCell(const Vector3 &point, const bool active)
 {
 	if (mRoot == NULL)
@@ -2100,5 +2182,5 @@
 
 
-bool VspOspTree::ViewPointValid(const Vector3 &viewPoint) const
+bool VspTree::ViewPointValid(const Vector3 &viewPoint) const
 {
 	VspNode *node = mRoot;
@@ -2130,5 +2212,5 @@
 
 
-void VspOspTree::PropagateUpValidity(VspNode *node)
+void VspTree::PropagateUpValidity(VspNode *node)
 {
 	const bool isValid = node->TreeValid();
@@ -2159,7 +2241,7 @@
 
 #if ZIPPED_VIEWCELLS
-bool VspOspTree::Export(ogzstream &stream)
+bool VspTree::Export(ogzstream &stream)
 #else
-bool VspOspTree::Export(ofstream &stream)
+bool VspTree::Export(ofstream &stream)
 #endif
 {
@@ -2171,7 +2253,7 @@
 
 #if ZIPPED_VIEWCELLS
-void VspOspTree::ExportNode(VspNode *node, ogzstream &stream)
+void VspTree::ExportNode(VspNode *node, ogzstream &stream)
 #else
-void VspOspTree::ExportNode(VspNode *node, ofstream &stream)
+void VspTree::ExportNode(VspNode *node, ofstream &stream)
 #endif
 {
@@ -2203,5 +2285,5 @@
 
 
-int VspOspTree::SplitRays(const AxisAlignedPlane &plane,
+int VspTree::SplitRays(const AxisAlignedPlane &plane,
 						  RayInfoContainer &rays,
 						  RayInfoContainer &frontRays,
@@ -2253,5 +2335,5 @@
 
 
-AxisAlignedBox3 VspOspTree::GetBBox(VspNode *node) const
+AxisAlignedBox3 VspTree::GetBBox(VspNode *node) const
 {
 	if (!node->GetParent())
@@ -2260,10 +2342,10 @@
 	if (!node->IsLeaf())
 	{
-		return (dynamic_cast<VspInterior *>(node))->GetBox();		
+		return (dynamic_cast<VspInterior *>(node))->GetBoundingBox();		
 	}
 
 	VspInterior *parent = dynamic_cast<VspInterior *>(node->GetParent());
 
-	AxisAlignedBox3 box(parent->GetBox());
+	AxisAlignedBox3 box(parent->GetBoundingBox());
 
 	if (parent->GetFront() == node)
@@ -2276,3 +2358,142 @@
 
 
-}
+/*****************************************************************/
+/*              class HierarchyManager implementation            */
+/*****************************************************************/
+
+HierarchyManager::HierarchyManager()
+{
+}
+
+
+SplitCandidate *HierarchyManager::NextSplitCandidate()
+{
+	SplitCandidate *splitCandidate = mTQueue.top();
+	mTQueue.pop();
+
+	return splitCandidate;
+}
+
+
+void HierarchyManager::PrepareTraversal()
+{
+
+#if TODO
+	/// create new vsp tree
+	mRoot = new VspLeaf();
+	/// we use the overall probability as normalizer
+	const float prop = mBoundingBox.GetVolume();
+
+	VspTraversalData tData(mRoot,
+						   0,
+						   rays,
+                           ComputePvsSize(*rays),
+						   prop,
+						   mBoundingBox);
+
+
+	// compute first split candidates
+	VspTree::VspSplitCandidate vspSplitCandidate = new VspTree::VspSplitCandidate();
+	EvalSplitCandidate(tData, *vspSplitCandidate);
+	mTQueue.push(splitCandidate);
+
+    OspSplitCandidate ospSplitCandidate = new OspSplitCandidate();
+	EvalSplitCandidate(tData, *ospSplitCandidate);
+	mTQueue.push(ospSplitCandidate);
+
+	mTotalCost = tData.mPvs * tData.mProbability / mBox.GetVolume();
+	mTotalPvsSize = tData.mPvs;
+	
+	mSubdivisionStats 
+			<< "#ViewCells\n1\n" <<  endl
+			<< "#RenderCostDecrease\n0\n" << endl 
+			<< "#SplitCandidateCost\n0\n" << endl
+			<< "#TotalRenderCost\n" << mTotalCost << endl
+			<< "#AvgRenderCost\n" << mTotalPvsSize << endl;
+
+	Debug << "total cost: " << mTotalCost << endl;
+
+#endif
+}
+
+
+void HierarchyManager::Construct(const VssRayContainer &sampleRays,
+								 const ObjectContainer &objects,
+								 AxisAlignedBox3 *forcedBoundingBox)
+{
+#if TODO
+	//-- store rays
+	for (rit = sampleRays.begin(); rit != rit_end; ++ rit)
+	{
+		VssRay *ray = *rit;
+
+		float minT, maxT;
+
+		static Ray hray;
+		hray.Init(*ray);
+
+		// TODO: not very efficient to implictly cast between rays types
+		if (mBoundingBox.GetRaySegment(hray, minT, maxT))
+		{
+			float len = ray->Length();
+
+			if (!len)
+				len = Limits::Small;
+
+			rays->push_back(RayInfo(ray, minT / len, maxT / len));
+		}
+	}
+#endif
+}
+
+
+bool HierarchyManager::FinishedConstruction()
+{
+	return mTQueue.empty();
+}
+
+
+void HierarchyManager::Construct(RayInfoContainer *rays)
+{
+	PrepareTraversal();
+
+	mVspTree->mVspStats.Start();
+	cout << "Constructing vsp bsp tree ... \n";
+
+	const long startTime = GetTime();	
+
+	while (!FinishedConstruction())
+	{
+		SplitCandidate *splitCandidate = NextSplitCandidate();
+	    
+		// cost ratio of cost decrease / totalCost
+		const float costRatio = splitCandidate->GetPriority() / mTotalCost;
+		
+		//Debug << "cost ratio: " << costRatio << endl;
+
+		if (costRatio < mTermMinGlobalCostRatio)
+			++ mGlobalCostMisses;
+	
+		// subdivide leaf node
+		// either object space or view space
+		if (splitCandidate->Type() == SplitCandidate::VIEW_SPACE)
+		{
+			VspTree::VspSplitCandidate *sc = 
+				dynamic_cast<VspTree::VspSplitCandidate *>(splitCandidate);
+
+			VspNode *r = mVspTree->Subdivide(mTQueue, *sc);
+		}
+		else // object space
+		{
+#if TODO
+			KdNode *r = mKdtree->Subdivide(tOspQueue, dynamic_cast<OspSplitCandidate<(splitCandidate));
+#endif
+		}
+	}
+
+	cout << "finished\n";
+
+	mVspTree->mVspStats.Stop();
+}
+
+}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h	(revision 1006)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h	(revision 1016)
@@ -130,5 +130,5 @@
 		{}
 
-		/** Returns cost of the traversal data.
+		/** Returns priority of the traversal data.
 		*/
 		float GetCost() const
@@ -167,5 +167,5 @@
 		// parent data
 		VspBspTraversalData mParentData;
-		// cost of applying this split
+		// prioriry of this split
 		float mRenderCost;
 
@@ -183,6 +183,5 @@
 #if 1
 			return mRenderCost;
-#endif
-#if 0
+#else
 			return (float) (-mDepth); // for kd tree
 #endif
@@ -221,5 +220,5 @@
 		a certain threshold.
 		@param onlyUnmailed if only the unmailed leaves should be considered
-		@param maxPvs the maximal pvs (-1 means unlimited)
+		@param maxPvs the maximal pvs of a leaf to be added (-1 means unlimited)
 	*/
 	void CollectLeaves(vector<BspLeaf *> &leaves, 
@@ -359,5 +358,5 @@
 	int ComputeBoxIntersections(const AxisAlignedBox3 &box, ViewCellContainer &viewCells) const;
 
-	// pointer to the hierarchy of view cells
+	/// pointer to the hierarchy of view cells
 	ViewCellsTree *mViewCellsTree;
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h	(revision 1013)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h	(revision 1016)
@@ -45,5 +45,50 @@
 };
 
-
+/** Candidate for a view space / object space split.
+*/
+class SplitCandidate
+{  
+public:
+
+	enum {OBJECT_SPACE, VIEW_SPACE};
+
+	/// the current split plane
+	AxisAlignedPlane mSplitPlane;
+	/// split axis of this plane (0, 1, 2, or 3 if non-axis-aligned)
+	int mSplitAxis;
+	/// the number of misses of max cost ratio until this split
+	int mMaxCostMisses;
+
+	/// priority of this split
+	float mPriority;
+	
+	SplitCandidate(): mPriority(0) 
+	{};
+
+	SplitCandidate(const AxisAlignedPlane &plane): mSplitPlane(plane)
+	{}
+
+	virtual int Type() const = 0;
+
+	/** Returns cost of the traversal data.
+	*/
+	float GetPriority() const
+	{
+#if 1
+		return mPriority;
+#else
+		return (float) (-mDepth); // for kd tree
+#endif
+	}
+
+	friend bool operator<(const SplitCandidate &a, const SplitCandidate &b)
+	{
+		return a.GetPriority() < b.GetPriority();
+	}
+};
+
+
+/** View space partition statistics.
+*/
 class VspTreeStatistics: public StatisticsBase
 {
@@ -154,5 +199,5 @@
 
 	/** Determines whether this node is a leaf or not
-	@return true if leaf
+		@return true if leaf
 	*/
 	virtual bool IsLeaf() const = 0;
@@ -161,5 +206,5 @@
 
 	/** Determines whether this node is a root
-	@return true if root
+		@return true if root
 	*/
 	virtual bool IsRoot() const;
@@ -250,10 +295,10 @@
 	}
 
-	AxisAlignedBox3 GetBox() const;
-	void SetBox(const AxisAlignedBox3 &box);
+	AxisAlignedBox3 GetBoundingBox() const;
+	void SetBoundingBox(const AxisAlignedBox3 &box);
 
 protected:
 
-	AxisAlignedBox3 mBox;
+	AxisAlignedBox3 mBoundingBox;
 
 	/// Splitting plane corresponding to this node
@@ -310,32 +355,32 @@
 
 
-/**
-	This class implements a structure holding two different hierarchies,
-	one for object space partitioning and one for view space partitioning.
-
-	The object space and the view space are subdivided using a cost heuristics.
-	If an object space split or a view space split is chosen is also evaluated
-	based on the heuristics. 
-	
-	The view space heuristics is evaluated by weighting and adding the pvss of the back and
-	front node of each specific split. unlike for the standalone method vspbsp tree,
-	the pvs of an object would not be the pvs of single object but that of all objects
-	which are contained in the same leaf of the object subdivision. This could be done
-	by storing the pointer to the object space partition parent, which would allow access to all children.
-	Another possibility is to include traced kd-cells in the ray casing process.
-
-	Accordingly, the object space heuristics is evaluated by storing a pvs of view cells with each object.
-	the contribution to an object to the pvs is the number of view cells it can be seen from.
-
-
-	There is a potential efficiency problem involved in a sense that once a certain type
-	of split is chosen for view space / object space, the candidates for the next split of 
-	object space / view space must be reevaluated.
-	
+typedef std::priority_queue<SplitCandidate *> SplitQueue;
+
+
+#if TODO
+/** candidate for a view space split
 */
-class VspOspTree 
+class OspSplitCandidate: public SplitCandidate
+{  
+	/// parent data
+	OspTraversalData mParentData;
+		
+	VspOspSplitCandidate(): mRenderCost(0) 
+	{};
+
+	int Type() const { return OSP_CANDIDATE; } 
+
+	VspOspSplitCandidate(const AxisAlignedPlane &plane, const VspOspTraversalData &tData): 
+	mSplitPlane(plane), mParentData(tData), mRenderCost(0)
+	{}
+};
+#endif
+
+/** View Space Partitioning tree.
+*/
+class VspTree 
 {
 	friend class ViewCellsParseHandlers;
-	friend class VspVspViewCellsManager;
+	friend class HierarchyManager;
 
 public:
@@ -343,5 +388,5 @@
 	/** Additional data which is passed down the BSP tree during traversal.
 	*/
-	class VspOspTraversalData
+	class VspTraversalData
 	{  
 	public:
@@ -374,5 +419,5 @@
 
 
-		VspOspTraversalData():
+		VspTraversalData():
 		mNode(NULL),
 		mDepth(0),
@@ -385,10 +430,10 @@
 		{}
 		
-		VspOspTraversalData(VspNode *node, 
-							const int depth, 
-							RayInfoContainer *rays,
-							const int pvs,
-							const float p,
-							const AxisAlignedBox3 &box): 
+		VspTraversalData(VspNode *node, 
+						 const int depth, 
+						 RayInfoContainer *rays,
+						 const int pvs,
+						 const float p,
+						 const AxisAlignedBox3 &box):
 		mNode(node), 
 		mDepth(depth), 
@@ -402,8 +447,7 @@
 		{}
 
-		VspOspTraversalData(PolygonContainer *polys, 
-							const int depth, 
-							RayInfoContainer *rays,
-							const AxisAlignedBox3 &box): 
+		VspTraversalData(const int depth, 
+						 RayInfoContainer *rays,
+						 const AxisAlignedBox3 &box): 
 		mNode(NULL), 
 		mDepth(depth), 
@@ -430,10 +474,27 @@
 		}
 
-		friend bool operator<(const VspOspTraversalData &a, const VspOspTraversalData &b)
+		friend bool operator<(const VspTraversalData &a, const VspTraversalData &b)
 		{
 			return a.GetCost() < b.GetCost();
 		}
     };
-	
+
+	/** Candidate for a view space split.
+	*/
+	class VspSplitCandidate: public SplitCandidate
+	{  
+	public:
+		/// parent data
+		VspTraversalData mParentData;
+		
+		VspSplitCandidate()
+		{};
+
+		int Type() const { return VIEW_SPACE; }
+
+		VspSplitCandidate(const AxisAlignedPlane &plane, const VspTraversalData &tData): 
+		SplitCandidate(plane), mParentData(tData)
+		{}
+	};
 
 	/** Struct for traversing line segment.
@@ -451,52 +512,13 @@
 	};
 
-	typedef std::priority_queue<VspOspTraversalData> VspOspTraversalQueue;
-	
-	/** candidate for a view space split
-	*/
-	struct VspOspSplitCandidate
-	{  
-		/// the current plane
-		AxisAlignedPlane mSplitPlane;
-		/// the number of misses of max cost ratio until this split
-		int mMaxCostMisses;
-		/// parent data
-		VspOspTraversalData mParentData;
-		/// cost of applying this split
-		float mRenderCost;
-
-		VspOspSplitCandidate(): mRenderCost(0) 
-		{};
-
-		VspOspSplitCandidate(const AxisAlignedPlane &plane, const VspOspTraversalData &tData): 
-		mSplitPlane(plane), mParentData(tData), mRenderCost(0)
-		{}
-
-		/** Returns cost of the traversal data.
-		*/
-		float GetCost() const
-		{
-#if 1
-			return mRenderCost;
-#else
-			return (float) (-mDepth); // for kd tree
-#endif
-		}
-
-		friend bool operator<(const VspOspSplitCandidate &a, const VspOspSplitCandidate &b)
-		{
-			return a.GetCost() < b.GetCost();
-		}
-    };
-
-	typedef std::priority_queue<VspOspSplitCandidate> VspOspSplitQueue;
+	//typedef std::priority_queue<VspTraversalData> VspOspTraversalQueue;
 
 	/** Default constructor creating an empty tree.
 	*/ 
-	VspOspTree();
+	VspTree();
 
 	/** Default destructor.
 	*/
-	~VspOspTree();
+	~VspTree();
 
 	/** Returns BSP Tree statistics.
@@ -510,6 +532,5 @@
 	/** Constructs the tree from a given set of rays.
 		@param sampleRays the set of sample rays the construction is based on
-		@param viewCells if not NULL, new view cells are 
-		created in the leafs and stored in the container
+		@param forcedBoundingBox a given bounding box is taken as view space
 	*/
 	void Construct(const VssRayContainer &sampleRays,
@@ -519,5 +540,5 @@
 		a certain threshold.
 		@param onlyUnmailed if only the unmailed leaves should be considered
-		@param maxPvs the maximal pvs (-1 means unlimited)
+		@param maxPvs the maximal pvs of a leaf to be added (-1 means unlimited)
 	*/
 	void CollectLeaves(vector<VspLeaf *> &leaves, 
@@ -638,5 +659,5 @@
 								ViewCellContainer &viewCells) const;
 
-	// pointer to the hierarchy of view cells
+	/// pointer to the hierarchy of view cells
 	ViewCellsTree *mViewCellsTree;
 
@@ -673,5 +694,5 @@
 	/** faster evaluation of split plane cost for kd axis aligned cells.
 	*/
-	float EvalSplitCost(const VspOspTraversalData &data,
+	float EvalSplitCost(const VspTraversalData &data,
 						const AxisAlignedBox3 &box,
 						const int axis,
@@ -682,14 +703,14 @@
 	/** Evaluates candidate for splitting.
 	*/
-	void EvalSplitCandidate(VspOspTraversalData &tData, VspOspSplitCandidate &splitData);
+	void EvalSplitCandidate(VspTraversalData &tData, VspSplitCandidate &splitData);
 
 	/** Computes priority of the traversal data and stores it in tData.
 	*/
-	void EvalPriority(VspOspTraversalData &tData) const;
+	void EvalPriority(VspTraversalData &tData) const;
 
 	/** Evaluates render cost decrease of next split.
 	*/
 	float EvalRenderCostDecrease(const AxisAlignedPlane &candidatePlane,
-								 const VspOspTraversalData &data) const;
+								 const VspTraversalData &data) const;
 
 	/** Constructs tree using the split priority queue.
@@ -724,5 +745,5 @@
 	/** Evaluates tree stats in the BSP tree leafs.
 	*/
-	void EvaluateLeafStats(const VspOspTraversalData &data);
+	void EvaluateLeafStats(const VspTraversalData &data);
 
 	/** Subdivides node with respect to the traversal data.
@@ -731,6 +752,6 @@
 		@returns new root of the subtree
 	*/
-	VspNode *Subdivide(VspOspSplitQueue &tQueue,
-					   VspOspSplitCandidate &splitCandidate);
+	VspNode *Subdivide(SplitQueue &tQueue,
+					   VspSplitCandidate &splitCandidate);
 
 	
@@ -750,12 +771,12 @@
 
 	VspInterior *SubdivideNode(const AxisAlignedPlane &splitPlane,
-							   VspOspTraversalData &tData,
-							   VspOspTraversalData &frontData,
-                               VspOspTraversalData &backData);
+							   VspTraversalData &tData,
+							   VspTraversalData &frontData,
+                               VspTraversalData &backData);
 
 	/** Selects an axis aligned for the next split.
 		@returns cost for this split
 	*/
-	float SelectPlane(const VspOspTraversalData &tData,
+	float SelectPlane(const VspTraversalData &tData,
 					  AxisAlignedPlane &plane,
 					  float &pFront,
@@ -815,9 +836,9 @@
 	/** Returns true if tree can be terminated.
 	*/
-	inline bool LocalTerminationCriteriaMet(const VspOspTraversalData &data) const;
+	inline bool LocalTerminationCriteriaMet(const VspTraversalData &data) const;
 
 	/** Returns true if global tree can be terminated.
 	*/
-	inline bool GlobalTerminationCriteriaMet(const VspOspTraversalData &data) const;
+	inline bool GlobalTerminationCriteriaMet(const VspTraversalData &data) const;
 
 	/** Adds ray sample contributions to the PVS.
@@ -951,4 +972,71 @@
 };
 
+
+class KdTree;
+
+/** This class implements a structure holding two different hierarchies,
+	one for object space partitioning and one for view space partitioning.
+
+	The object space and the view space are subdivided using a cost heuristics.
+	If an object space split or a view space split is chosen is also evaluated
+	based on the heuristics. 
+	
+	The view space heuristics is evaluated by weighting and adding the pvss of the back and
+	front node of each specific split. unlike for the standalone method vspbsp tree,
+	the pvs of an object would not be the pvs of single object but that of all objects
+	which are contained in the same leaf of the object subdivision. This could be done
+	by storing the pointer to the object space partition parent, which would allow access to all children.
+	Another possibility is to include traced kd-cells in the ray casing process.
+
+	Accordingly, the object space heuristics is evaluated by storing a pvs of view cells with each object.
+	the contribution to an object to the pvs is the number of view cells it can be seen from.
+
+	@note
+	There is a potential efficiency problem involved in a sense that once a certain type
+	of split is chosen for view space / object space, the candidates for the next split of 
+	object space / view space must be reevaluated.
+	
+*/
+class HierarchyManager
+{
+	/** Default constructor.
+	*/
+	HierarchyManager();
+
+	/** Constructs the view space and object space subdivision from a given set of rays
+		and a set of objects.
+		@param sampleRays the set of sample rays the construction is based on
+		@param objects the set of objects
+	*/
+	void Construct(const VssRayContainer &sampleRays,
+				   const ObjectContainer &objects,
+				   AxisAlignedBox3 *forcedBoundingBox);
+
+public:
+	VspTree *mVspTree;
+	KdTree *mKdTree;
+
+protected:
+
+	void Construct(RayInfoContainer *rays);
+	void PrepareTraversal();
+	bool FinishedConstruction();
+	SplitCandidate *NextSplitCandidate();
+
+
+
+	AxisAlignedBox3 mBoundingBox;
+
+	SplitQueue mTQueue;
+
+	//-- global criteria
+	float mTermMinGlobalCostRatio;
+	int mTermGlobalCostMissTolerance;
+	int mGlobalCostMisses;
+
+	/// keeps track of cost during subdivision
+	float mTotalCost;
+};
+
 }
 
