yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::layout_designer::DockNode Struct Reference

Represents a dock node in the layout tree. More...

#include <dock_tree.h>

Public Types

enum class  Type : std::uint8_t { kLeaf , kSplit }
 

Public Member Functions

 DockNode ()=default
 
std::unique_ptr< DockNodeClone () const
 
void SplitInPlace (SplitDirection dir, float ratio, std::unique_ptr< DockNode > new_child, bool new_child_first)
 
bool PromoteSingleChild ()
 
const PanelEntryFindPanel (const std::string &panel_id) const
 
bool IsSplit () const
 
bool IsLeaf () const
 
bool IsRoot () const
 
void AddPanel (const LayoutPanel &panel)
 
void Split (ImGuiDir direction, float ratio)
 
LayoutPanelFindPanel (const std::string &panel_id)
 
size_t CountPanels () const
 
std::unique_ptr< DockNodeClone () const
 

Static Public Member Functions

static std::unique_ptr< DockNodeMakeLeaf (std::vector< PanelEntry > panels)
 
static std::unique_ptr< DockNodeMakeSplit (SplitDirection dir, float ratio, std::unique_ptr< DockNode > a, std::unique_ptr< DockNode > b)
 

Public Attributes

DockNodeId id = kInvalidDockNodeId
 
Type type = Type::kLeaf
 
std::vector< PanelEntrypanels
 
int active_tab_index = 0
 
SplitDirection split_direction = SplitDirection::kLeft
 
float split_ratio = 0.5f
 
std::unique_ptr< DockNodechild_a
 
std::unique_ptr< DockNodechild_b
 
DockNodeType type = DockNodeType::Leaf
 
ImGuiID node_id = 0
 
ImGuiDir split_dir = ImGuiDir_None
 
std::unique_ptr< DockNodechild_left
 
std::unique_ptr< DockNodechild_right
 
std::vector< LayoutPanelpanels
 
ImGuiDockNodeFlags flags = ImGuiDockNodeFlags_None
 

Detailed Description

Represents a dock node in the layout tree.

Hierarchical structure representing the docking layout. Can be a split (with two children) or a leaf (containing panels).

Definition at line 61 of file dock_tree.h.

Member Enumeration Documentation

◆ Type

enum class yaze::editor::layout_designer::DockNode::Type : std::uint8_t
strong
Enumerator
kLeaf 
kSplit 

Definition at line 62 of file dock_tree.h.

Constructor & Destructor Documentation

◆ DockNode()

yaze::editor::layout_designer::DockNode::DockNode ( )
default

Member Function Documentation

◆ MakeLeaf()

std::unique_ptr< DockNode > yaze::editor::layout_designer::DockNode::MakeLeaf ( std::vector< PanelEntry > panels)
static

◆ MakeSplit()

std::unique_ptr< DockNode > yaze::editor::layout_designer::DockNode::MakeSplit ( SplitDirection dir,
float ratio,
std::unique_ptr< DockNode > a,
std::unique_ptr< DockNode > b )
static

Definition at line 53 of file dock_tree.cc.

References yaze::editor::layout_designer::internal::AllocateDockNodeId(), and kSplit.

Here is the call graph for this function:

◆ Clone() [1/2]

std::unique_ptr< DockNode > yaze::editor::layout_designer::DockNode::Clone ( ) const

Definition at line 66 of file dock_tree.cc.

References active_tab_index, child_a, child_b, id, panels, split_direction, split_ratio, and type.

◆ SplitInPlace()

void yaze::editor::layout_designer::DockNode::SplitInPlace ( SplitDirection dir,
float ratio,
std::unique_ptr< DockNode > new_child,
bool new_child_first )

Definition at line 84 of file dock_tree.cc.

References active_tab_index, child_a, child_b, kSplit, MakeLeaf(), panels, split_direction, split_ratio, and type.

Referenced by yaze::editor::layout_designer::ApplyDropSuggestion().

Here is the call graph for this function:

◆ PromoteSingleChild()

bool yaze::editor::layout_designer::DockNode::PromoteSingleChild ( )

Definition at line 108 of file dock_tree.cc.

References child_a, child_b, kSplit, and type.

◆ FindPanel() [1/2]

const PanelEntry * yaze::editor::layout_designer::DockNode::FindPanel ( const std::string & panel_id) const

Definition at line 120 of file dock_tree.cc.

References child_a, child_b, kLeaf, panels, and type.

◆ IsSplit()

◆ IsLeaf()

◆ IsRoot()

bool yaze::editor::layout_designer::DockNode::IsRoot ( ) const
inline

◆ AddPanel()

void yaze::editor::layout_designer::DockNode::AddPanel ( const LayoutPanel & panel)

◆ Split()

void yaze::editor::layout_designer::DockNode::Split ( ImGuiDir direction,
float ratio )

◆ FindPanel() [2/2]

LayoutPanel * yaze::editor::layout_designer::DockNode::FindPanel ( const std::string & panel_id)

◆ CountPanels()

size_t yaze::editor::layout_designer::DockNode::CountPanels ( ) const

◆ Clone() [2/2]

std::unique_ptr< DockNode > yaze::editor::layout_designer::DockNode::Clone ( ) const

Member Data Documentation

◆ id

◆ type [1/2]

◆ panels [1/2]

◆ active_tab_index

◆ split_direction

◆ split_ratio

◆ child_a

◆ child_b

◆ type [2/2]

DockNodeType yaze::editor::layout_designer::DockNode::type = DockNodeType::Leaf

Definition at line 69 of file layout_definition.h.

◆ node_id

ImGuiID yaze::editor::layout_designer::DockNode::node_id = 0

Definition at line 70 of file layout_definition.h.

◆ split_dir

◆ child_left

◆ child_right

◆ panels [2/2]

std::vector<LayoutPanel> yaze::editor::layout_designer::DockNode::panels

Definition at line 81 of file layout_definition.h.

◆ flags


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