Minsky
minsky::anonymous_namespace{group.cc} Namespace Reference

Functions

bool isGlobal (const GroupPtr &g)
 
template<class T >
void resizeItems (T &items, double sx, double sy)
 
template<class T >
void recentreItems (const T &items, float xc, float yc)
 
template<class G >
G & globalGroup (G &start)
 
float notchY (const vector< VariablePtr > &vars)
 

Function Documentation

◆ globalGroup()

template<class G >
G& minsky::anonymous_namespace{group.cc}::globalGroup ( G &  start)

Definition at line 730 of file group.cc.

Referenced by minsky::Group::globalGroup(), and minsky::Group::splitBoundaryCrossingWires().

731  {
732  auto g=&start;
733  for (auto i=start.group.lock(); i; i=i->group.lock())
734  g=i.get();
735  return *g;
736  }
Here is the caller graph for this function:

◆ isGlobal()

bool minsky::anonymous_namespace{group.cc}::isGlobal ( const GroupPtr g)

Definition at line 46 of file group.cc.

References minsky::cminsky(), and minsky::Minsky::model.

Referenced by minsky::Group::renameAllInstances().

47  {return !g || g==cminsky().model;}
const Minsky & cminsky()
const version to help in const correctness
Definition: minsky.h:549
GroupPtr model
Definition: minsky.h:255
Here is the call graph for this function:
Here is the caller graph for this function:

◆ notchY()

float minsky::anonymous_namespace{group.cc}::notchY ( const vector< VariablePtr > &  vars)

Definition at line 1088 of file group.cc.

Referenced by minsky::Group::drawIORegion().

1089  {
1090  if (vars.empty()) return 0;
1091  const float z=vars[0]->zoomFactor();
1092  float top=vars[0]->bb.top()*z, bottom=vars[0]->bb.top()*z;
1093  for (size_t i=0; i<vars.size(); ++i)
1094  {
1095  if (i%2)
1096  top-=vars[i]->height();
1097  else
1098  bottom+=vars[i]->height();
1099  }
1100  return vars.size()%2? top-vars.back()->bb.bottom()*z: bottom-vars.back()->bb.top()*z;
1101  }
Here is the caller graph for this function:

◆ recentreItems()

template<class T >
void minsky::anonymous_namespace{group.cc}::recentreItems ( const T &  items,
float  xc,
float  yc 
)

Definition at line 611 of file group.cc.

Referenced by minsky::Group::resize().

612  {
613  for (auto& i: items)
614  if (!i->ioVar())
615  {
616  i->m_x-=xc;
617  i->m_y-=yc;
618  }
619  }
Here is the caller graph for this function:

◆ resizeItems()

template<class T >
void minsky::anonymous_namespace{group.cc}::resizeItems ( T &  items,
double  sx,
double  sy 
)

Definition at line 598 of file group.cc.

Referenced by minsky::Group::resize().

599  {
600  for (auto& i: items)
601  if (!i->ioVar())
602  {
603  i->m_x*=sx;
604  i->m_y*=sy;
605  }
606  }
Here is the caller graph for this function: