Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 1021)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 1022)
@@ -368,5 +368,5 @@
 
 	virtual void CollectMergeCandidates(const VssRayContainer &rays, 
-										vector<MergeCandidate> &candidates) = 0;
+										vector<MergeCandidate> &candidates);
 
 	void CollectViewCells(const int n);
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 1021)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 1022)
@@ -13,4 +13,5 @@
 #include "PlyParser.h"
 #include "SamplingStrategy.h"
+#include "VspOspTree.h"
 
 
@@ -433,11 +434,11 @@
 		mViewCellsManager = new VspBspViewCellsManager(mVspBspTree);
 	}
-#if 0
 	else if (strcmp(name, "vspOspTree") == 0)
 	{
-		mVspOspTree = new VspOspTree();		
-		mViewCellsManager = new VspOspViewCellsManager(mVspOspTree);
-	}
-#endif
+		mVspTree = new VspTree();
+		mOspTree = new OspTree();
+
+		mViewCellsManager = new VspOspViewCellsManager(mVspTree, mOspTree);
+	}
 	else if (strcmp(name, "sceneDependent") == 0)
 	{
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 1020)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 1022)
@@ -22,6 +22,7 @@
 struct VssRayContainer;
 class SamplingStrategy;
-
 class GlRendererBuffer;
+class VspTree;
+class OspTree;
 
 /** Namespace for the external visibility preprocessor
@@ -134,4 +135,6 @@
 	  VssRayContainer &vssRays) {};
 
+  /** Returns a view cells manager with respect to the given name.
+  */
   ViewCellsManager *CreateViewCellsManager(const char *name);
 
@@ -144,7 +147,14 @@
   /// kD-tree organizing the scene graph (occluders + occludees) + viewcells
   KdTree *mKdTree;
-  
   /// View space partition bsp tree
   VspBspTree *mVspBspTree;
+  // view space partition tree
+  VspTree *mVspTree;
+  /// object space partition tree
+  OspTree *mOspTree;
+  /// BSP tree representing the viewcells
+  BspTree *mBspTree;
+
+
   /// list of all loaded occluders
   ObjectContainer mOccluders;
@@ -152,7 +162,5 @@
   ObjectContainer mOccludees;
    
-  /// BSP tree representing the viewcells
-  BspTree *mBspTree;
-
+  
   ViewCellsManager *mViewCellsManager;
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp	(revision 1021)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp	(revision 1022)
@@ -2310,4 +2310,95 @@
 /*****************************************************************/
 
+OspTree::OspTree():
+mRoot(NULL)
+#if TODO
+mOutOfBoundsCell(NULL),
+mStoreRays(false),
+mUseRandomAxis(false),
+mTimeStamp(1)
+#endif
+{
+#if TODO
+	bool randomize = false;
+	Environment::GetSingleton()->GetBoolValue("VspTree.Construction.randomize", randomize);
+	if (randomize)
+		Randomize(); // initialise random generator for heuristics
+
+	//-- termination criteria for autopartition
+	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("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("VspTree.Termination.ct_div_ci", mCtDivCi);
+
+	//-- partition criteria
+	Environment::GetSingleton()->GetFloatValue("VspTree.Construction.epsilon", mEpsilon);
+
+	// if only the driving axis is used for axis aligned split
+	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("VspTree.subdivisionStats", subdivisionStatsLog);
+	mSubdivisionStats.open(subdivisionStatsLog);
+
+	Environment::GetSingleton()->GetFloatValue("VspTree.Construction.minBand", mMinBand);
+	Environment::GetSingleton()->GetFloatValue("VspTree.Construction.maxBand", mMaxBand);
+	
+
+	//-- debug output
+
+	Debug << "******* VSP BSP options ******** " << endl;
+    Debug << "max depth: " << mTermMaxDepth << endl;
+	Debug << "min PVS: " << mTermMinPvs << endl;
+	Debug << "min probabiliy: " << mTermMinProbability << endl;
+	Debug << "min rays: " << mTermMinRays << endl;
+	Debug << "max ray contri: " << mTermMaxRayContribution << endl;
+	Debug << "max cost ratio: " << mTermMaxCostRatio << endl;
+	Debug << "miss tolerance: " << mTermMissTolerance << endl;
+	Debug << "max view cells: " << mMaxViewCells << endl;
+	Debug << "randomize: " << randomize << endl;
+
+	Debug << "min global cost ratio: " << mTermMinGlobalCostRatio << endl;
+	Debug << "global cost miss tolerance: " << mTermGlobalCostMissTolerance << endl;
+	Debug << "only driving axis: " << mOnlyDrivingAxis << endl;
+	Debug << "max memory: " << mMaxMemory << endl;
+	Debug << "use cost heuristics: " << mUseCostHeuristics << endl;
+	Debug << "subdivision stats log: " << subdivisionStatsLog << endl;
+	Debug << "use random axis: " << mUseRandomAxis << endl;
+	Debug << "priority queue type: " << mNodePriorityQueueType << endl;
+	Debug << "circulating axis: " << mCirculatingAxis << endl;
+	Debug << "minband: " << mMinBand << endl;
+	Debug << "maxband: " << mMaxBand << endl;
+	
+
+	mSplitCandidates = new vector<SortableEntry>;
+
+	Debug << endl;
+#endif
+}
+
+
 
 void OspTree::SplitObjects(const AxisAlignedPlane & splitPlane,
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1021)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1022)
@@ -113,12 +113,12 @@
 		mSamplingType = Preprocessor::DIRECTION_BASED_DISTRIBUTION;
 	}
