代码拉取完成,页面将自动刷新
同步操作将从 ZzqiZQute/图与网络优化_Qt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#ifndef SP_FRAME
#define SP_FRAME
#include <QFrame>
#include <QObject>
#include "spgraph.h"
class SPFrame : public QFrame
{
Q_OBJECT
public:
enum Method{
Bellman,Floyd
};
explicit SPFrame(QWidget* parent=0);
SPGraph *getGraph() const;
~SPFrame();
double getWinScale() const;
int getWinOffsetX() const;
void reset();
bool getEditable() const;
void setEditable(bool value);
int getWinOffsetY() const;
void setWinOffsetX(int value);
void setWinOffsetY(int value);
void setWinScale(double value);
void clearState();
bool getMethod() const;
void setMethod(bool value);
void saveWinOffset();
static QPoint calcEdgeCenter(SPVertex *v1, SPVertex *v2);
signals:
void hintChanged(QString);
protected:
void paintEvent(QPaintEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void wheelEvent(QWheelEvent *event);
void keyPressEvent(QKeyEvent *event);
void keyReleaseEvent(QKeyEvent *event);
private:
SPGraph* graph;
double winScale;
int winOffsetX;
int winOffsetY;
int winStartOffsetX;
int winStartOffsetY;
int winOriOffsetX;
int winOriOffsetY;
int realX;
int realY;
bool winStartMove;
bool refresh;
bool keyCtrlDown;
bool maybeMultiSelect;
bool multiSelect;
bool readyMultiMove;
bool createEdge;
bool findEdgeTail;
bool moveEdgeLabel;
bool editable;
bool method;
int moveVertexPos;
int currentLMouseX;
int currentLMouseY;
int moveVertexCenterX;
int moveVertexCenterY;
int maybeMultiSelectMouseX;
int maybeMultiSelectMouseY;
int maybeMultiSelectMouseX2;
int maybeMultiSelectMouseY2;
int createEdgeMouseX;
int createEdgeMouseY;
int createEdgeVertexHead;
int createEdgeVertexTail;
QString strHint;
QWidget *mParent;
void drawVertexs(QPainter *painter);
int checkLBtnDownVertex();
void drawTest(QPainter *painter);
void drawSelects(QPainter *painter);
void drawEdge(QPainter *painter);
QPoint mouseToReal(int x, int y);
QPoint realToMouse(int x, int y);
void init();
void drawStraightEdge(QPainter *painter, SPVertex *v1, SPVertex *v2);
void drawStraightMaybeEdge(QPainter *painter, SPVertex *v1, QPoint p);
void drawCurveEdge(QPainter *painter, SPVertex *v1, SPVertex *v2);
void drawHint(QPainter *painter);
int checkMouseMoveVertex(QPoint pos);
};
#endif // SP_FRAME
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。