![]() |
Divide Framework 0.1
A free and open-source 3D Framework under heavy development
|
#include <Editor.h>
Classes | |
struct | FocusedWindowState |
struct | QueueModelSpawn |
Public Types | |
enum class | WindowType : U8 { PostFX = 0 , SolutionExplorer , Properties , ContentExplorer , Output , NodePreview , SceneView , COUNT } |
enum class | ImGuiContextType : U8 { Gizmo = 0 , Editor = 1 , COUNT } |
Public Member Functions | |
Editor (PlatformContext &context, ImGuiStyleEnum theme=ImGuiStyle_DarkCodz01) | |
~Editor () override | |
bool | init (const vec2< U16 > renderResolution) |
void | close () |
void | idle () noexcept |
void | update (U64 deltaTimeUS) |
void | drawScreenOverlay (const Camera *camera, const Rect< I32 > &targetViewport, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut) const |
Render any editor specific element that needs to be part of the scene (e.g. Control Gizmo) | |
void | toggle (bool state) |
void | onWindowSizeChange (const SizeChangeParams ¶ms) |
void | onResolutionChange (const SizeChangeParams ¶ms) |
void | selectionChangeCallback (PlayerIndex idx, const vector< SceneGraphNode * > &nodes) const |
void | onChangeScene (Scene *newScene) |
bool | Undo () const |
size_t | UndoStackSize () const noexcept |
bool | Redo () const |
size_t | RedoStackSize () const noexcept |
Rect< I32 > | scenePreviewRect (bool globalCoords) const noexcept |
bool | wantsMouse () const |
bool | wantsKeyboard () const noexcept |
bool | wantsJoystick () const noexcept |
bool | hasFocus () const |
bool | isHovered () const |
template<typename T > | |
void | registerUndoEntry (const UndoEntry< T > &entry) |
bool | inEditMode () const noexcept |
bool | simulationPaused () const noexcept |
U32 | stepQueue () const noexcept |
const TransformSettings & | getTransformSettings () const noexcept |
void | setTransformSettings (const TransformSettings &settings) const noexcept |
void | infiniteGridAxisWidth (const F32 value) noexcept |
void | infiniteGridScale (const F32 value) noexcept |
void | showStatusMessage (const string &message, F32 durationMS, bool error) const |
const RenderTargetHandle & | getNodePreviewTarget () const noexcept |
bool | onKeyDown (const Input::KeyEvent &key) override |
Key pressed: return true if input was consumed. | |
bool | onKeyUp (const Input::KeyEvent &key) override |
Key released: return true if input was consumed. | |
bool | mouseMoved (const Input::MouseMoveEvent &arg) override |
Mouse moved: return true if input was consumed. | |
bool | mouseButtonPressed (const Input::MouseButtonEvent &arg) override |
Mouse button pressed: return true if input was consumed. | |
bool | mouseButtonReleased (const Input::MouseButtonEvent &arg) override |
Mouse button released: return true if input was consumed. | |
bool | joystickButtonPressed (const Input::JoystickEvent &arg) noexcept override |
Joystick or Gamepad: return true if input was consumed. | |
bool | joystickButtonReleased (const Input::JoystickEvent &arg) noexcept override |
bool | joystickAxisMoved (const Input::JoystickEvent &arg) noexcept override |
bool | joystickPovMoved (const Input::JoystickEvent &arg) noexcept override |
bool | joystickBallMoved (const Input::JoystickEvent &arg) noexcept override |
bool | joystickAddRemove (const Input::JoystickEvent &arg) noexcept override |
bool | joystickRemap (const Input::JoystickEvent &arg) noexcept override |
bool | onTextEvent (const Input::TextEvent &arg) override |
bool | saveToXML () const |
bool | loadFromXML () |
![]() | |
PlatformContextComponent (PlatformContext &context) noexcept | |
virtual | ~PlatformContextComponent ()=default |
PlatformContext & | context () noexcept |
const PlatformContext & | context () const noexcept |
![]() | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable (NonCopyable &&)=default | |
NonCopyable & | operator= (NonCopyable &&)=default |
![]() | |
FrameListener (const Str< 64 > &name, FrameListenerManager &parent, U32 callOrder) | |
Either give it a name. | |
virtual | ~FrameListener () override |
bool | operator< (FrameListener &that) const noexcept |
![]() | |
GUIDWrapper () noexcept | |
GUIDWrapper (const GUIDWrapper &old) noexcept | |
GUIDWrapper (GUIDWrapper &&old) noexcept | |
virtual | ~GUIDWrapper ()=default |
FORCE_INLINE I64 | getGUID () const noexcept |
GUIDWrapper & | operator= (const GUIDWrapper &old)=delete |
GUIDWrapper & | operator= (GUIDWrapper &&other)=delete |
![]() | |
virtual | ~InputAggregatorInterface ()=default |
virtual bool | onKeyDown (const KeyEvent &arg)=0 |
Keyboard: return true if input was consumed. | |
virtual bool | onKeyUp (const KeyEvent &arg)=0 |
virtual bool | mouseMoved (const MouseMoveEvent &arg)=0 |
Mouse: return true if input was consumed. | |
virtual bool | mouseButtonPressed (const MouseButtonEvent &arg)=0 |
virtual bool | mouseButtonReleased (const MouseButtonEvent &arg)=0 |
virtual bool | joystickButtonPressed (const JoystickEvent &arg)=0 |
Joystick or Gamepad: return true if input was consumed. | |
virtual bool | joystickButtonReleased (const JoystickEvent &arg)=0 |
virtual bool | joystickAxisMoved (const JoystickEvent &arg)=0 |
virtual bool | joystickPovMoved (const JoystickEvent &arg)=0 |
virtual bool | joystickBallMoved (const JoystickEvent &arg)=0 |
virtual bool | joystickAddRemove (const JoystickEvent &arg)=0 |
virtual bool | joystickRemap (const JoystickEvent &arg)=0 |
virtual bool | onTextEvent (const TextEvent &arg)=0 |
Static Public Attributes | |
static std::array< Input::MouseButton, 5 > | g_oisButtons |
static std::array< const char *, 3 > | g_supportedExportPlatforms |
Protected Member Functions | |
bool | framePostRender (const FrameEvent &evt) override |
bool | frameEnded (const FrameEvent &evt) noexcept override |
frameEnded is called after the buffers have been swapped | |
bool | isInit () const noexcept |
bool | render () |
BoundingSphere | teleportToNode (Camera *camera, const SceneGraphNode *sgn) const |
void | saveNode (const SceneGraphNode *sgn) const |
void | loadNode (SceneGraphNode *sgn) const |
void | queueRemoveNode (I64 nodeGUID) |
void | updateEditorFocus () |
void | updateFocusState (ImVec2 mousePos) |
void | createFontTexture (F32 DPIScaleFactor) |
Destroys the old font, if any, before loading the new one. | |
U32 | saveItemCount () const noexcept |
bool | isDefaultScene () const noexcept |
void | postRender (RenderStage stage, const CameraSnapshot &cameraSnapshot, RenderTargetID target, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut) |
void | getCommandBuffer (GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut) |
void | renderModelSpawnModal () |
PROPERTY_R_IW (I64, previewNodeGUID, -1) | |
PROPERTY_R_IW (bool, running, false) | |
PROPERTY_R_IW (bool, unsavedSceneChanges, false) | |
PROPERTY_R_IW (FocusedWindowState, windowFocusState) | |
POINTER_R_IW (Camera, selectedCamera, nullptr) | |
POINTER_R_IW (Camera, editorCamera, nullptr) | |
POINTER_R_IW (Camera, nodePreviewCamera, nullptr) | |
PROPERTY_R_IW (bool, nodePreviewWindowVisible, false) | |
PROPERTY_RW (bool, infiniteGridEnabledScene, true) | |
PROPERTY_RW (bool, infiniteGridEnabledNode, true) | |
PROPERTY_R (F32, infiniteGridAxisWidth, 2.f) | |
PROPERTY_R (F32, infiniteGridScale, 1.f) | |
PROPERTY_R_IW (FColour3, nodePreviewBGColour) | |
PROPERTY_INTERNAL (bool, lockSolutionExplorer, false) | |
PROPERTY_INTERNAL (bool, sceneGizmoEnabled, false) | |
void | renderDrawList (ImDrawData *pDrawData, I64 bufferGUID, const Rect< I32 > &targetViewport, bool editorPass, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut) |
bool | saveSceneChanges (const DELEGATE< void, std::string_view > &msgCallback, const DELEGATE< void, bool > &finishCallback) const |
Saves all new changes to the current scene and uses the provided callbacks to return progress messages. msgCallback gets called per save-step/process, finishCallback gets called once at the end. | |
bool | switchScene (const SceneEntry &scene, bool createIfNotExists=false) |
bool | openProject (const ProjectID &projectID) |
bool | modalTextureView (std::string_view modalName, Handle< Texture > tex, vec2< F32 > dimensions, bool preserveAspect, bool useModal) const |
Returns true if the window was closed. | |
bool | modalModelSpawn (Handle< Mesh > mesh, bool quick, const vec3< F32 > &scale=VECTOR3_UNIT, const vec3< F32 > &position=VECTOR3_ZERO) |
Returns true if the model was queued. | |
bool | spawnGeometry (Handle< Mesh > mesh, const vec3< F32 > &scale, const vec3< F32 > &position, const vec3< Angle::DEGREES< F32 > > &rotation, std::string_view name) const |
Return true if the model was spawned as a scene node. | |
bool | isNodeInView (const SceneGraphNode &node) const noexcept |
Return true if the specified node passed frustum culling during the main render pass. | |
void | onRemoveComponent (const EditorComponent &comp) const |
const ProjectIDs & | getProjectList () const noexcept |
const SceneEntries & | getSceneList () const noexcept |
LightPool & | getActiveLightPool () const |
SceneEnvironmentProbePool * | getActiveEnvProbePool () const noexcept |
void | toggleMemoryEditor (bool state) noexcept |
void | copyPlayerCamToEditorCam () noexcept |
void | setEditorCamLookAt (const vec3< F32 > &eye, const vec3< F32 > &fwd, const vec3< F32 > &up) |
void | setEditorCameraSpeed (const vec3< F32 > &speed) noexcept |
bool | addComponent (SceneGraphNode *selection, ComponentType newComponentType) const |
bool | addComponent (const Selections &selections, ComponentType newComponentType) const |
bool | removeComponent (SceneGraphNode *selection, ComponentType newComponentType) const |
bool | removeComponent (const Selections &selections, ComponentType newComponentType) const |
GenericVertexData * | getOrCreateIMGUIBuffer (I64 bufferGUID, U32 maxVertices, GFX::MemoryBarrierCommand &memCmdInOut) |
![]() | |
NonCopyable ()=default | |
~NonCopyable ()=default | |
![]() | |
void | setCallOrder (const U32 order) noexcept |
virtual bool | frameStarted (const FrameEvent &evt) |
virtual bool | framePreRender (const FrameEvent &evt) |
framePreRenderStarted is called when we need to start processing the visual aspect of a scene | |
virtual bool | frameSceneRenderStarted (const FrameEvent &evt) |
frameSceneRenderStarted is called right before rendering the scene for the current player starts | |
virtual bool | frameSceneRenderEnded (const FrameEvent &evt) |
frameSceneRenderEnded is called immediately after scene rendering for the current player has ended but before any blitting operations | |
virtual bool | frameRenderingQueued (const FrameEvent &evt) |
virtual bool | framePostRender (const FrameEvent &evt) |
virtual bool | frameEnded (const FrameEvent &evt) |
frameEnded is called after the buffers have been swapped | |
PROPERTY_R_IW (bool, enabled, false) | |
PROPERTY_RW (Str< 64 >, name) | |
Static Protected Member Functions | |
static ImGuiViewport * | FindViewportByPlatformHandle (ImGuiContext *context, const DisplayWindow *window) |
Protected Attributes | |
SceneGraphNode * | _previewNode { nullptr } |
![]() | |
PlatformContext & | _context |
![]() | |
const I64 | _guid |
Friends | |
class | Attorney::EditorGizmo |
class | Attorney::EditorMenuBar |
class | Attorney::EditorOutputWindow |
class | Attorney::EditorGeneralWidget |
class | Attorney::EditorOptionsWindow |
class | Attorney::EditorWindowManager |
class | Attorney::EditorPropertyWindow |
class | Attorney::EditorSceneViewWindow |
class | Attorney::EditorSolutionExplorerWindow |
class | Attorney::EditorRenderPassExecutor |
class | Attorney::EditorEditorComponent |
Additional Inherited Members | |
![]() | |
static I64 | generateGUID () noexcept |
![]() | |
NonMovable (NonMovable &&)=delete | |
NonMovable & | operator= (NonMovable &&)=delete |
NonMovable (const NonMovable &)=default | |
NonMovable & | operator= (const NonMovable &)=default |
NonMovable ()=default | |
~NonMovable ()=default | |
|
strong |
|
strong |
|
explicit |
Definition at line 181 of file Editor.cpp.
|
override |
Definition at line 204 of file Editor.cpp.
|
protected |
Definition at line 2785 of file Editor.cpp.
|
protected |
Definition at line 2773 of file Editor.cpp.
void Divide::Editor::close | ( | ) |
Definition at line 817 of file Editor.cpp.
|
protectednoexcept |
Definition at line 1653 of file Editor.cpp.
|
protected |
Destroys the old font, if any, before loading the new one.
Definition at line 215 of file Editor.cpp.
void Divide::Editor::drawScreenOverlay | ( | const Camera * | camera, |
const Rect< I32 > & | targetViewport, | ||
GFX::CommandBuffer & | bufferInOut, | ||
GFX::MemoryBarrierCommand & | memCmdInOut | ||
) | const |
Render any editor specific element that needs to be part of the scene (e.g. Control Gizmo)
Definition at line 1289 of file Editor.cpp.
|
staticprotected |
Definition at line 1795 of file Editor.cpp.
|
overrideprotectedvirtualnoexcept |
frameEnded is called after the buffers have been swapped
Reimplemented from Divide::FrameListener.
Definition at line 1372 of file Editor.cpp.
|
overrideprotectedvirtual |
framePostRenderStarted is called after the main rendering calls are finished (e.g. use this for debug calls)
Reimplemented from Divide::FrameListener.
Definition at line 1295 of file Editor.cpp.
|
protectednoexcept |
Definition at line 2710 of file Editor.cpp.
|
protected |
Definition at line 2704 of file Editor.cpp.
|
protected |
Definition at line 1300 of file Editor.cpp.
|
inlinenoexcept |
Definition at line 78 of file Editor.inl.
|
protected |
Definition at line 1394 of file Editor.cpp.
|
protectednoexcept |
Definition at line 2694 of file Editor.cpp.
|
protectednoexcept |
Definition at line 2699 of file Editor.cpp.
|
inlinenoexcept |
Definition at line 49 of file Editor.inl.
bool Divide::Editor::hasFocus | ( | ) | const |
Definition at line 2122 of file Editor.cpp.
|
noexcept |
Definition at line 210 of file Editor.cpp.
|
inlinenoexcept |
Definition at line 41 of file Editor.inl.
|
noexcept |
Definition at line 1205 of file Editor.cpp.
|
noexcept |
Definition at line 1211 of file Editor.cpp.
Definition at line 274 of file Editor.cpp.
|
protectednoexcept |
Definition at line 2283 of file Editor.cpp.
bool Divide::Editor::isHovered | ( | ) | const |
Definition at line 2127 of file Editor.cpp.
|
inlineprotectednoexcept |
Definition at line 37 of file Editor.inl.
|
protectednoexcept |
Return true if the specified node passed frustum culling during the main render pass.
Definition at line 1217 of file Editor.cpp.
|
overridevirtualnoexcept |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 2065 of file Editor.cpp.
|
overridevirtualnoexcept |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 2050 of file Editor.cpp.
|
overridevirtualnoexcept |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 2060 of file Editor.cpp.
|
overridevirtualnoexcept |
Joystick or Gamepad: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 2040 of file Editor.cpp.
|
overridevirtualnoexcept |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 2045 of file Editor.cpp.
|
overridevirtualnoexcept |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 2055 of file Editor.cpp.
|
overridevirtualnoexcept |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 2070 of file Editor.cpp.
bool Divide::Editor::loadFromXML | ( | ) |
Definition at line 2881 of file Editor.cpp.
|
protected |
Definition at line 2755 of file Editor.cpp.
|
protected |
Returns true if the model was queued.
Definition at line 2537 of file Editor.cpp.
|
protected |
Returns true if the window was closed.
Definition at line 2289 of file Editor.cpp.
|
overridevirtual |
Mouse button pressed: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1959 of file Editor.cpp.
|
overridevirtual |
Mouse button released: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1999 of file Editor.cpp.
|
overridevirtual |
Mouse moved: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1861 of file Editor.cpp.
void Divide::Editor::onChangeScene | ( | Scene * | newScene | ) |
Definition at line 2268 of file Editor.cpp.
|
overridevirtual |
Key pressed: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1701 of file Editor.cpp.
|
overridevirtual |
Key released: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1739 of file Editor.cpp.
|
protected |
Definition at line 2720 of file Editor.cpp.
void Divide::Editor::onResolutionChange | ( | const SizeChangeParams & | params | ) |
Definition at line 2180 of file Editor.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 2132 of file Editor.cpp.
void Divide::Editor::onWindowSizeChange | ( | const SizeChangeParams & | params | ) |
Definition at line 2151 of file Editor.cpp.
|
protected |
Definition at line 2214 of file Editor.cpp.
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 1236 of file Editor.cpp.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 2766 of file Editor.cpp.
bool Divide::Editor::Redo | ( | ) | const |
Definition at line 1685 of file Editor.cpp.
|
inlinenoexcept |
Definition at line 70 of file Editor.inl.
void Divide::Editor::registerUndoEntry | ( | const UndoEntry< T > & | entry | ) |
Definition at line 62 of file Editor.inl.
|
protected |
Definition at line 2815 of file Editor.cpp.
|
protected |
Definition at line 2803 of file Editor.cpp.
|
protected |
Definition at line 1138 of file Editor.cpp.
|
protected |
Definition at line 1433 of file Editor.cpp.
|
protected |
Definition at line 2574 of file Editor.cpp.
|
protectednoexcept |
Definition at line 2273 of file Editor.cpp.
|
protected |
Definition at line 2728 of file Editor.cpp.
|
protected |
Saves all new changes to the current scene and uses the provided callbacks to return progress messages. msgCallback gets called per save-step/process, finishCallback gets called once at the end.
Definition at line 2200 of file Editor.cpp.
bool Divide::Editor::saveToXML | ( | ) | const |
Definition at line 2833 of file Editor.cpp.
Definition at line 1382 of file Editor.cpp.
void Divide::Editor::selectionChangeCallback | ( | PlayerIndex | idx, |
const vector< SceneGraphNode * > & | nodes | ||
) | const |
Definition at line 1643 of file Editor.cpp.
Definition at line 1665 of file Editor.cpp.
|
protected |
Definition at line 1658 of file Editor.cpp.
|
inlinenoexcept |
Definition at line 45 of file Editor.inl.
Definition at line 2659 of file Editor.cpp.
|
inlinenoexcept |
Definition at line 57 of file Editor.inl.
|
protected |
Return true if the model was spawned as a scene node.
Definition at line 2666 of file Editor.cpp.
|
inlinenoexcept |
Definition at line 53 of file Editor.inl.
|
protected |
Definition at line 2219 of file Editor.cpp.
|
protected |
Definition at line 2715 of file Editor.cpp.
void Divide::Editor::toggle | ( | bool | state | ) |
Definition at line 883 of file Editor.cpp.
|
inlineprotectednoexcept |
Definition at line 74 of file Editor.inl.
bool Divide::Editor::Undo | ( | ) | const |
Definition at line 1670 of file Editor.cpp.
|
inlinenoexcept |
Definition at line 66 of file Editor.inl.
void Divide::Editor::update | ( | U64 | deltaTimeUS | ) |
Definition at line 991 of file Editor.cpp.
|
protected |
Definition at line 865 of file Editor.cpp.
|
protected |
Definition at line 1813 of file Editor.cpp.
|
noexcept |
Definition at line 2075 of file Editor.cpp.
|
noexcept |
Definition at line 2106 of file Editor.cpp.
bool Divide::Editor::wantsMouse | ( | ) | const |
Definition at line 2085 of file Editor.cpp.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
private |
|
static |
|
static |