Cafu Engine
DialogTerrainEdit.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_DIALOG_TERRAIN_EDIT_HPP_INCLUDED
8 #define CAFU_DIALOG_TERRAIN_EDIT_HPP_INCLUDED
9 
10 #include "wxFB/TerrainEditorDialogs.h"
11 #include "Math3D/BoundingBox.hpp"
12 
13 
14 class GameConfigT;
15 class ToolTerrainEditorT;
17 
18 
20 {
21  public:
22 
23  /// Constructor.
24  TerrainEditorDialogT(wxWindow* Parent, const GameConfigT& GameConfig, ToolTerrainEditorT* ParentTool);
25 
26  /// Updates the dialogs resolution combobox.
27  /// @param Resolution New resolution value.
28  void UpdateResolution(unsigned long Resolution);
29 
30  /// Returns the the currently active tool.
31  /// @return ID of the currently active tool.
32  int GetActiveTool() const;
33 
34  /// Gets the current radius value.
35  int GetRadius() const { return m_SpinCtrlRadius->GetValue(); }
36 
37  /// Gets the current hardness value.
38  int GetHardness() const { return m_SpinCtrlHardness->GetValue(); }
39 
40  /// Gets the current tool effect value.
41  int GetToolEffect() const { return m_SpinCtrlToolEffect->GetValue(); }
42 
43  /// React on middle mouse clicks from terrain editor tool.
44  /// @return Whether the middle mouse click has been handled by the dialog or not.
45  bool OnMMouseUp();
46 
47 
48  protected:
49 
50  void OnToolClicked (wxCommandEvent& event);
51  void OnSpinCtrlRadius (wxSpinEvent& event);
52  void OnSliderScrollRadius (wxScrollEvent& event);
53  void OnSpinCtrlHardness (wxSpinEvent& event);
54  void OnSliderScrollHardness (wxScrollEvent& event);
55  void OnSpinCtrlToolEffect (wxSpinEvent& event);
56  void OnSliderScrollToolEffect(wxScrollEvent& event);
57  void OnChoiceResolution (wxCommandEvent& event);
58  void OnButtonImport (wxCommandEvent& event);
59  void OnButtonExport (wxCommandEvent& event);
60  void OnButtonGenerate (wxCommandEvent& event);
61 
62 
63  private:
64 
65  friend class ToolTerrainEditorT;
66 
67  const GameConfigT& m_GameConfig;
68  ToolTerrainEditorT* m_ParentTool; ///< The terrain editor tool related to this dialog.
69 
70  TerrainGenerationDialogT* m_TerrainGenerationDialog;
71 };
72 
73 #endif
void UpdateResolution(unsigned long Resolution)
Updates the dialogs resolution combobox.
Definition: DialogTerrainEdit.cpp:30
bool OnMMouseUp()
React on middle mouse clicks from terrain editor tool.
Definition: DialogTerrainEdit.cpp:57
Definition: DialogTerrainEdit.hpp:19
int GetToolEffect() const
Gets the current tool effect value.
Definition: DialogTerrainEdit.hpp:41
Definition: DialogTerrainGeneration.hpp:14
int GetRadius() const
Gets the current radius value.
Definition: DialogTerrainEdit.hpp:35
Definition: ToolTerrainEdit.hpp:27
TerrainEditorDialogT(wxWindow *Parent, const GameConfigT &GameConfig, ToolTerrainEditorT *ParentTool)
Constructor.
Definition: DialogTerrainEdit.cpp:17
Class TerrainEditorDialogFB.
Definition: TerrainEditorDialogs.h:48
int GetHardness() const
Gets the current hardness value.
Definition: DialogTerrainEdit.hpp:38
The class describes the settings for a game/MOD.
Definition: GameConfig.hpp:32
int GetActiveTool() const
Returns the the currently active tool.
Definition: DialogTerrainEdit.cpp:41