MCPcopy Create free account
hub / github.com/KLayout/klayout / mode_name

Method mode_name

src/laybasic/laybasic/layLayoutViewBase.cc:6060–6084  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6058}
6059
6060std::string
6061LayoutViewBase::mode_name () const
6062{
6063 if (m_mode <= 0) {
6064
6065 std::vector<std::string> intrinsic_modes;
6066 intrinsic_mouse_modes (&intrinsic_modes);
6067
6068 if (int (intrinsic_modes.size ()) > -m_mode) {
6069 return name_from_title (intrinsic_modes [-m_mode]);
6070 }
6071
6072 } else {
6073
6074 for (auto i = mp_plugins.begin (); i != mp_plugins.end (); ++i) {
6075 std::string title;
6076 if ((*i) && (*i)->plugin_declaration () && (*i)->plugin_declaration ()->id () == m_mode && (*i)->plugin_declaration ()->implements_mouse_mode (title)) {
6077 return name_from_title (title);
6078 }
6079 }
6080
6081 }
6082
6083 return std::string ();
6084}
6085
6086void
6087LayoutViewBase::switch_mode (const std::string &name)

Callers 1

test_5Method · 0.80

Calls 7

name_from_titleFunction · 0.85
stringFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
idMethod · 0.45
implements_mouse_modeMethod · 0.45

Tested by 1

test_5Method · 0.64