yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::PolyhedralEditorView Class Reference

#include <polyhedral_editor_view.h>

Inheritance diagram for yaze::editor::PolyhedralEditorView:
Collaboration diagram for yaze::editor::PolyhedralEditorView:

Public Member Functions

 PolyhedralEditorView (Rom *rom=nullptr)
 
std::string GetId () const override
 Unique identifier for this panel.
 
std::string GetDisplayName () const override
 Human-readable name shown in menus and title bars.
 
std::string GetIcon () const override
 Material Design icon for this panel.
 
std::string GetEditorCategory () const override
 Editor category this panel belongs to.
 
int GetPriority () const override
 Get display priority for menu ordering.
 
void SetRom (Rom *rom)
 
absl::Status Load ()
 
void Draw (bool *p_open) override
 Draw the polyhedral editor UI (WindowContent interface)
 
absl::Status Update ()
 Legacy Update method for backward compatibility.
 
- Public Member Functions inherited from yaze::editor::WindowContent
virtual ~WindowContent ()=default
 
virtual void OnFirstDraw ()
 Called once before the first Draw() in a session.
 
virtual bool RequiresLazyInit () const
 Whether this panel uses lazy initialization.
 
void InvalidateLazyInit ()
 Reset lazy init state so OnFirstDraw() runs again.
 
virtual void OnOpen ()
 Called when panel becomes visible.
 
virtual void OnClose ()
 Called when panel is hidden.
 
virtual void OnFocus ()
 Called when panel receives focus.
 
virtual WindowLifecycle GetWindowLifecycle () const
 Get the lifecycle category for this window.
 
virtual WindowContextScope GetContextScope () const
 Optional context binding for this window (room/selection/etc)
 
virtual WindowScope GetScope () const
 Get the registration scope for this window.
 
virtual bool IsEnabled () const
 Check if this panel is currently enabled.
 
virtual std::string GetDisabledTooltip () const
 Get tooltip text when panel is disabled.
 
virtual std::string GetShortcutHint () const
 Get keyboard shortcut hint for display.
 
virtual std::string GetWorkflowGroup () const
 Optional workflow group for hack-centric actions.
 
virtual std::string GetWorkflowLabel () const
 Optional workflow label for menus/command palette.
 
virtual std::string GetWorkflowDescription () const
 Optional workflow description for menus/command palette.
 
virtual int GetWorkflowPriority () const
 Optional workflow ordering priority (lower sorts first).
 
virtual float GetPreferredWidth () const
 Get preferred width for this panel (optional)
 
virtual bool PreferAutoHideTabBar () const
 Whether the dock node hosting this panel should auto-hide its tab bar.
 
virtual bool IsVisibleByDefault () const
 Whether this panel should be visible by default.
 
virtual std::string GetParentPanelId () const
 Get parent panel ID for cascade behavior.
 
virtual bool CascadeCloseChildren () const
 Whether closing this panel should close child panels.
 
void DrawWithLazyInit (bool *p_open)
 Execute lazy initialization if needed, then call Draw()
 

Private Types

enum class  PlotPlane { kXY , kXZ , kYZ }
 

Private Member Functions

absl::Status LoadShapes ()
 
absl::Status SaveShapes ()
 
absl::Status WriteShape (const PolyShape &shape)
 
void DrawShapeEditor (PolyShape &shape)
 
void DrawVertexList (PolyShape &shape)
 
void DrawFaceList (PolyShape &shape)
 
void DrawPlot (const char *label, PlotPlane plane, PolyShape &shape)
 
void DrawPreview (PolyShape &shape)
 
uint32_t TablePc () const
 

Private Attributes

Romrom_ = nullptr
 
bool data_loaded_ = false
 
bool dirty_ = false
 
int selected_shape_ = 0
 
int selected_vertex_ = 0
 
std::vector< PolyShapeshapes_
 

Additional Inherited Members

- Protected Member Functions inherited from yaze::editor::WindowContent
void InvalidateCache ()
 Invalidate all cached computations.
 
template<typename T >
T & GetCached (const std::string &key, std::function< T()> compute)
 Get or compute a cached value.
 
bool IsCacheValid () const
 Check if cache has been invalidated.
 
void ClearCache ()
 Clear all cached values (more aggressive than InvalidateCache)
 

Detailed Description

Definition at line 36 of file polyhedral_editor_view.h.

Member Enumeration Documentation

◆ PlotPlane

Enumerator
kXY 
kXZ 
kYZ 

Definition at line 72 of file polyhedral_editor_view.h.

Constructor & Destructor Documentation

◆ PolyhedralEditorView()

yaze::editor::PolyhedralEditorView::PolyhedralEditorView ( Rom * rom = nullptr)
inlineexplicit

Definition at line 38 of file polyhedral_editor_view.h.

Member Function Documentation

◆ GetId()

std::string yaze::editor::PolyhedralEditorView::GetId ( ) const
inlineoverridevirtual

Unique identifier for this panel.

Returns
Panel ID in format "{category}.{name}" (e.g., "dungeon.room_selector")

IDs should be:

  • Lowercase with underscores
  • Prefixed with editor category
  • Unique across all panels

Implements yaze::editor::WindowContent.

Definition at line 44 of file polyhedral_editor_view.h.

◆ GetDisplayName()

std::string yaze::editor::PolyhedralEditorView::GetDisplayName ( ) const
inlineoverridevirtual

