Index: /GTP/trunk/Lib/Vis/Preprocessing/src/IntelRayCaster.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/IntelRayCaster.h	(revision 2623)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/IntelRayCaster.h	(revision 2678)
@@ -83,7 +83,7 @@
 						  const bool pruneInvalidRays = true);
 
-  virtual void AddDynamicObjecs(const ObjectContainer &objects, const Matrix4x4 &m) {};
-  virtual void UpdateDynamicObjects(const Matrix4x4 &m) {};
-  virtual void DeleteDynamicObjects() {};
+	virtual void AddDynamicObjecs(const ObjectContainer &objects, const Matrix4x4 &m) {DYN_ERROR_STRING;}
+	virtual void UpdateDynamicObjects(const Matrix4x4 &m) {DYN_ERROR_STRING;}
+	virtual void DeleteDynamicObjects() {DYN_ERROR_STRING;}
 
 protected:
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/InternalRayCaster.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/InternalRayCaster.h	(revision 2623)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/InternalRayCaster.h	(revision 2678)
@@ -58,7 +58,7 @@
 		);
 
-  virtual void AddDynamicObjecs(const ObjectContainer &objects, const Matrix4x4 &m) {};
-  virtual void UpdateDynamicObjects(const Matrix4x4 &m) {};
-  virtual void DeleteDynamicObjects() {};
+  virtual void AddDynamicObjecs(const ObjectContainer &objects, const Matrix4x4 &m) { DYN_ERROR_STRING; };
+  virtual void UpdateDynamicObjects(const Matrix4x4 &m) { DYN_ERROR_STRING;};
+  virtual void DeleteDynamicObjects() {DYN_ERROR_STRING;};
 
 protected:
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h	(revision 2643)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h	(revision 2678)
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2660)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2678)
@@ -1244,66 +1244,6 @@
 			pruneInvalidRays);
 
-		//#if DYNAMIC_OBJECTS_HACK
 		// disabled not neccessary
 		UpdateDynamicObjects();
-#if 0
-		static Ray hRay;
-		VssRayContainer::iterator vit, vit_end = vssRays.end();
-
-		for (vit = vssRays.begin(); vit != vit_end; ++ vit)
-		{
-			VssRay *vssRay = *vit;
-
-			DynamicObjectsContainer::const_iterator tit, tit_end = mDynamicObjects.end();
-			bool foundIntersect = false;
-
-#if USE_TRANSFORMED_MESH_INSTANCE_HACK
-			hRay.Init(*vssRay);
-
-			for (tit = mDynamicObjects.begin(); tit != tit_end; ++ tit)
-			{
-				TransformedMeshInstance *tmi = *tit;
-
-				float maxT, minT;
-				
-				// test with bounding box
-				if (tmi->GetBox().GetMinMaxT(hRay, &minT, &maxT))
-				{
-					if (tmi->CastRay(hRay)) //cout << "z"; else cout<< "r";
-					{
-						//cout << "i: " << Intersectable::GetTypeName(hRay.intersections[0].mObject);
-						foundIntersect = true;
-					}
-				}
-			}
-
-			if (foundIntersect)
-			{
-				++ numTransformed;
-				// write new results back into vssRay
-				vssRay->Init(hRay);
-			}
-
-			hRay.intersections.clear();
-#else
-
-			////////////
-			// TODO Vlastimil
-			
-			for (tit = mDynamicObjects.begin(); tit != tit_end; ++ tit)	
-			{
-				// remove vss ray termination triangle with container object
-				if (foundIntersect)
-				{
-					vssRay->mTerminationObject = (*tit)->GetIntersectable();
-				}
-			}
-
-	
-#endif
-
-
-		}
-#endif
 	}
 
@@ -1746,26 +1686,29 @@
 	bool parsed = false;
 
-	if (strstr(filename.c_str(), ".obj")) {
-	  cout<<"parsing obj file.."<<endl;
-	  ObjParser *p = new ObjParser;
-	  parsed = p->ParseFile(filename, 
-							leaf,
-							false);
-	  leaf->UpdateBox();
-	  cout<<leaf->GetBox();
-
-	  float s = 10.0f;
-	  leaf->ApplyTransform(ScaleMatrix(s, s, s));
-	  leaf->ApplyTransform(TranslationMatrix(Vector3(0, 10, 0)));
-
-	  
-	} else {
-	  cout<<"parsing binary obj file.."<<endl;
-
-	  parsed = LoadBinaryObj(filename, leaf, NULL, 100);
-	}
-	
+	if (strstr(filename.c_str(), ".obj"))
+	{
+		cout<<"parsing obj file.."<<endl;
+		ObjParser *p = new ObjParser;
+		parsed = p->ParseFile(filename, 
+			leaf,
+			false);
+		leaf->UpdateBox();
+		cout<<leaf->GetBox();
+
+		float s = 10.0f;
+		leaf->ApplyTransform(ScaleMatrix(s, s, s));
+		leaf->ApplyTransform(TranslationMatrix(Vector3(0, 10, 0)));
+
+
+	} 
+	else 
+	{
+		cout<<"parsing binary obj file ... " << endl;
+
+		parsed = LoadBinaryObj(filename, leaf, NULL, 100);
+	}
+
 	if (parsed)
