![]() |
Dandelion 2.0.0
A light-weight 3D builder for educational usage
|
用于渲染箭头的特殊线条集。 更多...
#include <mesh.hpp>
Public 成员函数 | |
| void | add_arrow (const Eigen::Vector3f &from, const Eigen::Vector3f &to) |
| void | update_arrow (std::size_t index, const Eigen::Vector3f &from, const Eigen::Vector3f &to) |
| 更新指定的箭头。 | |
| std::size_t | n_arrows () const noexcept |
| Public 成员函数 继承自 LineSet | |
| LineSet ()=default | |
| LineSet (const LineSet &other)=default | |
| LineSet (LineSet &&other)=default | |
| void | add_line (const Eigen::Vector3f &from, const Eigen::Vector3f &to) |
| std::size_t | n_lines () const noexcept |
| void | clear () noexcept |
| 清空 Mesh 中所有的图元数据。 | |
额外继承的成员函数 | |
| Public 属性 继承自 LineSet | |
| std::vector< Eigen::Vector3f > | positions |
| std::vector< std::array< unsigned int, 2 > > | lines |
| Eigen::Vector3f | color |
| bool | modified |
| std::string | name |
用于渲染箭头的特殊线条集。
ArrowSet 本质上还是一个 LineSet ,但提供了添加和更新箭头的便捷方法。 这个类并不强制保证所有的线条能正确地组成箭头,所以使用 ArrowSet 时, 应该尽可能避免直接更新 positions 和 lines ,只使用添加、更新、清空操作。
出于性能考虑,ArrowSet 不会强制检查其中的线段是否能组成箭头 。 如果随意插入线段,很可能导致更新和统计总数时得不到预期的结果。
| void ArrowSet::add_arrow | ( | const Eigen::Vector3f & | from, |
| const Eigen::Vector3f & | to ) |
添加一个箭头。
| from | 起始点。 |
| to | 终止点。 |
|
noexcept |
按每个箭头由 5 条线段组成计,统计当前的箭头总数。
| void ArrowSet::update_arrow | ( | std::size_t | index, |
| const Eigen::Vector3f & | from, | ||
| const Eigen::Vector3f & | to ) |
更新指定的箭头。
| index | 线条集中全都是箭头的前提下,要更新的箭头索引。 |
| from | 起始点。 |
| to | 终止点。 |