New context menu in Geometry and Appearance Views: special handle (upper

left corner) with new icon and view-specific context menu on current
source.
This commit is contained in:
brunoherbelin
2020-11-17 23:28:11 +01:00
parent 3b529222d8
commit 4630d39663
12 changed files with 339 additions and 24 deletions

View File

@@ -156,6 +156,12 @@ void PickingVisitor::visit(Handles &n)
float l = glm::length( glm::vec2(vec) );
picked = glm::length( glm::vec2( 1.f + l, -1.f - l) - glm::vec2(P) ) < 1.5f * scale;
}
else if ( n.type() == Handles::MENU ){
// the icon for restore is on the left top corner at (-0.12, 0.12) in scene coordinates
glm::vec4 vec = glm::inverse(modelview_) * glm::vec4( 0.1f, 0.1f, 0.f, 0.f );
float l = glm::length( glm::vec2(vec) );
picked = glm::length( glm::vec2( -1.f - l, 1.f + l) - glm::vec2(P) ) < 1.5f * scale;
}
if ( picked )
// add this to the nodes picked