-	  {
+	{
 		cout<<"success."<<endl;
 		leaf->UpdateBox();
@@ -1774,15 +1717,16 @@
 		//leaf->RebuildKtbTree();
 		mSceneGraph->GetRoot()->mChildren.push_back(leaf);
-		
+
 		if (mRayCaster)
-		  mRayCaster->AddDynamicObjecs(leaf->mGeometry, leaf->GetTransformation());
-		
-	  
+			mRayCaster->AddDynamicObjecs(leaf->mGeometry, leaf->GetTransformation());
+
+
 		return true;
-	  } else
-		{
-		  cout<<"failed."<<endl;
-
-		}
+	} 
+	else
+	{
+		cout<<"failed."<<endl;
+
+	}
 
 #endif
@@ -1792,63 +1736,71 @@
 
 
-void
-Preprocessor::ObjectMoved(SceneGraphLeaf *object)
-{
-  // first invalidate all PVS from which this object is visible
-  ViewCellContainer::const_iterator vit, vit_end = mViewCellsManager->GetViewCells().end();
-  
-  AxisAlignedBox3 box = object->GetBox();
-
-  ObjectContainer objects;
-
-  if (0) {
-	// simplified computation taking only the objects intersecting the box
-	KdNode::NewMail();
-	
-	// first mail all kDObjects which are intersected by the object
-	preprocessor->mKdTree->CollectKdObjects(box,
-											objects);
-	
-  } else {
-	ViewCellContainer viewCells;
-	mViewCellsManager->ComputeBoxIntersections(box, viewCells);
-	
-	ViewCellContainer::const_iterator it = viewCells.begin(), it_end = viewCells.end();
-	
-	ObjectPvs pvs;
-	
-	for (int i=0; it != it_end; ++ it, ++ i) {
-	  //cout<<"v"<<i<<" pvs="<<(*it)->GetPvs().mEntries.size()<<endl;
-	  pvs.MergeInPlace((*it)->GetPvs());
-	}
-
-	ObjectPvsIterator pit = pvs.GetIterator();
-	while (pit.HasMoreEntries())  {		
-	  PvsData pvsData;
-	  Intersectable *object = pit.Next(pvsData);
-	  objects.push_back(object);
-	}
-  }
-  
-  int pvsCounter = 0;
-  // now search for pvss which contained any mailed node
-  for (vit = mViewCellsManager->GetViewCells().begin(); vit != vit_end; ++ vit) {
-	ObjectPvs &pvs = (*vit)->GetPvs();
-	for (int i=0; i < objects.size(); i++) {
-	  vector<PvsEntry<Intersectable *,PvsData> >::iterator v;
-	  //	  ObjectPvsIterator it;
-	  if (pvs.Find(objects[i], v)) {
-		// clear the pvs
-		pvs.Clear();
-		pvsCounter++;
-		break;
-	  }
-	}
-  }
-
-  cout<<"Number of affected objects "<<objects.size()<<endl;
-  cout<<"Cleared "<<pvsCounter<<" PVSs ("<<mViewCellsManager->GetViewCells().size()/
-	(float)pvsCounter*100.0f<<"%) "<<endl;
-  
+void Preprocessor::ObjectMoved(SceneGraphLeaf *object)
+{
+	// first invalidate all PVS from which this object is visible
+	ViewCellContainer::const_iterator vit, vit_end = mViewCellsManager->GetViewCells().end();
+
+	AxisAlignedBox3 box = object->GetBox();
+
+	ObjectContainer objects;
+
+	if (0) 
+	{
+		// simplified computation taking only the objects intersecting the box
+		KdNode::NewMail();
+
+		// first mail all kDObjects which are intersected by the object
+		preprocessor->mKdTree->CollectKdObjects(box, objects);
+
+	} 
+	else 
+	{
+		ViewCellContainer viewCells;
+		mViewCellsManager->ComputeBoxIntersections(box, viewCells);
+
+		// add object to all viewcells that intersect the bounding box
+		ObjectPvs pvs;
+
+		ViewCellContainer::const_iterator it = viewCells.begin(), it_end = viewCells.end();
+
+		for (int i = 0; it != it_end; ++ it, ++ i) 
+		{
+			//cout<<"v"<<i<<" pvs="<<(*it)->GetPvs().mEntries.size()<<endl;
+			pvs.MergeInPlace((*it)->GetPvs());
+		}
+
+		ObjectPvsIterator pit = pvs.GetIterator();
+		while (pit.HasMoreEntries())  
+		{		
+			PvsData pvsData;
+			Intersectable *object = pit.Next(pvsData);
+			objects.push_back(object);
+		}
+	}
+
+	int pvsCounter = 0;
+
+	// now search for pvss which contained any mailed node
+	for (vit = mViewCellsManager->GetViewCells().begin(); vit != vit_end; ++ vit) 
+	{
+		ObjectPvs &pvs = (*vit)->GetPvs();
+
+		for (int i=0; i < objects.size(); i++) 
+		{
+			vector<PvsEntry<Intersectable *,PvsData> >::iterator v;
+		
+			if (pvs.Find(objects[i], v)) {
+				// clear the pvs
+				pvs.Clear();
+				pvsCounter++;
+				break;
+			}
+		}
+	}
+
+	cout<<"Number of affected objects "<<objects.size()<<endl;
+	cout<<"Cleared "<<pvsCounter<<" PVSs ("<<mViewCellsManager->GetViewCells().size()/
+		(float)pvsCounter*100.0f<<"%) "<<endl;
+
 }
 
@@ -1858,5 +1810,5 @@
 	if (mUpdateDynamicObjects) 
 	{
-	  
+		// delete ALL dynamic stuff and rebuild using the new trafos
 		preprocessor->mRayCaster->DeleteDynamicObjects();
 	
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2677)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2678)
@@ -497,9 +497,5 @@
 	for (dit = mDynamicObjects.begin(); dit != dit_end; ++ dit)
 	{
-#if USE_TRANSFORMED_MESH_INSTANCE_HACK
-		RenderIntersectable(*dit);
-#else
 		_RenderDynamicObject(*dit);
-#endif
 	}
 #endif
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h	(revision 2677)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h	(revision 2678)
@@ -236,7 +236,9 @@
 
 	bool mUseRandomColorPerPvsObject;