-	else if (strcmp(buf, "interior") == 0)
+	else if (strcmp(buf, "object_directional") == 0)
+	{
+		mSamplingType = Preprocessor::OBJECT_DIRECTION_BASED_DISTRIBUTION;
+	}
+	/*else if (strcmp(buf, "interior") == 0)
 	{
 		mSamplingType = Preprocessor::OBJECTS_INTERIOR_DISTRIBUTION;
-	}
-	else if (strcmp(buf, "object_directional") == 0)
-	{
-		mSamplingType = Preprocessor::OBJECT_DIRECTION_BASED_DISTRIBUTION;
-	}
+	}*/
 	else
 	{
@@ -142,8 +142,8 @@
 		mEvaluationSamplingType = Preprocessor::OBJECT_DIRECTION_BASED_DISTRIBUTION;
 	}
-	else if (strcmp(buf, "interior") == 0)
+	/*else if (strcmp(buf, "interior") == 0)
 	{
 		mEvaluationSamplingType = Preprocessor::OBJECTS_INTERIOR_DISTRIBUTION;
-	}
+	}*/
 	else
 	{
@@ -2358,6 +2358,4 @@
 
 
-
-
 void ViewCellsManager::ExportColor(Exporter *exporter, ViewCell *vc) const
 {
@@ -2423,4 +2421,10 @@
 
 
+void ViewCellsManager::CollectMergeCandidates(const VssRayContainer &rays, 
+											  vector<MergeCandidate> &candidates)
+{
+	// implemented in subclasses
+}
+
 /**********************************************************************/
 /*                 BspViewCellsManager implementation                 */
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h	(revision 1006)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h	(revision 1022)
@@ -21,4 +21,8 @@
 class ViewCellsManager;
 class ViewCellsTree;
+class VspTree;
+class OspTree;
+
+
 
 class ViewCellsParseHandlers: public HandlerBase
@@ -69,4 +73,7 @@
 
   VspBspTree *mVspBspTree;
+  VspTree *mVspTree;
+  OspTree *mOspTree;
+
   BspTree *mBspTree;
   ViewCellsTree *mViewCellsTree;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 1006)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 1022)
@@ -30,4 +30,6 @@
 #include "ViewCellsManager.h"
 #include "GzFileInputSource.h"
+#include "VspOspTree.h"
+
 
 namespace GtpVisibilityPreprocessor {
@@ -621,5 +623,5 @@
 		mViewCellsManager = new BspViewCellsManager(mBspTree);
 	}
-	else // vspBspTree
+	else if (strcmp(name, "vspBspTree") == 0) // 
 	{
 		Debug << "view cell type: VspBsp" << endl;
@@ -631,4 +633,17 @@
 		mVspBspTree->mBox = mViewSpaceBox;
 	}
+	else if (strcmp(name, "vspOspTree") == 0)
+	{
+		Debug << "view cell type: VspOsp" << endl;
+
+		mVspTree = new VspTree();
+		mOspTree = new OspTree();
+
+		//mCurrentBspNode = mVspBspTree->GetRoot();
+		mViewCellsManager = new VspOspViewCellsManager(mVspTree, mOspTree);
+
+		mVspTree->mBoundingBox = mViewSpaceBox;
+	}
+
 
 	mViewCellsTree = mViewCellsManager->GetViewCellsTree();
