Index: GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 2000)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 2005)
@@ -211,4 +211,5 @@
 				GenerateDebugInformation="FALSE"
 				SubSystem="1"
+				LargeAddressAware="2"
 				OptimizeReferences="2"
 				EnableCOMDATFolding="2"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2004)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2005)
@@ -253,4 +253,5 @@
 }
 
+#define POWERPLANT_HACK 1
 
 bool Preprocessor::LoadBinaryObj(const string filename,
@@ -279,12 +280,6 @@
 	samplesIn.read(reinterpret_cast<char *>(&numTriangles), sizeof(int));
 	root->mGeometry.reserve(numTriangles);
-	cout << "reserved " << numTriangles << " triangles " << endl;
-	//root->mGeometry.reserve(13000000);
-	
-	cout << "using " << numTriangles * (sizeof(TriangleIntersectable) + sizeof(TriangleIntersectable *)) / (1024 * 1024) << " MBs" << endl;
-
-	//vector<Triangle3> dummy;
-	//cout << "using " << numTriangles * sizeof(Triangle3) / (1024 * 1024) << " MBs" << endl;
-	//dummy.reserve(numTriangles);
+	cout << "loading " << numTriangles << " triangles (" 
+		 << numTriangles * (sizeof(TriangleIntersectable) + sizeof(TriangleIntersectable *)) / (1024 * 1024) << " MB)" << endl;
 
 	int i = 0;
@@ -296,5 +291,5 @@
 		samplesIn.read(reinterpret_cast<char *>(tri.mVertices + 1), sizeof(Vector3));
 		samplesIn.read(reinterpret_cast<char *>(tri.mVertices + 2), sizeof(Vector3));
-		
+
 		// end of file reached
 		if (samplesIn.eof())
@@ -303,9 +298,9 @@
 		TriangleIntersectable *obj = new TriangleIntersectable(tri);
 		root->mGeometry.push_back(obj);
-		//dummy.push_back(tri);
+		
 		i ++;
 	
-		if (i % 500000 == 0)
-			cout << "idx: " << i << endl;
+		if (i % 500000 == 499999)
+			 cout<<"\r"<<i<<"/"<<numTriangles<<"\r";
 	}
 	
Index: GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 2004)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 2005)
@@ -475,5 +475,5 @@
 	 
 	// assign the objects in sorted order
-	if (!TEST_POWERPLANT && mUseGlobalSorting)
+	if (mUseGlobalSorting)
 	{
 		AssignSortedObjects(sc, frontData, backData);
@@ -2226,12 +2226,13 @@
 	// create bvh traversal data
 	BvhTraversalData oData(bvhLeaf, 0, prop, nRays);
+	cout << "here4" << endl;
 	
 	// create sorted object lists for the first data
-	if (!TEST_POWERPLANT && mUseGlobalSorting)
+	if (mUseGlobalSorting)
 	{
 		AssignInitialSortedObjectList(oData, objects);
 	}
 	
-
+	cout << "here6" << endl;
 	///////////////////
 	//-- add first candidate for object space partition	
@@ -2294,4 +2295,5 @@
 	for (int i = 0; i < 3; ++ i)
 	{
+		cout << "here2 " << endl;
 		SortableEntryContainer *sortedObjects = new SortableEntryContainer();
 
@@ -2314,5 +2316,5 @@
 		delete sortedObjects;
 	}
-
+cout << "here102" << endl;
 	// last sorted list: by size
 	tData.mSortedObjects[3] = new ObjectContainer();
@@ -2393,5 +2395,5 @@
 	BvhTraversalData oData(bvhLeaf, 0, prop, nRays);
 
-	if (!TEST_POWERPLANT && mUseGlobalSorting)
+	if (mUseGlobalSorting)
 		AssignInitialSortedObjectList(oData, objects);
 	
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h	(revision 1999)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h	(revision 2005)
@@ -120,4 +120,5 @@
   int mObjectSpaceHierarchyType;
 int nViewCells;
+int nObjects;
   ////////////////////////////////
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp	(revision 2003)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp	(revision 2005)
@@ -202,5 +202,5 @@
 		return false;
 
-	if (1 && GVS_DEBUG)
+	if (0 && GVS_DEBUG)
 		mVssRays.push_back(new VssRay(*vssRay));
 
@@ -650,6 +650,6 @@
 	}
 
