Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1262)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1263)
@@ -749,7 +749,6 @@
 
 
-	// the type of hierarchy: this must be known before to build 
-	// the view cells manager
-	stream << "<ViewSpaceHierarchyType name=\"vspBspTree\" />" << endl;
+	// the type of hierarchy: this must be known before to build the view cells manager
+	//stream << "<ViewSpaceHierarchyType name=\"vspBspTree\" />" << endl;
 
 	//-- export the view cells and the pvs
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h	(revision 1201)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h	(revision 1263)
@@ -388,5 +388,5 @@
 {
 	friend class ViewCellsManager;
-
+	friend class ViewCellsParseHandlers;
 
 public:
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h	(revision 1233)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h	(revision 1263)
@@ -24,5 +24,5 @@
 class OspTree;
 class VspNode;
-
+class BvHierarchy;
 
 class ViewCellsParseHandlers: public HandlerBase
@@ -69,5 +69,5 @@
   void resetDocument();
 
-  void CreateViewCellsManager(const char *name);
+  void CreateViewCellsManager(/*const char *name*/);
 
 
@@ -75,4 +75,5 @@
   VspTree *mVspTree;
   OspTree *mOspTree;
+  BvHierarchy *mBvHierarchy;
 
   BspTree *mBspTree;
@@ -83,4 +84,8 @@
   ViewCell *mCurrentViewCell;
   KdNode *mCurrentKdNode;
+  
+  BspNode *mBspRoot;
+  VspNode *mVspRoot;
+  ViewCell *mViewCellRoot;
 
   ViewCellContainer mViewCells;
@@ -91,8 +96,14 @@
   IndexedBoundingBoxContainer mIBoundingBoxes;
  
-  /// current task for the parser
-  int mCurrentTask;
-
+  /// current state of the parser
+  int mCurrentState;
+  
   enum {PARSE_OPTIONS, PARSE_VIEWCELLS, PARSE_VSP, PARSE_OSP};
+
+  /// view space / object space hierarchy types
+  enum {BSP, VSP, OSP, BVH};
+
+  int mViewSpaceHierarchyType;
+  int mObjectSpaceHierarchyType;
 
   // Handlers for X3D
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 1262)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 1263)
@@ -33,5 +33,5 @@
 #include "VspTree.h"
 #include "KdTree.h"
-
+#include "BvHierarchy.h"
 
 
@@ -84,5 +84,5 @@
   , mBspTree(NULL)
   , mViewCellsTree(NULL)
-  , mCurrentTask(PARSE_OPTIONS)
+  , mCurrentState(PARSE_OPTIONS)
   , mCurrentViewCell(NULL)
   , mCurrentBspNode(NULL)
@@ -118,5 +118,5 @@
 
 	// inside the view cell description
-	if (mCurrentTask == PARSE_VIEWCELLS)
+	if (mCurrentState == PARSE_VIEWCELLS)
 	{
 		if (element == "Interior")
@@ -173,5 +173,5 @@
 
 	// not parsing view cells anymore
-	mCurrentTask = PARSE_OPTIONS;
+	mCurrentState = PARSE_OPTIONS;
 }
 
@@ -206,5 +206,5 @@
 			
 			// the view cells manager is created here
-			CreateViewCellsManager(ptr);
+			//CreateViewCellsManager(ptr);
 		}
 	}
@@ -331,5 +331,5 @@
 	{
 		cout << "parsing view cells" << endl;
-		mCurrentTask = PARSE_VIEWCELLS;
+		mCurrentState = PARSE_VIEWCELLS;
 	}
 
@@ -346,5 +346,5 @@
 		//StartViewSpaceHierarchy(attributes);
 		cout << "parsing view space partition" << endl;
-		mCurrentTask = PARSE_VSP;
+		mCurrentState = PARSE_VSP;
 	}
 
@@ -354,5 +354,5 @@
 		//StartObjectSpaceHierarchy(attributes);
 		cout << "parsing object space partition" << endl;
-		mCurrentTask = PARSE_OSP;
+		mCurrentState = PARSE_OSP;
 	}
 	
@@ -372,5 +372,5 @@
 
 	// parse view space partition
-	switch (mCurrentTask)
+	switch (mCurrentState)
 	{
 	case PARSE_VSP:
@@ -713,7 +713,7 @@
 
 
-void ViewCellsParseHandlers::CreateViewCellsManager(const char *name)
-{
-	if (strcmp(name, "bspTree") == 0)
+void ViewCellsParseHandlers::CreateViewCellsManager(/*const char *name*/)
+{
+	/*if (strcmp(name, "bsp") == 0)
 	{
 		Debug << "view cell type: Bsp" << endl;
@@ -723,6 +723,6 @@
 
 		mViewCellsManager = new BspViewCellsManager(mBspTree);
-	}
-	else if (strcmp(name, "vspBspTree") == 0) // 
+	}*/
+	if (mViewSpaceHierarchyType == BSP) // 
 	{
 		Debug << "view cell type: VspBsp" << endl;
@@ -732,11 +732,16 @@
 
 		mVspBspTree->mBox = mViewSpaceBox;
-	}
-	else if (strcmp(name, "vspOspTree") == 0)
-	{
-		Debug << "view cell type: VspOsp" << endl;
+		mVspBspTree->mRoot = mBspRoot;
+	}
+	else if (mViewSpaceHierarchyType == VSP) 
+	{
+		Debug << "view cell type: Vsp" << endl;
 
 		mVspTree = new VspTree();
-		mOspTree = new OspTree();
+
+		if (mObjectSpaceHierarchyType == OSP) 
+			mOspTree = new OspTree();
+		else
+			mBvHierarchy = new BvHierarchy();
 
 		// hack
@@ -747,4 +752,6 @@
 
 	mViewCellsTree = mViewCellsManager->GetViewCellsTree();
+	mViewCellsTree->mRoot = mViewCellRoot;
+
 	mViewCellsManager->SetViewSpaceBox(mViewSpaceBox);
 }
