本文整理汇总了C++中Filter::collectGraphVertices方法的典型用法代码示例。如果您正苦于以下问题:C++ Filter::collectGraphVertices方法的具体用法?C++ Filter::collectGraphVertices怎么用?C++ Filter::collectGraphVertices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Filter
的用法示例。
在下文中一共展示了Filter::collectGraphVertices方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeSubgraph
void Graph::makeSubgraph (const Graph &other, const Filter &filter,
Array<int> *mapping_out, Array<int> *inv_mapping)
{
QS_DEF(Array<int>, vertices);
if (mapping_out == 0)
mapping_out = &vertices;
filter.collectGraphVertices(other, *mapping_out);
makeSubgraph(other, *mapping_out, inv_mapping);
}
示例2: makeLayoutSubgraph
void MoleculeLayoutGraphSmart::makeLayoutSubgraph (MoleculeLayoutGraph &graph, Filter &vertex_filter, Filter *edge_filter)
{
_molecule = graph._molecule;
_graph = &graph;
_molecule_edge_mapping = graph._molecule_edge_mapping;
QS_DEF(Array<int>, vertices);
QS_DEF(Array<int>, vertex_mapping);
QS_DEF(Array<int>, edges);
QS_DEF(Array<int>, edge_mapping);
clear();
vertex_filter.collectGraphVertices(graph, vertices);
if (edge_filter != 0) (*edge_filter).collectGraphEdges(graph, edges);
if (edge_filter != 0) makeSubgraph(graph, vertices, &vertex_mapping, &edges, &edge_mapping);
else makeSubgraph(graph, vertices, &vertex_mapping);
LayoutVertex new_vertex;
LayoutEdge new_edge;
new_vertex.is_cyclic = false;
for (int i = 0; i < vertices.size(); i++)
{
new_vertex.ext_idx = vertices[i];
new_vertex.orig_idx = graph._layout_vertices[vertices[i]].orig_idx;
new_vertex.type = graph._layout_vertices[vertices[i]].type;
new_vertex.morgan_code = graph._layout_vertices[vertices[i]].morgan_code;
new_vertex.pos.copy(graph._layout_vertices[vertices[i]].pos);
registerLayoutVertex(vertex_mapping[vertices[i]], new_vertex);
}
int index = 0;
for (int i = edgeBegin(); i < edgeEnd(); i = edgeNext(i))
{
const Edge &edge = getEdge(i);
int ext_idx = graph.findEdgeIndex(vertices[edge.beg], vertices[edge.end]);
new_edge.ext_idx = ext_idx;
new_edge.orig_idx = graph._layout_edges[ext_idx].orig_idx;
new_edge.type = graph._layout_edges[ext_idx].type;
registerLayoutEdge(i, new_edge);
}
_layout_component_number.clear_resize(edgeEnd());
_layout_component_number.fffill();
_layout_component_count = 0;
}