#ifndef Q_CAMERA_WIDGET_H_ #define Q_CAMERA_WIDGET_H_ #include "BasicGlCamera.h" #include #include #include #include #include using namespace std; class QCameraWidget : public BasicGlCamera { Q_OBJECT typedef pair Position; typedef vector Positions; Positions fGeom; vector fBold; vector fEnable; vector highlightedPatches; vector highlightedPixels; int fWhite; int fWhitePatch; int64_t fMin; int64_t fMax; int lastFace; bool pixelColorUpToDate; GLfloat patchColour[3]; GLfloat pixelContourColour[3]; GLfloat patchesCoulour[3]; GLfloat highlightedPatchesCoulour[3]; GLfloat highlightedPixelsCoulour[3]; GLfloat tooHighValueCoulour[3]; GLfloat tooLowValueCoulour[3]; string dataText; string unitsText; string titleText; public: void highlightPixel(int idx); void highlightPatch(int idx); void clearHighlightedPatches(); void clearHighlightedPixels(); void setUnits(const string& units); void setTitle(const string& title); QCameraWidget(QWidget *pparent = 0); void paintGL(); void mousePressEvent(QMouseEvent *cEvent); void mouseMoveEvent(QMouseEvent *event); void mouseDoubleClickEvent(QMouseEvent *event); void Reset(); void drawCamera(bool alsoWire); void drawPatches(); void SetWhite(int idx); void SetEnable(int idx, bool b); double GetData(int idx); void SetMin(int64_t min); void SetMax(int64_t max); const char *GetName(); int GetIdx(float px, float py); char *GetObjectInfo(int px, int py); void SetData(const valarray &ddata); public Q_SLOTS: void linearScalePlease(bool); void logScalePlease(bool); void regularPalettePlease(bool); void prettyPalettePlease(bool); void greyScalePalettePlease(bool); void glowingPalettePlease(bool); void zeroRotationPlease(bool); void plus90RotationPlease(bool); void minus90RotationPlease(bool); Q_SIGNALS: void signalCurrentPixel(int pixel); void signalPixelMoveOver(int pixel); void signalPixelDoubleClick(int pixel); private: void CalculatePixelsColor(); void CalculatePatchColor(); void DrawCameraText(); void UpdateText(); void DrawScale(); void toggleInterfaceDisplay(); void repaintInterface(); QRadioButton* linearButton; QRadioButton* logButton; QRadioButton* regularPaletteButton; QRadioButton* prettyPaletteButton; QRadioButton* greyScalePaletteButton; QRadioButton* glowingPaletteButton; QRadioButton* zeroRotationButton; QRadioButton* minus90RotationButton; QRadioButton* plus90Rotationbutton; QLabel* scaleLabel; QLabel* colorPaletteLabel; QLabel* rotationLabel; QButtonGroup* scaleGroup; QButtonGroup* colorGroup; QButtonGroup* rotationGroup; bool logScale; int cameraRotation; }; typedef QCameraWidget Camera; #endif