Minsky
|
#include <group.h>
Public Member Functions | |
GroupItems () | |
virtual | ~GroupItems () |
GroupItems (const GroupItems &x) | |
GroupItems & | operator= (const GroupItems &) |
void | clear () |
bool | empty () const |
virtual bool | nocycles () const =0 |
tests that groups are arranged heirarchically without any recurrence More... | |
template<class M , class C > | |
const M::value_type | findAny (M GroupItems::*map, C c) const |
search for the first item in the heirarchy of map for which c is true. M::value_type must evaluate in a boolean environment to false if not valid C is of signature bool(M::value_type) More... | |
template<class R , class M , class C , class X > | |
std::vector< R > | findAll (C c, M(GroupItems::*m), X xfm) const |
finds all items/wires matching criterion c. Found items are transformed by xfm More... | |
WirePtr | removeWire (const Wire &) |
GroupPtr | removeGroup (const Group &) |
ItemPtr | findItem (const Item &it) const |
finds item within this group or subgroups. Returns null if not found More... | |
GroupPtr | findGroup (const Group &it) const |
finds group within this group or subgroups. Returns null if not found More... | |
WirePtr | findWire (const Wire &it) const |
finds wire within this group or subgroups. Returns null if not found More... | |
template<class C > | |
std::vector< ItemPtr > | findItems (C c) const |
returns list of items matching criterion c More... | |
template<class C > | |
std::vector< WirePtr > | findWires (C c) const |
returns list of wires matching criterion c More... | |
template<class C > | |
std::vector< GroupPtr > | findGroups (C c) const |
returns list of groups matching criterion c More... | |
ItemPtr | addItem (Item *it, bool inSchema=false) |
add item, ownership is passed More... | |
virtual ItemPtr | addItem (const std::shared_ptr< Item > &, bool inSchema=false) |
ItemPtr | removeItem (const Item &) |
GroupPtr | addGroup (const std::shared_ptr< Group > &) |
GroupPtr | addGroup (Group *g) |
WirePtr | addWire (const Item &from, const Item &to, unsigned toPortIdx) |
add a wire from item from, to item to, connecting to the toIdx port of to More... | |
WirePtr | addWire (const std::shared_ptr< Wire > &) |
WirePtr | addWire (Wire *w) |
WirePtr | addWire (const std::weak_ptr< Port > &from, const std::weak_ptr< Port > &to) |
std::size_t | numItems () const |
total number of items in this and child groups More... | |
std::size_t | numWires () const |
total number of wires in this and child groups More... | |
std::size_t | numGroups () const |
total number of groups in this and child groups More... | |
void | removeDisplayPlot () |
remove the display plot More... | |
template<class M , class O > | |
bool | recursiveDo (M GroupItems::*map, O op) const |
Perform action heirarchically on elements of map map. If op returns true, the operation terminates. returns true if operation terminates early, false if every element processed. O has signature bool(M, M::const_iterator) More... | |
template<class M , class O > | |
bool | recursiveDo (M GroupItems::*map, O op) |
O has signature bool(M&, M::iterator) More... | |
Static Public Member Functions | |
static void | adjustWiresGroup (Wire &w) |
adjust wire's group to be the least common ancestor of its ports More... | |
Public Attributes | |
Items | items |
Groups | groups |
Wires | wires |
std::set< Bookmark > | bookmarks |
std::vector< VariablePtr > | inVariables |
std::vector< VariablePtr > | outVariables |
std::vector< VariablePtr > | createdIOvariables |
classdesc::Exclude< std::weak_ptr< Group > > | self |
weak ref to this More... | |
classdesc::Exclude< std::shared_ptr< PlotWidget > > | displayPlot |
plot widget used for group icon More... | |
Protected Member Functions | |
WirePtr | addWire (const Item &from, const Item &to, unsigned toPortIdx, const std::vector< float > &coords) |
add a wire from item from, to item to, connecting to the toIdx port of to, with coordinates More... | |
WirePtr | addWire (const std::weak_ptr< Port > &from, const std::weak_ptr< Port > &to, const std::vector< float > &coords) |
void | renameVar (const GroupPtr &origGroup, VariableBase &v) |
rename variable so that it maintains most general scope possible More... | |
CLASSDESC_ACCESS (GroupItems) | |
Private Attributes | |
bool | inDestructor =false |
Friends | |
class | Canvas |
|
inlinevirtual |
Definition at line 85 of file group.h.
References clear(), and inDestructor.
|
inline |
Definition at line 659 of file group.cc.
Referenced by schema3::Minsky::populateGroup().
Definition at line 173 of file group.h.
References addGroup().
Referenced by addGroup().
add item, ownership is passed
Definition at line 165 of file group.h.
References addItem().
Referenced by addItem(), and minsky::Group::addItem().
|
virtual |
add item.
inSchema | - if building a group from schema processing, rather than generally. Does not adjust item position within group if true. |
Reimplemented in minsky::Group.
Definition at line 331 of file group.cc.
References minsky::Minsky::bookmarkRefresh(), TCLcmd::trap::init, and pyminsky::minsky.
|
inlineprotected |
add a wire from item from, to item to, connecting to the toIdx port of to, with coordinates
Definition at line 63 of file group.h.
References minsky::Item::ports(), and minsky::Item::portsSize().
Referenced by addWire(), minsky::Wire::moveIntoGroup(), and schema3::Minsky::populateGroup().
|
protected |
Definition at line 680 of file group.cc.
References minsky::cminsky(), and minsky::Minsky::inputWired().
|
inline |
add a wire from item from, to item to, connecting to the toIdx port of to
Definition at line 177 of file group.h.
References addWire().
Definition at line 180 of file group.h.
References addWire().
Referenced by addWire().
|
inline |
Definition at line 181 of file group.h.
References addWire().
|
static |
|
protected |
|
inline |
Definition at line 91 of file group.h.
References bookmarks, groups, inVariables, items, outVariables, and wires.
Referenced by minsky::Group::moveContents(), and ~GroupItems().
|
inline |
std::vector< R > minsky::GroupItems::findAll | ( | C | c, |
M GroupItems::* | m, | ||
X | xfm | ||
) | const |
const M::value_type minsky::GroupItems::findAny | ( | M GroupItems::* | map, |
C | c | ||
) | const |
search for the first item in the heirarchy of map for which c is true. M::value_type must evaluate in a boolean environment to false if not valid C is of signature bool(M::value_type)
Definition at line 442 of file group.h.
References groups.
Referenced by findGroup(), and findWire().
finds group within this group or subgroups. Returns null if not found
Definition at line 139 of file group.h.
References findAny(), and groups.
|
inline |
finds item within this group or subgroups. Returns null if not found
Definition at line 291 of file group.cc.
Referenced by schema3::Minsky::populateGroup().
|
inline |
finds wire within this group or subgroups. Returns null if not found
Definition at line 143 of file group.h.
References findAny(), and wires.
|
inline |
|
pure virtual |
tests that groups are arranged heirarchically without any recurrence
Implemented in minsky::Group.
size_t minsky::GroupItems::numGroups | ( | ) | const |
size_t minsky::GroupItems::numItems | ( | ) | const |
size_t minsky::GroupItems::numWires | ( | ) | const |
|
inline |
|
inline |
Perform action heirarchically on elements of map map. If op returns true, the operation terminates. returns true if operation terminates early, false if every element processed. O has signature bool(M, M::const_iterator)
Definition at line 111 of file group.h.
References minsky::GroupRecursiveDo(), and minsky::op.
Referenced by schema3::Minsky::Minsky(), minsky::Wire::moveIntoGroup(), and minsky::VariableInstanceList::VariableInstanceList().
|
inline |
O has signature bool(M&, M::iterator)
Definition at line 115 of file group.h.
References minsky::GroupRecursiveDo(), and minsky::op.
|
inline |
remove the display plot
Definition at line 196 of file group.h.
References displayPlot.
Definition at line 275 of file group.cc.
References minsky::group.
Definition at line 212 of file group.cc.
References minsky::Item::bookmarkId(), and minsky::VariableBase::controller.
Referenced by schema3::Minsky::populateGroup(), minsky::IntOp::removeControlledItems(), and minsky::GodleyIcon::removeControlledItems().
|
protected |
rename variable so that it maintains most general scope possible
Definition at line 303 of file group.cc.
References minsky::VariableBase::name(), minsky::VariableBase::rawName(), and minsky::valueId().
std::set<Bookmark> minsky::GroupItems::bookmarks |
Definition at line 81 of file group.h.
Referenced by minsky::Group::addBookmarkXY(), minsky::Group::bookmarkList(), clear(), minsky::Group::deleteBookmark(), and minsky::Group::gotoBookmark().
std::vector<VariablePtr> minsky::GroupItems::createdIOvariables |
classdesc::Exclude<std::shared_ptr<PlotWidget> > minsky::GroupItems::displayPlot |
plot widget used for group icon
Definition at line 194 of file group.h.
Referenced by removeDisplayPlot().
Groups minsky::GroupItems::groups |
Definition at line 79 of file group.h.
Referenced by clear(), empty(), findAll(), findAny(), findGroup(), findGroups(), minsky::Selection::insertGroup(), minsky::layoutGroup(), schema3::Minsky::Minsky(), minsky::Group::moveContents(), minsky::randomizeLayout(), MathDAG::SystemOfEquations::SystemOfEquations(), and minsky::anonymous_namespace{autoLayout.cc}::totalArea().
|
private |
Definition at line 59 of file group.h.
Referenced by ~GroupItems().
std::vector<VariablePtr> minsky::GroupItems::inVariables |
Definition at line 82 of file group.h.
Referenced by minsky::Group::addInputVar(), clear(), minsky::Group::deleteAttachedWires(), schema3::Minsky::Minsky(), and schema3::Minsky::populateGroup().
Items minsky::GroupItems::items |
Definition at line 78 of file group.h.
Referenced by clear(), empty(), findAll(), findItems(), minsky::MinskyTCL::findObject(), minsky::MinskyTCL::findVariable(), minsky::PhillipsDiagram::init(), minsky::Ravel::joinLockGroup(), minsky::layoutGroup(), minsky::Ravel::lockGroupColours(), schema3::Minsky::Minsky(), minsky::Group::moveContents(), minsky::GodleyTable::nameUnique(), minsky::randomizeLayout(), minsky::Ravel::Ravel(), MathDAG::SystemOfEquations::SystemOfEquations(), minsky::anonymous_namespace{autoLayout.cc}::totalArea(), minsky::VariableBase::units(), MathDAG::SystemOfEquations::updatePortVariableValue(), and minsky::VariableInstanceList::VariableInstanceList().
std::vector<VariablePtr> minsky::GroupItems::outVariables |
Definition at line 82 of file group.h.
Referenced by minsky::Group::addOutputVar(), clear(), minsky::Group::deleteAttachedWires(), schema3::Minsky::Minsky(), and schema3::Minsky::populateGroup().
classdesc::Exclude<std::weak_ptr<Group> > minsky::GroupItems::self |
Wires minsky::GroupItems::wires |
Definition at line 80 of file group.h.
Referenced by clear(), empty(), findWire(), findWires(), minsky::layoutGroup(), schema3::Minsky::Minsky(), and minsky::Wire::moveIntoGroup().