예제 #1
0
void ColorMapEditor::setScaledColors(bool scale) {
  if (scale)
    color_map.setMode(QwtLinearColorMap::ScaledColors);
  else
    color_map.setMode(QwtLinearColorMap::FixedColors);

  scalingChanged();
}
예제 #2
0
void Plot3DDialog::initConnections()
{
    // scales page connections
    connect(boxFrom, SIGNAL(valueChanged(double)), this, SLOT(updatePlot()));
    connect(boxTo, SIGNAL(valueChanged(double)), this, SLOT(updatePlot()));
    connect(boxMajors, SIGNAL(valueChanged(int)), this, SLOT(updatePlot()));
    connect(boxMinors, SIGNAL(valueChanged(int)), this, SLOT(updatePlot()));
    connect(boxPrecision, SIGNAL(valueChanged(int)), this, SLOT(updatePlot()));
    connect(boxTickLabelsFormat, SIGNAL(activated(int)), this, SLOT(updatePlot()));
    connect(axesList, SIGNAL(currentRowChanged(int)), this, SLOT(viewScaleLimits(int)));

    // axes page connections
    connect(boxMajorLength, SIGNAL(valueChanged(double)), this, SLOT(updatePlot()));
    connect(boxMinorLength, SIGNAL(valueChanged(double)), this, SLOT(updatePlot()));
    connect(axesList2, SIGNAL(currentRowChanged(int)), this, SLOT(viewAxisOptions(int)));

    //grid page connections
    connect(boxMajorGrids, SIGNAL(toggled(bool)), this, SLOT(enableMajorGrids(bool)));
    connect(boxMajorGrids, SIGNAL(toggled(bool)), this, SLOT(updatePlot()));
    connect(boxMinorGrids, SIGNAL(toggled(bool)), this, SLOT(enableMinorGrids(bool)));
    connect(boxMinorGrids, SIGNAL(toggled(bool)), this, SLOT(updatePlot()));
    connect(boxMajorGridStyle, SIGNAL(activated(int)), this, SLOT(updatePlot()));
    connect(boxMinorGridStyle, SIGNAL(activated(int)), this, SLOT(updatePlot()));
    connect(boxMajorGridWidth, SIGNAL(valueChanged(double)), this, SLOT(updatePlot()));
    connect(boxMinorGridWidth, SIGNAL(valueChanged(double)), this, SLOT(updatePlot()));
    connect(btnGrid, SIGNAL(colorChanged()), this, SLOT(updatePlot()));
    connect(btnGridMinor, SIGNAL(colorChanged()), this, SLOT(updatePlot()));

    //color page connections
    connect(btnAxes, SIGNAL(colorChanged()), this, SLOT(updatePlot()));
    connect(btnLabels, SIGNAL(colorChanged()), this, SLOT(updatePlot()));
    connect(btnNumbers, SIGNAL(colorChanged()), this, SLOT(updatePlot()));
    connect(btnMesh, SIGNAL(colorChanged()), this, SLOT(updatePlot()));
    connect(btnBackground, SIGNAL(colorChanged()), this, SLOT(updatePlot()));
    connect(d_color_map_editor, SIGNAL(scalingChanged()), this, SLOT(updatePlot()));

    connect(boxMeshLineWidth, SIGNAL(valueChanged(double)), d_plot, SLOT(setMeshLineWidth(double)));
    connect(boxOrthogonal, SIGNAL(toggled(bool)), d_plot, SLOT(setOrthogonal(bool)));
    connect(boxLegend, SIGNAL(toggled(bool)), d_plot, SLOT(showColorLegend(bool)));
    connect(boxResolution, SIGNAL(valueChanged(int)), d_plot, SLOT(setResolution(int)));
    connect(boxDistance, SIGNAL(valueChanged(int)), d_plot, SLOT(setLabelsDistance(int)));

    //title page connections
    connect(btnTitleColor, SIGNAL(colorChanged()), this, SLOT(updatePlot()));
}
예제 #3
0
파일: WWindow.cpp 프로젝트: omega-gg/Sky
void WWindowPrivate::init()
{
    Q_Q(WWindow);

    icon = sk->icon();

    visible = true;

    hoverItem = NULL;

    q->setAcceptHoverEvents(true);

#ifdef QT_LATEST
    q->setFlag(QQuickItem::ItemAcceptsDrops);
#endif

    //---------------------------------------------------------------------------------------------
    // View

#if defined(SK_WIN_NATIVE)
    view = new WView(q, NULL);
#elif defined(Q_OS_WIN)
    view = new WView(q, NULL, Qt::FramelessWindowHint | Qt::WindowMinimizeButtonHint);
#else
    view = new WView(q, NULL, Qt::FramelessWindowHint);
#endif

#ifdef QT_4
    view->setWindowTitle(sk->name());
#else
    view->setTitle(sk->name());
#endif

    if (icon.isEmpty() == false)
    {
#ifdef QT_4
        view->setWindowIcon(QIcon(icon));
#else
        view->setIcon(QIcon(icon));
#endif
    }

    view->setVisible(true);

    //---------------------------------------------------------------------------------------------
    // Signals

    QObject::connect(view, SIGNAL(messageReceived(const QString &)),
                     q,    SIGNAL(messageReceived(const QString &)));

    QObject::connect(view, SIGNAL(stateChanged(Qt::WindowState)),
                     q,    SIGNAL(stateChanged(Qt::WindowState)));

    QObject::connect(view, SIGNAL(fadeIn ()), q, SIGNAL(fadeIn ()));
    QObject::connect(view, SIGNAL(fadeOut()), q, SIGNAL(fadeOut()));

    QObject::connect(view, SIGNAL(dragEnded()), q, SIGNAL(dragEnded()));

    QObject::connect(view, SIGNAL(beforeClose()), q, SIGNAL(beforeClose()));

    //---------------------------------------------------------------------------------------------

    QObject::connect(view, SIGNAL(itemWidthChanged ()), q, SIGNAL(itemWidthChanged ()));
    QObject::connect(view, SIGNAL(itemHeightChanged()), q, SIGNAL(itemHeightChanged()));

    QObject::connect(view, SIGNAL(xChanged()), q, SIGNAL(viewXChanged()));
    QObject::connect(view, SIGNAL(yChanged()), q, SIGNAL(viewYChanged()));

    QObject::connect(view, SIGNAL(widthChanged ()), q, SIGNAL(viewWidthChanged ()));
    QObject::connect(view, SIGNAL(heightChanged()), q, SIGNAL(viewHeightChanged()));

    QObject::connect(view, SIGNAL(centerXChanged()), q, SIGNAL(centerXChanged()));
    QObject::connect(view, SIGNAL(centerYChanged()), q, SIGNAL(centerYChanged()));

    QObject::connect(view, SIGNAL(originXChanged()), q, SIGNAL(originXChanged()));
    QObject::connect(view, SIGNAL(originYChanged()), q, SIGNAL(originYChanged()));

    QObject::connect(view, SIGNAL(ratioChanged()), q, SIGNAL(ratioChanged()));

    QObject::connect(view, SIGNAL(zoomChanged()), q, SIGNAL(zoomChanged()));

    QObject::connect(view, SIGNAL(minimumWidthChanged ()), q, SIGNAL(minimumWidthChanged ()));
    QObject::connect(view, SIGNAL(minimumHeightChanged()), q, SIGNAL(minimumHeightChanged()));

    QObject::connect(view, SIGNAL(maximumWidthChanged ()), q, SIGNAL(maximumWidthChanged ()));
    QObject::connect(view, SIGNAL(maximumHeightChanged()), q, SIGNAL(maximumHeightChanged()));

    QObject::connect(view, SIGNAL(geometryNormalChanged()), q, SIGNAL(geometryNormalChanged()));

    QObject::connect(view, SIGNAL(minimizedChanged ()), q, SIGNAL(minimizedChanged ()));
    QObject::connect(view, SIGNAL(maximizedChanged ()), q, SIGNAL(maximizedChanged ()));
    QObject::connect(view, SIGNAL(fullScreenChanged()), q, SIGNAL(fullScreenChanged()));
    QObject::connect(view, SIGNAL(lockedChanged    ()), q, SIGNAL(lockedChanged    ()));
    QObject::connect(view, SIGNAL(scalingChanged   ()), q, SIGNAL(scalingChanged   ()));

    QObject::connect(view, SIGNAL(activeChanged  ()), q, SIGNAL(activeChanged  ()));
    QObject::connect(view, SIGNAL(enteredChanged ()), q, SIGNAL(enteredChanged ()));
    QObject::connect(view, SIGNAL(draggingChanged()), q, SIGNAL(draggingChanged()));
    QObject::connect(view, SIGNAL(draggedChanged ()), q, SIGNAL(draggedChanged ()));
    QObject::connect(view, SIGNAL(resizingChanged()), q, SIGNAL(resizingChanged()));
    QObject::connect(view, SIGNAL(touchingChanged()), q, SIGNAL(touchingChanged()));

    QObject::connect(view, SIGNAL(mousePosChanged   ()), q, SIGNAL(mousePosChanged   ()));
    QObject::connect(view, SIGNAL(mouseCursorChanged()), q, SIGNAL(mouseCursorChanged()));

#ifdef QT_4
    QObject::connect(view, SIGNAL(openglChanged()), q, SIGNAL(openglChanged()));
#endif

    QObject::connect(view, SIGNAL(antialiasChanged()), q, SIGNAL(antialiasChanged()));
    QObject::connect(view, SIGNAL(vsyncChanged    ()), q, SIGNAL(vsyncChanged    ()));

    QObject::connect(view, SIGNAL(hoverEnabledChanged()), q, SIGNAL(hoverEnabledChanged()));

    QObject::connect(view, SIGNAL(fadeEnabledChanged ()), q, SIGNAL(fadeEnabledChanged ()));
    QObject::connect(view, SIGNAL(fadeDurationChanged()), q, SIGNAL(fadeDurationChanged()));

    //---------------------------------------------------------------------------------------------

    QObject::connect(view, SIGNAL(idleCheckChanged()), q, SIGNAL(idleCheckChanged()));
    QObject::connect(view, SIGNAL(idleChanged     ()), q, SIGNAL(idleChanged     ()));
    QObject::connect(view, SIGNAL(idleDelayChanged()), q, SIGNAL(idleDelayChanged()));

    //---------------------------------------------------------------------------------------------

    QObject::connect(view, SIGNAL(mousePressed(WDeclarativeMouseEvent *)),
                     q,    SIGNAL(mousePressed(WDeclarativeMouseEvent *)));

    QObject::connect(view, SIGNAL(mouseReleased(WDeclarativeMouseEvent *)),
                     q,    SIGNAL(mouseReleased(WDeclarativeMouseEvent *)));

    QObject::connect(view, SIGNAL(mouseDoubleClicked(WDeclarativeMouseEvent *)),
                     q,    SIGNAL(mouseDoubleClicked(WDeclarativeMouseEvent *)));

    QObject::connect(view, SIGNAL(keyPressed(WDeclarativeKeyEvent *)),
                     q,    SIGNAL(keyPressed(WDeclarativeKeyEvent *)));

    QObject::connect(view, SIGNAL(keyReleased(WDeclarativeKeyEvent *)),
                     q,    SIGNAL(keyReleased(WDeclarativeKeyEvent *)));

    //---------------------------------------------------------------------------------------------

    QObject::connect(view, SIGNAL(keyShiftPressedChanged()),
                     q,    SIGNAL(keyShiftPressedChanged()));

    QObject::connect(view, SIGNAL(keyControlPressedChanged()),
                     q,    SIGNAL(keyControlPressedChanged()));

    QObject::connect(view, SIGNAL(keyAltPressedChanged()),
                     q,    SIGNAL(keyAltPressedChanged()));

    //---------------------------------------------------------------------------------------------

    QObject::connect(view, SIGNAL(availableGeometryChanged()),
                     q,    SIGNAL(availableGeometryChanged()));
}
예제 #4
0
void PlotCanvas::setScaling(qreal arg)
{
    if (m_scaling == arg) return;
    m_scaling = arg;
    emit scalingChanged(arg);
}
예제 #5
0
void VolumeScaling::uniformScalingChanged() {
    if (uniformScaling_.get())
        scalingChanged(0);
}
예제 #6
0
Dataset3D::Dataset3D( QDir filename, std::vector<QVector3D> data, nifti_image* header ) :
    DatasetNifti( filename, Fn::DatasetType::NIFTI_VECTOR, header ),
    m_data( data ),
    m_renderer( 0 ),
    m_stippleRenderer( 0 )
{
    m_properties["maingl"].createInt( Fn::Property::D_COLORMAP, -1 );
    m_properties["maingl"].createBool( Fn::Property::D_INTERPOLATION, false, "general" );
    m_properties["maingl"].createFloat( Fn::Property::D_ALPHA, 1.0f, 0.0, 1.0, "general" );
    m_properties["maingl"].createInt( Fn::Property::D_DIM, 3 );
    m_properties["maingl"].createFloat( Fn::Property::D_SCALING, 1.0f, 0.0f, 2.0f, "general" );
    m_properties["maingl"].createFloat( Fn::Property::D_OFFSET, 0.0f, -0.5, 0.5, "general" );
    m_properties["maingl"].createBool( Fn::Property::D_RENDER_VECTORS_STICKS, false, "general" );
    m_properties["maingl"].createBool( Fn::Property::D_RENDER_SAGITTAL, false, "general" );
    m_properties["maingl"].createBool( Fn::Property::D_RENDER_CORONAL, false, "general" );
    m_properties["maingl"].createBool( Fn::Property::D_RENDER_AXIAL, true, "general" );
    m_properties["maingl"].createBool( Fn::Property::D_HAS_TEXTURE, true );

    connect( m_properties["maingl"].getProperty( Fn::Property::D_RENDER_VECTORS_STICKS ), SIGNAL( valueChanged( QVariant ) ), this, SLOT( switchRenderSticks() ) );
    connect( m_properties["maingl"].getProperty( Fn::Property::D_SCALING ), SIGNAL( valueChanged( QVariant ) ), this, SLOT( scalingChanged() ) );

    m_properties["maingl"].createBool( Fn::Property::D_RENDER_VECTORS_STIPPLES, false, "stipples" );
    connect( m_properties["maingl"].getProperty( Fn::Property::D_RENDER_VECTORS_STIPPLES ), SIGNAL( valueChanged( QVariant ) ), this, SLOT( switchRenderStipples() ) );
    m_properties["maingl"].createList( Fn::Property::D_STIPPLE_PROB_MASK, { "none" }, 0, "stipples" );
    connect( m_properties["maingl"].getProperty( Fn::Property::D_STIPPLE_PROB_MASK ), SIGNAL( valueChanged( QVariant ) ), this, SLOT( probMaskChanged() ) );
    m_properties["maingl"].createColor( Fn::Property::D_COLOR, QColor( 255, 0, 0 ), "stipples" );
    m_properties["maingl"].createFloat( Fn::Property::D_STIPPLE_THICKNESS, 1.0f, 0.1f, 5.0f, "stipples" );
    m_properties["maingl"].createFloat( Fn::Property::D_STIPPLE_GLYPH_SIZE, 1.0f, 1.0f, 5.0f, "stipples" );
    m_properties["maingl"].createList( Fn::Property::D_STIPPLE_SLICE_ORIENT, { "axial", "coronal", "sagittal" }, 0, "stipples" );

    examineDataset();

    PropertyGroup props2( m_properties["maingl"] );
    m_properties.insert( "maingl2", props2 );
    m_properties["maingl2"].getProperty( Fn::Property::D_ACTIVE )->setPropertyTab( "general" );

    connect( Models::g(), SIGNAL( dataChanged( QModelIndex, QModelIndex ) ), this, SLOT( updateMaskSelect() ) );
    connect( Models::d(), SIGNAL( dataChanged( QModelIndex, QModelIndex ) ), this, SLOT( updateMaskSelect() ) );

    updateMaskSelect();
    probMaskChanged();
}