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

Classes

struct  RepulsiveForce
 
struct  WireForce
 

Typedefs

using Graph = boost::directed_graph< Item * >
 

Functions

double minD (const Item &item1, const Item &item2)
 
double totalArea (const Group &g)
 

Typedef Documentation

◆ Graph

using minsky::anonymous_namespace{autoLayout.cc}::Graph = typedef boost::directed_graph<Item*>

Definition at line 44 of file autoLayout.cc.

Function Documentation

◆ minD()

double minsky::anonymous_namespace{autoLayout.cc}::minD ( const Item item1,
const Item item2 
)

Definition at line 47 of file autoLayout.cc.

References minsky::Item::height(), and minsky::Item::width().

Referenced by minsky::Canvas::closestInPort(), minsky::Canvas::itemAt(), minsky::anonymous_namespace{autoLayout.cc}::WireForce::operator()(), and minsky::anonymous_namespace{autoLayout.cc}::RepulsiveForce::operator()().

48  {return std::max(item1.width()+item2.width(), item1.height()+item2.height());}
float width() const
Definition: item.h:242
float height() const
Definition: item.h:243
Here is the call graph for this function:
Here is the caller graph for this function:

◆ totalArea()

double minsky::anonymous_namespace{autoLayout.cc}::totalArea ( const Group g)

Definition at line 77 of file autoLayout.cc.

References minsky::GroupItems::groups, and minsky::GroupItems::items.

Referenced by minsky::layoutGroup(), and minsky::randomizeLayout().

78  {
79  double area=0;
80  for (auto& i: g.items)
81  area+=double(i->width())*i->height();
82  for (auto& i: g.groups)
83  area+=double(i->width())*i->height();
84  return area;
85  }
Groups groups
Definition: group.h:79
Here is the caller graph for this function: