TDME2  1.9.200
EditorView.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <string>
5 #include <vector>
6 
7 #include <tdme/tdme.h>
8 #include <tdme/engine/fwd-tdme.h>
12 #include <tdme/math/Vector3.h>
17 
18 using std::string;
19 using std::vector;
20 using std::unique_ptr;
21 
30 
31 /**
32  * Editor View
33  * @author Andreas Drewke
34  */
36  : public View
37  , public GUIInputEventHandler
38 {
39 private:
40  Engine* engine { nullptr };
41  PopUps* popUps { nullptr };
42  unique_ptr<EditorScreenController> editorScreenController;
44  array<bool, 8> mouseButtonsDown = { false, false, false, false, false, false, false, false };
45 
46 public:
47  // forbid class copy
49 
50  /**
51  * Public constructor
52  * @param popUps pop ups view
53  */
55 
56  /**
57  * Destructor
58  */
59  ~EditorView();
60 
61  /**
62  * @return pop ups
63  */
64  PopUps* getPopUps();
65 
66  /**
67  * @return screen controller
68  */
70  return editorScreenController.get();
71  }
72 
73  /**
74  * Init GUI elements
75  */
76  void updateGUIElements();
77 
78  // overridden methods
79  void handleInputEvents() override;
80  void display() override;
81  void initialize() override;
82  void activate() override;
83  void deactivate() override;
84  void dispose() override;
85  void tick() override;
86 
87  /**
88  * Set outliner content
89  * @param xml xml
90  */
91  void setOutlinerContent(const string& xml);
92 
93  /**
94  * Set outliner add drop down content
95  * @param xml xml
96  */
97  void setOutlinerAddDropDownContent(const string& xml);
98 
99  /**
100  * Set details content
101  * @param xml xml
102  */
103  void setDetailsContent(const string& xml);
104 
105  /**
106  * Reload tab outliner
107  * @param newSelectionValue new selection value
108  */
109  void reloadTabOutliner(const string& newSelectionValue = string());
110 
111  /**
112  * Determine current tab viewport screen constraints
113  * @param left left
114  * @param top top
115  * @param width width
116  * @param height height
117  * @param offsetX offset X
118  * @param offsetY offset Y
119  * @return success
120  */
121  bool getCurrentTabViewPort(int& left, int& top, int& width, int& height, int& offsetX, int& offsetY);
122 
123  /**
124  * Determine viewport screen constraints
125  * @param viewPortNode view port node
126  * @param left left
127  * @param top top
128  * @param width width
129  * @param height height
130  * @param offsetX offset X
131  * @param offsetY offset Y
132  */
133  void getViewPort(GUINode* viewPortNode, int& left, int& top, int& width, int& height, int& offsetX, int& offsetY);
134 
135  /**
136  * Determine current tab tooltip position
137  * @param screenNode screen node
138  * @param mouseX mouse x
139  * @param mouseY mouse Y
140  * @param tooltipLeft tooltip left
141  * @param tooltipTop tooltip top
142  * @return success
143  */
144  bool getCurrentTabTooltipPosition(GUIScreenNode* screenNode, int mouseX, int mouseY, int& tooltipLeft, int& tooltipTop);
145 
146  /**
147  * On drop
148  * @param paths paths of items that were dropped
149  */
150  void onDrop(const vector<string>& paths);
151 
152 };
Engine main class.
Definition: Engine.h:131
GUI node base class.
Definition: GUINode.h:64
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:72
Vector3 class representing vector3 mathematical structure and operations with x, y,...
Definition: Vector3.h:20
Pop ups controller accessor class.
Definition: PopUps.h:29
void getViewPort(GUINode *viewPortNode, int &left, int &top, int &width, int &height, int &offsetX, int &offsetY)
Determine viewport screen constraints.
Definition: EditorView.cpp:427
void dispose() override
Disposes the view.
Definition: EditorView.cpp:384
void display() override
Renders the view.
Definition: EditorView.cpp:314
void setOutlinerAddDropDownContent(const string &xml)
Set outliner add drop down content.
Definition: EditorView.cpp:400
void setOutlinerContent(const string &xml)
Set outliner content.
Definition: EditorView.cpp:396
void updateGUIElements()
Init GUI elements.
Definition: EditorView.cpp:343
EditorScreenController * getScreenController()
Definition: EditorView.h:69
void initialize() override
Initiates the view.
Definition: EditorView.cpp:347
void deactivate() override
Deactivate view.
Definition: EditorView.cpp:380
void handleInputEvents() override
Handle input events that have not yet been processed.
Definition: EditorView.cpp:97
bool getCurrentTabViewPort(int &left, int &top, int &width, int &height, int &offsetX, int &offsetY)
Determine current tab viewport screen constraints.
Definition: EditorView.cpp:420
void setDetailsContent(const string &xml)
Set details content.
Definition: EditorView.cpp:404
void activate() override
Activate view.
Definition: EditorView.cpp:360
EditorView(PopUps *popUps)
Public constructor.
Definition: EditorView.cpp:83
bool getCurrentTabTooltipPosition(GUIScreenNode *screenNode, int mouseX, int mouseY, int &tooltipLeft, int &tooltipTop)
Determine current tab tooltip position.
Definition: EditorView.cpp:439
unique_ptr< EditorScreenController > editorScreenController
Definition: EditorView.h:42
void reloadTabOutliner(const string &newSelectionValue=string())
Reload tab outliner.
Definition: EditorView.cpp:408
void onDrop(const vector< string > &paths)
On drop.
Definition: EditorView.cpp:452
GUI input event handler interface.
View interface, this combines application logic, regarding a application view, with screen controller...
Definition: View.h:11
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6