void ALCPeakFittingView::initialize() {
  m_ui.setupUi(m_widget);

  connect(m_ui.fit, SIGNAL(clicked()), this, SIGNAL(fitRequested()));

  m_ui.plot->setCanvasBackground(Qt::white);
  m_ui.plot->setAxisFont(QwtPlot::xBottom, m_widget->font());
  m_ui.plot->setAxisFont(QwtPlot::yLeft, m_widget->font());

  m_dataCurve->setStyle(QwtPlotCurve::NoCurve);
  m_dataCurve->setSymbol(
      QwtSymbol(QwtSymbol::Ellipse, QBrush(), QPen(), QSize(7, 7)));
  m_dataCurve->setRenderHint(QwtPlotItem::RenderAntialiased, true);
  m_dataCurve->attach(m_ui.plot);

  m_fittedCurve->setPen(QPen(Qt::red, 1.5));
  m_fittedCurve->setRenderHint(QwtPlotItem::RenderAntialiased, true);
  m_fittedCurve->attach(m_ui.plot);

  // XXX: Being a QwtPlotItem, should get deleted when m_ui.plot gets deleted
  // (auto-delete option)
  m_peakPicker = new MantidWidgets::PeakPicker(m_ui.plot, Qt::red);

  connect(m_peakPicker, SIGNAL(changed()), SIGNAL(peakPickerChanged()));

  connect(m_ui.peaks, SIGNAL(currentFunctionChanged()),
          SIGNAL(currentFunctionChanged()));
  connect(m_ui.peaks, SIGNAL(parameterChanged(QString, QString)),
          SIGNAL(parameterChanged(QString, QString)));

  connect(m_ui.help, SIGNAL(clicked()), this, SLOT(help()));
  connect(m_ui.plotGuess, SIGNAL(clicked()), this, SLOT(plotGuess()));
}
Example #2
0
//==============================================================================
void DRowAudioFilter::prepareToPlay (double sampleRate, int samplesPerBlock)
{
	currentSampleRate = sampleRate;
	
	parameterChanged(PREFILTER, 0.0f);
	parameterChanged(POSTFILTER, 0.0f);
}
Example #3
0
void QgsAtlasComposition::readXml( const QDomElement& atlasElem, const QDomDocument& )
{
  mEnabled = atlasElem.attribute( QStringLiteral( "enabled" ), QStringLiteral( "false" ) ) == QLatin1String( "true" ) ? true : false;
  emit toggled( mEnabled );
  if ( !mEnabled )
  {
    emit parameterChanged();
    return;
  }

  // look for stored layer name
  mCoverageLayer = nullptr;
  QMap<QString, QgsMapLayer*> layers = QgsMapLayerRegistry::instance()->mapLayers();
  for ( QMap<QString, QgsMapLayer*>::const_iterator it = layers.begin(); it != layers.end(); ++it )
  {
    if ( it.key() == atlasElem.attribute( QStringLiteral( "coverageLayer" ) ) )
    {
      mCoverageLayer = dynamic_cast<QgsVectorLayer*>( it.value() );
      break;
    }
  }

  mPageNameExpression = atlasElem.attribute( QStringLiteral( "pageNameExpression" ), QString() );
  mSingleFile = atlasElem.attribute( QStringLiteral( "singleFile" ), QStringLiteral( "false" ) ) == QLatin1String( "true" ) ? true : false;
  mFilenamePattern = atlasElem.attribute( QStringLiteral( "filenamePattern" ), QLatin1String( "" ) );

  mSortFeatures = atlasElem.attribute( QStringLiteral( "sortFeatures" ), QStringLiteral( "false" ) ) == QLatin1String( "true" ) ? true : false;
  if ( mSortFeatures )
  {
    mSortKeyAttributeName = atlasElem.attribute( QStringLiteral( "sortKey" ), QLatin1String( "" ) );
    // since 2.3, the field name is saved instead of the field index
    // following code keeps compatibility with version 2.2 projects
    // to be removed in QGIS 3.0
    bool isIndex;
    int idx = mSortKeyAttributeName.toInt( &isIndex );
    if ( isIndex && mCoverageLayer )
    {
      QgsFields fields = mCoverageLayer->fields();
      if ( idx >= 0 && idx < fields.count() )
      {
        mSortKeyAttributeName = fields.at( idx ).name();
      }
    }
    mSortAscending = atlasElem.attribute( QStringLiteral( "sortAscending" ), QStringLiteral( "true" ) ) == QLatin1String( "true" ) ? true : false;
  }
  mFilterFeatures = atlasElem.attribute( QStringLiteral( "filterFeatures" ), QStringLiteral( "false" ) ) == QLatin1String( "true" ) ? true : false;
  if ( mFilterFeatures )
  {
    mFeatureFilter = atlasElem.attribute( QStringLiteral( "featureFilter" ), QLatin1String( "" ) );
  }

  mHideCoverage = atlasElem.attribute( QStringLiteral( "hideCoverage" ), QStringLiteral( "false" ) ) == QLatin1String( "true" ) ? true : false;

  emit parameterChanged();
}
Example #4
0
void MiaMarkerStatistics::lineProfile(MiaMarker* marker, A* inData)
{
    int width, height, depth;
    width = inputImage->getWidth();
    height = inputImage->getHeight();
    depth = inputImage->getDepth();
    if(marker->type == MIA_Line)
    {
        MiaPoint4D pt1 = marker->getKeyPointAt(0);
        MiaPoint4D pt2 = marker->getKeyPointAt(1);
        pt1 = inputImage->convertPatientCoordinateToVoxel(pt1);
        pt2 = inputImage->convertPatientCoordinateToVoxel(pt2);
        if (pt1.distance(pt2) < 5)
            return;
        statisticsOnLine<A>(pt1,pt2,mean,standard_deviation,inData);
        MiaPoint4D pt3;
        pt3 = pt2*2 - pt1;

        float outside_mean = 0;
        float outside_std = 0;
        statisticsOnLine<A>(pt2,pt3,outside_mean,outside_std,inData);

        int endPointIndex = (int)(pt2.pos[2])*width*height + (int)(pt2.pos[1])*width + (int)(pt2.pos[0]);

        if(fabs(outside_mean-mean) > min(standard_deviation,outside_std)/2.0 && fabs(outside_mean-mean) < standard_deviation*3.0f)
        {
            float lower_threshold = mean - 3.0f*standard_deviation;
            float upper_threshold = mean + 3.0f*standard_deviation;
            if(outside_mean>mean)
            {
                upper_threshold = mean + (outside_mean - mean)*outside_std/(standard_deviation+outside_std);
            }
            else
            {
                lower_threshold = mean + (outside_mean - mean)*outside_std/(standard_deviation+outside_std);
            }

            wiredParameters.insert(QString("meanvalue"), mean);
            wiredParameters.insert(QString("lowerthrehold"), lower_threshold );
            wiredParameters.insert(QString("upperthrehold"), upper_threshold );
            wiredParameters.insert(QString("endPointIndex"),endPointIndex);
            emit parameterChanged(wiredParameters);
        }
        else
        {
            wiredParameters.insert(QString("meanvalue"), mean);
            wiredParameters.insert(QString("lowerthrehold"), mean - 1.5f*standard_deviation );
            wiredParameters.insert(QString("upperthrehold"), mean + 1.5f*standard_deviation );
            wiredParameters.insert(QString("endPointIndex"),endPointIndex);
            emit parameterChanged(wiredParameters);
        }

    }
    return;
}
Example #5
0
void QgsAtlasComposition::readXML( const QDomElement& atlasElem, const QDomDocument& )
{
  mEnabled = atlasElem.attribute( "enabled", "false" ) == "true" ? true : false;
  emit toggled( mEnabled );
  if ( !mEnabled )
  {
    emit parameterChanged();
    return;
  }

  // look for stored layer name
  mCoverageLayer = 0;
  QMap<QString, QgsMapLayer*> layers = QgsMapLayerRegistry::instance()->mapLayers();
  for ( QMap<QString, QgsMapLayer*>::const_iterator it = layers.begin(); it != layers.end(); ++it )
  {
    if ( it.key() == atlasElem.attribute( "coverageLayer" ) )
    {
      mCoverageLayer = dynamic_cast<QgsVectorLayer*>( it.value() );
      break;
    }
  }
  // look for stored composer map
  mComposerMap = 0;
  QList<const QgsComposerMap*> maps = mComposition->composerMapItems();
  for ( QList<const QgsComposerMap*>::const_iterator it = maps.begin(); it != maps.end(); ++it )
  {
    if (( *it )->id() == atlasElem.attribute( "composerMap" ).toInt() )
    {
      mComposerMap = const_cast<QgsComposerMap*>( *it );
      break;
    }
  }
  mMargin = atlasElem.attribute( "margin", "0.0" ).toDouble();
  mHideCoverage = atlasElem.attribute( "hideCoverage", "false" ) == "true" ? true : false;
  mFixedScale = atlasElem.attribute( "fixedScale", "false" ) == "true" ? true : false;
  mSingleFile = atlasElem.attribute( "singleFile", "false" ) == "true" ? true : false;
  mFilenamePattern = atlasElem.attribute( "filenamePattern", "" );

  mSortFeatures = atlasElem.attribute( "sortFeatures", "false" ) == "true" ? true : false;
  if ( mSortFeatures )
  {
    mSortKeyAttributeIdx = atlasElem.attribute( "sortKey", "0" ).toInt();
    mSortAscending = atlasElem.attribute( "sortAscending", "true" ) == "true" ? true : false;
  }
  mFilterFeatures = atlasElem.attribute( "filterFeatures", "false" ) == "true" ? true : false;
  if ( mFilterFeatures )
  {
    mFeatureFilter = atlasElem.attribute( "featureFilter", "" );
  }

  emit parameterChanged();
}
Example #6
0
void QgsAtlasComposition::readXml( const QDomElement &atlasElem, const QDomDocument & )
{
  mEnabled = atlasElem.attribute( QStringLiteral( "enabled" ), QStringLiteral( "false" ) ) == QLatin1String( "true" );
  emit toggled( mEnabled );
  if ( !mEnabled )
  {
    emit parameterChanged();
    return;
  }

  // look for stored layer name
  QString layerId = atlasElem.attribute( QStringLiteral( "coverageLayer" ) );
  QString layerName = atlasElem.attribute( QStringLiteral( "coverageLayerName" ) );
  QString layerSource = atlasElem.attribute( QStringLiteral( "coverageLayerSource" ) );
  QString layerProvider = atlasElem.attribute( QStringLiteral( "coverageLayerProvider" ) );

  mCoverageLayer = QgsVectorLayerRef( layerId, layerName, layerSource, layerProvider );
  mCoverageLayer.resolveWeakly( mComposition->project() );

  mPageNameExpression = atlasElem.attribute( QStringLiteral( "pageNameExpression" ), QString() );
  mSingleFile = atlasElem.attribute( QStringLiteral( "singleFile" ), QStringLiteral( "false" ) ) == QLatin1String( "true" );
  mFilenamePattern = atlasElem.attribute( QStringLiteral( "filenamePattern" ), QLatin1String( "" ) );

  mSortFeatures = atlasElem.attribute( QStringLiteral( "sortFeatures" ), QStringLiteral( "false" ) ) == QLatin1String( "true" );
  if ( mSortFeatures )
  {
    mSortKeyAttributeName = atlasElem.attribute( QStringLiteral( "sortKey" ), QLatin1String( "" ) );
    // since 2.3, the field name is saved instead of the field index
    // following code keeps compatibility with version 2.2 projects
    // to be removed in QGIS 3.0
    bool isIndex;
    int idx = mSortKeyAttributeName.toInt( &isIndex );
    if ( isIndex && mCoverageLayer )
    {
      QgsFields fields = mCoverageLayer->fields();
      if ( idx >= 0 && idx < fields.count() )
      {
        mSortKeyAttributeName = fields.at( idx ).name();
      }
    }
    mSortAscending = atlasElem.attribute( QStringLiteral( "sortAscending" ), QStringLiteral( "true" ) ) == QLatin1String( "true" );
  }
  mFilterFeatures = atlasElem.attribute( QStringLiteral( "filterFeatures" ), QStringLiteral( "false" ) ) == QLatin1String( "true" );
  if ( mFilterFeatures )
  {
    mFeatureFilter = atlasElem.attribute( QStringLiteral( "featureFilter" ), QLatin1String( "" ) );
  }

  mHideCoverage = atlasElem.attribute( QStringLiteral( "hideCoverage" ), QStringLiteral( "false" ) ) == QLatin1String( "true" );

  emit parameterChanged();
}
Example #7
0
ComplexParameter::ComplexParameter(QWidget *parent) :
        QWidget(parent)
{
    m_ui.setupUi(this);
    //m_ui.effectlist->horizontalHeader()->setVisible(false);
    //m_ui.effectlist->verticalHeader()->setVisible(false);


    m_ui.buttonLeftRight->setIcon(KIcon("go-next"));//better icons needed
    m_ui.buttonLeftRight->setToolTip(i18n("Allow horizontal moves"));
    m_ui.buttonUpDown->setIcon(KIcon("go-up"));
    m_ui.buttonUpDown->setToolTip(i18n("Allow vertical moves"));
    m_ui.buttonShowInTimeline->setIcon(KIcon("kmplayer"));
    m_ui.buttonShowInTimeline->setToolTip(i18n("Show keyframes in timeline"));
    m_ui.buttonHelp->setIcon(KIcon("help-about"));
    m_ui.buttonHelp->setToolTip(i18n("Parameter info"));
    m_ui.buttonNewPoints->setIcon(KIcon("document-new"));
    m_ui.buttonNewPoints->setToolTip(i18n("Add keyframe"));

    connect(m_ui.buttonLeftRight, SIGNAL(clicked()), this , SLOT(slotSetMoveX()));
    connect(m_ui.buttonUpDown, SIGNAL(clicked()), this , SLOT(slotSetMoveY()));
    connect(m_ui.buttonShowInTimeline, SIGNAL(clicked()), this , SLOT(slotShowInTimeline()));
    connect(m_ui.buttonNewPoints, SIGNAL(clicked()), this , SLOT(slotSetNew()));
    connect(m_ui.buttonHelp, SIGNAL(clicked()), this , SLOT(slotSetHelp()));
    connect(m_ui.parameterList, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(slotParameterChanged(const QString&)));
    connect(m_ui.kplotwidget, SIGNAL(parameterChanged(QDomElement)), this , SLOT(slotUpdateEffectParams(QDomElement)));
    connect(m_ui.kplotwidget, SIGNAL(parameterList(QStringList)), this , SLOT(slotUpdateParameterList(QStringList)));
    /*ÜeffectLists["audio"]=audioEffectList;
    effectLists["video"]=videoEffectList;
    effectLists["custom"]=customEffectList;*/
    setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
    m_ui.infoBox->hide();
    updateButtonStatus();

}
void Geometryval::slotDeleteFrame(int pos)
{
    // check there is more than one keyframe
    Mlt::GeometryItem item;
    int frame = m_timePos.getValue();

    if (pos == -1) pos = frame;
    int error = m_geom->next_key(&item, pos + 1);
    if (error) {
        error = m_geom->prev_key(&item, pos - 1);
        if (error || item.frame() == pos) return;
    }

    m_geom->remove(frame);
    buttonAdd->setEnabled(true);
    buttonDelete->setEnabled(false);
    widget->setEnabled(false);
    spinTransp->setEnabled(false);
    frameOptions->setEnabled(false);
    m_reset->setEnabled(false);
    m_helper->update();
    slotPositionChanged(pos, false);
    updateTransitionPath();
    emit parameterChanged();
}
Example #9
0
void PositionEdit::slotUpdatePosition()
{
    m_slider->blockSignals(true);
    m_slider->setValue(m_display->getValue());
    m_slider->blockSignals(false);
    emit parameterChanged(m_display->getValue());
}
Example #10
0
ViZscoreNoiseDetector::ViZscoreNoiseDetector()
	: ViNoiseDetector()
{
	setScale(30);
	setWindowSize(DEFAULT_WINDOW_SIZE);
	addParameter("Window Size");

	QObject::connect(this, SIGNAL(parameterChanged(QString,qreal)), this, SLOT(changeParameter(QString,qreal)));
}
Example #11
0
//-----------------------------------------------------------------------------
// Function: modelDataChanged()
//-----------------------------------------------------------------------------
void ModelParameterEditor::modelDataChanged(QModelIndex const& index)
{
    // Only changes in the default value emits parameterChanged.
    if (index.column() == ModelParameterColumns::VALUE)
    {
        QSharedPointer<ModelParameter> changedParameter = model_->getParameter(index);
        emit parameterChanged(changedParameter);
    }
    emit contentChanged();
}
Example #12
0
void QgsAtlasComposition::setEnabled( bool enabled )
{
  if ( enabled == mEnabled )
  {
    return;
  }

  mEnabled = enabled;
  mComposition->setAtlasMode( QgsComposition::AtlasOff );
  emit toggled( enabled );
  emit parameterChanged();
}
Example #13
0
void KeyframeEdit::generateAllParams()
{
    for (int col = 0; col < keyframe_list->columnCount(); ++col) {
        QString keyframes;
        for (int i = 0; i < keyframe_list->rowCount(); ++i) {
            if (keyframe_list->item(i, col))
                keyframes.append(QString::number(getPos(i)) + '=' + keyframe_list->item(i, col)->text() + ';');
        }
        m_params[col].setAttribute(getTag(), keyframes);
    }
    emit parameterChanged();
}
Example #14
0
void DRowAudioFilter::setScaledParameter (int index, float newValue)
{
	for (int i = 0; i < noParams; i++)
	{
		if (index == i) {
			if (params[i].getValue() != newValue) {
				params[i].setValue(newValue);
				sendChangeMessage (this);
			}
		}
	}
	parameterChanged(index, newValue);
}
  void ALCPeakFittingPresenter::initialize()
  {
    m_view->initialize();

    connect(m_view, SIGNAL(fitRequested()), SLOT(fit()));
    connect(m_view, SIGNAL(currentFunctionChanged()), SLOT(onCurrentFunctionChanged()));
    connect(m_view, SIGNAL(peakPickerChanged()), SLOT(onPeakPickerChanged()));

    // We are updating the whole function anyway, so paramName if left out
    connect(m_view, SIGNAL(parameterChanged(QString,QString)), SLOT(onParameterChanged(QString)));

    connect(m_model, SIGNAL(fittedPeaksChanged()), SLOT(onFittedPeaksChanged()));
    connect(m_model, SIGNAL(dataChanged()), SLOT(onDataChanged()));
  }
