void medFilteringWorkspace::setupViewContainerStack()
{
    if ( !this->stackedViewContainers()->count() )
    {
        d->inputContainer = this->stackedViewContainers()->addContainerInTab("Filtering");
        QLabel *inputLabel = new QLabel("INPUT");
        inputLabel->setAlignment(Qt::AlignCenter);
        d->inputContainer->setDefaultWidget(inputLabel);

        d->inputContainer->setUserClosable(false);
        d->inputContainer->setUserSplittable(false);
        d->inputContainer->setMultiLayered(false);

        d->outputContainer = d->inputContainer->splitVertically();
        QLabel *outputLabel = new QLabel("OUTPUT");
        outputLabel->setAlignment(Qt::AlignCenter);
        d->outputContainer->setDefaultWidget(outputLabel);
        d->outputContainer->setUserClosable(false);
        d->outputContainer->setUserSplittable(false);
        d->outputContainer->setMultiLayered(false);
        d->outputContainer->setAcceptDrops(false);

        connect(d->inputContainer, SIGNAL(viewContentChanged()), this, SLOT(changeToolBoxInput()));
        connect(d->inputContainer, SIGNAL(viewRemoved()), this, SLOT(changeToolBoxInput()));

        this->stackedViewContainers()->lockTabs();
        this->stackedViewContainers()->hideTabBar();
    }
}
Example #2
0
void medRegistrationWorkspace::setupTabbedViewContainer()
{

    //the stack has been instantiated in constructor
    if (!this->tabbedViewContainers()->count())
    {
        d->fixedContainer = this->tabbedViewContainers()->addContainerInTab(tr("Compare"));
        QLabel *fixedLabel = new QLabel(tr("FIXED"));
        fixedLabel->setAlignment(Qt::AlignCenter);
        d->fixedContainer->setDefaultWidget(fixedLabel);
        d->fixedContainer->setMultiLayered(false);
        d->fixedContainer->setUserSplittable(false);
        d->fixedContainer->setClosingMode(medViewContainer::CLOSE_VIEW);

        d->movingContainer = d->fixedContainer->splitVertically();
        QLabel *movingLabel = new QLabel(tr("MOVING"));
        movingLabel->setAlignment(Qt::AlignCenter);
        d->movingContainer->setDefaultWidget(movingLabel);
        d->movingContainer->setUserSplittable(false);
        d->movingContainer->setMultiLayered(false);
        d->movingContainer->setClosingMode(medViewContainer::CLOSE_VIEW);


        d->fuseContainer = this->tabbedViewContainers()->addContainerInTab(tr("Fuse"));
        QLabel *fuseLabel = new QLabel(tr("FUSE"));
        fuseLabel->setAlignment(Qt::AlignCenter);
        d->fuseContainer->setDefaultWidget(fuseLabel);
        d->fuseContainer->setClosingMode(medViewContainer::CLOSE_BUTTON_HIDDEN);
        d->fuseContainer->setUserSplittable(false);
        d->fuseContainer->setAcceptDrops(false);

        connect(d->fixedContainer, SIGNAL(viewContentChanged()),
                this, SLOT(updateFromFixedContainer()));
        connect(d->movingContainer,SIGNAL(viewContentChanged()),
                this, SLOT(updateFromMovingContainer()));

        connect(d->fixedContainer,SIGNAL(viewRemoved()),
                this, SLOT(updateFromFixedContainer()));
        connect(d->movingContainer,SIGNAL(viewRemoved()),
                this, SLOT(updateFromMovingContainer()));

        this->tabbedViewContainers()->lockTabs();
        this->tabbedViewContainers()->setCurrentIndex(0);
        d->fixedContainer->setSelected(true);
        d->movingContainer->setSelected(false);
    }
}
void medViewContainer::removeInternView()
{
    d->view = NULL;
    d->maximizedAction->setEnabled(false);
    d->defaultWidget->show();
    this->updateToolBar();

    emit viewRemoved();
}
View* Area::removeView(View *view)
{
    AreaIndex *index = indexOf(view);
    Q_ASSERT(index);

    emit aboutToRemoveView(index, view);
    index->remove(view);
    emit viewRemoved(index, view);
    
    return view;
}
Example #5
0
void terrama2::services::view::core::DataManager::removeView(ViewId viewId)
{
  {
    std::lock_guard<std::recursive_mutex> lock(mtx_);
    auto itPr = view_.find(viewId);
    if(itPr == view_.end())
    {
      QString errMsg = QObject::tr("DataProvider not registered.");
      TERRAMA2_LOG_ERROR() << errMsg;
      throw terrama2::InvalidArgumentException() << ErrorDescription(errMsg);
    }

    view_.erase(itPr);
  }

  emit viewRemoved(viewId);
}
Example #6
0
void medRegistrationWorkspace::updateFromRegistrationSuccess(medAbstractData *output)
{
    if(!d->registrationToolBox)
        return;

    //TODO disconnect because we dont want to change input of the undo redo process.
    //  find a better way to do it ? - RDE
    d->movingContainer->disconnect(this);

    d->movingContainer->removeView();
    d->movingContainer->addData(output);

    d->fuseContainer->removeView();
    d->fuseContainer->addData(d->registrationToolBox->fixedData());
    d->fuseContainer->addData(output);


    // Relink the views...
    medAbstractLayeredView* movingView  = dynamic_cast<medAbstractLayeredView*>(d->movingContainer->view());
    if(!movingView)
    {
        dtkWarn() << "Non layered view are not suported yet in registration workspace.";
        return;
    }


    medAbstractLayeredView* fuseView  = dynamic_cast<medAbstractLayeredView*>(d->fuseContainer->view());
    if(!fuseView)
    {
        dtkWarn() << "Non layered view are not suported yet in registration workspace.";
        return;
    }

    d->viewGroup->addImpactedView(movingView);
    d->viewGroup->addImpactedView(fuseView);
    d->viewGroup->removeParameter("DataList");

    d->movingLayerGroup->addImpactedlayer(movingView, output);
    d->movingLayerGroup->addImpactedlayer(fuseView, output);

    connect(d->movingContainer,SIGNAL(viewContentChanged()),
            this, SLOT(updateFromMovingContainer()));

    connect(d->movingContainer,SIGNAL(viewRemoved()),
            this, SLOT(updateFromMovingContainer()));
}
Example #7
0
//-----------------------------------------------------------------------------
// Function: ViewsModel::onRemoveItem()
//-----------------------------------------------------------------------------
void ViewsModel::onRemoveItem(QModelIndex const& index)
{
	// don't remove anything if index is invalid
	if (!index.isValid() || index.row() < 0 || index.row() >= views_.size())
    {
		return;
	}

	// remove the specified item
	beginRemoveRows(QModelIndex(), index.row(), index.row());
	views_.removeAt(index.row());
	endRemoveRows();

	// inform navigation tree that file set has been removed
	emit viewRemoved(index.row());

	// tell also parent widget that contents have been changed
	emit contentChanged();
}
void resliceToolBox::startReformat()
{
    if (d->currentView && getWorkspace())
    {
        medAbstractData* data = d->currentView->layerData(d->currentView->currentLayer());
        bool is3D = false;
        if ((data->identifier().contains("itkDataImage"))
                && (dynamic_cast<medAbstractImageData *>(data)->Dimension() == 3))
        {
            is3D = true;
        }

        if (d->currentView->layersCount() && is3D)
        {
            d->help0->hide();
            d->reformatOptions->show();
            d->b_startReslice->hide();

            d->resliceViewer = new medResliceViewer(d->currentView,getWorkspace()->stackedViewContainers());
            d->resliceViewer->setToolBox(this);
            getWorkspace()->stackedViewContainers()->setAcceptDrops(false);
            connect(d->resliceViewer,SIGNAL(imageReformatedGenerated()),this,SLOT(saveReformatedImage()));
            medViewContainer * container = getWorkspace()->stackedViewContainers()->insertContainerInTab(0,"Reslice");
            getWorkspace()->stackedViewContainers()->setCurrentIndex(0);
            container->setDefaultWidget(d->resliceViewer->viewWidget());
            connect(container, SIGNAL(viewRemoved()),this, SLOT(stopReformat()), Qt::UniqueConnection);

            connect(d->spacingX,SIGNAL(valueChanged(double)),d->resliceViewer,SLOT(thickSlabChanged(double)));
            connect(d->spacingY,SIGNAL(valueChanged(double)),d->resliceViewer,SLOT(thickSlabChanged(double)));
            connect(d->spacingZ,SIGNAL(valueChanged(double)),d->resliceViewer,SLOT(thickSlabChanged(double)));
            connect(d->b_saveImage,SIGNAL(clicked()),d->resliceViewer,SLOT(saveImage()));

            d->reformatedImage = 0;

            // close the initial tab which is not needed anymore
            getWorkspace()->stackedViewContainers()->removeTab(1);
            updateView();
        }