#ifndef PAPEREDITHANDLE_H #define PAPEREDITHANDLE_H #include #include "ui_paperedithandle.h" #include #include #include "../SmartEvaluationLogic/ScanDll.h" class CPaperEditHandle : public QWidget { Q_OBJECT public: CPaperEditHandle(QWidget *parent = 0); ~CPaperEditHandle(); enum MouseStatus { Mouse_Normal, Mouse_Drag, Mouse_Pen, Mouse_Line, Mouse_Eraser, Mouse_Cut, Mouse_Cuting, Mouse_Locate, }; void setCurrentBatch(batch_info* batchInfo, vector* papers); void GetCurrentPaper(paper_info& paperInfo); private slots: void slot_onButtonClick(); private: virtual void resizeEvent(QResizeEvent* event); virtual void mouseMoveEvent(QMouseEvent* event); virtual void mousePressEvent(QMouseEvent* event); virtual void mouseReleaseEvent(QMouseEvent* event); virtual void paintEvent(QPaintEvent *); virtual void wheelEvent(QWheelEvent *event); void ClickDrag(); void ClickRoomin(); void ClickRoomout(); void ClickRotate90(); void ClickRotateN90(); void ClickLocate(QObject* sender); void ClickEraser(QObject* sender); void ClickSwitchPage(); void ClickUndo(); void ClickRestore(); QPoint PointSwitchToImg(QPoint sPoint); QRect RectSwitchImg(QRect sRect); void SaveTempImg(); void CalcRoom(); private: Ui::CPaperEditHandle ui; QPoint m_offset; float m_room; QImage m_bgimage; //QStack m_stackImage; MouseStatus m_mousestatus; map> m_mapStackPage; int m_nCurrentPage; // 当前一张试卷中的第几页 int m_eraserW; int m_eraserH; int m_locateW; int m_locateH; bool m_bpressed; QPoint m_startPoint; QPoint m_endPoint; batch_info* m_pBatchInfo; vector* m_pPapers; int m_nCurrentPaper; // 当前第几张试卷 bool m_bLocateChecked; // 定位点选中 bool m_bEraserChecked; // 橡皮擦 map m_locatePointMap; }; #endif // PAPEREDITHANDLE_H