本文整理汇总了C++中TGraph::instance方法的典型用法代码示例。如果您正苦于以下问题:C++ TGraph::instance方法的具体用法?C++ TGraph::instance怎么用?C++ TGraph::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TGraph
的用法示例。
在下文中一共展示了TGraph::instance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: connectClips
inline void connectClips( TGraph& graph )
{
BOOST_FOREACH( typename TGraph::edge_descriptor ed, graph.getEdges() )
{
typename TGraph::Edge& edge = graph.instance( ed );
typename TGraph::Vertex& vertexSource = graph.sourceInstance( ed );
typename TGraph::Vertex& vertexDest = graph.targetInstance( ed );
TUTTLE_TCOUT( "[connectClips] " << edge );
TUTTLE_TCOUT( vertexSource << "->" << vertexDest );
if( ! vertexDest.isFake() && ! vertexSource.isFake() )
{
INode& sourceNode = vertexSource.getProcessNode();
INode& targetNode = vertexDest.getProcessNode();
sourceNode.connect( targetNode, sourceNode.getAttribute( edge.getInAttrName() ) );
}
}
}
示例2: connectClips
inline void connectClips(TGraph& graph)
{
BOOST_FOREACH(typename TGraph::edge_descriptor ed, graph.getEdges())
{
typename TGraph::Edge& edge = graph.instance(ed);
typename TGraph::Vertex& vertexOutput = graph.targetInstance(ed);
typename TGraph::Vertex& vertexInput = graph.sourceInstance(ed);
TUTTLE_LOG_TRACE("[Connect Clips] " << edge);
TUTTLE_LOG_TRACE("[Connect Clips] " << vertexOutput << " -> " << vertexInput);
// TUTTLE_LOG_VAR( TUTTLE_TRACE, edge.getInAttrName() );
if(!vertexOutput.isFake() && !vertexInput.isFake())
{
INode& outputNode = vertexOutput.getProcessNode();
INode& inputNode = vertexInput.getProcessNode();
inputNode.connect(outputNode, inputNode.getAttribute(edge.getInAttrName()));
}
}
}