OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::ParamsNode Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/EditGCodeDialog.hpp>

Collaboration diagram for Slic3r::GUI::ParamsNode:

Public Member Functions

 ParamsNode (const wxString &group_name, const std::string &icon_name, wxDataViewCtrl *ctrl)
 ParamsNode (ParamsNode *parent, const wxString &sub_group_name, const std::string &icon_name, wxDataViewCtrl *ctrl)
 ParamsNode (ParamsNode *parent, ParamType param_type, const std::string &param_key, wxDataViewCtrl *ctrl)
wxString GetFormattedText ()
bool IsContainer () const
bool IsGroupNode () const
bool IsParamNode () const
void SetContainer (bool is_container)
bool IsEnabled ()
void Enable (bool enable=true)
void Disable ()
void StartSearch ()
void RefreshSearch (const wxString &search_text)
void FinishSearch ()
ParamsNode * GetParent ()
ParamsNodePtrArray & GetChildren ()
wxDataViewItemArray GetEnabledChildren ()
void Append (std::unique_ptr< ParamsNode > child)

Public Attributes

wxBitmap icon
std::string icon_name
std::string param_key
wxString text

Private Attributes

ParamsNode * m_parent { nullptr }
ParamsNodePtrArray m_children
wxDataViewCtrl * m_ctrl
ParamType m_param_type { ParamType::Undef }
bool m_container { true }
bool m_expanded_before_search {false}
bool m_enabled {true}
bool m_bold {false}
std::unique_ptr< std::pair< int, int > > m_highlight_index {nullptr}

Detailed Description

Constructor & Destructor Documentation

◆ ParamsNode() [1/3]

Slic3r::GUI::ParamsNode::ParamsNode ( const wxString & group_name,
const std::string & icon_name,
wxDataViewCtrl * ctrl )
483, text(group_name)
484, m_ctrl(ctrl)
485, m_bold(true)
486{
487}
wxDataViewCtrl * m_ctrl
Definition EditGCodeDialog.hpp:103
wxString text
Definition EditGCodeDialog.hpp:133
std::string icon_name
Definition EditGCodeDialog.hpp:131
bool m_bold
Definition EditGCodeDialog.hpp:120

References icon_name, m_bold, m_ctrl, and text.

Referenced by ParamsNode(), ParamsNode(), and GetParent().

Here is the caller graph for this function:

◆ ParamsNode() [2/3]

Slic3r::GUI::ParamsNode::ParamsNode ( ParamsNode * parent,
const wxString & sub_group_name,
const std::string & icon_name,
wxDataViewCtrl * ctrl )
493 : m_parent(parent)
495 , text(sub_group_name)
496 , m_ctrl(ctrl)
497 , m_bold(true)
498{
499}
ParamsNode * m_parent
Definition EditGCodeDialog.hpp:101

References ParamsNode(), icon_name, m_bold, m_ctrl, m_parent, and text.

Here is the call graph for this function:

◆ ParamsNode() [3/3]

Slic3r::GUI::ParamsNode::ParamsNode ( ParamsNode * parent,
ParamType param_type,
const std::string & param_key,
wxDataViewCtrl * ctrl )
505 : m_parent(parent)
506 , m_param_type(param_type)
507 , m_container(false)
509 , m_ctrl(ctrl)
510{
512 if (param_type == ParamType::Vector)
513 text += "[]";
514 else if (param_type == ParamType::FilamentVector)
515 text += "[current_extruder]";
516
517 icon_name = ParamsInfo.at(param_type);
518}
std::string param_key
Definition EditGCodeDialog.hpp:132
bool m_container
Definition EditGCodeDialog.hpp:116
ParamType m_param_type
Definition EditGCodeDialog.hpp:105
wxString from_u8(const std::string &str)
Definition GUI.cpp:544
const std::map< ParamType, std::string > ParamsInfo
Definition EditGCodeDialog.cpp:456
@ FilamentVector
Definition EditGCodeDialog.hpp:90
@ Vector
Definition EditGCodeDialog.hpp:89

References ParamsNode(), Slic3r::GUI::FilamentVector, Slic3r::GUI::from_u8(), icon_name, m_container, m_ctrl, m_param_type, m_parent, param_key, Slic3r::GUI::ParamsInfo, text, and Slic3r::GUI::Vector.

Here is the call graph for this function:

Member Function Documentation

◆ Append()

