Index: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2613)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2614)
@@ -386,4 +386,5 @@
 	for (dit = mDynamicObjects.begin(); dit != dit_end; ++ dit)
 	{
+		//cerr << "here45\n****"<<endl;
 		RenderIntersectable(*dit);
 	}
@@ -659,4 +660,6 @@
 	int diffy = -(mousePoint.y - y);
 
+	const float t = 1.0f;
+
 	if (e->modifiers() & Qt::ControlModifier) 
 	{
@@ -664,5 +667,44 @@
 		mViewPoint.x += (x-mousePoint.x)*MOVE_SENSITIVITY / 2.0;
 	} 
-	else 
+	else if (e->modifiers() & Qt::AltModifier)
+	{
+		if (mCurrentDynamicObjectIdx >= 0)
+		{
+			Matrix4x4 tm;
+			TransformedMeshInstance *tmi;
+
+			switch (mTrafoType)
+			{
+			case 0:
+				{
+					const Vector3 transl(diffx, 0, diffy);
+					tmi = mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx];
+					tm = TranslationMatrix(transl);
+				}
+				break;
+			case 1:
+				{
+					float scalef = 1.0f + 0.01f * (diffx + diffy);
+					if (scalef < 0.9) scalef = 0.9f;
+					else if (scalef > 1.1f) scalef = 1.1f;
+					tmi = mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx];
+					tm = ScaleMatrix(scalef, scalef, scalef);
+				}
+				break;
+			case 2:
+				{
+					tmi = mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx];
+					tm = RotationXMatrix(diffx) * RotationYMatrix(diffy);
+				}
+				break;
+			default:
+				cerr << "not implemented" << endl;
+			}
+
+			tmi->ApplyWorldTransform(tm);
+			updateGL();
+		}
+	}
+	else
 	{
 		mViewPoint += mViewDirection*((mousePoint.y - y)*MOVE_SENSITIVITY);
@@ -889,8 +931,11 @@
 	mShowWeightedTriangles = false;
 	mShowDistribution = 15;
+	mCurrentDynamicObjectIdx = -1;
 
 	mSpatialFilterSize = 0.01;
 	mPvsSize = 0;
 	mRayVisualizationMethod = 0;
+	mTrafoType = 0;
+
 	mRenderError = 0.0f;
 	mShowRays = false;
@@ -950,7 +995,10 @@
 	connect(mControlWidget, SIGNAL(SetShowDistribution4(bool)), this, SLOT(SetShowDistribution4(bool)));
 
-
 	connect(mControlWidget,	SIGNAL(SetShowRays(bool)), this, SLOT(SetShowRays(bool)));
 
+	connect(mControlWidget, SIGNAL(SetTranslation(bool)), this, SLOT(SetTranslation(bool)));
+	connect(mControlWidget, SIGNAL(SetRotation(bool)), this, SLOT(SetRotation(bool)));
+	connect(mControlWidget, SIGNAL(SetScale(bool)), this, SLOT(SetScale(bool)));
+	
 	// setting the size here
 	resize(800, 600);
@@ -1009,7 +1057,9 @@
 void QtGlRendererWidget::LoadObject()
 {
-	string filename("../data/bunny.bn");
+	string filename("../data/teapot.bn");
 	
 	cout << "Loading model << " << filename << endl;
+
+	++ mCurrentDynamicObjectIdx;
 
 	if (mViewCellsManager->GetPreprocessor()->LoadDynamicGeometry(filename))
@@ -1587,5 +1637,5 @@
 	
 	rb1 = new QRadioButton("random colors", parent);
-	rb1->setText("wireframe");
+	rb1->setText("random");
 	connect(rb1, SIGNAL(toggled(bool)), SIGNAL(SetShowWireFrame(bool)));
 
@@ -1627,4 +1677,38 @@
 
 
+QGroupBox *QtRendererControlWidget::CreateTrafoPanel(QWidget *parent)
+{
+	QRadioButton *rb1, *rb2, *rb3;
+	
+	rb1 = new QRadioButton("translation", parent);
+	rb1->setText("translation");
+	connect(rb1, SIGNAL(toggled(bool)), SIGNAL(SetTranslation(bool)));
+
+	// Create a check box to be in the group box
+	rb2 = new QRadioButton("scale", parent);
+	rb2->setText("scale");
+	//vl->addWidget(rb1);
+	connect(rb2, SIGNAL(toggled(bool)), SIGNAL(SetScale(bool)));
+
+	rb3 = new QRadioButton("rotation", parent);
+	rb3->setText("rotation");
+	connect(rb3, SIGNAL(toggled(bool)), SIGNAL(SetRotation(bool)));
+    
+	QVBoxLayout *vbox2 = new QVBoxLayout;
+	QGroupBox *groupBox = new QGroupBox("Trafo types");
+
+	vbox2->addWidget(rb1);
+	vbox2->addWidget(rb2);
+	vbox2->addWidget(rb3);
+	
+	rb1->setChecked(true);
+
+	vbox2->addStretch(1);
+	groupBox->setLayout(vbox2);
+
+	return groupBox;
+}
+
+
 
 QGroupBox *QtRendererControlWidget::CreateRenderCostPanel(QWidget *parent)
@@ -1646,5 +1730,4 @@
 
 	QGroupBox *groupBox = new QGroupBox("Render cost options");
-
 	QVBoxLayout *vbox2 = new QVBoxLayout;
     
@@ -1857,4 +1940,7 @@
 	QGroupBox *groupBox3 = CreateRayVisualizationPanel(hbox);
 	vh->addWidget(groupBox3, 0, 0);
+
+	QGroupBox *groupBox4 = CreateTrafoPanel(hbox);
+	vh->addWidget(groupBox4, 0, 0);
 
 	//////////////////////////////////
@@ -2032,4 +2118,5 @@
 	cb->setChecked(false);
 	connect(cb, SIGNAL(toggled(bool)), SIGNAL(StoreStatistics()));*/
+
 	if (0) 
 	{
Index: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.h	(revision 2567)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.h	(revision 2614)
@@ -58,5 +58,4 @@
 	float scale;
 	QPoint lastPos;
-
 };
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h	(revision 2609)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h	(revision 2614)
@@ -91,4 +91,5 @@
 
   QGroupBox *CreateVisualizationPanel(QWidget *parent);
+  QGroupBox *CreateTrafoPanel(QWidget *parent);
 
   public slots:
@@ -156,4 +157,8 @@
   void SetShowDistribution3(bool);
   void SetShowDistribution4(bool);
+
+  void SetTranslation(bool);
+  void SetRotation(bool);
+  void SetScale(bool);
 };
 
@@ -204,4 +209,6 @@
 	int mShowDistribution;
 
+	int mCurrentDynamicObjectIdx;
+
 	// some statistics
 	int mPvsSize;
@@ -214,4 +221,5 @@
 
 	int mRayVisualizationMethod;
+	int mTrafoType;
 
 	QtRendererControlWidget *mControlWidget;
@@ -267,7 +275,4 @@
 	virtual int GetHeight() const { return height(); }
 
-	// virtual void
-	//  SetupProjection(const int w, const int h, const float angle = 70.0f);
-
 	virtual void
 		SetupCameraProjection(const int w, const int h, const float angle = 70.0f);
@@ -479,5 +484,20 @@
 		mRayVisualizationMethod = 3;
 	}
