File indexing completed on 2024-04-21 03:50:56

0001 #ifndef PAINTER_H
0002 #define PAINTER_H
0003 
0004 #include "ui/container.h"
0005 
0006 #include <QVector>
0007 
0008 
0009 /** Base class, responsible for load, display and annotate data. */
0010 class Painter
0011 {
0012 public:
0013     /** Constructor of Painter.
0014      * @param parent - Container instance to use.
0015      */
0016     explicit Painter(Container* parent);
0017     virtual ~Painter();
0018 
0019     /** paint given point.
0020      * @param point - point to paint.
0021      * @param isDragging = to know if it is a mouse drag event
0022      */
0023     virtual void paint(QPoint point, bool isDragging) = 0;
0024 
0025     /** Display given object.
0026      * @param object - MarkedObject instance to display.
0027      */
0028     virtual void paintObject(MarkedObject* object) = 0;
0029 
0030     /** Load the current MarkedObjects. */
0031     virtual void repaint() = 0;
0032 
0033     /** Undo last paint. */
0034     virtual void undo() = 0;
0035 
0036     /** Delete the current instance of MarkedObject. */
0037     virtual void deleteCurrentObject() = 0;
0038 
0039     /** Load given item base on its path.
0040      * @param path - item path.
0041      */
0042     virtual void changeItem(const QString& path) = 0;
0043 
0044     /** Import Objects to the parent.
0045      * @param objects - objects to load.
0046      */
0047     virtual bool importObjects(QVector<MarkedObject*> objects) = 0;
0048 protected:
0049     Container* m_parent;
0050 };
0051 
0052 #endif // PAINTER_H