MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / updateSelectableControls

Method updateSelectableControls

radiantcore/patch/PatchNode.cpp:85–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void 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
105const AABB& PatchNode::localAABB() const {
106 return m_patch.localAABB();

Callers 2

setDimsMethod · 0.80
importStateMethod · 0.80

Calls 3

clearMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected