本文整理汇总了C++中GraphAttributes::arrowEdge方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphAttributes::arrowEdge方法的具体用法?C++ GraphAttributes::arrowEdge怎么用?C++ GraphAttributes::arrowEdge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphAttributes
的用法示例。
在下文中一共展示了GraphAttributes::arrowEdge方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read
//.........这里部分代码省略.........
if (edgeSon->m_valueType != gmlStringValue) break;
label = edgeSon->m_stringValue;
break;
case graphicsPredefKey: {
if (edgeSon->m_valueType != gmlListBegin) break;
GmlObject *graphicsObject = edgeSon->m_pFirstSon;
for(; graphicsObject;
graphicsObject = graphicsObject->m_pBrother)
{
if(id(graphicsObject) == LinePredefKey &&
graphicsObject->m_valueType == gmlListBegin)
{
readLineAttribute(graphicsObject->m_pFirstSon,bends);
}
if(id(graphicsObject) == arrowPredefKey &&
graphicsObject->m_valueType == gmlStringValue)
arrow = graphicsObject->m_stringValue;
if(id(graphicsObject) == fillPredefKey &&
graphicsObject->m_valueType == gmlStringValue)
fill = graphicsObject->m_stringValue;
if (id(graphicsObject) == stipplePredefKey && //line style
graphicsObject->m_valueType == gmlIntValue)
stipple = graphicsObject->m_intValue;
if (id(graphicsObject) == lineWidthPredefKey && //line width
graphicsObject->m_valueType == gmlDoubleValue)
lineWidth = graphicsObject->m_doubleValue;
if (id(graphicsObject) == edgeWeightPredefKey &&
graphicsObject->m_valueType == gmlDoubleValue)
edgeWeight = graphicsObject->m_doubleValue;
}//for graphics
}
case generalizationPredefKey:
if (edgeSon->m_valueType != gmlIntValue) break;
umlType = (edgeSon->m_intValue == 0) ?
Graph::association : Graph::generalization;
break;
}
}
// check if everything required is defined correctly
if (sourceId == notDefined || targetId == notDefined) {
setError("source or target id not defined");
return false;
} else if (sourceId < minId || maxId < sourceId ||
targetId < minId || maxId < targetId) {
setError("source or target id out of range");
return false;
}
// create adjacent nodes if necessary and new edge
if (m_mapToNode[sourceId] == 0) m_mapToNode[sourceId] = G.newNode();
if (m_mapToNode[targetId] == 0) m_mapToNode[targetId] = G.newNode();
edge e = G.newEdge(m_mapToNode[sourceId],m_mapToNode[targetId]);
if (AG.attributes() & GraphAttributes::edgeGraphics)
AG.bends(e).conc(bends);
if (AG.attributes() & GraphAttributes::edgeType)
AG.type(e) = umlType;
if(AG.attributes() & GraphAttributes::edgeSubGraph)
AG.subGraphBits(e) = subGraph;
if (AG.attributes() & GraphAttributes::edgeLabel)
AG.labelEdge(e) = label;
if (AG.attributes() & GraphAttributes::edgeArrow)
if (arrow == "none")
AG.arrowEdge(e) = GraphAttributes::none;
else if (arrow == "last")
AG.arrowEdge(e) = GraphAttributes::last;
else if (arrow == "first")
AG.arrowEdge(e) = GraphAttributes::first;
else if (arrow == "both")
AG.arrowEdge(e) = GraphAttributes::both;
else
AG.arrowEdge(e) = GraphAttributes::undefined;
if (AG.attributes() & GraphAttributes::edgeColor)
AG.colorEdge(e) = fill;
if (AG.attributes() & GraphAttributes::edgeStyle)
{
AG.styleEdge(e) = AG.intToStyle(stipple);
AG.edgeWidth(e) = lineWidth;
}
if (AG.attributes() & GraphAttributes::edgeDoubleWeight)
AG.doubleWeight(e) = edgeWeight;
break; }
case directedPredefKey: {
if(son->m_valueType != gmlIntValue) break;
AG.directed(son->m_intValue > 0);
break; }
}
}
return true;
}//read