Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::Editor Class Referencefinal

#include <Editor.h>

+ Inheritance diagram for Divide::Editor:

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 &params)
 
void onResolutionChange (const SizeChangeParams &params)
 
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< I32scenePreviewRect (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 TransformSettingsgetTransformSettings () 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 RenderTargetHandlegetNodePreviewTarget () 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 ()
 
- Public Member Functions inherited from Divide::PlatformContextComponent
 PlatformContextComponent (PlatformContext &context) noexcept
 
virtual ~PlatformContextComponent ()=default
 
PlatformContextcontext () noexcept
 
const PlatformContextcontext () const noexcept
 
- Public Member Functions inherited from Divide::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
 NonCopyable (NonCopyable &&)=default
 
NonCopyableoperator= (NonCopyable &&)=default
 
- Public Member Functions inherited from Divide::FrameListener
 FrameListener (const Str< 64 > &name, FrameListenerManager &parent, U32 callOrder)
 Either give it a name.
 
virtual ~FrameListener () override
 
bool operator< (FrameListener &that) const noexcept
 
- Public Member Functions inherited from Divide::GUIDWrapper
 GUIDWrapper () noexcept
 
 GUIDWrapper (const GUIDWrapper &old) noexcept
 
 GUIDWrapper (GUIDWrapper &&old) noexcept
 
virtual ~GUIDWrapper ()=default
 
FORCE_INLINE I64 getGUID () const noexcept
 
GUIDWrapperoperator= (const GUIDWrapper &old)=delete
 
GUIDWrapperoperator= (GUIDWrapper &&other)=delete
 
- Public Member Functions inherited from Divide::Input::InputAggregatorInterface
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 ProjectIDsgetProjectList () const noexcept
 
const SceneEntriesgetSceneList () const noexcept
 
LightPoolgetActiveLightPool () const
 
SceneEnvironmentProbePoolgetActiveEnvProbePool () 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
 
GenericVertexDatagetOrCreateIMGUIBuffer (I64 bufferGUID, U32 maxVertices, GFX::MemoryBarrierCommand &memCmdInOut)
 
- Protected Member Functions inherited from Divide::NonCopyable
 NonCopyable ()=default
 
 ~NonCopyable ()=default
 
- Protected Member Functions inherited from Divide::FrameListener
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 }
 
- Protected Attributes inherited from Divide::PlatformContextComponent
PlatformContext_context
 
- Protected Attributes inherited from Divide::GUIDWrapper
const I64 _guid
 

Private Attributes

Time::ProfileTimer_editorUpdateTimer
 
Time::ProfileTimer_editorRenderTimer
 
MenuBar_uptr _menuBar
 
StatusBar_uptr _statusBar
 
EditorOptionsWindow_uptr _optionsWindow
 
UndoManager_uptr _undoManager
 
Gizmo_uptr _gizmo
 
DisplayWindow_mainWindow = nullptr
 
Handle< Texture_fontTexture = INVALID_HANDLE<Texture>
 
Handle< ShaderProgram_imguiProgram = INVALID_HANDLE<ShaderProgram>
 
Handle< ShaderProgram_infiniteGridProgram = INVALID_HANDLE<ShaderProgram>
 
IMPrimitive_infiniteGridPrimitive = nullptr
 
PipelineDescriptor _infiniteGridPipelineDesc
 
PipelineDescriptor _axisGizmoPipelineDesc
 
IMPrimitive_axisGizmo = nullptr
 
Pipeline_editorPipeline = nullptr
 
eastl::fixed_vector< std::pair< I64, GenericVertexData_ptr >, 5, true > _imguiBuffers
 
std::pair< bufferPtr, size_t > _memoryEditorData = { nullptr, 0 }
 
std::array< ImGuiContext *, to_base(ImGuiContextType::COUNT)> _imguiContexts = {}
 
std::array< std::unique_ptr< DockedWindow >, to_base(WindowType::COUNT)> _dockedWindows = {}
 
ResourcePath _externalTextEditorPath
 
SamplerDescriptor _editorSampler {}
 
