提升C++ - 生成布局
Boost C++ - generating a layout
我最近一直在用C++处理图形绘制。我的问题是,如何修复最后一个错误:
required from here
/usr/include/boost/graph/random_layout.hpp:30:8: error: ‘const class boost::random::linear_congruential_engine<unsigned int, 48271u, 0u, 2147483647u>’ has no member named ‘random_point’
put(position_map, v, topology.random_point());
^
对于这个小代码片段:
boost::minstd_rand gen;
PositionVec position_vec(num_vertices(component));
PositionMap position(position_vec.begin(), get(vertex_index, component));
topology_type topo(gen, -width/2, -height/2, width/2, height/2);
boost::random_graph_layout(component, position, gen);
我在这里做错了什么?
谢谢。
根据参考
资料template<typename Graph, typename PositionMap, typename Topology>
void
random_graph_layout(const Graph& g, PositionMap position_map,
const Topology& space); // <---
您应该传递拓扑对象的第三个参数random_graph_layout
而不是生成器。
所以打电话
boost::random_graph_layout(component, position, topo);
相关文章:
- 如何使用C/C++在MacOSX中获得键盘布局
- Vulkan验证层不断在VkQueuePresentKHR()上抛出图像布局错误
- 布局兼容类型的并集
- Qt自定义QPush按钮未显示在布局上
- 按钮悬停在 QT 中垂直布局的选项卡小部件中不起作用
- 调整布局上的 QGraphicsView 小部件的大小
- 如何在qt中将对象添加到现有布局中?--已解决
- 将布局映射到内存地址
- C++继承的虚拟类的内存布局
- 检查nullptr是否100%保护内存布局不受segfault影响
- C++ Python 的扩展 - 安全内存访问和内存布局
- QTree查看新行,没有布局就不可见已更改
- 类似元组的类模板的反向内存布局
- C++对象布局是否必须静态定义?
- 集合布局上的 Qt 分割错误
- QT将图像从缩略图拖放到网格布局(QVTKOpenGLWidget)?
- 更正GLSL无绑定纹理句柄中的结构布局
- POD类型是否完全等同于琐碎的标准布局类型
- 聚合类型是否意味着它也是标准布局
- 将小部件添加到布局后,QStylesheet 不起作用