| 83 | } |
| 84 | |
| 85 | void PatchNode::updateSelectableControls() |
| 86 | { |
| 87 | // Clear the control instance vector and reserve <size> memory |
| 88 | m_ctrl_instances.clear(); |
| 89 | |
| 90 | // We link the instances to the working control point set |
| 91 | auto& ctrlPoints = m_patch.getControlPointsTransformed(); |
| 92 | |
| 93 | m_ctrl_instances.reserve(ctrlPoints.size()); |
| 94 | |
| 95 | // greebo: Cycle through the patch's control vertices and add them as PatchControlInstance to the vector |
| 96 | // The PatchControlInstance constructor takes a pointer to a PatchControl and the SelectionChanged callback |
| 97 | // The passed callback points back to this class (the member method selectedChangedComponent() is called). |
| 98 | for(auto& ctrl : ctrlPoints) |
| 99 | { |
| 100 | m_ctrl_instances.emplace_back(ctrl, |
| 101 | std::bind(&PatchNode::selectedChangedComponent, this, std::placeholders::_1)); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | const AABB& PatchNode::localAABB() const { |
| 106 | return m_patch.localAABB(); |
no test coverage detected