void Slic3r::GUI::ParamsNode::Append ( std::unique_ptr< ParamsNode > child)
inline
169{ m_children.emplace_back(std::move(child)); }
ParamsNodePtrArray m_children
Definition EditGCodeDialog.hpp:102

References m_children.

Referenced by Slic3r::GUI::ParamsModel::AppendParam(), and Slic3r::GUI::ParamsModel::AppendSubGroup().

Here is the caller graph for this function:

◆ Disable()

void Slic3r::GUI::ParamsNode::Disable ( )
inline
159{ Enable(false); }
@ Enable
Definition Config.hpp:245

References Slic3r::Enable.

Referenced by RefreshSearch().

Here is the caller graph for this function:

◆ Enable()

void Slic3r::GUI::ParamsNode::Enable ( bool enable = true)
inline
158{ m_enabled = enable; }
bool m_enabled
Definition EditGCodeDialog.hpp:118

References m_enabled.

◆ FinishSearch()

void Slic3r::GUI::ParamsNode::FinishSearch ( )
563{
564 Enable();
565 m_highlight_index.reset();
566 const wxDataViewItem item(this);
567 if (!GetChildren().empty())
568 for (const auto& child : GetChildren())
569 child->FinishSearch();
570 m_expanded_before_search ? m_ctrl->Expand(item) : m_ctrl->Collapse(item);
571}
ParamsNodePtrArray & GetChildren()
Definition EditGCodeDialog.hpp:166
bool m_expanded_before_search
Definition EditGCodeDialog.hpp:117
std::unique_ptr< std::pair< int, int > > m_highlight_index
Definition EditGCodeDialog.hpp:122
bool empty(const BoundingBoxBase< PointType, PointsType > &bb)
Definition BoundingBox.hpp:273

References Slic3r::empty(), Slic3r::Enable, GetChildren(), m_ctrl, m_expanded_before_search, and m_highlight_index.

Here is the call graph for this function:

◆ GetChildren()

ParamsNodePtrArray & Slic3r::GUI::ParamsNode::GetChildren ( )
inline
166{ return m_children; }

References m_children.

Referenced by Slic3r::GUI::ParamsModel::AppendParam(), Slic3r::GUI::ParamsModel::AppendSubGroup(), Slic3r::GUI::ParamsModel::Delete(), FinishSearch(), Slic3r::GUI::ParamsModel::GetChildren(), RefreshSearch(), and StartSearch().

Here is the caller graph for this function:

◆ GetEnabledChildren()

wxDataViewItemArray Slic3r::GUI::ParamsNode::GetEnabledChildren ( )
573 {
574 wxDataViewItemArray array;
575 for (const std::unique_ptr<ParamsNode>& child : m_children)
576 if (child->IsEnabled())
577 array.Add(wxDataViewItem(child.get()));
578 return array;
579}

References m_children.

Referenced by RefreshSearch().

Here is the caller graph for this function:

◆ GetFormattedText()

wxString Slic3r::GUI::ParamsNode::GetFormattedText ( )
521{
522 wxString formatted_text(text);
523 if (m_highlight_index) {
524 wxString substr = formatted_text.substr(m_highlight_index->first, m_highlight_index->second);
525 formatted_text = formatted_text.Remove(m_highlight_index->first, m_highlight_index->second);
526 highlight(substr);
527 formatted_text.insert(m_highlight_index->first, substr);
528 }
529
530 if (m_bold)
531 make_bold(formatted_text);
532
533 return formatted_text;
534}
static void highlight(wxString &str)
Definition EditGCodeDialog.cpp:470
static void make_bold(wxString &str)
Definition EditGCodeDialog.cpp:463

References Slic3r::GUI::highlight(), m_bold, m_highlight_index, Slic3r::GUI::make_bold(), and text.

Referenced by Slic3r::GUI::ParamsModel::GetValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetParent()

ParamsNode * Slic3r::GUI::ParamsNode::GetParent ( )
inline
165{ return m_parent; }

References ParamsNode(), and m_parent.

Referenced by Slic3r::GUI::ParamsModel::Delete(), Slic3r::GUI::ParamsModel::GetParent(), and Slic3r::GUI::ParamsModel::GetTopLevelCategory().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsContainer()

bool Slic3r::GUI::ParamsNode::IsContainer ( ) const
inline
152{ return m_container; }

References m_container.

Referenced by Slic3r::GUI::ParamsModel::IsContainer().

Here is the caller graph for this function:

◆ IsEnabled()