-	
+
+	void SetTranslation(bool b)
+	{
+		mTrafoType = 0;
+	}
+
+	void SetScale(bool b)
+	{
+		mTrafoType = 1;
+	}
+	
+	void SetRotation(bool b)
+	{
+		mTrafoType = 2;
+	}
+
 	void SetShowDistribution1(bool b)
 	{
Index: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp	(revision 2609)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp	(revision 2614)
@@ -242,15 +242,16 @@
 QtGlViewer::mouseMoveEvent(QMouseEvent *event)
 {
-  int dx = event->x() - lastPos.x();
-  int dy = event->y() - lastPos.y();  
-  
-  if (event->modifiers() & Qt::CTRL)
-		{
-			scale = scale*(1.0f - dy/(float)height());
-			if (scale < 0.01f)
-				scale = 0.01f;
-			updateGL();
-		}
-  else {
+	int dx = event->x() - lastPos.x();
+	int dy = event->y() - lastPos.y();  
+
+	if (event->modifiers() & Qt::CTRL)
+	{
+		scale = scale*(1.0f - dy/(float)height());
+		if (scale < 0.01f)
+			scale = 0.01f;
+		updateGL();
+	}
+	else
+	{
 		float W = width();
 		float H = height();
@@ -259,26 +260,26 @@
 		int y = event->y();
 		int lastY = lastPos.y();
-	
+
 		float quat[4];
 		trackball(quat,
-				  (2.0 * lastX - W) / W,
-				  (H - 2.0 * lastY) / H,
-				  (2.0 * x - W) / W,
-				  (H - 2.0 * y) / H
-				  );
+			(2.0 * lastX - W) / W,
+			(H - 2.0 * lastY) / H,
+			(2.0 * x - W) / W,
+			(H - 2.0 * y) / H
+			);
 
 		add_quats(quat, manipulatorLastQuat, manipulatorLastQuat);
-  }
-  
-  lastPos = event->pos();
-  updateGL();
-}
-
-void QtGlViewer::timerEvent(QTimerEvent *event) 
-{
-	update();
-}
-
-
-}
-
+	}
+
+	lastPos = event->pos();
+	updateGL();
+}
+
+	void QtGlViewer::timerEvent(QTimerEvent *event) 
+	{
+		update();
+	}
+
+
+}
+
