代码拉取完成,页面将自动刷新
同步操作将从 ZzqiZQute/图与网络优化_Qt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "nsmvertexparam.h"
NSMVertexParam::NSMVertexParam()
{
p=0;
capacity=POS_INFINITY;
flow=0;
cost=0;
oriCost=0;
rc=0;
metrics=new QFontMetrics(QFont("微软雅黑",15));
}
NSMVertexParam::~NSMVertexParam()
{
delete metrics;
}
NSMVertexParam::NSMVertexParam(int p, int c, int capacity)
{
this->p=p;
this->cost=c;
this->capacity=capacity;
oriCost=cost;
flow=0;
rc=0;
metrics=new QFontMetrics(QFont("微软雅黑",15));
}
int NSMVertexParam::getP() const
{
return p;
}
void NSMVertexParam::setP(int value)
{
p = value;
}
int NSMVertexParam::getCost() const
{
return cost;
}
void NSMVertexParam::setCost(int value)
{
cost = value;
cWidth=metrics->horizontalAdvance(QString("%1 [%2]").arg(getCost()).arg(getRc()));
}
bool NSMVertexParam::getCurve() const
{
return curve;
}
void NSMVertexParam::setCurve(bool value)
{
curve = value;
}
bool NSMVertexParam::getHover() const
{
return hover;
}
void NSMVertexParam::setHover(bool value)
{
hover = value;
}
int NSMVertexParam::getFlow() const
{
return flow;
}
void NSMVertexParam::setFlow(int value)
{
flow = value;
if(getCapacity()==POS_INFINITY){
fWidth= metrics->horizontalAdvance(QString("%1").arg(getFlow()));
}else{
fWidth= metrics->horizontalAdvance(QString("%1 (%2)").arg(getFlow()).arg(getCapacity()));
}
}
bool NSMVertexParam::isDummy() const
{
return bDummy;
}
void NSMVertexParam::setDummy(bool value)
{
bDummy = value;
}
int NSMVertexParam::getCapacity() const
{
return capacity;
}
void NSMVertexParam::setCapacity(int value)
{
capacity = value;
if(getCapacity()==POS_INFINITY){
fWidth= metrics->horizontalAdvance(QString("%1").arg(getFlow()));
}else{
fWidth= metrics->horizontalAdvance(QString("%1 (%2)").arg(getFlow()).arg(getCapacity()));
}
}
int NSMVertexParam::getC() const
{
return c;
}
void NSMVertexParam::setC(int value)
{
c = value;
}
int NSMVertexParam::getFWidth() const
{
return fWidth;
}
void NSMVertexParam::setFWidth(int value)
{
fWidth = value;
}
int NSMVertexParam::getCWidth() const
{
return cWidth;
}
void NSMVertexParam::setCWidth(int value)
{
cWidth = value;
}
double NSMVertexParam::getFDeg() const
{
return fDeg;
}
void NSMVertexParam::setFDeg(double value)
{
fDeg = value;
}
double NSMVertexParam::getFDis() const
{
return fDis;
}
void NSMVertexParam::setFDis(double value)
{
fDis = value;
}
double NSMVertexParam::getCDeg() const
{
return cDeg;
}
void NSMVertexParam::setCDeg(double value)
{
cDeg = value;
}
double NSMVertexParam::getCDis() const
{
return cDis;
}
void NSMVertexParam::setCDis(double value)
{
cDis = value;
}
int NSMVertexParam::getFX() const
{
return fX;
}
void NSMVertexParam::setFX(int value)
{
fX = value;
}
int NSMVertexParam::getFY() const
{
return fY;
}
void NSMVertexParam::setFY(int value)
{
fY = value;
}
int NSMVertexParam::getCX() const
{
return cX;
}
void NSMVertexParam::setCX(int value)
{
cX = value;
}
int NSMVertexParam::getCY() const
{
return cY;
}
void NSMVertexParam::setCY(int value)
{
cY = value;
}
bool NSMVertexParam::getMoveCFlag() const
{
return moveCFlag;
}
void NSMVertexParam::setMoveCFlag(bool value)
{
moveCFlag = value;
}
bool NSMVertexParam::getMoveFFlag() const
{
return moveFFlag;
}
void NSMVertexParam::setMoveFFlag(bool value)
{
moveFFlag = value;
}
void NSMVertexParam::saveCXY()
{
oricX=cX;
oricY=cY;
}
void NSMVertexParam::saveFXY()
{
orifX=fX;
orifY=fY;
}
int NSMVertexParam::getOrifX() const
{
return orifX;
}
void NSMVertexParam::setOrifX(int value)
{
orifX = value;
}
int NSMVertexParam::getOrifY() const
{
return orifY;
}
void NSMVertexParam::setOrifY(int value)
{
orifY = value;
}
int NSMVertexParam::getOricX() const
{
return oricX;
}
void NSMVertexParam::setOricX(int value)
{
oricX = value;
}
int NSMVertexParam::getOricY() const
{
return oricY;
}
void NSMVertexParam::setOricY(int value)
{
oricY = value;
}
int NSMVertexParam::getRc() const
{
return rc;
}
void NSMVertexParam::setRc(int value)
{
rc = value;
}
int NSMVertexParam::getOriCost() const
{
return oriCost;
}
void NSMVertexParam::setOriCost(int value)
{
oriCost = value;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。