Ejemplo n.º 1
0
void RenderRectangle::removeView(View *view)
{
	if(view != NULL && !_views.empty())
	{
	  osg::ref_ptr<View> cv = getCurrentView(); // Save currently selected view
	  osg::ref_ptr<View> v_save = view; // Save to make sure View doesn't get deallocated

	  // Find the view to be deleted
	  ViewList::iterator i = std::find(_views.begin(), _views.end(), view);
	  while(i != _views.end())
	  {
	    // Save this view's trackball then erase it from the list
	    (*i)->saveTrackball();
	    _views.erase(i);
		
		i = std::find(_views.begin(), _views.end(), view); // Find next instance of view
	  }

	  // We erased the currently selected view, so select the first view
	  if(cv == v_save) 
	  {
		_currView = 0;
		selectCurrentView(); // Will select first view (or default view if no stored views)
	  }
	  else selectView(cv); // Select what was already selected before
	}
}
Ejemplo n.º 2
0
void VideosWindow::onSourceReady()
{
    disconnect(mafwTrackerSource, SIGNAL(containerChanged(QString)), this, SLOT(onSourceReady()));
    connect(mafwTrackerSource, SIGNAL(containerChanged(QString)), this, SLOT(onContainerChanged(QString)));
    connect(mafwTrackerSource, SIGNAL(metadataChanged(QString)), this, SLOT(onMetadataChanged(QString)));

    selectView();
}
Ejemplo n.º 3
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    _marker_detector.setMinMaxSize(0.0001,0.5);

    ui->cameraResolutionComboBox->addItem("640x480");
    ui->cameraResolutionComboBox->addItem("1920x1080");

    _serial_port = new QSerialPort();
    refreshSerialPortOptions();
    connect(ui->serialConnectButton,SIGNAL(clicked()),SLOT(updateSerialPort()));
    connect(ui->serialDisconnectButton,SIGNAL(clicked()),SLOT(disconnectSerialPort()));
    connect(_serial_port,SIGNAL(readyRead()),SLOT(receiveData()));
    connect(ui->sendSerialDataButton,SIGNAL(clicked()),SLOT(sendTextEditSerialData()));
    connect(ui->sendSerialDataLineEdit,SIGNAL(returnPressed()),SLOT(sendTextEditSerialData()));
    connect(ui->refreshSerialOptionsButton,SIGNAL(clicked()),SLOT(refreshSerialPortOptions()));
    loadDefaultSettings();
    //applySettings();

    //Timer connects to the kcamera object to call grabFrame every 30 milliseconds
    _timer = new QTimer(this);
    connect(_timer,SIGNAL(timeout()),SLOT(update()));
    _timer->start(20);

    //Update video every 20ms
    QTimer* video_timer = new QTimer(this);
    connect(video_timer,SIGNAL(timeout()),SLOT(updateVideo()));
    video_timer->start(20);

    connect(ui->applySettingsButton,SIGNAL(clicked()),SLOT(applySettings()));

    QFileDialog* file_dialog = new QFileDialog();
    connect(file_dialog,SIGNAL(fileSelected(QString)),ui->calibrationFileLineEdit,SLOT(setText(QString)));
    connect(ui->browseCalibrationFileButton,SIGNAL(clicked()),file_dialog,SLOT(open()));

    //Connections for selecting view (image/2D trace)
    connect(ui->viewSelectComboBox,SIGNAL(currentIndexChanged(QString)),SLOT(selectView(QString)));

    connect(ui->saveSentDataButton,SIGNAL(clicked()),SLOT(saveSentData()));
    connect(ui->clearSentDataButton,SIGNAL(clicked()),SLOT(clearSentData()));

    ui->markerTracePlot->addGraph();
    ui->markerTracePlot->graph(0)->addData(1.5,1.5);

    ui->markerTracePlot->graph(0)->addData(1.9,1.9);
    ui->markerTracePlot->graph(0)->addData(1.5,1.9);
    ui->markerTracePlot->graph(0)->setScatterStyle(QCPScatterStyle::ssCross);
    ui->markerTracePlot->replot();

    _running = false;
    _frame_count = 0;
    connect(ui->startRunButton,SIGNAL(clicked()),this,SLOT(startRun()));
    connect(ui->stopRunButton,SIGNAL(clicked()),this,SLOT(stopRun()));

    _received_data_max_length = 1000;
    _sent_data_max_length = 1000;

    //Camera Sliders
    connect(ui->brightnessSlider, SIGNAL(valueChanged(int)), this, SLOT(updateBrightness(int)));
    connect(ui->sharpnessSlider, SIGNAL(valueChanged(int)), this, SLOT(updateSharpness(int)));
    connect(ui->autofocusCheckbox, SIGNAL(toggled(bool)), this, SLOT(updateAutoFocus(bool)));
    connect(ui->focusSlider, SIGNAL(valueChanged(int)), this, SLOT(updateFocus(int)));
}
Ejemplo n.º 4
0
void GLvlView::on_actionSagittal_triggered(bool){selectView(GLvlView::sagittal);}
Ejemplo n.º 5
0
void GLvlView::on_actionCoronal_triggered(bool){selectView(GLvlView::coronal);}
Ejemplo n.º 6
0
void GLvlView::on_actionAxial_triggered(bool){selectView(GLvlView::axial);}