Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h	(revision 882)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h	(revision 955)
@@ -10,4 +10,6 @@
 #include "RayInfo.h"
 #include "ViewCellBsp.h"
+
+
 
 namespace GtpVisibilityPreprocessor {
@@ -325,4 +327,5 @@
 	/** Writes tree to output stream
 	*/
+	//bool Export(ogzstream &stream);
 	bool Export(ofstream &stream);
 
@@ -691,7 +694,8 @@
 
 	/** Writes the node to disk
-		@note: should be implemented as visitor
+		@note: should be implemented as visitor.
 	*/
 	void ExportNode(BspNode *node, ofstream &stream);
+	//void ExportNode(BspNode *node, ogzstream &stream);
 
 	/** Returns estimated memory usage of tree.
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp	(revision 938)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp	(revision 955)
@@ -13,5 +13,8 @@
 #include <stack>
 
+
+
 namespace GtpVisibilityPreprocessor {
+
 
 
@@ -1944,4 +1947,5 @@
 
 bool ViewCellsTree::Export(ofstream &stream, const bool exportPvs)
+//bool ViewCellsTree::Export(ogzstream &stream, const bool exportPvs)
 {
 	// export recursivly all view cells from the root
@@ -1980,4 +1984,5 @@
 
 
+//void ViewCellsTree::ExportPvs(ViewCell *viewCell, ogzstream &stream)
 void ViewCellsTree::ExportPvs(ViewCell *viewCell, ofstream &stream)
 {
@@ -1992,4 +1997,5 @@
 
 void ViewCellsTree::ExportViewCell(ViewCell *viewCell, ofstream &stream, const bool exportPvs)
+//void ViewCellsTree::ExportViewCell(ViewCell *viewCell, ogzstream &stream, const bool exportPvs)
 {
 	if (viewCell->IsLeaf())
@@ -2003,6 +2009,8 @@
 		//-- export pvs
 		if (exportPvs)
+		{
 			ExportPvs(viewCell, stream);
-	
+		}
+
 		stream << "\" />" << endl;
 		//stream << " </Leaf>" << endl;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 944)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 955)
@@ -465,5 +465,5 @@
 	/** Exports bounding boxes as xml stream
 	*/
-	bool ExportBoundingBoxes(ofstream &xmlstream, const ObjectContainer &objects) const;
+	//bool ExportBoundingBoxes(ofstream &xmlstream, const ObjectContainer &objects) const;
 
 	/** Intersects box with the tree and returns the number of intersected boxes.
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp	(revision 882)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp	(revision 955)
@@ -3846,4 +3846,5 @@
 
 bool VspBspTree::Export(ofstream &stream)
+//bool VspBspTree::Export(ogzstream &stream)
 {
 	ExportNode(mRoot, stream);
@@ -3854,4 +3855,5 @@
 
 void VspBspTree::ExportNode(BspNode *node, ofstream &stream)
+//void VspBspTree::ExportNode(BspNode *node, ogzstream &stream)
 {
 	if (node->IsLeaf())
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h	(revision 938)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h	(revision 955)
@@ -7,5 +7,8 @@
 #include "Statistics.h"
 #include "Material.h"
-//namespace GtpVisibilityPreprocessor {
+//#include "bzip2stream.hpp"
+#include "gzstream.h"
+
+//class ogzstream;
 
 namespace GtpVisibilityPreprocessor {
@@ -25,4 +28,5 @@
 class Environment;
 
+
 /** Statistics for a view cell partition.
 */
@@ -436,5 +440,6 @@
 	/** Exports view cells to file.
 	*/
-    bool Export(ofstream &stream, const bool exportPvs = false);
+	bool Export(ofstream &stream, const bool exportPvs = false);
+    //bool Export(ogzstream &stream, const bool exportPvs = false);
 
 	/** Export statistics of this view cell tree.
@@ -541,8 +546,10 @@
 	*/
 	void ExportViewCell(ViewCell *viewCell, ofstream &stream, const bool exportPvs);
+	//void ExportViewCell(ViewCell *viewCell, ogzstream &stream, const bool exportPvs);
 
 	/** Exports pvs of a view cell.
 	*/
 	void ExportPvs(ViewCell *viewCell, ofstream &stream);
+	//void ExportPvs(ViewCell *viewCell, ogzstream &stream);
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h	(revision 938)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h	(revision 955)
@@ -8,4 +8,5 @@
 #include "Mesh.h"
 #include "BoundingBoxConverter.h"
+//#include "gzstream.h"
 
 namespace GtpVisibilityPreprocessor {
@@ -179,5 +180,4 @@
   return target;
 }
-
 }
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 944)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 955)
@@ -755,4 +755,5 @@
 	const unsigned long startMillis = XMLPlatformUtils::getCurrentMillis();
 	parser->parse(filename.c_str());