Example #16
0
void Geometryval::slotTransparencyChanged(int transp)
{
    int pos = m_ui.spinPos->value();
    Mlt::GeometryItem item;
    int error = m_geom->fetch(&item, pos);
    if (error || item.key() == false) {
        // no keyframe under cursor
        return;
    }
    item.mix(transp);
    m_paramRect->setBrush(QColor(255, 0, 0, transp));
    m_geom->insert(item);
    emit parameterChanged();
}
Example #17
0
bool MeshLabXMLStdDialog::showAutoDialog(MeshLabXMLFilterContainer& mfc,PluginManager& pm,MeshDocument * md, MainWindowInterface *mwi, QWidget *gla/*=0*/ )
{
	/*if (mfc.filterInterface == NULL)
	return false;*/
	curMeshDoc = md;
	if (curMeshDoc == NULL)
		return false;
	env.loadMLScriptEnv(*curMeshDoc,pm);
	if (mfc.xmlInfo == NULL)
		return false;
	if (mfc.act == NULL)
		return false;

	validcache = false;
	//curAction=mfc.act;
	curmfc=&mfc;
	curmwi=mwi;
	curParMap.clear();
	//prevParMap.clear();
	curModel = md->mm();
	curgla=gla;

	QString fname = mfc.act->text();
	//mfi->initParameterSet(action, *mdp, curParSet);
	MLXMLPluginInfo::XMLMapList mplist = mfc.xmlInfo->filterParametersExtendedInfo(fname);
	curParMap = mplist;
	//curmask = mfc->xmlInfo->filterAttribute(mfc->act->text(),QString("postCond"));
	if(curParMap.isEmpty() && !isPreviewable())
		return false;

	QTime tt;
	tt.start();
	createFrame();
	loadFrameContent();

	curMeshDoc->Log.Logf(GLLogStream::SYSTEM,"GUI created in %i msec",tt.elapsed());
	//QString postCond = mfc.xmlInfo->filterAttribute(fname,MLXMLElNames::filterPostCond);
	//QStringList postCondList = postCond.split(QRegExp("\\W+"), QString::SkipEmptyParts);
	//curmask = MeshLabFilterInterface::convertStringListToMeshElementEnum(postCondList);
	if(isPreviewable())
	{
		meshState.create(curmask, curModel);
		connect(stdParFrame,SIGNAL(parameterChanged()), this, SLOT(applyDynamic()));
	}
	connect(curMeshDoc, SIGNAL(currentMeshChanged(int)),this, SLOT(changeCurrentMesh(int)));
	raise();
	activateWindow();
	return true;
}
Example #18
0
void KeyframeEdit::slotUpdateVisibleParameter(int id, bool update)
{
    for (int i = 0; i < m_params.count(); ++i) {
        m_params[i].setAttribute(QStringLiteral("intimeline"), (i == id ? "1" : "0"));
    }
    for (int col = 0; col < keyframe_list->columnCount(); ++col) {
        DoubleParameterWidget *doubleparam = static_cast <DoubleParameterWidget*>(m_slidersLayout->itemAtPosition(col, 0)->widget());
        if (!doubleparam)
            continue;
        doubleparam->setInTimelineProperty(col == id);
        ////qDebug()<<"// PARAM: "<<col<<" Set TO: "<<(bool) (col == id);
        
    }
    if (update) emit parameterChanged();
}
ErosionEffectController::ErosionEffectController(QObject *parent) :
    EffectController(parent)
{
    fx.reset(new ErosionEffect());

    QSettings settings;
    settings.beginGroup("erosion");

    auto params = fx->parameters();
    params.density = settings.value("density", params.density).value<float>();
    params.strength = settings.value("strength", params.strength).value<float>();
    fx->setParameters(params);

    settings.endGroup();

    connect(fx.data(), SIGNAL(parameterChanged(ErosionParameters)), SLOT(preview()));
}
Example #20
0
XMLAbsWidget::XMLAbsWidget(const MLXMLPluginInfo::XMLMap& xmlWidgetTag, EnvWrap& envir,QWidget* parent )
:XMLMeshLabWidget(xmlWidgetTag,envir,parent)
{
	m_min = env.evalFloat(xmlWidgetTag[MLXMLElNames::guiMinExpr]);
	m_max = env.evalFloat(xmlWidgetTag[MLXMLElNames::guiMaxExpr]);

	fieldDesc = new QLabel(xmlWidgetTag[MLXMLElNames::guiLabel] + " (abs and %)",this);
	fieldDesc->setToolTip(xmlWidgetTag[MLXMLElNames::paramHelpTag]);
	absSB = new QDoubleSpinBox(this);
	percSB = new QDoubleSpinBox(this);

	absSB->setMinimum(m_min-(m_max-m_min));
	absSB->setMaximum(m_max*2);
	absSB->setAlignment(Qt::AlignRight);

	int decimals= 7-ceil(log10(fabs(m_max-m_min)) ) ;
	//qDebug("range is (%f %f) %f ",m_max,m_min,fabs(m_max-m_min));
	//qDebug("log range is %f ",log10(fabs(m_max-m_min)));
	absSB->setDecimals(decimals);
	absSB->setSingleStep((m_max-m_min)/100.0);
	float initVal = env.evalFloat(xmlWidgetTag[MLXMLElNames::paramDefExpr]);
	absSB->setValue(initVal);

	percSB->setMinimum(-200);
	percSB->setMaximum(200);
	percSB->setAlignment(Qt::AlignRight);
	percSB->setSingleStep(0.5);
	percSB->setValue((100*(initVal - m_min))/(m_max - m_min));
	percSB->setDecimals(3);
	absLab=new QLabel("<i> <small> world unit</small></i>",this);
	percLab=new QLabel("<i> <small> perc on"+QString("(%1 .. %2)").arg(m_min).arg(m_max)+"</small></i>",this);

	//gridLay->addWidget(fieldDesc,row,0,Qt::AlignLeft);
	glay = new QGridLayout();
	glay->addWidget(absLab,0,0,Qt::AlignHCenter);
	glay->addWidget(percLab,0,1,Qt::AlignHCenter);
	glay->addWidget(absSB,1,0,Qt::AlignTop);
	glay->addWidget(percSB,1,1,Qt::AlignTop);
	//gridLay->addLayout(lay,row,1,1,2,Qt::AlignTop);


	connect(absSB,SIGNAL(valueChanged(double)),this,SLOT(on_absSB_valueChanged(double)));
	connect(percSB,SIGNAL(valueChanged(double)),this,SLOT(on_percSB_valueChanged(double)));
	connect(this,SIGNAL(dialogParamChanged()),parent,SIGNAL(parameterChanged()));
	setVisibility(isImportant);
}
Example #21
0
XMLEditWidget::XMLEditWidget(const MLXMLPluginInfo::XMLMap& xmlWidgetTag,EnvWrap& envir,QWidget* parent)
:XMLMeshLabWidget(xmlWidgetTag,envir,parent)
{
	fieldDesc = new QLabel(xmlWidgetTag[MLXMLElNames::guiLabel],this);
	lineEdit = new QLineEdit(this);
	//int row = gridLay->rowCount() -1;

	fieldDesc->setToolTip(xmlWidgetTag[MLXMLElNames::paramHelpTag]);
	lineEdit->setText(xmlWidgetTag[MLXMLElNames::paramDefExpr]);

	//gridLay->addWidget(fieldDesc,row,0,Qt::AlignTop);
	//gridLay->addWidget(lineEdit,row,1,Qt::AlignTop);
	connect(lineEdit,SIGNAL(editingFinished()),parent,SIGNAL(parameterChanged()));
	connect(lineEdit,SIGNAL(selectionChanged()),this,SLOT(tooltipEvaluation()));

	setVisibility(isImportant);
}
Example #22
0
void Geometryval::slotUpdateTransitionProperties()
{
    int pos = m_timePos.getValue();
    Mlt::GeometryItem item;
    int error = m_geom->next_key(&item, pos);
    if (error || item.frame() != pos) {
        // no keyframe under cursor
        return;
    }
    QRectF r = m_paramRect->rect().normalized();
    QPointF rectpos = m_paramRect->pos();
    item.x(rectpos.x() / m_dar);
    item.y(rectpos.y());
    item.w(r.width() / m_dar);
    item.h(r.height());
    m_geom->insert(item);
    updateTransitionPath();
    emit parameterChanged();
}
  void TOPPASInputFileListVertex::showFilesDialog()
  {
    TOPPASInputFilesDialog tifd(getFileNames(), cwd_);
    if (tifd.exec())
    {
      QStringList updated_filelist;
      tifd.getFilenames(updated_filelist);
      if (getFileNames() != updated_filelist)
      { // files were changed
        setFilenames(updated_filelist); // to correct filenames (separators etc)
        qobject_cast<TOPPASScene *>(scene())->updateEdgeColors();

        // update cwd
        cwd_ = tifd.getCWD();

        emit parameterChanged(true); // aborts the pipeline (if running) and resets downstream nodes
      }
    }
  }
