TDME2  1.9.200
ParticleSystemEditorTabView.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <string>
5 
6 #include <tdme/tdme.h>
7 #include <tdme/audio/fwd-tdme.h>
8 #include <tdme/engine/fwd-tdme.h>
10 #include <tdme/math/Vector3.h>
21 
22 using std::string;
23 using std::unique_ptr;
24 
25 using tdme::audio::Audio;
43 
44 /**
45  * Particle system editor tab view
46  * @author Andreas Drewke
47  */
49  : public TabView
50  , public PlayableSoundView
52  , protected Gizmo
53 {
54 protected:
55  Audio* audio { nullptr };
56  unique_ptr<Engine> engine;
57 
58 private:
59  EditorView* editorView { nullptr };
60  string tabId;
61  PopUps* popUps { nullptr };
62  unique_ptr<Prototype> prototype;
63  unique_ptr<CameraRotationInputHandler> cameraRotationInputHandler;
64  unique_ptr<ParticleSystemEditorTabController> particleSystemEditorTabController;
69 
71 
72  int64_t audioStarted;
73  int64_t audioOffset;
74 
75  int particleSystemIdx { -1 };
77 
78 protected:
79  /**
80  * On rotation event to be overloaded
81  */
82  void onCameraRotation() override;
83 
84  /**
85  * On scale event to be overloaded
86  */
87  void onCameraScale() override;
88 
89 public:
90  // forbid class copy
92 
93  /**
94  * Public constructor
95  * @param editorView editor view
96  * @param tabId tab id
97  */
99 
100  /**
101  * Destructor
102  */
104 
105  /**
106  * @return editor view
107  */
109  return editorView;
110  }
111 
112  /**
113  * @return associated tab controller
114  */
115  inline TabController* getTabController() override {
117  }
118 
119  /**
120  * @return pop up views
121  */
122  inline PopUps* getPopUps() {
123  return popUps;
124  }
125 
126  /**
127  * @return prototype
128  */
130  return prototype.get();
131  }
132 
133  // overridden methods
134  void handleInputEvents() override;
135  void display() override;
136  inline const string& getTabId() override {
137  return tabId;
138  }
139  void initialize() override;
140  void dispose() override;
141  Engine* getEngine() override;
142  void activate() override;
143  void deactivate() override;
144  void reloadOutliner() override;
145  inline bool hasFixedSize() override{ return false; };
146  void updateRendering() override;
147 
148  // overridden methods
149  void playSound(const string& soundId) override;
150  void stopSound() override;
151 
152  /**
153  * Init particle system
154  */
155  void initParticleSystem();
156 
157  /**
158  * Uninit particle system
159  */
160  void uninitParticleSystem();
161 
162  /**
163  * @return particle system index
164  */
166 
167  /**
168  * Set particle system index, the particle system to edit
169  * @param idx index
170  * @param changeOutlinerSelection change outliner selection
171  */
172  void setParticleSystemIndex(int idx, bool changeOutlinerSelection = true);
173 
174  /**
175  * Update GIZMO
176  */
177  void updateGizmo();
178 
179  /**
180  * Set GIZMO rotation
181  * @param transform transform
182  */
183  void setGizmoRotation(const Transform& transform);
184 
185  /**
186  * Apply particle system transform
187  * @param particleSystemEntity particle system entity
188  * @param guiOnly GUI only
189  */
190  void applyParticleSystemTransform(ParticleSystem* particleSystemEntity, bool guiOnly);
191 
192  /**
193  * Saving prototype as tempty prototype
194  * @param pathName path name
195  * @param fileName file name
196  */
197  void saveFile(const string& pathName, const string& fileName);
198 
199 };
Interface to audio module.
Definition: Audio.h:29
Engine main class.
Definition: Engine.h:131
Frame buffer class.
Definition: FrameBuffer.h:22
Transform which contain scale, rotations and translation.
Definition: Transform.h:29
Prototype definition.
Definition: Prototype.h:55
Vector3 class representing vector3 mathematical structure and operations with x, y,...
Definition: Vector3.h:20
Gizmo tool for views.
Definition: Gizmo.h:31
Pop ups controller accessor class.
Definition: PopUps.h:29
void saveFile(const string &pathName, const string &fileName)
Saving prototype as tempty prototype.
void setGizmoRotation(const Transform &transform)
Set GIZMO rotation.
bool hasFixedSize() override
If this viewport framebuffer has a fixed size.
void onCameraRotation() override
On rotation event to be overloaded.
unique_ptr< ParticleSystemEditorTabController > particleSystemEditorTabController
void handleInputEvents() override
Handle input events that have not yet been processed.
void applyParticleSystemTransform(ParticleSystem *particleSystemEntity, bool guiOnly)
Apply particle system transform.
unique_ptr< CameraRotationInputHandler > cameraRotationInputHandler
void setParticleSystemIndex(int idx, bool changeOutlinerSelection=true)
Set particle system index, the particle system to edit.
ParticleSystemEditorTabView(EditorView *editorView, const string &tabId, Prototype *prototype)
Public constructor.
void onCameraScale() override
On scale event to be overloaded.
Particle system entity interface.
Tab controller, which connects UI with logic.
Definition: TabController.h:34
Playable sound view interface, which represents a view that supports playing sounds additionally.
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6