string _lastOpenSceneName { "" }
 
U32 _stepQueue = 1u
 
F32 _queuedDPIValue = -1.f
 
bool _simulationPaused = true
 
ImGuiStyleEnum _currentTheme = ImGuiStyle_Count
 
bool _showSampleWindow = false
 
bool _showOptionsWindow = false
 
bool _showMemoryEditor = false
 
bool _isScenePaused = false
 
bool _gridSettingsDirty = true
 
CircularBuffer< SceneEntry, 10 > _recentSceneList
 
CameraSnapshot _render2DSnapshot
 
RenderTargetHandle _nodePreviewRTHandle {}
 
struct Divide::Editor::QueueModelSpawn _queuedModelSpawn
 

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 Public Member Functions inherited from Divide::GUIDWrapper
static I64 generateGUID () noexcept
 
- Private Member Functions inherited from Divide::NonMovable
 NonMovable (NonMovable &&)=delete
 
NonMovableoperator= (NonMovable &&)=delete
 
 NonMovable (const NonMovable &)=default
 
NonMovableoperator= (const NonMovable &)=default
 
 NonMovable ()=default
 
 ~NonMovable ()=default
 

Detailed Description

Definition at line 137 of file Editor.h.

Member Enumeration Documentation

◆ ImGuiContextType

enum class Divide::Editor::ImGuiContextType : U8
strong
Enumerator
Gizmo 
Editor 
COUNT 

Definition at line 171 of file Editor.h.

◆ WindowType

enum class Divide::Editor::WindowType : U8
strong
Enumerator
PostFX 
SolutionExplorer 
Properties 
ContentExplorer 
Output 
NodePreview 
SceneView 
COUNT 

Definition at line 159 of file Editor.h.

Constructor & Destructor Documentation

◆ Editor()

Divide::Editor::Editor ( PlatformContext context,
ImGuiStyleEnum  theme = ImGuiStyle_DarkCodz01 
)
explicit

Definition at line 181 of file Editor.cpp.

◆ ~Editor()

Divide::Editor::~Editor ( )
override

Definition at line 204 of file Editor.cpp.

Member Function Documentation

◆ addComponent() [1/2]

bool Divide::Editor::addComponent ( const Selections selections,
ComponentType  newComponentType 
) const
protected

Definition at line 2785 of file Editor.cpp.

◆ addComponent() [2/2]

bool Divide::Editor::addComponent ( SceneGraphNode selection,
ComponentType  newComponentType 
) const
protected

Definition at line 2773 of file Editor.cpp.

◆ close()

void Divide::Editor::close ( )

Definition at line 817 of file Editor.cpp.

◆ copyPlayerCamToEditorCam()

void Divide::Editor::copyPlayerCamToEditorCam ( )
protectednoexcept

Definition at line 1653 of file Editor.cpp.

◆ createFontTexture()

void Divide::Editor::createFontTexture ( F32  DPIScaleFactor)
protected

Destroys the old font, if any, before loading the new one.

Definition at line 215 of file Editor.cpp.

◆ drawScreenOverlay()

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.

◆ FindViewportByPlatformHandle()

ImGuiViewport * Divide::Editor::FindViewportByPlatformHandle ( ImGuiContext *  context,
const DisplayWindow window 
)
staticprotected

Definition at line 1795 of file Editor.cpp.

◆ frameEnded()

bool Divide::Editor::frameEnded ( const FrameEvent evt)
overrideprotectedvirtualnoexcept

frameEnded is called after the buffers have been swapped

Reimplemented from Divide::FrameListener.

Definition at line 1372 of file Editor.cpp.

◆ framePostRender()

bool Divide::Editor::framePostRender ( const FrameEvent evt)
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.

◆ getActiveEnvProbePool()

SceneEnvironmentProbePool * Divide::Editor::getActiveEnvProbePool ( ) const
protectednoexcept

Definition at line 2710 of file Editor.cpp.

◆ getActiveLightPool()

LightPool & Divide::Editor::getActiveLightPool ( ) const
protected

