paperedithandle.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef PAPEREDITHANDLE_H
  2. #define PAPEREDITHANDLE_H
  3. #include <QWidget>
  4. #include "ui_paperedithandle.h"
  5. #include <QStack>
  6. #include <map>
  7. #include "../SmartEvaluationLogic/ScanDll.h"
  8. class CPaperEditHandle : public QWidget
  9. {
  10. Q_OBJECT
  11. public:
  12. CPaperEditHandle(QWidget *parent = 0);
  13. ~CPaperEditHandle();
  14. enum MouseStatus
  15. {
  16. Mouse_Normal,
  17. Mouse_Drag,
  18. Mouse_Pen,
  19. Mouse_Line,
  20. Mouse_Eraser,
  21. Mouse_Cut,
  22. Mouse_Cuting,
  23. Mouse_Locate,
  24. };
  25. void setCurrentBatch(batch_info* batchInfo, vector<paper_info>* papers);
  26. void GetCurrentPaper(paper_info& paperInfo);
  27. private slots:
  28. void slot_onButtonClick();
  29. private:
  30. virtual void resizeEvent(QResizeEvent* event);
  31. virtual void mouseMoveEvent(QMouseEvent* event);
  32. virtual void mousePressEvent(QMouseEvent* event);
  33. virtual void mouseReleaseEvent(QMouseEvent* event);
  34. virtual void paintEvent(QPaintEvent *);
  35. virtual void wheelEvent(QWheelEvent *event);
  36. void ClickDrag();
  37. void ClickRoomin();
  38. void ClickRoomout();
  39. void ClickRotate90();
  40. void ClickRotateN90();
  41. void ClickLocate(QObject* sender);
  42. void ClickEraser(QObject* sender);
  43. void ClickSwitchPage();
  44. void ClickUndo();
  45. void ClickRestore();
  46. QPoint PointSwitchToImg(QPoint sPoint);
  47. QRect RectSwitchImg(QRect sRect);
  48. void SaveTempImg();
  49. void CalcRoom();
  50. private:
  51. Ui::CPaperEditHandle ui;
  52. QPoint m_offset;
  53. float m_room;
  54. QImage m_bgimage;
  55. //QStack<QImage> m_stackImage;
  56. MouseStatus m_mousestatus;
  57. map<int, QStack<string>> m_mapStackPage;
  58. int m_nCurrentPage; // 当前一张试卷中的第几页
  59. int m_eraserW;
  60. int m_eraserH;
  61. int m_locateW;
  62. int m_locateH;
  63. bool m_bpressed;
  64. QPoint m_startPoint;
  65. QPoint m_endPoint;
  66. batch_info* m_pBatchInfo;
  67. vector<paper_info>* m_pPapers;
  68. int m_nCurrentPaper; // 当前第几张试卷
  69. bool m_bLocateChecked; // 定位点选中
  70. bool m_bEraserChecked; // 橡皮擦
  71. map<QObject *, QPoint> m_locatePointMap;
  72. };
  73. #endif // PAPEREDITHANDLE_H