Example #24
0
//----------------------------------------------------------------------------
ctkDICOMQueryWidget::~ctkDICOMQueryWidget()
{
  Q_D(ctkDICOMQueryWidget);

  disconnect(d->NameSearch, SIGNAL(textChanged(QString)), this, SLOT(startTimer()));
  disconnect(d->StudySearch, SIGNAL(textChanged(QString)), this, SLOT(startTimer()));
  disconnect(d->SeriesSearch, SIGNAL(textChanged(QString)), this, SLOT(startTimer()));
  disconnect(d->IdSearch, SIGNAL(textChanged(QString)), this, SLOT(startTimer()));
  disconnect(d->DateRangeWidget, SIGNAL(endDateTimeChanged(QDateTime)), this, SLOT(startTimer()));
  disconnect(d->DateRangeWidget, SIGNAL(startDateTimeChanged(QDateTime)), this, SLOT(startTimer()));
  disconnect(d->ModalityWidget, SIGNAL(selectedModalitiesChanged(QStringList)), this, SLOT(startTimer()));

  disconnect(d->SearchTimer, SIGNAL(timeout()), this, SIGNAL(parameterChanged()));

  disconnect(d->NameSearch, SIGNAL(returnPressed()), this, SLOT(onReturnPressed()));
  disconnect(d->StudySearch, SIGNAL(returnPressed()), this, SLOT(onReturnPressed()));
  disconnect(d->SeriesSearch, SIGNAL(returnPressed()), this, SLOT(onReturnPressed()));
  disconnect(d->IdSearch, SIGNAL(returnPressed()), this, SLOT(onReturnPressed()));
}
QgsAtlasCompositionWidget::QgsAtlasCompositionWidget( QWidget* parent, QgsComposition* c ):
    QWidget( parent ), mComposition( c )
{
  setupUi( this );

  mAtlasCoverageLayerComboBox->setFilters( QgsMapLayerProxyModel::VectorLayer );

  connect( mAtlasCoverageLayerComboBox, SIGNAL( layerChanged( QgsMapLayer* ) ), mAtlasSortFeatureKeyComboBox, SLOT( setLayer( QgsMapLayer* ) ) );
  connect( mAtlasCoverageLayerComboBox, SIGNAL( layerChanged( QgsMapLayer* ) ), mPageNameWidget, SLOT( setLayer( QgsMapLayer* ) ) );

  // Sort direction
  mAtlasSortFeatureDirectionButton->setEnabled( false );
  mAtlasSortFeatureKeyComboBox->setEnabled( false );

  // connect to updates
  connect( &mComposition->atlasComposition(), SIGNAL( parameterChanged() ), this, SLOT( updateGuiElements() ) );

  updateGuiElements();
}
void ParameterPanel::initWidget()
{
	m_model = new ParameterModel(this);
	connect(m_model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SIGNAL(parameterChanged()));

	m_delegate = new ParameterDelegate(this);

	m_view = new QTreeView(this);
	m_view->setModel(m_model);
	m_view->setItemDelegate(m_delegate);
	m_view->header()->setStretchLastSection(true);
	m_view->header()->setSectionsClickable(false);
	m_view->setAlternatingRowColors(true);
	m_view->setEditTriggers(QAbstractItemView::AllEditTriggers);
	m_view->setTextElideMode(Qt::ElideMiddle);

	//	m_view->setIndentation(0);	// @@ This would be nice if it didn't affect the roots.

	setWidget(m_view);
}
Example #27
0
void Geometryval::slotAddFrame()
{
    int pos = m_ui.spinPos->value();
    Mlt::GeometryItem item;
    item.frame(pos);
    item.x(m_paramRect->pos().x());
    item.y(m_paramRect->pos().y());
    item.w(m_paramRect->rect().width());
    item.h(m_paramRect->rect().height());
    item.mix(m_ui.spinTransp->value());
    m_geom->insert(item);
    m_ui.buttonAdd->setEnabled(false);
    m_ui.buttonDelete->setEnabled(true);
    m_ui.widget->setEnabled(true);
    m_ui.spinTransp->setEnabled(true);
    m_scaleMenu->setEnabled(true);
    m_alignMenu->setEnabled(true);
    m_helper->update();
    emit parameterChanged();
}
Example #28
0
void MiaMarkerStatistics::normalStatistics(MiaMarker* marker, A* inData)
{
    int width, height, depth;
    width = inputImage->getWidth();
    height = inputImage->getHeight();
    depth = inputImage->getDepth();
    int sliceSize = width*height;
    if ( marker->type == MIA_Point)
    {
        MiaPoint4D pt = marker->getKeyPointAt(0);
        pt = inputImage->convertPatientCoordinateToVoxel(pt);
        int x,y,z;
        x = pt.pos[0]; y = pt.pos[1]; z = pt.pos[2];
        int ind = z*sliceSize + y*width + x;
        mean = inData[ind];

        wiredParameters.insert(QString("meanvalue"), mean);
        qDebug()<<mean;
        emit parameterChanged(wiredParameters);
    }
}
Example #29
0
void Geometryval::slotAddFrame(int pos)
{
    int frame = m_timePos.getValue();
    if (pos == -1) pos = frame;
    Mlt::GeometryItem item;
    item.frame(pos);
    QRectF r = m_paramRect->rect().normalized();
    QPointF rectpos = m_paramRect->pos();
    item.x(rectpos.x() / m_dar);
    item.y(rectpos.y());
    item.w(r.width() / m_dar);
    item.h(r.height());
    item.mix(spinTransp->value());
    m_geom->insert(item);
    buttonAdd->setEnabled(false);
    buttonDelete->setEnabled(true);
    widget->setEnabled(true);
    spinTransp->setEnabled(true);
    frameOptions->setEnabled(true);
    m_reset->setEnabled(true);
    m_helper->update();
    emit parameterChanged();
}
Example #30
0
void Geometryval::slotDeleteFrame()
{
    // check there is more than one keyframe
    Mlt::GeometryItem item;
    const int pos = m_ui.spinPos->value();
    int error = m_geom->next_key(&item, pos + 1);
    if (error) {
        error = m_geom->prev_key(&item, pos - 1);
        if (error || item.frame() == pos) return;
    }

    m_geom->remove(m_ui.spinPos->value());
    m_ui.buttonAdd->setEnabled(true);
    m_ui.buttonDelete->setEnabled(false);
    m_ui.widget->setEnabled(false);
    m_ui.spinTransp->setEnabled(false);
    m_scaleMenu->setEnabled(false);
    m_alignMenu->setEnabled(false);
    m_helper->update();
    slotPositionChanged(pos, false);
    updateTransitionPath();
    emit parameterChanged();
}