bool Slic3r::GUI::ParamsNode::IsEnabled ( )
inline
157{ return m_enabled; }

References m_enabled.

Referenced by Slic3r::GUI::ParamsModel::Delete().

Here is the caller graph for this function:

◆ IsGroupNode()

bool Slic3r::GUI::ParamsNode::IsGroupNode ( ) const
inline
153{ return m_parent == nullptr; }

References m_parent.

Referenced by Slic3r::GUI::ParamsModel::GetParent(), and Slic3r::GUI::ParamsModel::GetTopLevelCategory().

Here is the caller graph for this function:

◆ IsParamNode()

bool Slic3r::GUI::ParamsNode::IsParamNode ( ) const
inline
154{ return m_param_type != ParamType::Undef; }
@ Undef
Definition EditGCodeDialog.hpp:87

References m_param_type, and Slic3r::GUI::Undef.

Referenced by Slic3r::GUI::ParamsModel::GetParamName(), and RefreshSearch().

Here is the caller graph for this function:

◆ RefreshSearch()

void Slic3r::GUI::ParamsNode::RefreshSearch ( const wxString & search_text)
546{
547 if (!GetChildren().empty())
548 for (auto& child : GetChildren())
549 child->RefreshSearch(search_text);
550
552 if (auto pos = text.find(search_text); IsParamNode() && pos != wxString::npos) {
554 Enable();
555 } else {
556 Disable();
557 }
558 else
559 Enable();
560}
wxDataViewItemArray GetEnabledChildren()
Definition EditGCodeDialog.cpp:573
void Disable()
Definition EditGCodeDialog.hpp:159
bool IsParamNode() const
Definition EditGCodeDialog.hpp:154
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16
std::unique_ptr< T > make_unique(Args &&... args)
Definition libslic3r.h:239

References Disable(), Slic3r::empty(), Slic3r::Enable, GetChildren(), GetEnabledChildren(), IsParamNode(), m_highlight_index, Slic3r::make_unique(), and text.

Here is the call graph for this function:

◆ SetContainer()

void Slic3r::GUI::ParamsNode::SetContainer ( bool is_container)
inline
155{ m_container = is_container; }

References m_container.

◆ StartSearch()

void Slic3r::GUI::ParamsNode::StartSearch ( )
537{
538 const wxDataViewItem item(this);
539 m_expanded_before_search = m_ctrl->IsExpanded(item);
540 if (!GetChildren().empty())
541 for (const auto& child : GetChildren())
542 child->StartSearch();
543}

References Slic3r::empty(), GetChildren(), m_ctrl, and m_expanded_before_search.

Here is the call graph for this function:

Member Data Documentation

◆ icon

wxBitmap Slic3r::GUI::ParamsNode::icon

◆ icon_name

std::string Slic3r::GUI::ParamsNode::icon_name

◆ m_bold

bool Slic3r::GUI::ParamsNode::m_bold {false}
private
120{false};

Referenced by ParamsNode(), ParamsNode(), and GetFormattedText().

◆ m_children

ParamsNodePtrArray Slic3r::GUI::ParamsNode::m_children
private

◆ m_container

bool Slic3r::GUI::ParamsNode::m_container { true }
private
116{ true };

Referenced by ParamsNode(), IsContainer(), and SetContainer().

◆ m_ctrl

wxDataViewCtrl* Slic3r::GUI::ParamsNode::m_ctrl
private

◆ m_enabled

bool Slic3r::GUI::ParamsNode::m_enabled {true}
private
118{true};

Referenced by Enable(), and IsEnabled().

◆ m_expanded_before_search

bool Slic3r::GUI::ParamsNode::m_expanded_before_search {false}
private
117{false};

Referenced by FinishSearch(), and StartSearch().

◆ m_highlight_index

std::unique_ptr<std::pair<int, int> > Slic3r::GUI::ParamsNode::m_highlight_index {nullptr}
private
122{nullptr};

Referenced by FinishSearch(), GetFormattedText(), and RefreshSearch().

◆ m_param_type

ParamType Slic3r::GUI::ParamsNode::m_param_type { ParamType::Undef }
private

Referenced by ParamsNode(), and IsParamNode().

◆ m_parent

ParamsNode* Slic3r::GUI::ParamsNode::m_parent { nullptr }
private
101{ nullptr };

Referenced by ParamsNode(), ParamsNode(), GetParent(), and IsGroupNode().

◆ param_key

std::string Slic3r::GUI::ParamsNode::param_key

◆ text


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