Definition at line 2704 of file Editor.cpp.

◆ getCommandBuffer()

void Divide::Editor::getCommandBuffer ( GFX::CommandBuffer bufferInOut,
GFX::MemoryBarrierCommand memCmdInOut 
)
protected

Definition at line 1300 of file Editor.cpp.

◆ getNodePreviewTarget()

const RenderTargetHandle & Divide::Editor::getNodePreviewTarget ( ) const
inlinenoexcept

Definition at line 78 of file Editor.inl.

◆ getOrCreateIMGUIBuffer()

GenericVertexData * Divide::Editor::getOrCreateIMGUIBuffer ( I64  bufferGUID,
U32  maxVertices,
GFX::MemoryBarrierCommand memCmdInOut 
)
protected

Definition at line 1394 of file Editor.cpp.

◆ getProjectList()

const ProjectIDs & Divide::Editor::getProjectList ( ) const
protectednoexcept

Definition at line 2694 of file Editor.cpp.

◆ getSceneList()

const SceneEntries & Divide::Editor::getSceneList ( ) const
protectednoexcept

Definition at line 2699 of file Editor.cpp.

◆ getTransformSettings()

const TransformSettings & Divide::Editor::getTransformSettings ( ) const
inlinenoexcept

Definition at line 49 of file Editor.inl.

◆ hasFocus()

bool Divide::Editor::hasFocus ( ) const

Definition at line 2122 of file Editor.cpp.

◆ idle()

void Divide::Editor::idle ( )
noexcept

Definition at line 210 of file Editor.cpp.

◆ inEditMode()

bool Divide::Editor::inEditMode ( ) const
inlinenoexcept

Definition at line 41 of file Editor.inl.

◆ infiniteGridAxisWidth()

void Divide::Editor::infiniteGridAxisWidth ( const F32  value)
noexcept

Definition at line 1205 of file Editor.cpp.

◆ infiniteGridScale()

void Divide::Editor::infiniteGridScale ( const F32  value)
noexcept

Definition at line 1211 of file Editor.cpp.

◆ init()

bool Divide::Editor::init ( const vec2< U16 renderResolution)

Definition at line 274 of file Editor.cpp.

◆ isDefaultScene()

bool Divide::Editor::isDefaultScene ( ) const
protectednoexcept

Definition at line 2283 of file Editor.cpp.

◆ isHovered()

bool Divide::Editor::isHovered ( ) const

Definition at line 2127 of file Editor.cpp.

◆ isInit()

bool Divide::Editor::isInit ( ) const
inlineprotectednoexcept

Definition at line 37 of file Editor.inl.

◆ isNodeInView()

bool Divide::Editor::isNodeInView ( const SceneGraphNode node) const
protectednoexcept

Return true if the specified node passed frustum culling during the main render pass.

Definition at line 1217 of file Editor.cpp.

◆ joystickAddRemove()

bool Divide::Editor::joystickAddRemove ( const Input::JoystickEvent arg)
overridevirtualnoexcept

Implements Divide::Input::InputAggregatorInterface.

Definition at line 2065 of file Editor.cpp.

◆ joystickAxisMoved()

bool Divide::Editor::joystickAxisMoved ( const Input::JoystickEvent arg)
overridevirtualnoexcept

Implements Divide::Input::InputAggregatorInterface.

Definition at line 2050 of file Editor.cpp.

◆ joystickBallMoved()

bool Divide::Editor::joystickBallMoved ( const Input::JoystickEvent arg)
overridevirtualnoexcept

Implements Divide::Input::InputAggregatorInterface.

Definition at line 2060 of file Editor.cpp.

◆ joystickButtonPressed()

bool Divide::Editor::joystickButtonPressed ( const Input::JoystickEvent arg)
overridevirtualnoexcept

Joystick or Gamepad: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 2040 of file Editor.cpp.

◆ joystickButtonReleased()

bool Divide::Editor::joystickButtonReleased ( const Input::JoystickEvent arg)
overridevirtualnoexcept

