27 #include <TCL_obj_base.h> 59 Wire(
const std::weak_ptr<Port>&
from,
const std::weak_ptr<Port>&
to,
60 const std::vector<float>& a_coords=std::vector<float>());
63 std::shared_ptr<Port>
from()
const {
return m_from.lock();}
64 std::shared_ptr<Port>
to()
const {
return m_to.lock();}
67 void moveToPorts(
const std::shared_ptr<Port>&
from,
const std::shared_ptr<Port>&
to);
72 void draw(cairo_t* cairo,
bool reverseArrow=
false)
const;
75 std::vector<float>
coords()
const;
76 std::vector<float>
coords(
const std::vector<float>&
coords);
79 bool near(
float x,
float y)
const;
88 void editHandle(
unsigned position,
float x,
float y);
110 #pragma omit pack minsky::Wire 111 #pragma omit unpack minsky::Wire 116 public classdesc::NullDescriptor<classdesc::pack_t> {};
118 public classdesc::NullDescriptor<classdesc::unpack_t> {};
bool visible() const
whether this wire is visible or not
std::vector< WirePtr > Wires
std::shared_ptr< Port > from() const
std::vector< std::pair< float, float > > cairoCoords
contains all the internal cairo coordinates used to draw a wire
std::shared_ptr< Port > to() const
static constexpr float handleRadius
std::vector< float > m_coords
std::shared_ptr< Wire > WirePtr
void deleteHandle(float x, float y)
int unitsCtr
for detecting wiring loops in units()
void insertHandle(unsigned position, float x, float y)
void storeCairoCoords(cairo_t *cairo) const
stash all the internal cairo coordinates along a wire
std::vector< float > coords() const
display coordinates
unsigned nearestHandle(float x, float y)
returns the index into the coordinate list if x,y is close to it. Otherwise inserts midpoints and ret...
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky's state cha...
std::weak_ptr< Port > m_to
void split()
splits wires crossing group boundaries
represents the units (in sense of dimensional analysis) of a variable.
bool near(float x, float y) const
returns true if coordinates are near this wire
std::weak_ptr< Port > m_from
ports this wire connects
void moveIntoGroup(Group &dest)
move this from its group into dest
Units units(bool) const
units (dimensional analysis) of data flowing across wire
void moveToPorts(const std::shared_ptr< Port > &from, const std::shared_ptr< Port > &to)
switch ports this wire links to
void draw(cairo_t *cairo, bool reverseArrow=false) const
draw this item into a cairo context
void editHandle(unsigned position, float x, float y)