MCPcopy Create free account
hub / github.com/dalboris/vpaint / connected

Function connected

src/Gui/VectorAnimationComplex/Algorithms.cpp:30–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28{
29
30CellSet connected(const CellSet & cells)
31{
32 CellSet res = cells;
33 CellSet addedCells = cells;
34
35 // while some cells have been added
36 while(addedCells.size() != 0)
37 {
38 CellSet newAddedCells;
39 foreach(Cell * c, addedCells)
40 {
41 CellSet neighbourhood = c->neighbourhood();
42 foreach(Cell * d, neighbourhood)
43 {
44 if(!res.contains(d))
45 {
46 res << d;
47 newAddedCells << d;
48 }
49 }
50 }
51 addedCells = newAddedCells;
52 }
53
54 return res;
55}
56
57
58CellSet closure(Cell * c)

Callers 1

selectConnectedMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected