Debian Codegraph @

modules/navigation_3d/editor/navigation_region_3d_editor_plugin.h

raw symbols SCIP
1 /**************************************************************************/
2 /* navigation_region_3d_editor_plugin.h */
3 /**************************************************************************/
4 /* This file is part of: */
5 /* GODOT ENGINE */
6 /* https://godotengine.org */
7 /**************************************************************************/
8 /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9 /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10 /* */
11 /* Permission is hereby granted, free of charge, to any person obtaining */
12 /* a copy of this software and associated documentation files (the */
13 /* "Software"), to deal in the Software without restriction, including */
14 /* without limitation the rights to use, copy, modify, merge, publish, */
15 /* distribute, sublicense, and/or sell copies of the Software, and to */
16 /* permit persons to whom the Software is furnished to do so, subject to */
17 /* the following conditions: */
18 /* */
19 /* The above copyright notice and this permission notice shall be */
20 /* included in all copies or substantial portions of the Software. */
21 /* */
22 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25 /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26 /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27 /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29 /**************************************************************************/
30
31 #pragma once
32
33 #include "editor/plugins/editor_plugin.h"
34
35 #include "navigation_region_3d_gizmo_plugin.h"
36
37 class AcceptDialog;
38 class Button;
39 class ConfirmationDialog;
40 class HBoxContainer;
41 class Label;
42 class NavigationRegion3D;
43
44 class NavigationRegion3DEditor : public Control {
45 friend class NavigationRegion3DEditorPlugin;
46
47 GDCLASS(NavigationRegion3DEditor, Control);
48
49 AcceptDialog *err_dialog = nullptr;
50 ConfirmationDialog *multibake_dialog = nullptr;
51
52 HBoxContainer *bake_hbox = nullptr;
53 Button *button_bake = nullptr;
54 Button *button_reset = nullptr;
55 Label *bake_info = nullptr;
56
57 LocalVector<NavigationRegion3D *> selected_regions;
58
59 LocalVector<NavigationRegion3D *> regions_to_bake;
60 LocalVector<NavigationRegion3D *> regions_with_navmesh_to_bake;
61
62 int processed_regions_to_bake_count = 0;
63 int processed_regions_to_bake_count_max = 0;
64 bool region_baking_canceled = false;
65 NavigationRegion3D *currently_baking_region = nullptr;
66
67 bool bake_in_process = false;
68
69 void _bake_pressed();
70 void _clear_pressed();
71
72 void _on_navmesh_multibake_confirmed();
73 void _on_navmesh_multibake_canceled();
74 void _process_regions_to_bake();
75
76 protected:
77 void _node_removed(Node *p_node);
78 void _notification(int p_what);
79
80 public:
81 void edit(LocalVector<NavigationRegion3D *> p_regions);
82 NavigationRegion3DEditor();
83 };
84
85 class NavigationRegion3DEditorPlugin : public EditorPlugin {
86 GDCLASS(NavigationRegion3DEditorPlugin, EditorPlugin);
87
88 NavigationRegion3DEditor *navigation_region_editor = nullptr;
89
90 Ref<NavigationRegion3DGizmoPlugin> gizmo_plugin;
91
92 public:
93 virtual String get_plugin_name() const override { return "NavigationRegion3D"; }
94 bool has_main_screen() const override { return false; }
95 virtual void edit(Object *p_object) override;
96 virtual bool handles(Object *p_object) const override;
97 virtual void make_visible(bool p_visible) override;
98
99 NavigationRegion3DEditorPlugin();
100 };