1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #ifndef DIEITEM_H
- #define DIEITEM_H
- #pragma once
- #include <QGraphicsRectItem>
- #include <QColor>
- #include <QDebug>
- #include <QPen>
- #include <QMenu>
- #include <QGraphicsSceneContextMenuEvent>
- #include "CMatrixCommon.h"
- #include <CWaferMatrix.h>
- #include <CViewInterface.h>
- class DieItem : public QObject, public QGraphicsRectItem {
- public:
-
- DieItem(const WAFER_MATRIX_POINT_INFO_STRUCT& info, QGraphicsItem* parent = nullptr)
- : QGraphicsRectItem(parent), m_info(info) {
-
- updateAppearance();
-
- setAcceptHoverEvents(true);
- }
-
- int getRow() const;
- int getCol() const;
- int getMatrixId() const;
- int getDieIndex() const;
- void setSelected(bool selected);
- void setLeftSelected(bool selected);
- void setRightSelected(bool selected);
- void updateAppearance();
- protected:
- void hoverEnterEvent(QGraphicsSceneHoverEvent*) override;
- void hoverLeaveEvent(QGraphicsSceneHoverEvent*) override;
-
-
- private:
- int row, col,matrixId, dieIndex;
- ns_mat::PICK_DIE_STATUS status;
- bool isSelected = false;
- WAFER_MATRIX_POINT_INFO_STRUCT m_info;
-
- QColor getColorByStatus(ns_mat::PICK_DIE_STATUS status);
- };
- #endif
|