+	//ogzstream stream; parser->parse(stream);
 	const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis();
 	duration = endMillis - startMillis;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 944)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 955)
@@ -18,4 +18,6 @@
 
 
+
+
 namespace GtpVisibilityPreprocessor {
 
@@ -508,8 +510,8 @@
 	PostProcess(preprocessor->mObjects, postProcessSamples);
 
-	cout << "time needed for  post processing (merge) step: "
+	cout << "time needed for post processing (merge) step: "
 		 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl;
 
-	Debug << "time needed for  post processing (merge) step: "
+	Debug << "time needed for post processing (merge) step: "
 		 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl;
 
@@ -2037,29 +2039,4 @@
 
 
-bool ViewCellsManager::ExportBoundingBoxes(ofstream &xmlstream, 
-										   const ObjectContainer &objects) const
-{
-	//-- export the view cells and the pvs
-	xmlstream << "<BoundingBoxes>" << endl;
-
-	ObjectContainer::const_iterator oit, oit_end = objects.end();
-
-	for (oit = objects.begin(); oit != oit_end; ++ oit)
-	{
-			MeshInstance *mi = dynamic_cast<MeshInstance *>(*oit);
-			const AxisAlignedBox3 box = mi->GetBox();
-
-			//-- the bounding boxes
-			xmlstream << "<BoundingBox" << " id=\"" << mi->GetId() << "\""
-				      << " min=\"" << box.Min().x << " " << box.Min().y << " " << box.Min().z << "\""
-					  << " max=\"" << box.Max().x << " " << box.Max().y << " " << box.Max().z << "\" />" << endl;
-	}
-
-	xmlstream << "</BoundingBoxes>" << endl;
-
-	return true;
-}
-
-
 /**********************************************************************/
 /*                 BspViewCellsManager implementation                 */
@@ -2772,4 +2749,5 @@
 bool BspViewCellsManager::ExportViewCells(const string filename, const bool exportPvs, const ObjectContainer &objects)
 {
+#if STILL_HAS_TODO
 	cout << "exporting view cells to xml ... ";
 	std::ofstream stream;
@@ -2809,5 +2787,5 @@
 
 	cout << "finished" << endl;
-
+#endif
 	return true;
 }
@@ -4773,10 +4751,11 @@
 {
 	cout << "exporting view cells to xml ... ";
-	std::ofstream stream;
+	
+	//ogzstream stream(filename.c_str());
+	std::ofstream stream(filename.c_str());
 
 	// for output we need unique ids for each view cell
 	CreateUniqueViewCellIds();
 
-	stream.open(filename.c_str());
 	stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"<<endl;
 	stream << "<Visibility_Solution>" << endl;
@@ -4787,13 +4766,28 @@
 		   << " max=\"" << mViewSpaceBox.Max().x << " " << mViewSpaceBox.Max().y << " " << mViewSpaceBox.Max().z << "\" />" << endl;
 
-	ExportBoundingBoxes(stream, objects);
-
-	//-- the type of the view cells hierarchy
-	stream << "<Hierarchy name=\"vspBspTree\" />" << endl;
+	
+	//-- export bounding boxes
+	stream << "<BoundingBoxes>" << endl;
+
+	ObjectContainer::const_iterator oit, oit_end = objects.end();
+
+	for (oit = objects.begin(); oit != oit_end; ++ oit)
+	{
+			MeshInstance *mi = dynamic_cast<MeshInstance *>(*oit);
+			const AxisAlignedBox3 box = mi->GetBox();
+
+			//-- the bounding boxes
+			stream << "<BoundingBox" << " id=\"" << mi->GetId() << "\""
+				   << " min=\"" << box.Min().x << " " << box.Min().y << " " << box.Min().z << "\""
+				   << " max=\"" << box.Max().x << " " << box.Max().y << " " << box.Max().z << "\" />" << endl;
+	}
+
+	stream << "</BoundingBoxes>" << endl;
+
 
 	//-- export the view cells and the pvs
 	const int numViewCells = mCurrentViewCellsStats.viewCells;
 
-	stream << "<ViewCells number=\"" << numViewCells << "\" />" << endl;
+	stream << "<ViewCells number=\"" << numViewCells << "\" >" << endl;
 	
 	mViewCellsTree->Export(stream, exportPvs);
@@ -4803,5 +4797,7 @@
 
 	//-- export the spatial hierarchy
-	stream << "<Hierarchy>" << endl;
+	
+	// the type of the view cells hierarchy
+	stream << "<Hierarchy name=\"vspBspTree\" />" << endl;
 	mVspBspTree->Export(stream);
 	stream << endl << "</Hierarchy>" << endl;
@@ -4810,6 +4806,7 @@
 
 	stream << "</Visibility_Solution>" << endl;
+
+
 	stream.close();
-
 	cout << "finished" << endl;
 
