TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ ShowFileMenu()

void MainMenu::ShowFileMenu ( )

Definition at line 59 of file MainMenu.cpp.

60{
61 if (ImGui::MenuItem("Open"))
62 {
63 appState->serailizer->LoadFile(ShowOpenFileDialog("*.terr3d"));
64 }
65
66 if (ImGui::MenuItem("Save"))
67 {
68 appState->serailizer->LoadFile(ShowSaveFileDialog("*.terr3d"));
69 }
70
71 if (ImGui::MenuItem("Install Module"))
72 {
73// appState->modules.manager->InstallModule(ShowOpenFileDialog("*.terr3dmodule"));
74 }
75
76 Model *modelToExport;
77
78 switch (appState->mode)
79 {
80 case ApplicationMode::TERRAIN:
81 modelToExport = appState->models.coreTerrain;
82 break;
83
84 case ApplicationMode::CUSTOM_BASE:
85 modelToExport = appState->models.customBase;
86 break;
87
88 default:
89 modelToExport = appState->models.coreTerrain;
90 break;
91 }
92
93 if (ImGui::BeginMenu("Export Mesh As"))
94 {
95 if (ImGui::MenuItem("Wavefont OBJ"))
96 {
97 ExportModelAssimp(modelToExport, "obj", ShowSaveFileDialog(".obj\0"), "obj");
98 }
99
100 if (ImGui::MenuItem("FBX"))
101 {
102 ExportModelAssimp(modelToExport, "fbx", ShowSaveFileDialog(".fbx\0"), "fbx");
103 }
104
105 if (ImGui::MenuItem("GLTF v2"))
106 {
107 ExportModelAssimp(modelToExport, "gltf2", ShowSaveFileDialog(".gltf\0"), "gltf");
108 }
109
110 if (ImGui::MenuItem("GLB v2"))
111 {
112 ExportModelAssimp(modelToExport, "glb2", ShowSaveFileDialog(".glb\0"), "glb");
113 }
114
115 if (ImGui::MenuItem("JSON"))
116 {
117 ExportModelAssimp(modelToExport, "json", ShowSaveFileDialog(".json\0"));
118 }
119
120 if (ImGui::MenuItem("STL"))
121 {
122 ExportModelAssimp(modelToExport, "stl", ShowSaveFileDialog(".stl\0"));
123 }
124
125 if (ImGui::MenuItem("PLY"))
126 {
127 ExportModelAssimp(modelToExport, "ply", ShowSaveFileDialog(".ply\0"));
128 }
129
130 if (ImGui::MenuItem("Collada"))
131 {
132 ExportModelAssimp(modelToExport, "collada", ShowSaveFileDialog(".dae\0"), "dae");
133 }
134
135 ImGui::EndMenu();
136 }
137
138 if (ImGui::MenuItem("Close"))
139 {
140 appState->globals.currentOpenFilePath = "";
141 }
142
143 if (ImGui::MenuItem("Pack Project"))
144 {
145 appState->serailizer->PackProject(ShowSaveFileDialog("*.terr3dpack"));
146 }
147
148 if (ImGui::MenuItem("Load Packed Project"))
149 {
150 appState->serailizer->LoadPackedProject(ShowOpenFileDialog("*.terr3dpack"));
151 }
152
153 if (ImGui::MenuItem("Load Auto Saved Project"))
154 {
155 appState->serailizer->LoadFile(GetExecutableDir() + PATH_SEPARATOR "Data" PATH_SEPARATOR "cache" PATH_SEPARATOR "autosave" PATH_SEPARATOR "autosave.terr3d");
156 }
157
158 if (ImGui::MenuItem("Exit"))
159 {
160 exit(0);
161 }
162}
Definition: Model.h:9