-	//exporter->ExportRays(vcRays, RgbColor(1, 0, 0));
-	//exporter->ExportRays(vcRays2, RgbColor(0, 1, 0));
+	exporter->ExportRays(vcRays, RgbColor(1, 0, 0));
+	exporter->ExportRays(vcRays2, RgbColor(0, 1, 0));
 	exporter->ExportRays(vcRays3, RgbColor(1, 1, 1));
 }
@@ -1065,4 +1065,6 @@
 	}
 
+	cout << "here4 " << mKdTree->GetBox() << endl;
+	cout << "here5 " << mViewCellsManager->GetViewSpaceBox() << endl;
 	mGvsStats.Stop();
 	mGvsStats.Print(mGvsStatsStream);
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 1999)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 2005)
@@ -95,4 +95,5 @@
   , mHierarchyManager(NULL)
   , nViewCells(0)
+  , nObjects(0)
 {
 	std::stable_sort(mObjects->begin(), mObjects->end(), ilt);
@@ -206,5 +207,5 @@
 	// go one up in the tree
 	if (mCurrentBspNode->GetParent())
-	{	Debug << "]";
+	{	//cout << "]";
 		mCurrentBspNode = mCurrentBspNode->GetParent();
 	}
@@ -216,5 +217,5 @@
 	// go one up in the tree
 	if (mCurrentBvhNode->GetParent())
-	{	Debug << "]";
+	{	//cout << "]";
 		mCurrentBvhNode = mCurrentBvhNode->GetParent();
 	}
@@ -226,5 +227,6 @@
 	// go one up in the tree
 	if (mCurrentOspNode->mParent)
-	{	Debug << "]";
+	{	
+		//cout << "]";
 		mCurrentOspNode = mCurrentOspNode->mParent;
 	}
@@ -236,5 +238,6 @@
 	// go one up in the tree
 	if (mCurrentVspNode->GetParent())
-	{	Debug << "]";
+	{	
+		//cout << "]";
 		mCurrentVspNode = mCurrentVspNode->GetParent();
 	}
@@ -246,5 +249,6 @@
 	// go one up in the tree
 	if (mCurrentViewCell->GetParent())
-	{	Debug << "]";
+	{	
+		//cout << "]";
 		mCurrentViewCell = mCurrentViewCell->GetParent();
 	}
@@ -289,5 +293,5 @@
 	if (element == "Interior") 
 	{
-		Debug << "[";
+		//cout << "[";
 		StartBspInterior(attributes);
 	}
@@ -295,5 +299,5 @@
 	if (element == "Leaf") 
 	{
-		Debug << "l";
+		//cout << "l";
 		StartBspLeaf(attributes);
 	}
@@ -306,10 +310,10 @@
 	if (element == "Interior") 
 	{
-		Debug << "[";
+		//cout << "[";
 		StartVspInterior(attributes);
 	}
 	if (element == "Leaf") 
 	{
-		Debug << "l";
+		//cout << "l";
 		StartVspLeaf(attributes);
 	}
@@ -322,5 +326,5 @@
 	if (element == "Interior") 
 	{
-		Debug << "[";
+		//cout << "[";
 		StartOspInterior(attributes);
 	}
@@ -328,5 +332,5 @@
 	if (element == "Leaf") 
 	{
-		Debug << "l";
+		//cout << "l";
 		StartOspLeaf(attributes);
 	}
@@ -339,5 +343,5 @@
 	if (element == "Interior") 
 	{
-		Debug << "[";
+		//cout << "[";
 		StartBvhInterior(attributes);
 	}
@@ -345,5 +349,5 @@
 	if (element == "Leaf") 
 	{
-		Debug << "l";
+		//cout << "l";
 		StartBvhLeaf(attributes);
 	}
@@ -392,10 +396,8 @@
 														   AttributeList& attributes)
 {
-	if (((nViewCells ++) % 1000) == 0)
-		Debug << "\n " << nViewCells << " view cells parsed" << endl;
 	// interiors + leaves interpreted view cells else
 	if (element == "Interior") 
 	{
-		Debug << "[";
+		//cout << "[";
 		StartViewCell(attributes, false);
 	}
@@ -403,5 +405,5 @@
 	if (element == "Leaf") 
 	{
-		Debug << "l";
+		//cout << "l";
 		StartViewCell(attributes, true);
 	}
@@ -417,5 +419,5 @@
 	if (element == "ViewCells")
 	{
-	  Debug << "\nparsing view cells" << endl;
+		cout << "\nparsing view cells" << endl;
 		
 		mCurrentState = PARSE_VIEWCELLS;
@@ -428,5 +430,5 @@
 	if (element == "ViewSpaceHierarchy")
 	{		
-		Debug << "\nparsing view space hierarchy" << endl;
+		cout << "\nparsing view space hierarchy" << endl;
 		mCurrentState = PARSE_VIEWSPACE_HIERARCHY;
 		StartViewSpaceHierarchy(attributes);
@@ -436,5 +438,5 @@
 	if (element == "ObjectSpaceHierarchy")
 	{
-		Debug << "\nparsing object space hierarchy" << endl;
+		cout << "\nparsing object space hierarchy" << endl;
 		mCurrentState = PARSE_OBJECTSPACE_HIERARCHY;
 		StartObjectSpaceHierarchy(attributes);
@@ -444,5 +446,5 @@
 	if (element == "BoundingBox")
 	{
-	  //		Debug << "b";
+		// cout << "b";
 		StartBoundingBox(attributes);
 	}
@@ -452,7 +454,13 @@
 	{
 	case PARSE_VIEWSPACE_HIERARCHY:
+		if ((++ nViewCells % 1000) == 0)
+			cout<<"\r"<<nViewCells<<" view cells parsed\r";
+		
 		StartViewSpaceHierarchyElement(element, attributes);
 		break;
 	case PARSE_OBJECTSPACE_HIERARCHY:
+		if ((++ nObjects % 1000) == 0)
+		 cout<<"\r"<< nObjects <<" objects parsed\r";
+		
 		StartObjectSpaceHierarchyElement(element, attributes);
 		break;
@@ -703,5 +711,5 @@
 		else
 		{
-			Debug << "error: view cell does not exist" << endl;
+			cerr << "error: view cell does not exist" << endl;
 		}
 	}
@@ -882,5 +890,4 @@
 		ViewCellContainer::iterator vit, vit_end = mViewCells.end();
 
-		Debug << "exchanging boxes" << endl;
 		int i = 0;
 		// remove view cells and exchange them with the 
@@ -888,6 +895,6 @@
 		for (vit = mViewCells.begin(); vit != vit_end; ++ vit, ++ i)
 		{
-			if ((i % 1000) == 0)
-				Debug << "\n exchanged " << i << " boxes" << endl;
+			//if ((i % 1000) == 0)
+			//	Debug << "\n exchanged " << i << " boxes" << endl;
 			ViewCell *vc = (*vit);
 
@@ -916,5 +923,5 @@
 			(*vit) = bspVc;
 		}
-		Debug << "finished" << endl;
+		cout << "finished creating view space hierarchy" << endl;
 	}
 	else if (mViewSpaceHierarchyType == VSP) 
@@ -1279,5 +1286,5 @@
 		else
 		{
-			Debug << "error: object with id " << objId << " does not exist" << endl;
+			cerr << "error: object with id " << objId << " does not exist" << endl;
 		}
 	}
