void RawCellmlViewWidget::initialize(const QString &pFileName, const bool &pUpdate) { // Retrieve the editing widget associated with the given file, if any CoreCellMLEditing::CoreCellmlEditingWidget *newEditingWidget = mEditingWidgets.value(pFileName); if (!newEditingWidget) { // No editing widget exists for the given file, so create one QString fileContents; Core::readTextFromFile(pFileName, fileContents); newEditingWidget = new CoreCellMLEditing::CoreCellmlEditingWidget(fileContents, !Core::FileManager::instance()->isReadableAndWritable(pFileName), new QsciLexerXML(this), parentWidget()); // Update our viewer whenever necessary connect(newEditingWidget->editor(), SIGNAL(textChanged()), this, SLOT(updateViewer())); connect(newEditingWidget->editor(), SIGNAL(cursorPositionChanged(const int &, const int &)), this, SLOT(updateViewer())); // Keep track of our editing widget and add it to ourselves mEditingWidgets.insert(pFileName, newEditingWidget); layout()->addWidget(newEditingWidget); }
void PVImageViewer::updateData(QVariant &data) { if(!data.isNull() && data.isValid()) { QString path = data.toString(); setFilePath(path); updateViewer(); } }
void ViewerConfiguration::eyeDistanceSliderCallback(GLMotif::TextFieldSlider::ValueChangedCallbackData* cbData) { /* Update the eye distance: */ eyeDist=cbData->value/unitScale; /* Re-position the left and right eyes: */ Vector eyeOffset=eyePos[2]-eyePos[1]; eyeOffset.normalize(); eyeOffset*=eyeDist*Scalar(0.5); eyePos[1]=eyePos[0]-eyeOffset; eyePos[2]=eyePos[0]+eyeOffset; /* Update the GUI: */ for(int eyeIndex=1;eyeIndex<3;++eyeIndex) for(int i=0;i<3;++i) eyePosSliders[eyeIndex][i]->setValue(eyePos[eyeIndex][i]*unitScale); /* Update the controlled viewer: */ updateViewer(); }
void ViewerConfiguration::eyePosSliderCallback(GLMotif::TextFieldSlider::ValueChangedCallbackData* cbData,const int& sliderIndex) { /* Determine which eye position has changed: */ int eyeIndex=sliderIndex/3; int component=sliderIndex%3; /* Update the changed eye: */ eyePos[eyeIndex][component]=cbData->value/unitScale; /* Update dependent state: */ switch(eyeIndex) { case 0: // Mono eye { /* Re-position the left and right eyes: */ Scalar offset=(eyePos[2][component]-eyePos[1][component])*Scalar(0.5); eyePos[1][component]=eyePos[0][component]-offset; eyePos[2][component]=eyePos[0][component]+offset; /* Update the GUI: */ for(int updateEyeIndex=1;updateEyeIndex<3;++updateEyeIndex) eyePosSliders[updateEyeIndex][component]->setValue(eyePos[updateEyeIndex][component]*unitScale); break; } case 1: // Left eye case 2: // Right eye /* Recalculate the mono eye position and the eye distance: */ eyePos[0][component]=Math::mid(eyePos[1][component],eyePos[2][component]); eyeDist=Geometry::dist(eyePos[1],eyePos[2]); /* Update the GUI: */ eyePosSliders[0][component]->setValue(eyePos[0][component]*unitScale); eyeDistanceSlider->setValue(eyeDist*unitScale); break; } /* Update the controlled viewer: */ updateViewer(); }
void TriangulationTab::on_doBundleAdjustment_clicked() { sfmapp->doBundleAdjustment(); updateViewer(); }
void TriangulationTab::on_removeLastCamera_clicked() { sfmapp->removeLastCamera(); updateViewer(); }
void TriangulationTab::on_runNextReconstruction_clicked() { sfmapp->reconstructNextImagePair(); updateViewer(); }
void TriangulationTab::on_runInitialReconstruction_clicked() { sfmapp->reconstructInitialImagePair(); updateViewer(); }