Wheel flying, different color for wireframe, center scene only for the first model
authorDmitriy Morozov <morozov@cs.duke.edu>
Mon, 19 Jun 2006 09:00:02 -0400
changeset 5 4928fc0f292d
parent 4 f79ae6818a11
child 6 8752e612ec07
child 7 8871c5317b90
Wheel flying, different color for wireframe, center scene only for the first model
VEFViewer.cpp
--- a/VEFViewer.cpp	Tue Jun 13 13:53:04 2006 -0400
+++ b/VEFViewer.cpp	Mon Jun 19 09:00:02 2006 -0400
@@ -10,6 +10,7 @@
 void VEFViewer::init()
 {
 	setBackgroundColor(QColor(0xAA, 0xAA, 0xAA));
+	setWheelBinding(Qt::AltModifier, CAMERA, MOVE_FORWARD);
 
 	// Lights
 	glEnable(GL_LIGHTING);
@@ -51,8 +52,12 @@
 	
 	setSceneBoundingBox(min, max);
 	setSceneCenter(center);
-	camera()->centerScene();
-	camera()->showEntireScene();
+
+	if (modelList->count() == 1)
+	{
+		camera()->centerScene();
+		camera()->showEntireScene();
+	}
 
 	std::cout << "Min: " << min << std::endl;
 	std::cout << "Max: " << max << std::endl;
@@ -282,11 +287,16 @@
 	}
 	
 	// Draw the object
-	glColor3f(0., .4, .6);
 	if (!isWireframe())	
+    {
+	    glColor3f(0., .4, .6);
 		glCallList(display_list);
+    }
 	else
+    {
+	    glColor3f(1., 0, 0);
 		glCallList(wireframe_display_list);
+    }
 }
 
 void QFacesLWI::drawWithNames(int offset) const