Implements Divide::Input::InputAggregatorInterface.

Definition at line 2045 of file Editor.cpp.

◆ joystickPovMoved()

bool Divide::Editor::joystickPovMoved ( const Input::JoystickEvent arg)
overridevirtualnoexcept

Implements Divide::Input::InputAggregatorInterface.

Definition at line 2055 of file Editor.cpp.

◆ joystickRemap()

bool Divide::Editor::joystickRemap ( const Input::JoystickEvent arg)
overridevirtualnoexcept

Implements Divide::Input::InputAggregatorInterface.

Definition at line 2070 of file Editor.cpp.

◆ loadFromXML()

bool Divide::Editor::loadFromXML ( )

Definition at line 2881 of file Editor.cpp.

◆ loadNode()

void Divide::Editor::loadNode ( SceneGraphNode sgn) const
protected

Definition at line 2755 of file Editor.cpp.

◆ modalModelSpawn()

bool Divide::Editor::modalModelSpawn ( Handle< Mesh >  mesh,
bool  quick,
const vec3< F32 > &  scale = VECTOR3_UNIT,
const vec3< F32 > &  position = VECTOR3_ZERO 
)
protected

Returns true if the model was queued.

Definition at line 2537 of file Editor.cpp.

◆ modalTextureView()

bool Divide::Editor::modalTextureView ( std::string_view  modalName,
Handle< Texture tex,
vec2< F32 dimensions,
bool  preserveAspect,
bool  useModal 
) const
protected

Returns true if the window was closed.

Definition at line 2289 of file Editor.cpp.

◆ mouseButtonPressed()

bool Divide::Editor::mouseButtonPressed ( const Input::MouseButtonEvent arg)
overridevirtual

Mouse button pressed: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 1959 of file Editor.cpp.

◆ mouseButtonReleased()

bool Divide::Editor::mouseButtonReleased ( const Input::MouseButtonEvent arg)
overridevirtual

Mouse button released: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 1999 of file Editor.cpp.

◆ mouseMoved()

bool Divide::Editor::mouseMoved ( const Input::MouseMoveEvent arg)
overridevirtual

Mouse moved: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 1861 of file Editor.cpp.

◆ onChangeScene()

void Divide::Editor::onChangeScene ( Scene newScene)

Definition at line 2268 of file Editor.cpp.

◆ onKeyDown()

bool Divide::Editor::onKeyDown ( const Input::KeyEvent key)
overridevirtual

Key pressed: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 1701 of file Editor.cpp.

◆ onKeyUp()

bool Divide::Editor::onKeyUp ( const Input::KeyEvent key)
overridevirtual

Key released: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 1739 of file Editor.cpp.

◆ onRemoveComponent()

void Divide::Editor::onRemoveComponent ( const EditorComponent comp) const
protected

Definition at line 2720 of file Editor.cpp.

◆ onResolutionChange()

void Divide::Editor::onResolutionChange ( const SizeChangeParams params)

Definition at line 2180 of file Editor.cpp.

◆ onTextEvent()

bool Divide::Editor::onTextEvent ( const Input::TextEvent arg)
overridevirtual

Implements Divide::Input::InputAggregatorInterface.

Definition at line 2132 of file Editor.cpp.

◆ onWindowSizeChange()

void Divide::Editor::onWindowSizeChange ( const SizeChangeParams params)

Definition at line 2151 of file Editor.cpp.

◆ openProject()

bool Divide::Editor::openProject ( const ProjectID projectID)
protected

Definition at line 2214 of file Editor.cpp.

◆ POINTER_R_IW() [1/3]

Divide::Editor::POINTER_R_IW ( Camera  ,
editorCamera  ,
nullptr   
)
protected

◆ POINTER_R_IW() [2/3]

Divide::Editor::POINTER_R_IW ( Camera  ,
nodePreviewCamera  ,
nullptr   
)
protected

◆ POINTER_R_IW() [3/3]

Divide::Editor::POINTER_R_IW ( Camera  ,
selectedCamera  ,
nullptr   
)
protected

