| 47 | } |
| 48 | |
| 49 | std::string PatchNode::getFingerprint() |
| 50 | { |
| 51 | constexpr std::size_t SignificantDigits = scene::SignificantFingerprintDoubleDigits; |
| 52 | |
| 53 | if (m_patch.getHeight() * m_patch.getWidth() == 0) |
| 54 | { |
| 55 | return std::string(); // empty patches produce an empty fingerprint |
| 56 | } |
| 57 | |
| 58 | math::Hash hash; |
| 59 | |
| 60 | // Width & Height |
| 61 | hash.addSizet(m_patch.getHeight()); |
| 62 | hash.addSizet(m_patch.getWidth()); |
| 63 | |
| 64 | // Subdivision Settings |
| 65 | if (m_patch.subdivisionsFixed()) |
| 66 | { |
| 67 | hash.addSizet(static_cast<std::size_t>(m_patch.getSubdivisions().x())); |
| 68 | hash.addSizet(static_cast<std::size_t>(m_patch.getSubdivisions().y())); |
| 69 | } |
| 70 | |
| 71 | // Material Name |
| 72 | hash.addString(m_patch.getShader()); |
| 73 | |
| 74 | // Combine all control point data |
| 75 | for (const auto& ctrl : m_patch.getControlPoints()) |
| 76 | { |
| 77 | hash.addVector3(ctrl.vertex, SignificantDigits); |
| 78 | hash.addDouble(ctrl.texcoord.x(), SignificantDigits); |
| 79 | hash.addDouble(ctrl.texcoord.y(), SignificantDigits); |
| 80 | } |
| 81 | |
| 82 | return hash; |
| 83 | } |
| 84 | |
| 85 | void PatchNode::updateSelectableControls() |
| 86 | { |
nothing calls this directly
no test coverage detected