put the fake lines at a clipable depth
authorDiane Trout <diane@caltech.edu>
Sat, 25 Feb 2006 06:43:48 +0000 (06:43 +0000)
committerDiane Trout <diane@caltech.edu>
Sat, 25 Feb 2006 06:43:48 +0000 (06:43 +0000)
I'm not sure why these precise parameters work, but the slider now
nicely makes my fake lines fade in and out of existence.

mussagl.pro
qui/PathScene.cxx
qui/PathWindow.cxx

index 453719b56da1e85d0eae804e5be17d68641d9e4b..62efcaed1cad6f84cecb1dc3b8aada0025f22e65 100644 (file)
@@ -36,4 +36,6 @@ SOURCES += mussagl.cxx \
 #           test/test_mussa.cxx \
 #           test/test_nway.cxx \
 #           test/test_sequence.cxx 
+
+LIBS += -lm
 QT += opengl
index 1ae8fd0c70deb54d03d4f5ddde2eab9509483964..8e78c61294fade580c3ed51fb51241c995689a2c 100644 (file)
@@ -6,11 +6,12 @@
 #include <iostream>
 
 #include <GL/gl.h>
+#include <math.h>
 
 PathScene::PathScene(int frags, int len, QWidget *parent) : 
   QGLWidget(parent),
   X(0),
-  clipZ(32.0),
+  clipZ(30.0),
   zoom(0),
   maxOrtho2d(-50.0, -50, 3000000.0, 300.0),
   curOrtho2d(maxOrtho2d),
@@ -253,7 +254,7 @@ static void tracks()
 
 static void draw_lines(int fragsize, int length)
 {
-  float depth = 1.0;
+  float depth = 30;
 
   glColor3f(0.3, 0.9, 0.3);
   glLineWidth(0.001);
@@ -271,9 +272,9 @@ static void draw_lines(int fragsize, int length)
       x = (GLfloat)(base_block * fragsize +base_offset);
 
       depth -= 0.1;
-      if (depth < -2.0) depth = 1.0;
+      if (depth < 20.0) depth = 30.0;
 
-      z = (-32.0 - (-32.0 * depth));
+      z = -22.0 - (30-ceil(depth));
 
       //std::cout << "Z: " << z << "\n";
 
index a3a3a0776b881c11fc49cc9962a49973c9b95c3e..c2f2e71a56660f1e78de33ad98e21b9c8f8a0979 100644 (file)
@@ -25,7 +25,9 @@ PathWindow::PathWindow(QWidget *) :
   mussaViewTB->addAction(toggleMotifsAction);
 
   ThresholdWidget *threshold = new ThresholdWidget;
-  connect(threshold, SIGNAL(currentThresholdChanged(int)),
+  threshold->setRange(21, 30);
+  scene->setClipPlane(21);
+  connect(threshold, SIGNAL(thresholdChanged(int)),
           scene, SLOT(setClipPlane(int)));
   mussaViewTB->addWidget(threshold);
   addToolBar(mussaViewTB);