track labels
[mussa.git] / qui / PathWindow.cpp
index 7ffbadc5023dfa5546ec3f69d183b86bcfb80b3b..5a1dc5389234301b1f7559d6bb540b9d34cd0811 100644 (file)
@@ -43,16 +43,16 @@ PathWindow::PathWindow(Mussa *analysis_, QWidget *parent) :
   zoomBox.setRange(2,1000);
   mussaViewTB.addWidget(&zoomBox);
   connect(&zoomBox, SIGNAL(valueChanged(int)), 
-          &path_view.scene, SLOT(setZoom(int)));
+          &path_view.scene(), SLOT(setZoom(int)));
   
   threshold.setRange(19, 30);
   threshold.setThreshold(19);
   //scene->setClipPlane(20);
   // FIXME: for when we get the paths drawn at the appropriate depth
-  //connect(threshold, SIGNAL(thresholdChanged(int)),
-  //        scene, SLOT(setClipPlane(int)));
   //connect(&threshold, SIGNAL(thresholdChanged(int)),
-  //        &scene, SLOT(setSoftThreshold(int)));
+  //        this, SLOT(setClipPlane(int)));
+  connect(&threshold, SIGNAL(thresholdChanged(int)),
+          this, SLOT(setSoftThreshold(int)));
   mussaViewTB.addWidget(&threshold);
 
   addToolBar(&mussaViewTB);
@@ -264,7 +264,7 @@ void PathWindow::loadSavedAnalysis()
 
 void PathWindow::setSoftThreshold(int threshold)
 {
-  if (analysis->get_threshold() != threshold) {
+  if (analysis->get_soft_thres() != threshold) {
     analysis->set_soft_thres(threshold);
     analysis->nway();
     updateLinks();
@@ -293,9 +293,9 @@ void PathWindow::NotImplementedBox()
 void PathWindow::promptSaveOpenGlPixmap()
 {
   QSize size;
-  size = path_view.scene.size();
+  size = path_view.scene().size();
   //Image Save Dialog
-  ImageSaveDialog imageSaveDialog(&path_view.scene, this);
+  ImageSaveDialog imageSaveDialog(&path_view.scene(), this);
   imageSaveDialog.setSize(size.width(), size.height());
   int result = imageSaveDialog.exec();
   cout << "Result: " << result << "\n";
@@ -304,20 +304,21 @@ void PathWindow::promptSaveOpenGlPixmap()
 void PathWindow::updateAnalysis()
 {
   cout << "analysis updated" << endl;
-  path_view.scene.clear();
+  path_view.scene().clear();
   const vector<Sequence>& seqs = analysis->sequences();
   for(vector<Sequence>::const_iterator seq_i = seqs.begin();
       seq_i != seqs.end();
       ++seq_i)
   {
-    path_view.scene.push_sequence(*seq_i);
+    path_view.scene().push_sequence(*seq_i);
   }
   updateLinks();
+  path_view.updateTracks();
 }
 
 void PathWindow::updateLinks()
 {
-  path_view.scene.clear_links();
+  path_view.scene().clear_links();
   bool reversed = false;
   const NwayPaths& nway = analysis->paths();
 
@@ -354,7 +355,8 @@ void PathWindow::updateLinks()
       normalized_path.push_back(x);
       rc_flags.push_back(reversed);
     }
-    path_view.scene.link(normalized_path, rc_flags, path_itor->window_size);
+    path_view.scene().link(normalized_path, rc_flags, path_itor->window_size);
   }
+  path_view.scene().update();
 }