00001 #ifndef H_LAYER_ARROWS
00002 #define H_LAYER_ARROWS
00003
00004 #include "Layer.h"
00005 #include "FlowDataWorker.h"
00006 #include "ui_ArrowLayer.h"
00007
00008 class LayerArrows : public Layer
00009 {
00010 Q_OBJECT
00011
00012 public:
00013 LayerArrows();
00014 ~LayerArrows();
00015
00016 void setWidget(QWidget *widget);
00017
00018 void draw(const DrawInfo &drawInfo);
00019
00020 public slots:
00021 void setFlowData(FlowData *flowData);
00022 void setSize(const QSize &size);
00023 void setQuantity(int quant);
00024 void setArrowSize(int size);
00025 void setArrowNormPerc(int arrowNormPerc);
00026 void colorsChanged();
00027
00028 protected:
00029 void customEvent(QEvent *event);
00030
00031 private:
00032 void invalidate();
00033 void free();
00034 void calculate();
00035 void updateImage();
00036 QPainterPath getArrowPath();
00037 QSize arrowCount;
00038 float arrowSize, arrowNormPerc;
00039
00040 Ui::ArrowLayer uiLayer;
00041 QImage image;
00042 FlowDataWorkerVector flowDataWorker;
00043 QMutex rawDataMutex;
00044 Vector3* rawData;
00045 };
00046
00047 #endif // H_LAYER_ARROWS