+
 #if DYNAMIC_OBJECTS_HACK
 	DynamicObjectsContainer mDynamicObjects;
 #endif
+
 	QtGlRendererWidget(SceneGraph *sceneGraph,
 		               ViewCellsManager *viewcells,
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 2645)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 2678)
@@ -220,4 +220,5 @@
 	/// the view cells manager
 	ViewCellsManager *mViewCellsManager;
+
 #if DYNAMIC_OBJECTS_HACK
 	DynamicObjectsContainer mDynamicObjects;
@@ -295,4 +296,6 @@
 	virtual void EvalViewCellHistogram();
 
+	/** Notify the preprocessor that an object has moved and must be reevaluated.
+	*/
 	virtual void ObjectMoved(SceneGraphLeaf *object);
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Containers.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Containers.h	(revision 2615)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Containers.h	(revision 2678)
@@ -76,9 +76,6 @@
 /// a container for dynamic objects
 
-#if USE_TRANSFORMED_MESH_INSTANCE_HACK
-typedef std::vector<TransformedMeshInstance *> DynamicObjectsContainer;
-#else
 typedef vector<SceneGraphLeaf *> DynamicObjectsContainer;
-#endif
+
 
 }
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2660)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2678)
@@ -368,15 +368,10 @@
 												  const bool isTermination) const
 {
+	// dynamic objects are scene graph leaves
 #if DYNAMIC_OBJECTS_HACK
-
-#if USE_TRANSFORMED_MESH_INSTANCE_HACK
-	if (ray.mTerminationObject->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE)
-		return ray.mTerminationObject;
-#else
 	if (ray.mTerminationObject->Type() == Intersectable::SCENEGRAPHLEAF_INTERSECTABLE)
 		return ray.mTerminationObject;
 #endif
 
-#endif
 	if (mUseKdPvs)
 	{
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2677)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2678)
@@ -522,9 +522,10 @@
 	glPopMatrix();
 
-#if 1
-	// test the box of the object
-	AxisAlignedBox3 box = leaf->GetBox();
-	RenderBox(box);
-#endif
+	if (1)
+	{
+		// test the box of the object
+		AxisAlignedBox3 box = leaf->GetBox();
+		RenderBox(box);
+	}
 }
 
