MCPcopy Create free account
hub / github.com/Linloir/GraphBuilder / SetWeight

Method SetWeight

graph_implement.cpp:157–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void ALGraph::SetWeight(MyGraphicsLineItem *garc, int weight){
158 int strtVex = GetIdOf(garc->stVex());
159 int endVex = GetIdOf(garc->edVex());
160 ALArc *p = vexList[strtVex].firstArc;
161 while(p != nullptr){
162 if(p->eVexID == endVex){
163 p->weight = weight;
164 p->gArc->setText(QString::asprintf("%d", weight));
165 }
166 p = p->nextArc;
167 }
168 if(type == UDG){
169 p = vexList[endVex].firstArc;
170 while(p != nullptr){
171 if(p->eVexID == strtVex){
172 p->weight = weight;
173 }
174 p = p->nextArc;
175 }
176 }
177}
178
179void ALGraph::ConvertType(int _type){
180 if(_type == type) return;

Callers 2

MyCanvasMethod · 0.80
InitMethod · 0.80

Calls 3

stVexMethod · 0.80
edVexMethod · 0.80
setTextMethod · 0.45

Tested by

no test coverage detected