Exemplo n.º 1
0
void OverviewWidget::renderPreviews() {
    if(autoPreview_) {
        if (renderPort_) {
            int currentFrame = currentFrame_;
            if (!previews_.empty()) {
                for (size_t vs = 0; vs < previews_.size(); vs++) {
                    overviewScene_->removeItem(previews_.at(vs));
                }
            }
            previews_.clear();
            int quadSize = 40;
            int stepLength = duration_ / quadSize;
            if (stepLength < quadSize)
                stepLength = quadSize;
            // save the current settings
            tgt::ivec2 size = renderPort_->getSize();
            renderPort_->resize(tgt::ivec2(quadSize,quadSize));
            QPixmap previewPixmap;
            QImage* preview = 0;
            for (int i = 0; i < duration_ - 1; i += stepLength) {
                preview = new QImage(QSize(quadSize,quadSize), QImage::Format_ARGB32);
                emit currentFrameChanged(i);
                networkEvaluator_->process();
                tgt::col4* buffer = renderPort_->readColorBuffer<uint8_t>(); // TODO: catch exceptions
                for (int x = quadSize-1; x >= 0; x-=1) {
                    for (int y = 0; y < quadSize; y+=1) {
                        QColor color(buffer->r, buffer->g, buffer->b, 255);
                        QRgb rgba = color.rgba();
                        preview->setPixel(x,y, rgba);
                        buffer++;
                    }
                }
                const QImage img = preview->copy(0,0, quadSize,quadSize);

                previewPixmap = QPixmap::fromImage(img);
                QGraphicsPixmapItem* pixmapItem = overviewScene_->addPixmap(previewPixmap);
                previews_.push_back(pixmapItem);
                pixmapItem->moveBy(i, 26);
                pixmapItem->setZValue(-1);
            }
            delete preview;
            renderPort_->resize(size);
            setCurrentFrame(currentFrame);
            emit currentFrameChanged(currentFrame);
        }
    }

}
Exemplo n.º 2
0
void Controller::update()
{
    GuiDataVect data = engine.getVisibleData();
    clearCurrentFrameData();
    QString roomId = QString::fromStdString(engine.getRoomsManager()->currentRoom()->id);
    if (current_room != roomId) {
        current_room = roomId;
        emit roomChanged();
    }
    for (GuiDataVect::iterator i = data.begin(); i != data.end(); ++i){
        GuiData data = (*i);
        engine.relToAbsRect(data.rect);
        QGuiData *d = new QGuiData();
        d->setX(data.rect.x);
        d->setY(data.rect.y);
        d->setWidth(data.rect.w);
        d->setHeight(data.rect.h);
        d->setAlpha(data.alpha);
        d->setId(QString::fromStdString(data.id));
        if (data.text != ""){
            d->setTextFlag();
            d->setContent(QString::fromStdString(data.text));
        } else if (data.image != ""){
            d->setContent(QString::fromStdString(data.image));
        } else {
            continue; //inventory_label non ha ne testo ne immagine
        }
        _currentFrameData.append(d);
    }
    emit currentFrameChanged();
}
Exemplo n.º 3
0
void AnimationEditor::end() {
    if(interactionMode_)
        animation_->setInteractionMode(false);
    currentFrame_ = static_cast<int>(duration_);
    timer_->stop();
    animation_->renderAt((float)currentFrame_/30.0f);
    emit currentFrameChanged(currentFrame_);
}
Exemplo n.º 4
0
void Model::togglePin(int index) {
    if (_running)
        return;
    if (!hasFrames())
        return;
    _current->togglePin(index);
    emit currentFrameChanged();
}
Exemplo n.º 5
0
void Control::setCurrentFrame(size_t frame)
{
    if (IsSlave)
        return;

    FileInfoData->Frames_Pos_Set(frame);
    Q_EMIT currentFrameChanged();
}
Exemplo n.º 6
0
//---------------------------------------------------------------------------
void Control::on_M9_clicked(bool checked)
{
    if (IsSlave)
        return;

    FileInfoData->Frames_Pos_Set(0);
    Q_EMIT currentFrameChanged();
}
Exemplo n.º 7
0
void OverviewView::mouseMoveEvent(QMouseEvent* e) {
    QScrollBar* scroll = horizontalScrollBar();
    if (barMovement_) {
        emit barMovement(offset_ - 1 * (relativeBarPosition_ - e->pos().x()));
    }
    else if (slide_ && e->x()+ scroll->value() >= 0 && e->x() + scroll->value() <= AnimationEditor::getDuration()) {
        currentFrameGraphicsItem_->setPos(e->x() + scroll->value(), 20);
        emit currentFrameChanged(e->x() + scroll->value());
    }
    else if (slide_ && e->x()+ scroll->value() > AnimationEditor::getDuration()) {
        currentFrameGraphicsItem_->setPos(AnimationEditor::getDuration(), 20);
        emit currentFrameChanged(static_cast<int>(AnimationEditor::getDuration()));
    }
    else if (slide_ && e->x()+ scroll->value() < 0) {
        currentFrameGraphicsItem_->setPos(0, 20);
        emit currentFrameChanged(0);
    }
}
Exemplo n.º 8
0
void Editor::scrubTo(int frame)
{
    if (frame < 1) { frame = 1; }
    int oldFrame = mFrame;
    mFrame = frame;

    Q_EMIT currentFrameChanged(oldFrame);
    Q_EMIT currentFrameChanged(frame);

    // FIXME: should not emit Timeline update here.
    // Editor must be an individual class.
    // Will remove all Timeline related code in Editor class.
    if (mPlaybackManager && !mPlaybackManager->isPlaying())
    {
        emit updateTimeLine(); // needs to update the timeline to update onion skin positions
    }
    mObject->updateActiveFrames(frame);
}
Exemplo n.º 9
0
//---------------------------------------------------------------------------
void MainWindow::createGraphsLayout()
{
    clearGraphsLayout();

    if (Files_CurrentPos==(size_t)-1)
    {
        for (size_t type = 0; type < Type_Max; type++)
            for (size_t group=0; group<PerStreamType[type].CountOfGroups; group++)
                if (CheckBoxes[type][group])
                    CheckBoxes[type][group]->hide();
        if (ui->fileNamesBox)
            ui->fileNamesBox->hide();

        createDragDrop();
        return;
    }
    clearDragDrop();

    for (size_t type = 0; type < Type_Max; type++)
        for (size_t group=0; group<PerStreamType[type].CountOfGroups; group++)
            if (CheckBoxes[type][group] && Files_CurrentPos<Files.size() && Files[Files_CurrentPos]->ActiveFilters[PerStreamType[type].PerGroup[group].ActiveFilterGroup])
                CheckBoxes[type][group]->show();
            else
                CheckBoxes[type][group]->hide();
    if (ui->fileNamesBox)
        ui->fileNamesBox->show();

    PlotsArea=Files[Files_CurrentPos]->Stats.empty()?NULL:new Plots(this, Files[Files_CurrentPos]);
    if (!ui->actionGraphsLayout->isChecked())
        PlotsArea->hide();
    ui->verticalLayout->addWidget(PlotsArea);

    TinyDisplayArea=new TinyDisplay(this, Files[Files_CurrentPos]);
    if (!ui->actionGraphsLayout->isChecked())
        TinyDisplayArea->hide();
    ui->verticalLayout->addWidget(TinyDisplayArea);

    ControlArea=new Control(this, Files[Files_CurrentPos], Control::Style_Cols);
    connect( ControlArea, SIGNAL( currentFrameChanged() ), 
        this, SLOT( on_CurrentFrameChanged() ) );

    if (!ui->actionGraphsLayout->isChecked())
        ControlArea->hide();
    ui->verticalLayout->addWidget(ControlArea);

    //InfoArea=new Info(this, Files[Files_CurrentPos], Info::Style_Grid);
    //ui->verticalLayout->addWidget(InfoArea);

    TinyDisplayArea->ControlArea=ControlArea;
    ControlArea->TinyDisplayArea=TinyDisplayArea;
    ControlArea->InfoArea=InfoArea;

    refreshDisplay();

    configureZoom();
}
Exemplo n.º 10
0
//---------------------------------------------------------------------------
void Control::on_P9_clicked(bool checked)
{
    if (IsSlave)
        return;

    if (FileInfoData->ReferenceStat()->x_Current_Max)
    {
        FileInfoData->Frames_Pos_Set(FileInfoData->ReferenceStat()->x_Current_Max-1);
        Q_EMIT currentFrameChanged();
    }
}
Exemplo n.º 11
0
void Model::goPrev()
{
    if (_running)
        return;
    if (!hasFrames())
        return;
    if (_current == _frames.begin())
        return;

    _current--;
    _index--;
    emit currentFrameChanged();
}
Exemplo n.º 12
0
void Model::frameTimeout() {
    if (!_running)
        return;

    if (++_current == _frames.end()) {
        _current = _frames.begin();
        _index = 0;
    } else {
        _index++;
    }
    emit currentFrameChanged();
    QTimer::singleShot(100, this, SLOT(frameTimeout()));
}
Exemplo n.º 13
0
void Model::goFirst()
{
    if (_running)
        return;
    if (!hasFrames())
        return;
    if (_current == _frames.begin())
        return;

    _current = _frames.begin();
    _index = 0;
    emit currentFrameChanged();
}
Exemplo n.º 14
0
void Model::addBlankFrame()
{
    if (_running)
        return;
    Frame frame(0x00, 100);
    if (hasFrames()) {
        _current++;
        _index++;
    }
    _current = _frames.insert(_current, frame);
    _total++;
    emit currentFrameChanged();
}
Exemplo n.º 15
0
void Model::goNext()
{
    if (_running)
        return;
    if (!hasFrames())
        return;
    Frames::iterator next = _current;
    if (++next == _frames.end())
        return;

    _current++;
    _index++;
    emit currentFrameChanged();
}
Exemplo n.º 16
0
void Model::goLast()
{
    if (_running)
        return;
    if (!hasFrames())
        return;
    Frames::iterator next = _current;
    if (++next == _frames.end())
        return;

    _current = _frames.end();
    _current--;
    _index = _total - 1;
    emit currentFrameChanged();
}
Exemplo n.º 17
0
void OverviewView::mousePressEvent(QMouseEvent* e) {
    if (scene_->itemAt(mapToScene(e->pos()).x(), mapToScene(e->pos()).y())
        && scene_->itemAt(mapToScene(e->pos()).x(), mapToScene(e->pos()).y())->boundingRect() == highlightBar_->boundingRect()) {
        barMovement_ = true;
        relativeBarPosition_ = e->pos().x();
    }
    else if (e->button() == Qt::LeftButton) {
        QScrollBar* scroll = horizontalScrollBar();
        if (e->x()+ scroll->value() >= 0 && e->x()+ scroll->value() <= AnimationEditor::getDuration()) {
            currentFrameGraphicsItem_->setPos(e->x() + scroll->value(), 20);
            slide_ = true;
            emit currentFrameChanged(e->x() + scroll->value());
        }
    }
    QGraphicsView::mousePressEvent(e);
}
Exemplo n.º 18
0
DCameraView::DCameraView(QWidget *parent) :
    QFrame(parent),
    m_source(NULL),
    m_mirroredHorizontal(false),
    m_mirroredVertical(false),
    m_scale(1.0),
    m_aspectRatioMode(Qt::KeepAspectRatio),
    m_brightness(0),
    m_contrast(0),
    m_hue(0),
    m_saturation(0),
    m_round(false)
{
    cameraFormatProxy = new CameraFormatProxy(this);
    connect(cameraFormatProxy, SIGNAL(currentFrameChanged()), this, SLOT(repaint()));
}
Exemplo n.º 19
0
void Model::deleteCurrentFrame()
{
    if (_running)
        return;
    if (!hasFrames())
        return;

    _current = _frames.erase(_current);
    if (_current == _frames.end() && _frames.begin() != _frames.end()) {

        _current--;
        _index--;
    }

    _total--;
    emit currentFrameChanged();
}
Exemplo n.º 20
0
void Editor::scrubTo( int frame )
{
    if ( frame < 1 )
    {
        frame = 1;
    }
    int oldFrame = mFrame;
    mFrame = frame;

    if ( mScribbleArea->shouldUpdateAll() )
    {
        mScribbleArea->updateAllFrames();
    }

    Q_EMIT currentFrameChanged( frame );
    
    mScribbleArea->update();
}
Exemplo n.º 21
0
void AnimationEditor::update() {
    if(interactionMode_)
        animation_->setInteractionMode(true);
    else
        animation_->setInteractionMode(false);
    if(currentFrame_ + frameSkip_ < 0) {
        currentFrame_ = 0;
        timer_->stop();
    }
    else if(currentFrame_ + frameSkip_ > duration_) {
        currentFrame_ = static_cast<int>(duration_);
        timer_->stop();
    }
    else
        currentFrame_ +=frameSkip_*timeStretch_;
    emit currentFrameChanged(currentFrame_);
    animation_->renderAt((float)currentFrame_/30.0f);
}
void FramestackWidget::currentSessionChanged(KDevelop::IDebugSession* session)
{
    kDebug() << "Adding session:" << isVisible();

    m_session = session;
    
    m_threads->setModel(session ? session->frameStackModel() : 0);
    m_frames->setModel(session ? session->frameStackModel() : 0);

    if (session) {
        connect(session->frameStackModel(), SIGNAL(currentThreadChanged(int)),
                SLOT(currentThreadChanged(int)));
        currentThreadChanged(session->frameStackModel()->currentThread());
        connect(session->frameStackModel(), SIGNAL(currentFrameChanged(int)),
                SLOT(currentFrameChanged(int)));
        currentFrameChanged(session->frameStackModel()->currentFrame());
    }

    if (isVisible()) {
        showEvent(0);
    }
}
Exemplo n.º 23
0
void AnimationEditor::setCurrentFrame(int currentFrame) {
    currentFrame_ = currentFrame;
    animation_->renderAt((float)currentFrame_/30.0f);
    emit currentFrameChanged(currentFrame_);
    timer_->stop();
}
Exemplo n.º 24
0
void TimelineToolBar::createCenterControls()
{
    addSpacing(5);

    auto *toStart = createAction(TimelineConstants::C_TO_START,
                                 TimelineIcons::TO_FIRST_FRAME.icon(),
                                 tr("To Start"),
                                 QKeySequence(Qt::Key_Home));

    connect(toStart, &QAction::triggered, this, &TimelineToolBar::toFirstFrameTriggered);
    addAction(toStart);

    addSpacing(2);

    auto *previous = createAction(TimelineConstants::C_PREVIOUS,
                                  TimelineIcons::BACK_ONE_FRAME.icon(),
                                  tr("Previous"),
                                  QKeySequence(Qt::Key_Comma));

    connect(previous, &QAction::triggered, this, &TimelineToolBar::previousFrameTriggered);
    addAction(previous);

    addSpacing(2);

    auto *play = createAction(TimelineConstants::C_PLAY,
                              TimelineIcons::START_PLAYBACK.icon(),
                              tr("Play"),
                              QKeySequence(Qt::Key_Space));

    connect(play, &QAction::triggered, this, &TimelineToolBar::playTriggered);
    addAction(play);

    addSpacing(2);

    auto *next = createAction(TimelineConstants::C_NEXT,
                              TimelineIcons::FORWARD_ONE_FRAME.icon(),
                              tr("Next"),
                              QKeySequence(Qt::Key_Period));

    connect(next, &QAction::triggered, this, &TimelineToolBar::nextFrameTriggered);
    addAction(next);

    addSpacing(2);

    auto *toEnd = createAction(TimelineConstants::C_TO_END,
                               TimelineIcons::TO_LAST_FRAME.icon(),
                               tr("To End"),
                               QKeySequence(Qt::Key_End));

    connect(toEnd, &QAction::triggered, this, &TimelineToolBar::toLastFrameTriggered);
    addAction(toEnd);

#if 0
    auto *loop = new QAction(TimelineIcons::LOOP_PLAYBACK.icon(), tr("Loop"), this);
    addAction(loop);
#endif

    addSpacing(5);

    addSeparator();

    m_currentFrame = createToolBarLineEdit(this);
    addWidget(m_currentFrame);

    auto emitCurrentChanged = [this]() { emit currentFrameChanged(m_currentFrame->text().toInt()); };
    connect(m_currentFrame, &QLineEdit::editingFinished, emitCurrentChanged);

    addSeparator();

    addSpacing(10);

    QIcon autoKeyIcon = TimelineUtils::mergeIcons(TimelineIcons::GLOBAL_RECORD_KEYFRAMES,
                                                  TimelineIcons::GLOBAL_RECORD_KEYFRAMES_OFF);

    m_recording = createAction(TimelineConstants::C_AUTO_KEYFRAME,
                               autoKeyIcon,
                               tr("Auto Key"),
                               QKeySequence(Qt::Key_K));

    m_recording->setCheckable(true);
    connect(m_recording, &QAction::toggled, [&](bool value) { emit recordToggled(value); });

    addAction(m_recording);

    addSpacing(10);

    addSeparator();

    addSpacing(10);

    auto *curvePicker = createAction(TimelineConstants::C_CURVE_PICKER,
                                     TimelineIcons::CURVE_EDITOR.icon(),
                                     tr("Curve Picker"),
                                     QKeySequence(Qt::Key_C));

    curvePicker->setObjectName("Curve Picker");
    connect(curvePicker, &QAction::triggered, this, &TimelineToolBar::openEasingCurveEditor);
    addAction(curvePicker);

    addSpacing(10);

#if 0
    addSeparator();

    addSpacing(10);

    auto *curveEditor = new QAction(TimelineIcons::CURVE_PICKER.icon(), tr("Curve Editor"));
    addAction(curveEditor);
#endif
}
Exemplo n.º 25
0
void tttTimelapseManager::backward(){
	m_CurrentFrame--;
	emit currentFrameChanged(m_CurrentFrame);
	this->updateControls();
}
Exemplo n.º 26
0
Model::Model()
{
    _init();
    emit currentFrameChanged();
}
Exemplo n.º 27
0
void AnimationEditor::start() {
    currentFrame_  = 0;
    emit currentFrameChanged(currentFrame_);
}
Exemplo n.º 28
0
void tttTimelapseManager::slotCurrentFrameChanged(unsigned long frame){
	m_CurrentFrame=frame;
	emit currentFrameChanged(m_CurrentFrame);
	this->updateControls();
}
Exemplo n.º 29
0
bool CameraFormatProxy::present(const QVideoFrame &frame)
{
    m_currentFrame = frame;
    emit currentFrameChanged();
    return true;
}
Exemplo n.º 30
0
void tttTimelapseManager::last(){

	m_CurrentFrame =m_Dataset->GetLastTimestamp();
	emit currentFrameChanged(m_CurrentFrame);
	this->updateControls();
}