@@ -567,30 +568,9 @@
 	for (dit = p->mDynamicObjects.begin(); dit != dit_end; ++ dit)
 	{
-#if USE_TRANSFORMED_MESH_INSTANCE_HACK
-		RenderIntersectable(*dit);
-#else
 		_RenderDynamicObject(*dit);
+	}
 #endif
-	}
-#endif
-
-#if 1
 	_RenderSceneTrianglesWithDrawArrays();
 
-#else
-	static int glList = -1;
-	if (mUseGlLists) {
-		if (glList == -1) {
-			glList = glGenLists(1);
-			glNewList(glList, GL_COMPILE);
-			_RenderSceneTriangles();
-			glEndList();
-		}
-
-		glCallList(glList);
-	} else
-		_RenderSceneTriangles();
-
-#endif
 	return true;
 }
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/common.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/common.h	(revision 2655)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/common.h	(revision 2678)
@@ -24,6 +24,6 @@
 
 #define DYNAMIC_OBJECTS_HACK 1
-#define USE_TRANSFORMED_MESH_INSTANCE_HACK 0
-//#define USE_HAVRAN_RAYCASTER 0
+#define USE_HAVRAN_RAYCASTER 0
+
 
 namespace GtpVisibilityPreprocessor {
@@ -532,4 +532,6 @@
 #endif
 
+#define DYN_ERROR_STRING do {std::cout << "error: dynamic objects not supported" << endl;} while (0)
+
 /** view cell id belonging to empty view space.
 */
@@ -545,4 +547,2 @@
 
 
-
-
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Matrix4x4.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Matrix4x4.cpp	(revision 1980)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Matrix4x4.cpp	(revision 2678)
@@ -137,9 +137,9 @@
     indxr[i] = irow;
     indxc[i] = icol;
-    if (x[icol][icol] == 0.0)
+    if (x[icol][icol] == 0.0f)
       return 1; /* singular matrix */
 
-    pivinv = 1.0 / x[icol][icol];
-    x[icol][icol] = 1.0 ;
+    pivinv = 1.0f / x[icol][icol];
+    x[icol][icol] = 1.0f ;
     for ( l = 0 ; l<n ; l++)
       x[l][icol] = x[l][icol] * pivinv ;
@@ -149,5 +149,5 @@
       {
         dum = x[icol][ll];
-	x[icol][ll] = 0.0;
+	x[icol][ll] = 0.0f;
         for ( l = 0 ; l<n ; l++)
 	  x[l][ll] = x[l][ll] - x[l][icol] * dum ;
@@ -208,5 +208,5 @@
   for (int i = 0; i < 4; i++)
     for (int j = 0; j < 4; j++)
-      M.x[i][j] = (i == j) ? 1.0 : 0.0;
+      M.x[i][j] = (i == j) ? 1.0f : 0.0f;
   return M;
 }
@@ -321,5 +321,5 @@
   double one_minus_cosine = 1 - cosine;
 
-  M.x[0][0] = axis.x * axis.x + (1.0 - axis.x * axis.x) * cosine;
+  M.x[0][0] = axis.x * axis.x + (1.0f - axis.x * axis.x) * cosine;
   M.x[0][1] = axis.x * axis.y * one_minus_cosine + axis.z * sine;
   M.x[0][2] = axis.x * axis.z * one_minus_cosine - axis.y * sine;
@@ -327,5 +327,5 @@
 
   M.x[1][0] = axis.x * axis.y * one_minus_cosine - axis.z * sine;
-  M.x[1][1] = axis.y * axis.y + (1.0 - axis.y * axis.y) * cosine;
+  M.x[1][1] = axis.y * axis.y + (1.0f - axis.y * axis.y) * cosine;
   M.x[1][2] = axis.y * axis.z * one_minus_cosine + axis.x * sine;
   M.x[1][3] = 0;
@@ -333,5 +333,5 @@
   M.x[2][0] = axis.x * axis.z * one_minus_cosine + axis.y * sine;
   M.x[2][1] = axis.y * axis.z * one_minus_cosine - axis.x * sine;
-  M.x[2][2] = axis.z * axis.z + (1.0 - axis.z * axis.z) * cosine;
+  M.x[2][2] = axis.z * axis.z + (1.0f - axis.z * axis.z) * cosine;
   M.x[2][3] = 0;
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Camera.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Camera.cpp	(revision 2635)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Camera.cpp	(revision 2678)
@@ -21,5 +21,4 @@
 
 #ifdef USE_HAVRAN_RAYCASTER
-//#include "timer.h"
 #include "raypack.h"
 #endif
