SceneEditor3D.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  2. // Please see LICENSE.md in repository root for license information
  3. // https://github.com/AtomicGameEngine/AtomicGameEngine
  4. #pragma once
  5. #include <TurboBadger/tb_widgets_common.h>
  6. #include "../ResourceEditor.h"
  7. #include "SceneView3D.h"
  8. #include "Gizmo3D.h"
  9. using namespace Atomic;
  10. using namespace tb;
  11. namespace Atomic
  12. {
  13. class Scene;
  14. class Node;
  15. class View3D;
  16. class Camera;
  17. class DebugRenderer;
  18. class Octree;
  19. }
  20. namespace AtomicEditor
  21. {
  22. class SceneEditor3D: public ResourceEditor
  23. {
  24. OBJECT(SceneEditor3D);
  25. public:
  26. SceneEditor3D(Context* context, const String& fullpath, UITabContainer* container);
  27. virtual ~SceneEditor3D();
  28. bool OnEvent(const TBWidgetEvent &ev);
  29. void SelectNode(Node* node);
  30. Scene* GetScene() { return scene_; }
  31. Gizmo3D* GetGizmo() { return gizmo3D_; }
  32. void SetFocus();
  33. virtual bool RequiresInspector() { return true; }
  34. void Close(bool navigateToAvailableResource = true);
  35. bool Save();
  36. private:
  37. void HandleUpdate(StringHash eventType, VariantMap& eventData);
  38. void HandleEditorActiveNodeChange(StringHash eventType, VariantMap& eventData);
  39. void HandlePlayStarted(StringHash eventType, VariantMap& eventData);
  40. void HandlePlayStopped(StringHash eventType, VariantMap& eventData);
  41. void HandleGizmoEditModeChanged(StringHash eventType, VariantMap& eventData);
  42. SharedPtr<Scene> scene_;
  43. // TODO: multiple views
  44. SharedPtr<SceneView3D> sceneView_;
  45. SharedPtr<Gizmo3D> gizmo3D_;
  46. WeakPtr<Node> selectedNode_;
  47. SharedPtr<Node> clipboardNode_;
  48. };
  49. }