Human-readable name shown in menus and title bars.

Returns
Display name (e.g., "Room Selector")

Implements yaze::editor::WindowContent.

Definition at line 45 of file polyhedral_editor_view.h.

◆ GetIcon()

std::string yaze::editor::PolyhedralEditorView::GetIcon ( ) const
inlineoverridevirtual

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::WindowContent.

Definition at line 46 of file polyhedral_editor_view.h.

References ICON_MD_VIEW_IN_AR.

◆ GetEditorCategory()

std::string yaze::editor::PolyhedralEditorView::GetEditorCategory ( ) const
inlineoverridevirtual

Editor category this panel belongs to.

Returns
Category name matching EditorType (e.g., "Dungeon", "Overworld")

Implements yaze::editor::WindowContent.

Definition at line 47 of file polyhedral_editor_view.h.

◆ GetPriority()

int yaze::editor::PolyhedralEditorView::GetPriority ( ) const
inlineoverridevirtual

Get display priority for menu ordering.

Returns
Priority value (lower = higher in list, default 50)

Reimplemented from yaze::editor::WindowContent.

Definition at line 48 of file polyhedral_editor_view.h.

◆ SetRom()

void yaze::editor::PolyhedralEditorView::SetRom ( Rom * rom)
inline

Definition at line 54 of file polyhedral_editor_view.h.

References data_loaded_, and rom_.

◆ Load()

absl::Status yaze::editor::PolyhedralEditorView::Load ( )

Definition at line 58 of file polyhedral_editor_view.cc.

References dirty_, LoadShapes(), and RETURN_IF_ERROR.

Here is the call graph for this function:

◆ Draw()

◆ Update()

◆ LoadShapes()

◆ SaveShapes()

absl::Status yaze::editor::PolyhedralEditorView::SaveShapes ( )
private

Definition at line 134 of file polyhedral_editor_view.cc.

References dirty_, RETURN_IF_ERROR, shapes_, and WriteShape().

Referenced by Draw(), and Update().

Here is the call graph for this function:

◆ WriteShape()

absl::Status yaze::editor::PolyhedralEditorView::WriteShape ( const PolyShape & shape)
private

◆ DrawShapeEditor()

void yaze::editor::PolyhedralEditorView::DrawShapeEditor ( PolyShape & shape)
private

◆ DrawVertexList()

void yaze::editor::PolyhedralEditorView::DrawVertexList ( PolyShape & shape)
private

Definition at line 318 of file polyhedral_editor_view.cc.

References dirty_, yaze::gui::LayoutHelpers::GetStandardInputWidth(), selected_vertex_, and yaze::editor::PolyShape::vertices.

Referenced by DrawShapeEditor().

Here is the call graph for this function:

◆ DrawFaceList()

void yaze::editor::PolyhedralEditorView::DrawFaceList ( PolyShape & shape)
private

Definition at line 346 of file polyhedral_editor_view.cc.

References dirty_, yaze::editor::PolyShape::faces, yaze::gui::LayoutHelpers::GetCompactInputWidth(), and yaze::editor::PolyShape::vertices.

Referenced by DrawShapeEditor().

Here is the call graph for this function:

◆ DrawPlot()

void yaze::editor::PolyhedralEditorView::DrawPlot ( const char * label,
PlotPlane plane,
PolyShape & shape )
private

Definition at line 384 of file polyhedral_editor_view.cc.

References dirty_, kXY, kXZ, kYZ, selected_vertex_, and yaze::editor::PolyShape::vertices.

Referenced by DrawShapeEditor().

◆ DrawPreview()

void yaze::editor::PolyhedralEditorView::DrawPreview ( PolyShape & shape)
private

◆ TablePc()

uint32_t yaze::editor::PolyhedralEditorView::TablePc ( ) const
private

Definition at line 54 of file polyhedral_editor_view.cc.

References yaze::SnesToPc().

Referenced by Draw(), LoadShapes(), and Update().

Here is the call graph for this function:

Member Data Documentation

◆ rom_

Rom* yaze::editor::PolyhedralEditorView::rom_ = nullptr
private

Definition at line 85 of file polyhedral_editor_view.h.

Referenced by Draw(), LoadShapes(), SetRom(), Update(), and WriteShape().

◆ data_loaded_

bool yaze::editor::PolyhedralEditorView::data_loaded_ = false
private

Definition at line 86 of file polyhedral_editor_view.h.

Referenced by Draw(), LoadShapes(), SetRom(), and Update().

◆ dirty_

bool yaze::editor::PolyhedralEditorView::dirty_ = false
private

◆ selected_shape_

int yaze::editor::PolyhedralEditorView::selected_shape_ = 0
private

Definition at line 88 of file polyhedral_editor_view.h.

Referenced by Draw(), LoadShapes(), and Update().

◆ selected_vertex_

int yaze::editor::PolyhedralEditorView::selected_vertex_ = 0
private

Definition at line 89 of file polyhedral_editor_view.h.

Referenced by Draw(), DrawPlot(), DrawVertexList(), LoadShapes(), and Update().

◆ shapes_

std::vector<PolyShape> yaze::editor::PolyhedralEditorView::shapes_
private

Definition at line 91 of file polyhedral_editor_view.h.

Referenced by Draw(), LoadShapes(), SaveShapes(), and Update().


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