◆ postRender()

void Divide::Editor::postRender ( RenderStage  stage,
const CameraSnapshot cameraSnapshot,
RenderTargetID  target,
GFX::CommandBuffer bufferInOut,
GFX::MemoryBarrierCommand memCmdInOut 
)
protected

Definition at line 1236 of file Editor.cpp.

◆ PROPERTY_INTERNAL() [1/2]

Divide::Editor::PROPERTY_INTERNAL ( bool  ,
lockSolutionExplorer  ,
false   
)
protected

◆ PROPERTY_INTERNAL() [2/2]

Divide::Editor::PROPERTY_INTERNAL ( bool  ,
sceneGizmoEnabled  ,
false   
)
protected

◆ PROPERTY_R() [1/2]

Divide::Editor::PROPERTY_R ( F32  ,
infiniteGridAxisWidth  ,
2.  f 
)
protected

◆ PROPERTY_R() [2/2]

Divide::Editor::PROPERTY_R ( F32  ,
infiniteGridScale  ,
1.  f 
)
protected

◆ PROPERTY_R_IW() [1/6]

Divide::Editor::PROPERTY_R_IW ( bool  ,
nodePreviewWindowVisible  ,
false   
)
protected

◆ PROPERTY_R_IW() [2/6]

Divide::Editor::PROPERTY_R_IW ( bool  ,
running  ,
false   
)
protected

◆ PROPERTY_R_IW() [3/6]

Divide::Editor::PROPERTY_R_IW ( bool  ,
unsavedSceneChanges  ,
false   
)
protected

◆ PROPERTY_R_IW() [4/6]

Divide::Editor::PROPERTY_R_IW ( FColour3  ,
nodePreviewBGColour   
)
protected

◆ PROPERTY_R_IW() [5/6]

Divide::Editor::PROPERTY_R_IW ( FocusedWindowState  ,
windowFocusState   
)
protected

◆ PROPERTY_R_IW() [6/6]

Divide::Editor::PROPERTY_R_IW ( I64  ,
previewNodeGUID  ,
1 
)
protected

◆ PROPERTY_RW() [1/2]

Divide::Editor::PROPERTY_RW ( bool  ,
infiniteGridEnabledNode  ,
true   
)
protected

◆ PROPERTY_RW() [2/2]

Divide::Editor::PROPERTY_RW ( bool  ,
infiniteGridEnabledScene  ,
true   
)
protected

◆ queueRemoveNode()

void Divide::Editor::queueRemoveNode ( I64  nodeGUID)
protected

Definition at line 2766 of file Editor.cpp.

◆ Redo()

bool Divide::Editor::Redo ( ) const

Definition at line 1685 of file Editor.cpp.

◆ RedoStackSize()

size_t Divide::Editor::RedoStackSize ( ) const
inlinenoexcept

Definition at line 70 of file Editor.inl.

◆ registerUndoEntry()

template<typename T >
void Divide::Editor::registerUndoEntry ( const UndoEntry< T > &  entry)

Definition at line 62 of file Editor.inl.

◆ removeComponent() [1/2]

bool Divide::Editor::removeComponent ( const Selections selections,
ComponentType  newComponentType 
) const
protected

Definition at line 2815 of file Editor.cpp.

◆ removeComponent() [2/2]

bool Divide::Editor::removeComponent ( SceneGraphNode selection,
ComponentType  newComponentType 
) const
protected

Definition at line 2803 of file Editor.cpp.

◆ render()

bool Divide::Editor::render ( )
protected

Definition at line 1138 of file Editor.cpp.

◆ renderDrawList()

void Divide::Editor::renderDrawList ( ImDrawData *  pDrawData,
I64  bufferGUID,
const Rect< I32 > &  targetViewport,
bool  editorPass,
GFX::CommandBuffer bufferInOut,
GFX::MemoryBarrierCommand memCmdInOut 
)
protected

Definition at line 1433 of file Editor.cpp.

◆ renderModelSpawnModal()

void Divide::Editor::renderModelSpawnModal ( )
protected

Definition at line 2574 of file Editor.cpp.

◆ saveItemCount()

U32 Divide::Editor::saveItemCount ( ) const
protectednoexcept

Definition at line 2273 of file Editor.cpp.

◆ saveNode()

void Divide::Editor::saveNode ( const SceneGraphNode sgn) const
protected

Definition at line 2728 of file Editor.cpp.

◆ saveSceneChanges()

bool Divide::Editor::saveSceneChanges ( const DELEGATE< void, std::string_view > &  msgCallback,
const DELEGATE< void, bool > &  finishCallback 
) const
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.

◆ saveToXML()

bool Divide::Editor::saveToXML ( ) const

Definition at line 2833 of file Editor.cpp.

◆ scenePreviewRect()

Rect< I32 > Divide::Editor::scenePreviewRect ( bool  globalCoords) const
noexcept

Definition at line 1382 of file Editor.cpp.

◆ selectionChangeCallback()

void Divide::Editor::selectionChangeCallback ( PlayerIndex  idx,
const vector< SceneGraphNode * > &  nodes 
) const

Definition at line 1643 of file Editor.cpp.

◆ setEditorCameraSpeed()

void Divide::Editor::setEditorCameraSpeed ( const vec3< F32 > &  speed)
protectednoexcept

Definition at line 1665 of file Editor.cpp.

◆ setEditorCamLookAt()

void Divide::Editor::setEditorCamLookAt ( const vec3< F32 > &  eye,
const vec3< F32 > &  fwd,
const vec3< F32 > &  up 
)
protected

Definition at line 1658 of file Editor.cpp.

◆ setTransformSettings()

void Divide::Editor::setTransformSettings ( const TransformSettings settings) const
inlinenoexcept

Definition at line 45 of file Editor.inl.

◆ showStatusMessage()

void Divide::Editor::showStatusMessage ( const string message,
F32  durationMS,
bool  error 
) const

Definition at line 2659 of file Editor.cpp.

◆ simulationPaused()

bool Divide::Editor::simulationPaused ( ) const
inlinenoexcept

Definition at line 57 of file Editor.inl.

◆ spawnGeometry()

bool Divide::Editor::spawnGeometry ( Handle< Mesh >  mesh,
const vec3< F32 > &  scale,
const vec3< F32 > &  position,
const vec3< Angle::DEGREES< F32 > > &  rotation,
std::string_view  name 
) const
protected

Return true if the model was spawned as a scene node.

Definition at line 2666 of file Editor.cpp.

◆ stepQueue()

U32 Divide::Editor::stepQueue ( ) const
inlinenoexcept

Definition at line 53 of file Editor.inl.

◆ switchScene()

bool Divide::Editor::switchScene ( const SceneEntry scene,
bool  createIfNotExists = false 
)
protected

Definition at line 2219 of file Editor.cpp.

◆ teleportToNode()

BoundingSphere Divide::Editor::teleportToNode ( Camera camera,
const SceneGraphNode sgn 
) const
protected

Definition at line 2715 of file Editor.cpp.

◆ toggle()

void Divide::Editor::toggle ( bool  state)

Definition at line 883 of file Editor.cpp.

◆ toggleMemoryEditor()

void Divide::Editor::toggleMemoryEditor ( bool  state)
inlineprotectednoexcept

Definition at line 74 of file Editor.inl.

◆ Undo()

bool Divide::Editor::Undo ( ) const

Definition at line 1670 of file Editor.cpp.

◆ UndoStackSize()

size_t Divide::Editor::UndoStackSize ( ) const
inlinenoexcept

Definition at line 66 of file Editor.inl.

◆ update()

void Divide::Editor::update ( U64  deltaTimeUS)

Definition at line 991 of file Editor.cpp.

◆ updateEditorFocus()

void Divide::Editor::updateEditorFocus ( )
protected

Definition at line 865 of file Editor.cpp.

◆ updateFocusState()

void Divide::Editor::updateFocusState ( ImVec2  mousePos)
protected

Definition at line 1813 of file Editor.cpp.

◆ wantsJoystick()

bool Divide::Editor::wantsJoystick ( ) const
noexcept

Definition at line 2075 of file Editor.cpp.

◆ wantsKeyboard()

bool Divide::Editor::wantsKeyboard ( ) const
noexcept

Definition at line 2106 of file Editor.cpp.

◆ wantsMouse()

bool Divide::Editor::wantsMouse ( ) const

Definition at line 2085 of file Editor.cpp.

Friends And Related Function Documentation

◆ Attorney::EditorEditorComponent

friend class Attorney::EditorEditorComponent
friend

Definition at line 153 of file Editor.h.

◆ Attorney::EditorGeneralWidget

friend class Attorney::EditorGeneralWidget
friend

Definition at line 146 of file Editor.h.

◆ Attorney::EditorGizmo

friend class Attorney::EditorGizmo
friend

Definition at line 143 of file Editor.h.

◆ Attorney::EditorMenuBar

friend class Attorney::EditorMenuBar
friend

Definition at line 144 of file Editor.h.

◆ Attorney::EditorOptionsWindow

friend class Attorney::EditorOptionsWindow
friend

Definition at line 147 of file Editor.h.

◆ Attorney::EditorOutputWindow

friend class Attorney::EditorOutputWindow
friend

Definition at line 145 of file Editor.h.

◆ Attorney::EditorPropertyWindow

friend class Attorney::EditorPropertyWindow
friend

Definition at line 149 of file Editor.h.

◆ Attorney::EditorRenderPassExecutor

Definition at line 152 of file Editor.h.

◆ Attorney::EditorSceneViewWindow

friend class Attorney::EditorSceneViewWindow
friend

Definition at line 150 of file Editor.h.

◆ Attorney::EditorSolutionExplorerWindow

Definition at line 151 of file Editor.h.

◆ Attorney::EditorWindowManager

friend class Attorney::EditorWindowManager
friend

Definition at line 148 of file Editor.h.

Member Data Documentation

◆ _axisGizmo

IMPrimitive* Divide::Editor::_axisGizmo = nullptr
private

Definition at line 357 of file Editor.h.

◆ _axisGizmoPipelineDesc

PipelineDescriptor Divide::Editor::_axisGizmoPipelineDesc
private

Definition at line 356 of file Editor.h.

◆ _currentTheme

ImGuiStyleEnum Divide::Editor::_currentTheme = ImGuiStyle_Count
private

Definition at line 374 of file Editor.h.

◆ _dockedWindows

std::array<std::unique_ptr<DockedWindow>, to_base( WindowType::COUNT )> Divide::Editor::_dockedWindows = {}
private

Definition at line 364 of file Editor.h.

◆ _editorPipeline

Pipeline* Divide::Editor::_editorPipeline = nullptr
private

Definition at line 358 of file Editor.h.

◆ _editorRenderTimer

Time::ProfileTimer& Divide::Editor::_editorRenderTimer
private

Definition at line 341 of file Editor.h.

◆ _editorSampler

SamplerDescriptor Divide::Editor::_editorSampler {}
private

Definition at line 368 of file Editor.h.

◆ _editorUpdateTimer

Time::ProfileTimer& Divide::Editor::_editorUpdateTimer
private

Definition at line 340 of file Editor.h.

◆ _externalTextEditorPath

ResourcePath Divide::Editor::_externalTextEditorPath
private

Definition at line 366 of file Editor.h.

◆ _fontTexture

Handle<Texture> Divide::Editor::_fontTexture = INVALID_HANDLE<Texture>
private

Definition at line 350 of file Editor.h.

◆ _gizmo

Gizmo_uptr Divide::Editor::_gizmo
private

Definition at line 347 of file Editor.h.

◆ _gridSettingsDirty

bool Divide::Editor::_gridSettingsDirty = true
private

Definition at line 379 of file Editor.h.

◆ _imguiBuffers

eastl::fixed_vector<std::pair<I64, GenericVertexData_ptr>, 5, true> Divide::Editor::_imguiBuffers
private

