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

#include <polyhedral_editor_panel.h>

Inheritance diagram for yaze::editor::PolyhedralEditorPanel:
Collaboration diagram for yaze::editor::PolyhedralEditorPanel:

Public Member Functions

 PolyhedralEditorPanel (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 (EditorPanel interface)
 
absl::Status Update ()
 Legacy Update method for backward compatibility.
 
- Public Member Functions inherited from yaze::editor::EditorPanel
virtual ~EditorPanel ()=default
 
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 PanelCategory GetPanelCategory () const
 Get the lifecycle category for this panel.
 
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 float GetPreferredWidth () const
 Get preferred width for this panel (optional)
 
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.
 

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_
 

Detailed Description

Definition at line 36 of file polyhedral_editor_panel.h.

Member Enumeration Documentation

◆ PlotPlane

Enumerator
kXY 
kXZ 
kYZ 

Definition at line 72 of file polyhedral_editor_panel.h.

Constructor & Destructor Documentation

◆ PolyhedralEditorPanel()

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

Definition at line 38 of file polyhedral_editor_panel.h.

Member Function Documentation

◆ GetId()

std::string yaze::editor::PolyhedralEditorPanel::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::EditorPanel.

Definition at line 44 of file polyhedral_editor_panel.h.

◆ GetDisplayName()

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

Human-readable name shown in menus and title bars.

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

Implements yaze::editor::EditorPanel.

Definition at line 45 of file polyhedral_editor_panel.h.

◆ GetIcon()

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

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::EditorPanel.

Definition at line 46 of file polyhedral_editor_panel.h.

References ICON_MD_VIEW_IN_AR.

◆ GetEditorCategory()

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

Editor category this panel belongs to.

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

Implements yaze::editor::EditorPanel.

Definition at line 47 of file polyhedral_editor_panel.h.

◆ GetPriority()

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

Get display priority for menu ordering.

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

Reimplemented from yaze::editor::EditorPanel.

Definition at line 48 of file polyhedral_editor_panel.h.

◆ SetRom()

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

Definition at line 54 of file polyhedral_editor_panel.h.

References data_loaded_, and rom_.

◆ Load()

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

Definition at line 57 of file polyhedral_editor_panel.cc.

References dirty_, LoadShapes(), and RETURN_IF_ERROR.

Here is the call graph for this function:

◆ Draw()

void yaze::editor::PolyhedralEditorPanel::Draw ( bool * p_open)
overridevirtual

◆ Update()

absl::Status yaze::editor::PolyhedralEditorPanel::Update ( )

◆ LoadShapes()

◆ SaveShapes()

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

Definition at line 133 of file polyhedral_editor_panel.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::PolyhedralEditorPanel::WriteShape ( const PolyShape & shape)
private

◆ DrawShapeEditor()

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

◆ DrawVertexList()

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

Definition at line 317 of file polyhedral_editor_panel.cc.

References dirty_, selected_vertex_, and yaze::editor::PolyShape::vertices.

Referenced by DrawShapeEditor().

◆ DrawFaceList()

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

◆ DrawPlot()

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

Definition at line 383 of file polyhedral_editor_panel.cc.

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

Referenced by DrawShapeEditor().

◆ DrawPreview()

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

◆ TablePc()

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

Definition at line 53 of file polyhedral_editor_panel.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::PolyhedralEditorPanel::rom_ = nullptr
private

Definition at line 85 of file polyhedral_editor_panel.h.

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

◆ data_loaded_

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

Definition at line 86 of file polyhedral_editor_panel.h.

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

◆ dirty_

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

◆ selected_shape_

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

Definition at line 88 of file polyhedral_editor_panel.h.

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

◆ selected_vertex_

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

Definition at line 89 of file polyhedral_editor_panel.h.

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

◆ shapes_

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

Definition at line 91 of file polyhedral_editor_panel.h.

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


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