MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / graphButtons

Method graphButtons

source/MaterialXGraphEditor/Graph.cpp:2948–3147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2946}
2947
2948void Graph::graphButtons()
2949{
2950 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.15f, .15f, .15f, 1.0f));
2951 ImGui::SetWindowFontScale(_fontScale);
2952
2953 if (ImGui::BeginMenuBar())
2954 {
2955 if (ImGui::BeginMenu("File"))
2956 {
2957 // Buttons for loading and saving a .mtlx
2958 if (ImGui::MenuItem("New", "Ctrl-N"))
2959 {
2960 clearGraph();
2961 }
2962 else if (ImGui::MenuItem("Open", "Ctrl-O"))
2963 {
2964 loadGraphFromFile(true);
2965 }
2966 else if (ImGui::MenuItem("Reload", "Ctrl-R"))
2967 {
2968 loadGraphFromFile(false);
2969 }
2970 else if (ImGui::MenuItem("Save", "Ctrl-S"))
2971 {
2972 saveGraphToFile();
2973 }
2974 ImGui::EndMenu();
2975 }
2976
2977 if (ImGui::BeginMenu("Graph"))
2978 {
2979 if (ImGui::MenuItem("Auto Layout"))
2980 {
2981 _autoLayout = true;
2982 _needsNavigation = true;
2983 }
2984 ImGui::Separator();
2985 Layout::Options& opts = _layout.options;
2986 if (ImGui::Checkbox("Insert Virtual Nodes", &opts.insertVirtualNodes))
2987 {
2988 _autoLayout = true;
2989 _needsNavigation = true;
2990 }
2991 if (ImGui::Checkbox("Minimize Crossings", &opts.minimizeCrossings))
2992 {
2993 _autoLayout = true;
2994 _needsNavigation = true;
2995 }
2996 if (ImGui::Checkbox("Refine Positions", &opts.refinePositions))
2997 {
2998 _autoLayout = true;
2999 _needsNavigation = true;
3000 }
3001 ImGui::EndMenu();
3002 }
3003
3004 if (ImGui::BeginMenu("Viewer"))
3005 {

Callers

nothing calls this directly

Calls 12

MenuItemClass · 0.85
splitterFunction · 0.85
Vector2Function · 0.85
isOpenedMethod · 0.80
c_strMethod · 0.80
getPixelRatioMethod · 0.80
getViewWidthMethod · 0.80
getViewHeightMethod · 0.80
setViewWidthMethod · 0.80
setViewHeightMethod · 0.80
getViewCameraMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected