MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / drawDialog

Method drawDialog

source/MRCommonPlugins/Basic/MRMoveObjectByMouse.cpp:53–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void MoveObjectByMouse::drawDialog( ImGuiContext*)
54{
55 auto menuWidth = 400.f * UI::scale();
56 if ( !ImGuiBeginWindow_( { .width = menuWidth } ) )
57 return;
58
59 if ( int( moveByMouse_.modXfMode ) == int( XfMode::Scale ) )
60 {
61 ImGui::Text( "%s", _tr( "Drag object with LMB to uniform scale\nRMB - non-uniform" ) );
62 }
63 else if ( int( moveByMouse_.modXfMode ) == int( XfMode::Rotate ) )
64 {
65 ImGui::Text( "%s", _tr( "Drag object with LMB to rotate\n" ) );
66 }
67 else
68 {
69 ImGui::Text( "%s", _tr( "Drag object with LMB to move\n" ) );
70 }
71
72 ImGui::Separator();
73
74 ImGui::Text( "%s", _tr( "Mode:" ) );
75 UI::radioButtonOrModifier( _tr( "Move" ), moveByMouse_.modXfMode, int( XfMode::Move ), 0, UI::getImGuiModPrimaryCtrl() | ImGuiMod_Alt );
76 ImGui::SameLine();
77 UI::radioButtonOrModifier( _tr( "Rotate" ), moveByMouse_.modXfMode, int( XfMode::Rotate ), UI::getImGuiModPrimaryCtrl(), UI::getImGuiModPrimaryCtrl() | ImGuiMod_Alt );
78 ImGui::SameLine();
79 UI::radioButtonOrModifier( _tr( "Scale" ), moveByMouse_.modXfMode, int( XfMode::Scale ), ImGuiMod_Alt, UI::getImGuiModPrimaryCtrl() | ImGuiMod_Alt );
80
81 ImGui::Text( "%s", _tr( "Target:" ) );
82 UI::radioButtonOrModifier( _tr( "Picked object" ), moveByMouse_.modXfTarget, int( XfTarget::Picked ), 0, ImGuiMod_Shift );
83 ImGui::SameLine();
84 UI::radioButtonOrModifier( _tr( "Selected object(s)" ), moveByMouse_.modXfTarget, int( XfTarget::Selected ), ImGuiMod_Shift, ImGuiMod_Shift );
85
86 ImGui::EndCustomStatePlugin();
87}
88
89bool MoveObjectByMouse::onDragStart_( MouseButton btn, int modifiers )
90{

Callers

nothing calls this directly

Calls 5

TextClass · 0.85
radioButtonOrModifierFunction · 0.85
getImGuiModPrimaryCtrlFunction · 0.85
EndCustomStatePluginFunction · 0.85
scaleClass · 0.50

Tested by

no test coverage detected