source: trunk/FACT++/gui/QCameraWidget.h@ 15043

Last change on this file since 15043 was 12103, checked in by lyard, 13 years ago
added auto highlight of pixels
File size: 1.5 KB
Line 
1#ifndef Q_CAMERA_WIDGET_H_
2#define Q_CAMERA_WIDGET_H_
3
4#include "BasicGlCamera.h"
5#include <valarray>
6#include <set>
7
8class QCameraWidget : public BasicGlCamera
9{
10 Q_OBJECT
11
12 typedef std::pair<double, double> Position;
13 typedef std::vector<Position> Positions;
14
15 //FIXME this variable seems to be deprecated
16 Positions fGeom;
17
18 std::vector<bool> fBold;
19 std::vector<bool> fEnable;
20
21 std::vector<int> highlightedPatches;
22 std::vector<int> highlightedPixels;
23
24
25 int lastFace;
26 bool fShowPixelMoveOver;
27 bool fShowPatchMoveOver;
28
29public:
30 void highlightPixel(int idx, bool highlight=true);
31 void highlightPatch(int idx, bool highlight=true);
32 void clearHighlightedPatches();
33 void clearHighlightedPixels();
34 QCameraWidget(QWidget *pparent = 0);
35 void paintGL();
36 void mousePressEvent(QMouseEvent *cEvent);
37 void mouseMoveEvent(QMouseEvent *event);
38 void mouseDoubleClickEvent(QMouseEvent *event);
39 void Reset();
40 void drawCamera(bool alsoWire);
41 void DrawCameraText();
42 void drawPatches();
43 void SetEnable(int idx, bool b);
44 double GetData(int idx);
45 const char *GetName();
46
47 int GetIdx(float px, float py);
48 char *GetObjectInfo(int px, int py);
49
50 void SetData(const std::valarray<double> &ddata);
51 void SetData(const std::valarray<float> &ddata);
52
53
54 void ShowPixelCursor(bool);
55 void ShowPatchCursor(bool);
56
57private:
58 void CalculatePixelsColor();
59 void CalculatePatchColor();
60
61};
62
63typedef QCameraWidget Camera;
64#endif
Note: See TracBrowser for help on using the repository browser.