Пример #1
0
void Slider::reloadSlider()
{
    slider->hide();
    if (orientation == 0) {
      slider->setOrientation(Qt::Horizontal);
      slider->setGeometry(x()+10, height()/2-10, width()-20, 20);
    }
      else if (orientation == 1) {
             slider->setOrientation(Qt::Vertical);
             slider->setGeometry(width()/2-10, 10, 20, height()-20);
           }
    slider->setMinValue(-32768);
    slider->show();

    setTickmarks (tickmarks);
    setTickInterval (tickInterval);
    setTracking (tracking);
    setPageStep(pageStep);
    setMainColor(mainColor);
    setTickmarksColor(tickmarksColor);

    setMinValue(minValue);
    setMaxValue(maxValue);
    if (direction == 0) slider->setValue((int)(-32768 + (value-minValue)/lineStep));
      else if (direction == 1) slider->setValue((int)(-32768 + (maxValue-value)/lineStep));

    setNewMask();
}
Пример #2
0
Slider::Slider( QWidget *parent, const char *name,Qt::WFlags flag)
       :VtlWidget( parent, name, flag)
{
    resize(100,40);

    slider = new QSlider(this);
    slider->setOrientation(Qt::Horizontal);
    slider->setGeometry(10,10,80,20);
    slider->setMinValue(-32768);
    slider->show();

    orientation = Qt::Horizontal;
    direction = LeftToRight;
    minValue = 0;
    maxValue = 100;
    value = 0;
    tracking = Disabled;
    tickmarks = 0;
    tickInterval = 10;
    lineStep = 10;
    pageStep = 10;
    mainColor = Qt::white;
    tickmarksColor = Qt::black;
    precision = 1;

    setTickmarks (tickmarks);
    setTickInterval (tickInterval);
    setTracking (tracking);
    setDirection(direction);
    setLineStep(lineStep);
    setPageStep(pageStep);
    setMainColor(mainColor);
    setTickmarksColor(tickmarksColor);

    setNewMask();

    MDIRef = NULL;

    connect(slider, SIGNAL(valueChanged(int)), this, SLOT(onValueChanged(int)));
    connect(slider, SIGNAL(sliderMoved(int)), this, SLOT(setNewMask()));
}
Пример #3
0
void MainWindow::_init()
{

    setWindowState(Qt::WindowFullScreen);
    m_bPerspectiveProjection = false;
    ui->radioBtnTransformation->hide();
    m_bHideFaces = false;
    m_pView = new CCoordinateView(this);
    m_pView3D = new C3DView(PROJECTION_DEFAULT,this);
    m_pView3D->hide();
//    m_pView->hide();
    //m_pView->hideGrid(true);
    //m_pView->hideGrid(false);

    ui->viewFrameGrid->addWidget(m_pView);
    ui->viewFrameGrid->addWidget(m_pView3D);

    m_pDebugBox = new CDebugModeBox(this);
    ui->sidePanel->addWidget(m_pDebugBox);
    m_pDebugBox->setDisabled(true);

    m_pTmpUndoStack.clear();

    m_firstPoint = QPoint(0,0);
    m_secondPoint = QPoint(0,0);

    m_btnClickState = MCS_UNDEFINED;

    m_pCurrentListener = NULL;

    m_bHighlightInitPoints = false;
    m_mainColor = QColor(Qt::blue);
    //m_mainColor.setAlpha(10);
    m_secondaryColor = QColor(Qt::red);


    ui->btnSecondaryColor->setAutoFillBackground(true);
    ui->btnMainColor->setAutoFillBackground(true);

    m_mode = MODE_NORMAL;


    ui->radioBtnAlgDDA->setChecked(true);
    ui->radioBtnAlgBrezenhema->setChecked(false);

    ui->radioBtnDefaultMode->setChecked(true);
    //defaultModeEnable();

    //ui->debugInfoBrowser->setUndoRedoEnabled(true);

    m_drawShapeType = DST_LINE;

    //m_pListener = new CListenerLineDDA(m_pView, m_pDebugBox,QColor(Qt::red), QColor(Qt::blue));

    connect(m_pView,SIGNAL(clickOnCell(int,int)),this,SLOT(mouseClickOnCell(int,int)));
    connect(m_pView,SIGNAL(moveOnCell(int,int)),this,SLOT(mouseMoveOnCell(int,int)));
    connect(m_pView,SIGNAL(releaseOnScene(int,int)),this,SLOT(mouseReleaseOnCell(int,int)));
//    connect(ui->btnZoomIn,SIGNAL(clicked()),m_pView,SLOT(zoomIn()));
//    connect(ui->btnZoomOut,SIGNAL(clicked()),m_pView,SLOT(zoomOut()));

    connect(ui->btnMainColor,SIGNAL(clicked()),this,SLOT(setMainColor()));
    connect(ui->btnSecondaryColor,SIGNAL(clicked()),this,SLOT(setSecondaryColor()));

    connect(ui->btnClear,SIGNAL(clicked()),this,SLOT(clearView()));

    connect(ui->radioBtnDebugMode,SIGNAL(clicked()),this,SLOT(debugModeEnable()));
    connect(ui->radioBtnDefaultMode,SIGNAL(clicked()),this,SLOT(defaultModeEnable()));


    connect(ui->checkBoxHightlightEndPoints,SIGNAL(clicked()),this,SLOT(highlightEndPoints()));

    connect(ui->radioBtnAlgBrezenhema,SIGNAL(clicked()),this,SLOT(drawAlgorithmChanged()));
    connect(ui->radioBtnAlgDDA,SIGNAL(clicked()),this,SLOT(drawAlgorithmChanged()));
    connect(ui->radioBtnRound,SIGNAL(clicked()),this,SLOT(drawAlgorithmChanged()));
    connect(ui->radioBtnAlgorithmParabola,SIGNAL(clicked()),this,SLOT(drawAlgorithmChanged()));
    connect(ui->radioBtnBSpline,SIGNAL(clicked()),this,SLOT(drawAlgorithmChanged()));
    connect(ui->radioBtnBese,SIGNAL(clicked()),this,SLOT(drawAlgorithmChanged()));
    connect(ui->radioBtnLineFilling,SIGNAL(clicked()),this,SLOT(drawAlgorithmChanged()));
    connect(ui->radioBtnLineVertexFilling,SIGNAL(clicked()),this,SLOT(drawAlgorithmChanged()));
    connect(ui->radioBtnTransformation,SIGNAL(clicked()),this,SLOT(drawAlgorithmChanged()));


    connect(ui->tabAlgorithms,SIGNAL(currentChanged(int)),this,SLOT(algorithmTabIndexChanged(int)));
    connect(ui->zoomSlider,SIGNAL(valueChanged(int)),this,SLOT(zoomChanged(int)));


    connect(ui->checkBoxHightlight,SIGNAL(clicked()),this,SLOT(perspectiveProjection()));
    connect(ui->checkBoxHideFaces,SIGNAL(clicked()),this,SLOT(hideFaces()));

    //connect(ui->btnRunThread, SIGNAL(clicked()),this,SLOT(runThread()));

    ui->radioBtnAlgDDA->setChecked(true);
    ui->radioBtnAlgBrezenhema->setChecked(false);
    ui->radioBtnDefaultMode->setChecked(true);

    createListeners();
    ui->radioBtnAlgDDA->click();

    _setMainColor(m_mainColor);
    _setSecondaryColor(m_secondaryColor);


//    CAlgorithmVertexLineFilling alg;
//    QList<QPoint> list;
//    list << QPoint(0,0) << QPoint(20,0) << QPoint(10,10) ;//<< QPoint(20,20) << QPoint(20,0);// << QPoint(20,20) << QPoint(-15,3);
//    alg.setPoints(list);
//    //qDebug() << alg.getDrawPoints();
//    StepPoints points = alg.getDrawPoints();
//    for(int i=0; i<points.size();i++)
//    {
//        m_pView->setCellColor(points.at(i),m_mainColor);
//    }

    m_lastZoomValue = ui->zoomSlider->value();
}
Пример #4
0
GraphViewEvent::GraphViewEvent(QWidget *parent):GraphViewResults(parent),
mEvent(0)
{
    setMainColor(QColor(100, 100, 100));
    mGraph->setBackgroundColor(QColor(230, 230, 230));
}
Пример #5
0
bool Slider::onPropertyChanged(const QString& name, const QVariant& val)
{
    
    if ( VtlWidget::onPropertyChanged(name, val) )
      return TRUE;

    VtlActionHandler* actHandler = ((VtlWindow*)this->parentWidget())->actionHandler();  

    if (name == (QString) "PROCNAME") {
      processName = val.toString();
    }  
    else if (name == (QString) "ORIENTATION") {
           actHandler->setProperty(this, name, QVariant(orientation), val);
           setOrientation(val.toInt());
    }
    else if (name == (QString) "MINVALUE") {
           actHandler->setProperty(this, name, QVariant(minValue), val);
           setMinValue(val.toDouble());
    }
    else if (name == (QString) "MAXVALUE") {
           actHandler->setProperty(this, name, QVariant(maxValue), val);
           setMaxValue(val.toDouble());
    }
    else if (name == (QString) "DIRECTION") {
           actHandler->setProperty(this, name, QVariant(direction), val);
           setDirection(val.toInt());
    }
    else if (name == (QString )"SOURCER") {
      if ( val.toString() != "None" ) {
        _sourcer = SourcerConnector<VtlWidget>::change (this, _sourcer, val.toString() );
      }
      else 
        _sourcer = 0;
    }
    else if (name == (QString) "TRACKING") {
           actHandler->setProperty(this, name, QVariant(tracking), val);
           setTracking(val.toInt());
    }
    else if (name == (QString) "TICKMARKS") {
           actHandler->setProperty(this, name, QVariant(tickmarks), val);
           setTickmarks(val.toInt());
    }
    else if (name == (QString) "TICKINTERVAL") {
           actHandler->setProperty(this, name, QVariant(tickInterval), val);
           setTickInterval(val.toInt());
    }
    else if (name == (QString) "LINESTEP") {
           actHandler->setProperty(this, name, QVariant(lineStep), val);
           setLineStep(val.toDouble());
    }
    else if (name == (QString) "PAGESTEP") {
           actHandler->setProperty(this, name, QVariant(pageStep), val);
           setPageStep(val.toInt());
    }
    else if (name == (QString) "MAIN_COLOR") {
           actHandler->setProperty(this, name, QVariant(mainColor), val);
           setMainColor(val.toColor());
    }
    else if (name == (QString) "TICKMARKS_COLOR") {
           actHandler->setProperty(this, name, QVariant(tickmarksColor), val);
           setTickmarksColor(val.toColor());
    }
    else if (name == (QString) "PRECISION") {
           actHandler->setProperty(this, name, QVariant(precision), val);
           setPrecision(val.toInt());
    }

    repaint();
    return TRUE;
}