add export depth menu
This commit is contained in:
@@ -1420,6 +1420,9 @@ Here's a list of what's available in this release.
|
||||
<button-custom id="file-submenu-export-layers" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
||||
<text text="Separate Layers" grow="1" margin="0 0 0 5"/>
|
||||
</button-custom>
|
||||
<button-custom id="file-submenu-export-depth" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
||||
<text text="3D View + Depth" grow="1" margin="0 0 0 5"/>
|
||||
</button-custom>
|
||||
</popup-menu>
|
||||
</layout>
|
||||
|
||||
|
||||
@@ -184,6 +184,7 @@ public:
|
||||
void dialog_browse();
|
||||
void dialog_export(std::string ext);
|
||||
void dialog_export_layers();
|
||||
void dialog_export_depth();
|
||||
void dialog_export_cubes();
|
||||
void dialog_layer_rename();
|
||||
void dialog_resize();
|
||||
|
||||
@@ -460,6 +460,29 @@ void App::dialog_export_layers()
|
||||
}
|
||||
}
|
||||
|
||||
void App::dialog_export_depth()
|
||||
{
|
||||
if (!check_license())
|
||||
{
|
||||
message_box("License", "This function is disabled in demo mode.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (canvas)
|
||||
{
|
||||
// TODO: use picker
|
||||
canvas->m_canvas->export_layers(doc_name, [this] {
|
||||
#if defined(__IOS__)
|
||||
message_box("Export 3D View + Depth", "Image and depth exported to Files/PanoPainter");
|
||||
#elif defined(__OSX__)
|
||||
message_box("Export 3D View + Depth", "Image and depth exported to Pictures/PanoPainter folder");
|
||||
#elif defined(_WIN32)
|
||||
message_box("Export 3D View + Depth", "Image and depth exported to " + work_path);
|
||||
#endif
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void App::dialog_resize()
|
||||
{
|
||||
auto dialog = std::make_shared<NodeDialogResize>();
|
||||
|
||||
@@ -625,7 +625,14 @@ void App::init_menu_file()
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
};
|
||||
};
|
||||
subpopup->find<NodeButtonCustom>("file-submenu-export-depth")->on_click = [this, subpopup, popup](Node*) {
|
||||
dialog_export_depth();
|
||||
subpopup->mouse_release();
|
||||
subpopup->destroy();
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
};
|
||||
};
|
||||
if (auto b = popup->find<NodeButtonCustom>("file-share"))
|
||||
b->on_click = [this, popup](Node*) {
|
||||
share_file(doc_path);
|
||||
|
||||
@@ -1544,6 +1544,30 @@ void Canvas::inject_xmp(std::string jpg_path)
|
||||
|
||||
}
|
||||
|
||||
void Canvas::export_depth(std::string file_name, std::function<void()> on_complete)
|
||||
{
|
||||
if (App::I.check_license())
|
||||
{
|
||||
std::thread t([=] {
|
||||
BT_SetTerminate();
|
||||
export_depth_thread(file_name);
|
||||
if (on_complete)
|
||||
on_complete();
|
||||
});
|
||||
t.detach();
|
||||
}
|
||||
}
|
||||
|
||||
void Canvas::export_depth_thread(std::string file_name)
|
||||
{
|
||||
App::I.async_start();
|
||||
gl_state gl;
|
||||
gl.save();
|
||||
|
||||
gl.restore();
|
||||
App::I.async_end();
|
||||
}
|
||||
|
||||
void Canvas::export_layers(std::string file_name, std::function<void()> on_complete)
|
||||
{
|
||||
if (App::I.check_license())
|
||||
|
||||
@@ -263,7 +263,9 @@ public:
|
||||
void export_equirectangular_thread(std::string file_path);
|
||||
void export_layers(std::string file_name, std::function<void()> on_complete = nullptr);
|
||||
void export_layers_thread(std::string file_name);
|
||||
void export_cubes();
|
||||
void export_depth(std::string file_name, std::function<void()> on_complete = nullptr);
|
||||
void export_depth_thread(std::string file_name);
|
||||
void export_cubes();
|
||||
void project_save(std::function<void(bool)> on_complete = nullptr);
|
||||
void project_save(std::string file_path, std::function<void(bool)> on_complete = nullptr);
|
||||
bool project_save_thread(std::string file_path);
|
||||
|
||||
Reference in New Issue
Block a user