Logo Search packages:      
Sourcecode: caret version File versions  Download package

void GuiDisplayControlDialog::updateRegionItems (  ) 

update region items

update region items.

Definition at line 8420 of file GuiDisplayControlDialog.cxx.

References FileUtilities::basename(), WustlRegionFile::TimeCourse::getAllRegionCaseNames(), DisplaySettingsWustlRegion::getGraphMode(), WustlRegionFile::getNumberOfTimeCourses(), DisplaySettingsWustlRegion::getPopupGraphEnabled(), DisplaySettingsWustlRegion::getSelectedCaseName(), DisplaySettingsWustlRegion::getSelectedPaintVolume(), DisplaySettingsWustlRegion::getSelectedTimeCourse(), WustlRegionFile::getTimeCourse(), DisplaySettingsWustlRegion::getTimeCourseSelection(), DisplaySettingsWustlRegion::getUserScale(), pageRegionMain, regionAllTimeCoursesCheckBox, regionCaseComboBox, regionGraphAutoScaleRadioButton, regionGraphUserScaleMaxLineEdit, regionGraphUserScaleMinLineEdit, regionGraphUserScaleRadioButton, regionPaintVolumeComboBox, regionPopupGraphCheckBox, regionSingleTimeCourseCheckBox, regionTimeCourseComboBox, DisplaySettingsWustlRegion::setSelectedCaseName(), updatePageSelectionComboBox(), and validRegionData.

Referenced by GuiMainWindow::fileModificationUpdate(), showDisplayControlPage(), and updateAllItemsInDialog().

{
   updatePageSelectionComboBox();

   if (pageRegionMain == NULL) {
      return;
   }
   
   DisplaySettingsWustlRegion* dswr = theMainWindow->getBrainSet()->getDisplaySettingsWustlRegion();
   const WustlRegionFile* wrf = theMainWindow->getBrainSet()->getWustlRegionFile();
   
   switch (dswr->getTimeCourseSelection()) {
      case DisplaySettingsWustlRegion::TIME_COURSE_SELECTION_ALL:
         regionAllTimeCoursesCheckBox->setChecked(true);
         break;
      case DisplaySettingsWustlRegion::TIME_COURSE_SELECTION_SINGLE:
         regionSingleTimeCourseCheckBox->setChecked(true);
         break;
   }
   
   const int numTimeCourses = wrf->getNumberOfTimeCourses();
   const int numPaintVolumes = theMainWindow->getBrainSet()->getNumberOfVolumePaintFiles();
   bool valid = (numTimeCourses > 0) && (numPaintVolumes > 0);
   
   pageRegionMain->setEnabled(validRegionData);
   
   if (valid) {
      regionTimeCourseComboBox->clear();
      for (int i = 0; i < numTimeCourses; i++) {
         regionTimeCourseComboBox->addItem(wrf->getTimeCourse(i)->getName());
      }
      regionTimeCourseComboBox->setCurrentIndex(dswr->getSelectedTimeCourse());
      
      int item = -1;
      regionCaseComboBox->clear();
      const int selectedTimeCourse = dswr->getSelectedTimeCourse();
      if ((selectedTimeCourse >= 0) &&
          (selectedTimeCourse < wrf->getNumberOfTimeCourses())) {
         const WustlRegionFile::TimeCourse* tc = wrf->getTimeCourse(selectedTimeCourse);
         std::vector<QString> caseNames;
         tc->getAllRegionCaseNames(caseNames);
         for (int j = 0; j < static_cast<int>(caseNames.size()); j++) {
            regionCaseComboBox->addItem(caseNames[j]);
            if (caseNames[j] == dswr->getSelectedCaseName()) {
               item = j;
            }
         }
      }
      if (item < 0) {
         item = 0;
      }
      regionCaseComboBox->setCurrentIndex(item);
      dswr->setSelectedCaseName(regionCaseComboBox->currentText());

      regionPaintVolumeComboBox->clear();
      for (int i = 0; i < numPaintVolumes; i++) {
         const QString name = FileUtilities::basename(
                      theMainWindow->getBrainSet()->getVolumePaintFile(i)->getFileName());
         regionPaintVolumeComboBox->addItem(name);
      }
      regionPaintVolumeComboBox->setCurrentIndex(dswr->getSelectedPaintVolume());
      
      regionPopupGraphCheckBox->setChecked(dswr->getPopupGraphEnabled());
      
      switch (dswr->getGraphMode()) {
         case DisplaySettingsWustlRegion::GRAPH_MODE_AUTO_SCALE:
            regionGraphAutoScaleRadioButton->setChecked(true);
            break;
         case DisplaySettingsWustlRegion::GRAPH_MODE_USER_SCALE:
            regionGraphUserScaleRadioButton->setChecked(true);
            break;
      }
      
      float minScale, maxScale;
      dswr->getUserScale(minScale, maxScale);
      regionGraphUserScaleMinLineEdit->setText(QString::number(minScale));
      regionGraphUserScaleMaxLineEdit->setText(QString::number(maxScale));
   }
}


Generated by  Doxygen 1.6.0   Back to index