55 Wire(
const std::weak_ptr<Port>&
from,
const std::weak_ptr<Port>&
to,
56 const std::vector<float>& a_coords=std::vector<float>());
59 std::shared_ptr<Port>
from()
const {
return m_from.lock();}
60 std::shared_ptr<Port>
to()
const {
return m_to.lock();}
63 void moveToPorts(
const std::shared_ptr<Port>&
from,
const std::shared_ptr<Port>&
to);
68 void draw(cairo_t* cairo,
bool reverseArrow=
false)
const;
71 std::vector<float>
coords()
const;
72 std::vector<float>
coords(
const std::vector<float>&
coords);
75 bool near(
float x,
float y)
const;
84 void editHandle(
unsigned position,
float x,
float y);
99 typedef std::vector<WirePtr>
Wires;
106 #pragma omit pack minsky::Wire 107 #pragma omit unpack minsky::Wire 112 public classdesc::NullDescriptor<classdesc::pack_t> {};
114 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...
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)