Skip to content
Snippets Groups Projects
petrack.cpp 140 KiB
Newer Older
void Petrack::skipToFrameFromTrajectory(QPointF pos)
{
    auto       peds      = getPedestrianUserSelection();
    const auto before    = mControlWidget->getTrackShowBefore();
    const auto after     = mControlWidget->getTrackShowAfter();
    const auto currFrame = mPlayerWidget->getPos();
    FrameRange frameRange{before, after, currFrame};
    auto res = mPersonStorage.getProximalPersons(pos, peds, frameRange);

    if(res.size() == 1)
    {
        mPlayerWidget->skipToFrame(res.front().frame);
    }
    else if(res.size() > 1)
    {
        PWarning(
            this,
            tr("Too many trajectories"),
            tr("PeTrack can't determine which point you meant. Try selecting fewer trajectories first."));
    }
}

void Petrack::setGitInformation(
    const std::string &gitCommitID,
    const std::string &gitCommitDate,
    const std::string &gitCommitBranch)
    mGitCommitID     = QString::fromStdString(gitCommitID);
    mGitCommitDate   = QString::fromStdString(gitCommitDate);
    mGitCommitBranch = QString::fromStdString(gitCommitBranch);
}

void Petrack::setCompileInformation(
    const std::string &compileOS,
    const std::string &compileTimeStamp,
    const std::string &compilerID,
    const std::string &compilerVersion)
    mCompileOS       = QString::fromStdString(compileOS);
    mCompileDate     = QString::fromStdString(compileTimeStamp);
    mCompilerID      = QString::fromStdString(compilerID);
    mCompilerVersion = QString::fromStdString(compilerVersion);
}

#include "moc_petrack.cpp"