1 | #ifndef Q_CAMERA_WIDGET_H_
|
---|
2 | #define Q_CAMERA_WIDGET_H_
|
---|
3 |
|
---|
4 | #include "BasicGlCamera.h"
|
---|
5 | #include <valarray>
|
---|
6 | #include <set>
|
---|
7 |
|
---|
8 | class 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 |
|
---|
27 |
|
---|
28 | public:
|
---|
29 | void highlightPixel(int idx, bool highlight=true);
|
---|
30 | void highlightPatch(int idx, bool highlight=true);
|
---|
31 | void clearHighlightedPatches();
|
---|
32 | void clearHighlightedPixels();
|
---|
33 | QCameraWidget(QWidget *pparent = 0);
|
---|
34 | void paintGL();
|
---|
35 | void mousePressEvent(QMouseEvent *cEvent);
|
---|
36 | void mouseMoveEvent(QMouseEvent *event);
|
---|
37 | void mouseDoubleClickEvent(QMouseEvent *event);
|
---|
38 | void Reset();
|
---|
39 | void drawCamera(bool alsoWire);
|
---|
40 | void DrawCameraText();
|
---|
41 | void drawPatches();
|
---|
42 | void SetEnable(int idx, bool b);
|
---|
43 | double GetData(int idx);
|
---|
44 | const char *GetName();
|
---|
45 |
|
---|
46 | int GetIdx(float px, float py);
|
---|
47 | char *GetObjectInfo(int px, int py);
|
---|
48 |
|
---|
49 | void SetData(const std::valarray<double> &ddata);
|
---|
50 | void SetData(const std::valarray<float> &ddata);
|
---|
51 |
|
---|
52 |
|
---|
53 | private:
|
---|
54 | void CalculatePixelsColor();
|
---|
55 | void CalculatePatchColor();
|
---|
56 |
|
---|
57 | };
|
---|
58 |
|
---|
59 | typedef QCameraWidget Camera;
|
---|
60 | #endif
|
---|