Skip to content
Snippets Groups Projects
analysePlot.h 3.23 KiB
Newer Older
/*
 * PeTrack - Software for tracking pedestrians movement in videos
 * Copyright (C) 2010-2020 Forschungszentrum Jülich GmbH,
 * Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand,
 * Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

d.kilic's avatar
d.kilic committed
#ifndef ANALYSEPLOT_H
#define ANALYSEPLOT_H

//#ifdef QWT // kann nicht nur in .pro ausgeschlossen werden, da auch von ui benutzt wird

#include <QPen>

#include <qwt_plot.h>
#include <qwt_plot_zoomer.h>
#include <qwt_plot_item.h>

#include "helper.h"
#include "tracker.h"
#include "trackerReal.h"

class Control;

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

class TrackerRealPlotItem: public QwtPlotItem
{
public:
    TrackerRealPlotItem();

    void draw(QPainter* p, const QwtScaleMap& mapX, const QwtScaleMap& mapY, const QRectF& re) const;

    void setPen(const QPen &pen);

//     void setModel(int model, int x, int y);

    void setTrackerReal(TrackerReal* trackerReal);

private:
    TrackerReal *mTrackerReal;
//     int mModel, mX, mY;
    QPen mPen;
};

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

class AnalysePlot: public QwtPlot
{
    Q_OBJECT

public:
    AnalysePlot(QWidget *parent = NULL);

    void setCursor(const QColor &col);

    QPoint getPos(const QColor &col) const;

//     double map(const QColor &col) const;

    inline void setControlWidget(Control *control)
    {
        mControlWidget = control;
    }
    inline Control * getControlWidget() const
    {
        return mControlWidget;
    }
    inline void setActFrame(int f)
    {
        mActFrame = f;
    }
    inline int getActFrame() const
    {
        return mActFrame;
    }
    void setTrackerReal(TrackerReal* TR);
    void setScale();
//     void updateTracker();

    inline double symbolSize() const
    {
        return mSymbolSize;
    }
    inline void setSymbolSize(double s)
    {
        mSymbolSize = s;
    }
    QwtPlotZoomer * getZoomer()
    {
        return mZoomer;
    }

    inline double xMax() const
    {
        return mXMax;
    }
    inline double yMax() const
    {
        return mYMax;
    }

private:
    double mSymbolSize;
    double mXMin, mXMax, mYMin, mYMax;
    Control *mControlWidget;
    TrackerReal *mTrackerReal;
//     ImagePlotItem *mImageItem;
    TrackerRealPlotItem *mTrackerRealItem;
//     RectPlotItem *mRectItem;
//     ViewAnalysePlotItem *mViewAnalyseItem;
    QwtPlotZoomer *mZoomer;
    int mActFrame;
};

//#else // QWT nicht verfuegbar
//class AnalysePlot: public QWidget
//{
//    Q_OBJECT
//}
//#endif

#endif