Definition at line 360 of file Editor.h.

◆ _imguiContexts

std::array<ImGuiContext*, to_base( ImGuiContextType::COUNT )> Divide::Editor::_imguiContexts = {}
private

Definition at line 363 of file Editor.h.

◆ _imguiProgram

Handle<ShaderProgram> Divide::Editor::_imguiProgram = INVALID_HANDLE<ShaderProgram>
private

Definition at line 351 of file Editor.h.

◆ _infiniteGridPipelineDesc

PipelineDescriptor Divide::Editor::_infiniteGridPipelineDesc
private

Definition at line 355 of file Editor.h.

◆ _infiniteGridPrimitive

IMPrimitive* Divide::Editor::_infiniteGridPrimitive = nullptr
private

Definition at line 354 of file Editor.h.

◆ _infiniteGridProgram

Handle<ShaderProgram> Divide::Editor::_infiniteGridProgram = INVALID_HANDLE<ShaderProgram>
private

Definition at line 352 of file Editor.h.

◆ _isScenePaused

bool Divide::Editor::_isScenePaused = false
private

Definition at line 378 of file Editor.h.

◆ _lastOpenSceneName

string Divide::Editor::_lastOpenSceneName { "" }
private

Definition at line 370 of file Editor.h.

◆ _mainWindow

DisplayWindow* Divide::Editor::_mainWindow = nullptr
private

Definition at line 349 of file Editor.h.

◆ _memoryEditorData

std::pair<bufferPtr, size_t> Divide::Editor::_memoryEditorData = { nullptr, 0 }
private

Definition at line 362 of file Editor.h.

◆ _menuBar

MenuBar_uptr Divide::Editor::_menuBar
private

Definition at line 343 of file Editor.h.

◆ _nodePreviewRTHandle

RenderTargetHandle Divide::Editor::_nodePreviewRTHandle {}
private

Definition at line 382 of file Editor.h.

◆ _optionsWindow

EditorOptionsWindow_uptr Divide::Editor::_optionsWindow
private

Definition at line 345 of file Editor.h.

◆ _previewNode

SceneGraphNode* Divide::Editor::_previewNode { nullptr }
protected

Definition at line 337 of file Editor.h.

◆ _queuedDPIValue

F32 Divide::Editor::_queuedDPIValue = -1.f
private

Definition at line 372 of file Editor.h.

◆ _queuedModelSpawn

struct Divide::Editor::QueueModelSpawn Divide::Editor::_queuedModelSpawn
private

◆ _recentSceneList

CircularBuffer<SceneEntry, 10> Divide::Editor::_recentSceneList
private

Definition at line 380 of file Editor.h.

◆ _render2DSnapshot

CameraSnapshot Divide::Editor::_render2DSnapshot
private

Definition at line 381 of file Editor.h.

◆ _showMemoryEditor

bool Divide::Editor::_showMemoryEditor = false
private

Definition at line 377 of file Editor.h.

◆ _showOptionsWindow

bool Divide::Editor::_showOptionsWindow = false
private

Definition at line 376 of file Editor.h.

◆ _showSampleWindow

bool Divide::Editor::_showSampleWindow = false
private

Definition at line 375 of file Editor.h.

◆ _simulationPaused

bool Divide::Editor::_simulationPaused = true
private

Definition at line 373 of file Editor.h.

◆ _statusBar

StatusBar_uptr Divide::Editor::_statusBar
private

Definition at line 344 of file Editor.h.

◆ _stepQueue

U32 Divide::Editor::_stepQueue = 1u
private

Definition at line 371 of file Editor.h.

◆ _undoManager

UndoManager_uptr Divide::Editor::_undoManager
private

Definition at line 346 of file Editor.h.

◆ g_oisButtons

◆ g_supportedExportPlatforms

std::array< const char *, 3 > Divide::Editor::g_supportedExportPlatforms
static
Initial value:
= { "Windows",
"Linux",
"macOS" }

Definition at line 157 of file Editor.h.


The documentation for this class was generated from the following files: