Minsky
minsky::Item Class Reference

#include <item.h>

Inheritance diagram for minsky::Item:
Inheritance graph
Collaboration diagram for minsky::Item:
Collaboration graph

Classes

struct  MemoisedRotator
 

Public Member Functions

 Item ()
 
virtual std::weak_ptr< Portports (std::size_t i) const
 callback to be run when item deleted from group More...
 
std::size_t portsSize () const
 number of ports More...
 
float portX (std::size_t i)
 
float portY (std::size_t i)
 
virtual bool contains (float xx, float yy) const
 
bool contains (const Point &p) const
 
void updateBoundingBox () override
 
void throw_error (const std::string &) const
 mark item on canvas, then throw More...
 
virtual bool ioVar () const
 indicates this is a group I/O variable More...
 
virtual double value () const
 current value of output port More...
 
double rotation () const
 
double rotation (const double &r)
 
std::pair< double, bool > rotationAsRadians () const
 return the rotation as radians, and whether rotation should have additional straight angle added for text that stays upright. More...
 
float iWidth () const
 
float iWidth (const float &w)
 
float iHeight () const
 
float iHeight (const float &h)
 
virtual void flip ()
 rotate icon though 180∘ More...
 
virtual std::string classType () const
 
std::string id () const
 return an id uniquely identifying this item More...
 
virtual float x () const
 
virtual float y () const
 
virtual float zoomFactor () const
 
void ensureBBValid () const
 
float width () const
 
float height () const
 
virtual std::vector< Pointcorners () const
 
float left () const
 
float right () const
 
float top () const
 
float bottom () const
 
std::string bookmarkId () const
 Id of bookmark associated with this. More...
 
void adjustBookmark () const override
 adjust bookmark list to reflect current configuration More...
 
float resizeHandleSize () const
 resize handles should be at least a percentage if the icon size (#1025) More...
 
virtual bool onResizeHandle (float x, float y) const
 
virtual bool inItem (float x, float y) const
 
virtual bool onItem (float x, float y) const
 returns true if (x,y) is on the icon More...
 
virtual void onMouseDown (float x, float y)
 respond to mouse down events More...
 
virtual void onMouseUp (float x, float y)
 respond to mouse up events More...
 
virtual bool onMouseMotion (float x, float y)
 respond to mouse motion events with button pressed More...
 
virtual bool onMouseOver (float x, float y)
 respond to mouse motion events (hover) without button pressed More...
 
virtual void onMouseLeave ()
 respond to mouse leave events (when mouse leaves item) More...
 
virtual bool onKeyPress (int keySym, const std::string &utf8, int state)
 respond to key press events More...
 
virtual void deleteAttachedWires ()
 delete all attached wires More...
 
virtual Itemclone () const
 
virtual bool visible () const
 whether this item is visible on the canvas. More...
 
void moveTo (float x, float y)
 
virtual void draw (cairo_t *cairo) const
 draw this item into a cairo context More...
 
virtual void resize (const LassoBox &b)
 resize this item on the canvas More...
 
virtual float scaleFactor () const
 factor by which item has been resized More...
 
virtual float scaleFactor (const float &sf)
 
void dummyDraw () const
 draw into a dummy cairo context, for purposes of calculating port positions More...
 
virtual void displayTooltip (cairo_t *, const std::string &) const
 display tooltip text, eg on mouseover More...
 
virtual void updateIcon (double t)
 update display after a step() More...
 
 Item (const Item &)=default
 
Itemoperator= (const Item &)=default
 
virtual ~Item ()
 
void drawPorts (cairo_t *cairo) const
 
virtual void drawResizeHandles (cairo_t *cairo) const
 
virtual ClickType::Type clickType (float x, float y) const
 returns the clicktype given a mouse click at x, y. More...
 
virtual std::shared_ptr< PortclosestOutPort (float x, float y) const
 returns closest output port to x,y More...
 
virtual std::shared_ptr< PortclosestInPort (float x, float y) const
 
virtual std::shared_ptr< Itemselect (float x, float y) const
 returns the variable if point (x,y) is within a visible variable icon, null otherwise. More...
 
virtual void TCL_obj (classdesc::TCL_obj_t &t, const std::string &d)
 runs the TCL_obj descriptor suitable for this type More...
 
void RESTProcess (classdesc::RESTProcess_t &rp, const std::string &d) override
 runs the RESTProcess descriptor suitable for this type More...
 
void RESTProcess (classdesc::RESTProcess_t &rp, const std::string &d) const override
 
virtual void json_pack (classdesc::json_pack_t &j) const
 
virtual void displayDelayedTooltip (float x, float y)
 enable extended tooltip help message appropriate for mouse at (x,y) More...
 
virtual void disableDelayedTooltip ()
 
virtual bool editorMode () const
 some items have an editor mode attribute More...
 
virtual void toggleEditorMode ()
 
virtual Units units (bool check=false) const
 compute the dimensional units More...
 
Units checkUnits () const
 perform units consistency checks More...
 
ItemPtr itemPtrFromThis () const
 return a shared_ptr to this More...
 
virtual void destroyFrame ()
 destroy any popup windows associated with this More...
 
- Public Member Functions inherited from minsky::NoteBase
virtual std::string const & detailedText () const
 
virtual std::string const & detailedText (const std::string &x)
 
virtual std::string const & tooltip () const
 
virtual std::string const & tooltip (const std::string &x)
 
virtual ~NoteBase ()=default
 

Static Public Member Functions

static void drawSelected (cairo_t *cairo)
 

Public Attributes

float m_x =0
 
float m_y =0
 position in canvas, or within group More...
 
float m_sf =1
 scale factor of item on canvas, or within group More...
 
bool onResizeHandles =false
 set to true to indicate mouse is ovcaler resize handles More...
 
bool onBorder =false
 true to indicate mouse hovering over border More...
 
std::string deleteCallback
 
BoundingBox bb
 canvas bounding box. More...
 
- Public Attributes inherited from minsky::NoteBase
bool mouseFocus =false
 true if target of a mouseover More...
 
bool selected =false
 true if selected for cut, copy or group operation More...
 
bool bookmark =false
 Is this item also a bookmark? More...
 

Static Protected Member Functions

static void drawResizeHandle (cairo_t *cairo, double x, double y, double sf, double angle)
 

Protected Attributes

double m_width =10
 
double m_height =10
 
ItemPortVector m_ports
 
minsky::Item::MemoisedRotator memoisedRotator
 

Detailed Description

Definition at line 148 of file item.h.

Constructor & Destructor Documentation

◆ Item() [1/2]

minsky::Item::Item ( )
inline

Definition at line 172 of file item.h.

Referenced by clone().

172 : TCLAccessor<Item,double>("rotation",(Getter)&Item::rotation,(Setter)&Item::rotation) {}
double rotation() const
Definition: item.h:211
Here is the caller graph for this function:

◆ Item() [2/2]

minsky::Item::Item ( const Item )
default

◆ ~Item()

virtual minsky::Item::~Item ( )
inlinevirtual

Definition at line 313 of file item.h.

313 {}

Member Function Documentation

◆ adjustBookmark()

void minsky::Item::adjustBookmark ( ) const
overridevirtual

adjust bookmark list to reflect current configuration

Reimplemented from minsky::NoteBase.

Definition at line 192 of file item.cc.

References minsky::Minsky::bookmarkRefresh(), and pyminsky::minsky.

193  {
194  if (auto g=group.lock())
195  {
196  auto& bookmarks=g->bookmarks;
197  if (bookmark)
198  g->addBookmarkXY(left(),top(),bookmarkId());
199  else
200  bookmarks.erase(bookmarkId());
202  }
203  }
float top() const
Definition: item.cc:177
float left() const
Definition: item.cc:163
virtual void bookmarkRefresh()
refresh the bookmark menu after changes
Definition: minsky.h:450
bool bookmark
Is this item also a bookmark?
Definition: noteBase.h:33
std::string bookmarkId() const
Id of bookmark associated with this.
Definition: item.h:251
Definition: group.tcl:84
Minsky & minsky()
global minsky object
Definition: minskyTCL.cc:51
Here is the call graph for this function:

◆ bookmarkId()

std::string minsky::Item::bookmarkId ( ) const
inline

Id of bookmark associated with this.

Definition at line 251 of file item.h.

References minsky::to_string(), and minsky::NoteBase::tooltip().

Referenced by minsky::GroupItems::removeItem().

251 {return tooltip().empty()? std::to_string(size_t(this)): tooltip();}
virtual std::string const & tooltip() const
Definition: noteBase.h:36
string to_string(CONST84 char *x)
Definition: minskyTCLObj.h:33
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bottom()

float minsky::Item::bottom ( ) const

Definition at line 184 of file item.cc.

Referenced by height(), and minsky::LassoBox::intersects().

185  {
186  auto bottom=y();
187  for (auto& p: corners())
188  if (p.y()>bottom) bottom=p.y();
189  return bottom;
190  }
virtual float y() const
Definition: item.cc:114
float bottom() const
Definition: item.cc:184
virtual std::vector< Point > corners() const
Definition: item.cc:153
Here is the caller graph for this function:

◆ checkUnits()

Units minsky::Item::checkUnits ( ) const
inline

perform units consistency checks

Definition at line 357 of file item.h.

References units().

357 {return units(true);}
virtual Units units(bool check=false) const
compute the dimensional units
Definition: item.h:352
Here is the call graph for this function:

◆ classType()

◆ clickType()

ClickType::Type minsky::Item::clickType ( float  x,
float  y 
) const
virtual

returns the clicktype given a mouse click at x, y.

Reimplemented in minsky::Group, minsky::VariableBase, minsky::PlotWidget, minsky::GodleyIcon, and minsky::Sheet.

Definition at line 275 of file item.cc.

References minsky::portRadius.

Referenced by minsky::VariableBase::clickType().

276  {
277  // if selecting a contained variable, the delegate to that
278  if (auto item=select(x,y))
279  return item->clickType(x,y);
280 
281  // firstly, check whether a port has been selected
282  for (auto& p: m_ports)
283  {
284  if (hypot(x-p->x(), y-p->y()) < portRadius*zoomFactor())
285  return ClickType::onPort;
286  }
287 
288  if (onResizeHandle(x,y)) return ClickType::onResize;
289  if (inItem(x,y)) return ClickType::inItem;
290  if (onItem(x,y)) return ClickType::onItem;
291  return ClickType::outside;
292  }
virtual float x() const
Definition: item.cc:107
virtual float y() const
Definition: item.cc:114
virtual float zoomFactor() const
Definition: item.cc:121
virtual bool onResizeHandle(float x, float y) const
Definition: item.cc:228
ItemPortVector m_ports
Definition: item.h:156
virtual bool inItem(float x, float y) const
Definition: item.h:259
constexpr float portRadius
radius of circle marking ports at zoom=1
Definition: item.h:69
virtual bool onItem(float x, float y) const
returns true if (x,y) is on the icon
Definition: item.cc:242
virtual std::shared_ptr< Item > select(float x, float y) const
returns the variable if point (x,y) is within a visible variable icon, null otherwise.
Definition: item.h:328
Here is the caller graph for this function:

◆ clone()

◆ closestInPort()

shared_ptr< Port > minsky::Item::closestInPort ( float  x,
float  y 
) const
virtual

Definition at line 428 of file item.cc.

References minsky::sqr().

429  {
430  if (auto v=select(x,y))
431  return v->closestInPort(x,y);
432  shared_ptr<Port> r;
433  for (size_t i=0; i<m_ports.size(); ++i)
434  if (m_ports[i]->input() &&
435  (!r || sqr(m_ports[i]->x()-x)+sqr(m_ports[i]->y()-y) <
436  sqr(r->x()-x)+sqr(r->y()-y)))
437  r=m_ports[i];
438  return r;
439  }
Definition: input.py:1
virtual float x() const
Definition: item.cc:107
virtual float y() const
Definition: item.cc:114
ItemPortVector m_ports
Definition: item.h:156
T sqr(T x)
Definition: geometry.h:36
virtual std::shared_ptr< Item > select(float x, float y) const
returns the variable if point (x,y) is within a visible variable icon, null otherwise.
Definition: item.h:328
Here is the call graph for this function:

◆ closestOutPort()

shared_ptr< Port > minsky::Item::closestOutPort ( float  x,
float  y 
) const
virtual

returns closest output port to x,y

Definition at line 421 of file item.cc.

422  {
423  if (auto v=select(x,y))
424  return v->closestOutPort(x,y);
425  return portsSize()>0 && !ports(0).lock()->input()? ports(0).lock(): nullptr;
426  }
std::size_t portsSize() const
number of ports
Definition: item.h:184
virtual float x() const
Definition: item.cc:107
virtual float y() const
Definition: item.cc:114
virtual std::weak_ptr< Port > ports(std::size_t i) const
callback to be run when item deleted from group
Definition: item.h:180
virtual std::shared_ptr< Item > select(float x, float y) const
returns the variable if point (x,y) is within a visible variable icon, null otherwise.
Definition: item.h:328

◆ contains() [1/2]

virtual bool minsky::Item::contains ( float  xx,
float  yy 
) const
inlinevirtual

Reimplemented in minsky::PlotWidget, and minsky::Sheet.

Definition at line 196 of file item.h.

References left(), resizeHandleSize(), and top().

Referenced by minsky::Sheet::contains().

196  {
197  auto hz=resizeHandleSize(); // extend by resize handle size (which is also portRadius)
198  return left()-hz<=xx && right()+hz>=xx && top()-hz<=yy && bottom()+hz>=yy;
199  }
float top() const
Definition: item.cc:177
float left() const
Definition: item.cc:163
float resizeHandleSize() const
resize handles should be at least a percentage if the icon size (#1025)
Definition: item.h:255
Here is the call graph for this function:
Here is the caller graph for this function:

◆ contains() [2/2]

bool minsky::Item::contains ( const Point p) const
inline

Definition at line 200 of file item.h.

References contains().

Referenced by contains().

200 {return contains(p.x(),p.y());}
virtual bool contains(float xx, float yy) const
Definition: item.h:196
Here is the call graph for this function:
Here is the caller graph for this function:

◆ corners()

std::vector< Point > minsky::Item::corners ( ) const
virtual

Reimplemented in minsky::Sheet.

Definition at line 153 of file item.cc.

154  {
155  ensureBBValid();
156  auto left=x()+bb.left()*zoomFactor(), right=x()+bb.right()*zoomFactor();
157  auto top=y()+bb.top()*zoomFactor(), bottom=y()+bb.bottom()*zoomFactor();
161  }
float bottom() const
Definition: item.h:99
float right() const
Definition: item.cc:170
virtual float x() const
Definition: item.cc:107
virtual float y() const
Definition: item.cc:114
float top() const
Definition: item.cc:177
BoundingBox bb
canvas bounding box.
Definition: item.h:195
virtual float zoomFactor() const
Definition: item.cc:121
minsky::Item::MemoisedRotator memoisedRotator
void ensureBBValid() const
Definition: item.h:241
float left() const
Definition: item.cc:163
float right() const
Definition: item.h:97
float left() const
Definition: item.h:96
float bottom() const
Definition: item.cc:184
void update(float a, float x, float y)
Definition: item.h:161
float top() const
Definition: item.h:98
double rotation() const
Definition: item.h:211

◆ deleteAttachedWires()

void minsky::Item::deleteAttachedWires ( )
virtual

delete all attached wires

Reimplemented in minsky::Group.

Definition at line 139 of file item.cc.

140  {
141  for (auto& p: m_ports)
142  p->deleteWires();
143  }
ItemPortVector m_ports
Definition: item.h:156

◆ destroyFrame()

virtual void minsky::Item::destroyFrame ( )
inlinevirtual

destroy any popup windows associated with this

Reimplemented in minsky::VariableBase, minsky::PlotWidget, and minsky::GodleyIcon.

Definition at line 363 of file item.h.

363 {}

◆ disableDelayedTooltip()

virtual void minsky::Item::disableDelayedTooltip ( )
inlinevirtual

Definition at line 342 of file item.h.

342 {}

◆ displayDelayedTooltip()

virtual void minsky::Item::displayDelayedTooltip ( float  x,
float  y 
)
inlinevirtual

enable extended tooltip help message appropriate for mouse at (x,y)

Reimplemented in minsky::Ravel.

Definition at line 341 of file item.h.

341 {}

◆ displayTooltip()

void minsky::Item::displayTooltip ( cairo_t *  cairo,
const std::string &  tooltip 
) const
virtual

display tooltip text, eg on mouseover

Reimplemented in minsky::UserFunction.

Definition at line 398 of file item.cc.

References minsky::latexToPango().

Referenced by minsky::UserFunction::displayTooltip(), minsky::IntOp::draw(), minsky::Ravel::draw(), and minsky::VariableBase::draw().

399  {
400  const string unitstr=units().latexStr();
401  if (!tooltip.empty() || !unitstr.empty())
402  {
403  const cairo::CairoSave cs(cairo);
404  Pango pango(cairo);
405  string toolTipText=latexToPango(tooltip);
406  if (!unitstr.empty())
407  toolTipText+=" Units:"+latexToPango(unitstr);
408  pango.setMarkup(toolTipText);
409  const float z=zoomFactor();
410  cairo_translate(cairo,z*(0.5*bb.width())+10,
411  z*(-0.5*bb.height())-20);
412  cairo_rectangle(cairo,0,0,pango.width(),pango.height());
413  cairo_set_source_rgb(cairo,1,1,1);
414  cairo_fill_preserve(cairo);
415  cairo_set_source_rgb(cairo,0,0,0);
416  pango.show();
417  cairo_stroke(cairo);
418  }
419  }
virtual Units units(bool check=false) const
compute the dimensional units
Definition: item.h:352
std::string latexToPango(const char *s)
Definition: latexMarkup.h:30
float width() const
Definition: item.h:94
BoundingBox bb
canvas bounding box.
Definition: item.h:195
virtual std::string const & tooltip() const
Definition: noteBase.h:36
virtual float zoomFactor() const
Definition: item.cc:121
float height() const
Definition: item.h:95
std::string latexStr() const
insert braces around exponents for LaTeX processing
Definition: variableType.cc:40
Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw()

void minsky::Item::draw ( cairo_t *  cairo) const
virtual

draw this item into a cairo context

Reimplemented in minsky::Group, minsky::VariableBase, minsky::PlotWidget, minsky::GodleyIcon, minsky::Ravel, minsky::OperationBase, minsky::PhillipsStock, minsky::Sheet, minsky::IntOp, minsky::SwitchIcon, minsky::UserFunction, minsky::Lock, and minsky::DataOp.

Definition at line 363 of file item.cc.

References minsky::flipped(), minsky::latexToPango(), M_PI, minsky::Rotate::x(), and minsky::Rotate::y().

Referenced by minsky::BoundingBox::update().

364  {
365  auto [angle,flipped]=rotationAsRadians();
366  const Rotate r(rotation()+(flipped? 180:0),0,0);
367  Pango pango(cairo);
368  const float z=zoomFactor();
369  pango.angle=angle+(flipped? M_PI: 0);
370  pango.setFontSize(12.0*scaleFactor()*z);
371  pango.setMarkup(latexToPango(detailedText()));
372  // parameters of icon in userspace (unscaled) coordinates
373  const float w=0.5*pango.width()+2*z;
374  const float h=0.5*pango.height()+4*z;
375 
376  cairo_move_to(cairo,r.x(-w+1,-h+2), r.y(-w+1,-h+2));
377  pango.show();
378 
379  if (mouseFocus) {
380  displayTooltip(cairo,tooltip());
381  }
382  if (onResizeHandles) drawResizeHandles(cairo);
383  cairo_move_to(cairo,r.x(-w,-h), r.y(-w,-h));
384  cairo_line_to(cairo,r.x(w,-h), r.y(w,-h));
385  cairo_line_to(cairo,r.x(w,h), r.y(w,h));
386  cairo_line_to(cairo,r.x(-w,h), r.y(-w,h));
387  cairo_close_path(cairo);
388  cairo_clip(cairo);
389  if (selected) drawSelected(cairo);
390  }
#define M_PI
some useful geometry types, defined from boost::geometry
Definition: geometry.h:29
std::string latexToPango(const char *s)
Definition: latexMarkup.h:30
virtual void displayTooltip(cairo_t *, const std::string &) const
display tooltip text, eg on mouseover
Definition: item.cc:398
bool onResizeHandles
set to true to indicate mouse is ovcaler resize handles
Definition: item.h:175
std::pair< double, bool > rotationAsRadians() const
return the rotation as radians, and whether rotation should have additional straight angle added for ...
Definition: item.cc:92
virtual std::string const & tooltip() const
Definition: noteBase.h:36
virtual float zoomFactor() const
Definition: item.cc:121
bool flipped(double rotation)
returns if the angle (in degrees) is in the second or third quadrant
Definition: geometry.h:102
static void drawSelected(cairo_t *cairo)
Definition: item.cc:308
virtual void drawResizeHandles(cairo_t *cairo) const
Definition: item.cc:343
bool selected
true if selected for cut, copy or group operation
Definition: noteBase.h:32
virtual float scaleFactor() const
factor by which item has been resized
Definition: item.cc:128
bool mouseFocus
true if target of a mouseover
Definition: noteBase.h:31
virtual std::string const & detailedText() const
Definition: noteBase.h:34
double rotation() const
Definition: item.h:211
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawPorts()

void minsky::Item::drawPorts ( cairo_t *  cairo) const

Definition at line 294 of file item.cc.

References M_PI, and minsky::portRadius.

Referenced by minsky::IntOp::draw(), minsky::Ravel::draw(), and minsky::VariableBase::draw().

295  {
296  const CairoSave cs(cairo);
297  cairo_new_path(cairo);
298  for (auto& p: m_ports)
299  {
300  cairo_new_sub_path(cairo);
301  cairo_arc(cairo, p->x()-x(), p->y()-y(), portRadius*zoomFactor(), 0, 2*M_PI);
302  }
303  cairo_set_source_rgb(cairo, 0,0,0);
304  cairo_set_line_width(cairo,1);
305  cairo_stroke(cairo);
306  }
#define M_PI
some useful geometry types, defined from boost::geometry
Definition: geometry.h:29
virtual float x() const
Definition: item.cc:107
virtual float y() const
Definition: item.cc:114
virtual float zoomFactor() const
Definition: item.cc:121
ItemPortVector m_ports
Definition: item.h:156
constexpr float portRadius
radius of circle marking ports at zoom=1
Definition: item.h:69
Here is the caller graph for this function:

◆ drawResizeHandle()

void minsky::Item::drawResizeHandle ( cairo_t *  cairo,
double  x,
double  y,
double  sf,
double  angle 
)
staticprotected

Definition at line 316 of file item.cc.

317  {
318  const cairo::CairoSave cs(cairo);
319  cairo_translate(cairo,x,y);
320  cairo_rotate(cairo,angle);
321  cairo_scale(cairo,sf,sf);
322  cairo_move_to(cairo,-1,-.2);
323  cairo_line_to(cairo,-1,-1);
324  cairo_line_to(cairo,1,1);
325  cairo_line_to(cairo,1,0.2);
326  cairo_move_to(cairo,-1,-1);
327  cairo_line_to(cairo,-.2,-1);
328  cairo_move_to(cairo,.2,1);
329  cairo_line_to(cairo,1,1);
330  }
virtual float x() const
Definition: item.cc:107
virtual float y() const
Definition: item.cc:114

◆ drawResizeHandles()

void minsky::Item::drawResizeHandles ( cairo_t *  cairo) const
virtual

Reimplemented in minsky::BottomRightResizerItem, and minsky::Sheet.

Definition at line 343 of file item.cc.

References M_PI.

344  {
345  auto sf=resizeHandleSize();
346  double angle=0.5*M_PI;
347  for (auto& p: corners())
348  {
349  angle+=0.5*M_PI;
350  drawResizeHandle(cairo,p.x()-x(),p.y()-y(),sf,angle);
351  }
352  cairo_stroke(cairo);
353  }
#define M_PI
some useful geometry types, defined from boost::geometry
Definition: geometry.h:29
virtual float x() const
Definition: item.cc:107
virtual float y() const
Definition: item.cc:114
static void drawResizeHandle(cairo_t *cairo, double x, double y, double sf, double angle)
Definition: item.cc:316
float resizeHandleSize() const
resize handles should be at least a percentage if the icon size (#1025)
Definition: item.h:255
virtual std::vector< Point > corners() const
Definition: item.cc:153

◆ drawSelected()

void minsky::Item::drawSelected ( cairo_t *  cairo)
static

Definition at line 308 of file item.cc.

Referenced by minsky::IntOp::draw(), minsky::Ravel::draw(), and minsky::VariableBase::draw().

309  {
310  // implemented by filling the clip region with a transparent grey
311  const CairoSave cs(cairo);
312  cairo_set_source_rgba(cairo, 0.5,0.5,0.5,0.4);
313  cairo_paint(cairo);
314  }
Here is the caller graph for this function:

◆ dummyDraw()

void minsky::Item::dummyDraw ( ) const

draw into a dummy cairo context, for purposes of calculating port positions

Definition at line 392 of file item.cc.

393  {
394  const ecolab::cairo::Surface s(cairo_recording_surface_create(CAIRO_CONTENT_COLOR_ALPHA,NULL));
395  draw(s.cairo());
396  }
virtual void draw(cairo_t *cairo) const
draw this item into a cairo context
Definition: item.cc:363

◆ editorMode()

virtual bool minsky::Item::editorMode ( ) const
inlinevirtual

some items have an editor mode attribute

Reimplemented in minsky::Ravel, and minsky::GodleyIcon.

Definition at line 345 of file item.h.

345 {return false;}

◆ ensureBBValid()

void minsky::Item::ensureBBValid ( ) const
inline

Definition at line 241 of file item.h.

References bb, minsky::BoundingBox::update(), and minsky::BoundingBox::valid().

241 {if (!bb.valid()) bb.update(*this);}
BoundingBox bb
canvas bounding box.
Definition: item.h:195
bool valid() const
Definition: item.h:93
void update(const Item &x)
Definition: item.cc:46
Here is the call graph for this function:

◆ flip()

virtual void minsky::Item::flip ( )
inlinevirtual

rotate icon though 180∘

Reimplemented in minsky::SwitchIcon.

Definition at line 232 of file item.h.

References rotation().

232 {rotation(rotation()+180);}
double rotation() const
Definition: item.h:211
Here is the call graph for this function:

◆ height()

float minsky::Item::height ( ) const
inline

Definition at line 243 of file item.h.

References bottom(), and top().

Referenced by minsky::PhillipsStock::draw(), minsky::PlotWidget::height(), minsky::anonymous_namespace{autoLayout.cc}::minD(), and resizeHandleSize().

243 {return bottom()-top();}
float top() const
Definition: item.cc:177
float bottom() const
Definition: item.cc:184
Here is the call graph for this function:
Here is the caller graph for this function:

◆ id()

std::string minsky::Item::id ( ) const
inline

return an id uniquely identifying this item

Definition at line 236 of file item.h.

References minsky::str().

236 {return str(size_t(this));}
std::string str(T x)
utility function to create a string representation of a numeric type
Definition: str.h:33
Here is the call graph for this function:

◆ iHeight() [1/2]

float minsky::Item::iHeight ( ) const
inline

◆ iHeight() [2/2]

float minsky::Item::iHeight ( const float &  h)
inline

Definition at line 225 of file item.h.

References bb, m_height, and minsky::BoundingBox::update().

225  {
226  m_height=h;
227  bb.update(*this);
228  return m_height;
229  }
BoundingBox bb
canvas bounding box.
Definition: item.h:195
double m_height
Definition: item.h:155
void update(const Item &x)
Definition: item.cc:46
Here is the call graph for this function:

◆ inItem()

virtual bool minsky::Item::inItem ( float  x,
float  y 
) const
inlinevirtual
Returns
true if item internally responds to the mouse, and (x,y) is within editable area

Reimplemented in minsky::GodleyIcon, minsky::Ravel, and minsky::Sheet.

Definition at line 259 of file item.h.

259 {return false;}

◆ ioVar()

virtual bool minsky::Item::ioVar ( ) const
inlinevirtual

indicates this is a group I/O variable

Reimplemented in minsky::VariableBase.

Definition at line 207 of file item.h.

207 {return false;}

◆ itemPtrFromThis()

ItemPtr minsky::Item::itemPtrFromThis ( ) const

return a shared_ptr to this

Definition at line 447 of file item.cc.

Referenced by minsky::Ravel::exportAsCSV(), minsky::Ravel::joinLockGroup(), and minsky::TensorsFromPort::tensorsFromPort().

448  {
449  if (auto g=group.lock())
450  return g->findItem(*this);
451  return {};
452  }
Definition: group.tcl:84
Here is the caller graph for this function:

◆ iWidth() [1/2]

float minsky::Item::iWidth ( ) const
inline

◆ iWidth() [2/2]

float minsky::Item::iWidth ( const float &  w)
inline

Definition at line 218 of file item.h.

References bb, m_width, and minsky::BoundingBox::update().

218  {
219  m_width=w;
220  bb.update(*this);
221  return m_width;
222  }
BoundingBox bb
canvas bounding box.
Definition: item.h:195
void update(const Item &x)
Definition: item.cc:46
double m_width
Definition: item.h:155
Here is the call graph for this function:

◆ json_pack()

◆ left()

float minsky::Item::left ( ) const

Definition at line 163 of file item.cc.

Referenced by contains(), minsky::LassoBox::intersects(), and width().

164  {
165  auto left=x();
166  for (auto& p: corners())
167  if (p.x()<left) left=p.x();
168  return left;
169  }
virtual float x() const
Definition: item.cc:107
float left() const
Definition: item.cc:163
virtual std::vector< Point > corners() const
Definition: item.cc:153
Here is the caller graph for this function:

◆ moveTo()

void minsky::Item::moveTo ( float  x,
float  y 
)

Definition at line 256 of file item.cc.

References minsky::anonymous_namespace{userFunction.cc}::isfinite().

Referenced by minsky::Minsky::addIntegral(), minsky::VariableBase::draw(), minsky::layoutGroup(), minsky::PhillipsDiagram::mouseMove(), minsky::IntOp::resize(), minsky::Ravel::resize(), minsky::VariableBase::resize(), and minsky::Minsky::setDefinition().

257  {
258  // cowardly refuse to move to a nonsense coordinate
259  if (!isfinite(x)||!isfinite(y)) return;
260  if (auto g=group.lock())
261  {
262  const float invZ=1/zoomFactor();
263  m_x=(x-g->x())*invZ;
264  m_y=(y-g->y())*invZ;
265  }
266  else
267  {
268  m_x=x;
269  m_y=y;
270  }
271  if (bookmark) adjustBookmark();
272  assert(abs(x-this->x())<1 && abs(y-this->y())<1);
273  }
void adjustBookmark() const override
adjust bookmark list to reflect current configuration
Definition: item.cc:192
virtual float x() const
Definition: item.cc:107
virtual float y() const
Definition: item.cc:114
virtual float zoomFactor() const
Definition: item.cc:121
bool bookmark
Is this item also a bookmark?
Definition: noteBase.h:33
Definition: group.tcl:84
float m_y
position in canvas, or within group
Definition: item.h:173
float m_x
Definition: item.h:173
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onItem()

bool minsky::Item::onItem ( float  x,
float  y 
) const
virtual

returns true if (x,y) is on the icon

Definition at line 242 of file item.cc.

References minsky::Rotate::x(), and minsky::Rotate::y().

243  {
244  const Rotate r(-rotation(),this->x(),this->y());
245  return bb.contains(
246  (r.x(x,y)-this->x())/zoomFactor(),
247  (r.y(x,y)-this->y())/zoomFactor());
248  }
virtual float x() const
Definition: item.cc:107
virtual float y() const
Definition: item.cc:114
BoundingBox bb
canvas bounding box.
Definition: item.h:195
virtual float zoomFactor() const
Definition: item.cc:121
bool contains(float x, float y) const
Definition: item.h:89
double rotation() const
Definition: item.h:211
Here is the call graph for this function:

◆ onKeyPress()

virtual bool minsky::Item::onKeyPress ( int  keySym,
const std::string &  utf8,
int  state 
)
inlinevirtual

respond to key press events

Returns
true if it needs to be rerendered

Reimplemented in minsky::VariableBase, minsky::GodleyIcon, minsky::Ravel, minsky::IntOp, and minsky::Sheet.

Definition at line 276 of file item.h.

277  {return false;}

◆ onMouseDown()

virtual void minsky::Item::onMouseDown ( float  x,
float  y 
)
inlinevirtual

respond to mouse down events

Reimplemented in minsky::GodleyIcon, and minsky::Ravel.

Definition at line 263 of file item.h.

263 {}

◆ onMouseLeave()

virtual void minsky::Item::onMouseLeave ( )
inlinevirtual

respond to mouse leave events (when mouse leaves item)

Reimplemented in minsky::PlotWidget, minsky::GodleyIcon, and minsky::Ravel.

Definition at line 273 of file item.h.

273 {}

◆ onMouseMotion()

virtual bool minsky::Item::onMouseMotion ( float  x,
float  y 
)
inlinevirtual

respond to mouse motion events with button pressed

Returns
true if it needs to be rerendered

Reimplemented in minsky::VariableBase, minsky::GodleyIcon, and minsky::Ravel.

Definition at line 268 of file item.h.

268 {return false;}

◆ onMouseOver()

virtual bool minsky::Item::onMouseOver ( float  x,
float  y 
)
inlinevirtual

respond to mouse motion events (hover) without button pressed

Returns
true if it needs to be rerendered

Reimplemented in minsky::PlotWidget, minsky::GodleyIcon, and minsky::Ravel.

Definition at line 271 of file item.h.

271 {return false;}

◆ onMouseUp()

virtual void minsky::Item::onMouseUp ( float  x,
float  y 
)
inlinevirtual

respond to mouse up events

Reimplemented in minsky::GodleyIcon, and minsky::Ravel.

Definition at line 265 of file item.h.

265 {}

◆ onResizeHandle()

bool minsky::Item::onResizeHandle ( float  x,
float  y 
) const
virtual
Returns
true is (x,y) is located on a resize handle

Reimplemented in minsky::BottomRightResizerItem, and minsky::Sheet.

Definition at line 228 of file item.cc.

References minsky::anonymous_namespace{item.cc}::near().

229  {
230  float rhSize=resizeHandleSize();
231  auto cnrs=corners();
232  return any_of(cnrs.begin(), cnrs.end(), [&](const Point& p)
233  {return near(x,y,p.x(),p.y(),rhSize);});
234  }
virtual float x() const
Definition: item.cc:107
virtual float y() const
Definition: item.cc:114
bool near(float x0, float y0, float x1, float y1, float d)
Definition: item.cc:147
boost::geometry::model::d2::point_xy< float > Point
Definition: geometry.h:34
float resizeHandleSize() const
resize handles should be at least a percentage if the icon size (#1025)
Definition: item.h:255
virtual std::vector< Point > corners() const
Definition: item.cc:153
Here is the call graph for this function:

◆ operator=()

Item& minsky::Item::operator= ( const Item )
default

◆ ports()

virtual std::weak_ptr<Port> minsky::Item::ports ( std::size_t  i) const
inlinevirtual

callback to be run when item deleted from group

return a weak reference to the ith port

Reimplemented in minsky::IntOp.

Definition at line 180 of file item.h.

References m_ports.

Referenced by minsky::GroupItems::addWire(), schema3::IdMap::at(), minsky::anonymous_namespace{operation.cc}::CheckConsistent::CheckConsistent(), minsky::VariableBase::inputWired(), MathDAG::SubexpressionCache::key(), MathDAG::SystemOfEquations::makeDAG(), minsky::IntOp::ports(), portX(), portY(), minsky::Minsky::setDefinition(), and minsky::TensorsFromPort::tensorsFromPorts().

180  {
181  return i<m_ports.size()? m_ports[i]: nullptr;
182  }
ItemPortVector m_ports
Definition: item.h:156
Here is the caller graph for this function:

◆ portsSize()

std::size_t minsky::Item::portsSize ( ) const
inline

number of ports

Definition at line 184 of file item.h.

References m_ports.

Referenced by minsky::GroupItems::addWire(), schema3::IdMap::at(), minsky::anonymous_namespace{operation.cc}::CheckConsistent::CheckConsistent(), and minsky::TensorsFromPort::tensorsFromPorts().

184 {return m_ports.size();}
ItemPortVector m_ports
Definition: item.h:156
Here is the caller graph for this function:

◆ portX()

float minsky::Item::portX ( std::size_t  i)
inline

Definition at line 185 of file item.h.

References ports().

185  {
186  if (auto p=ports(i).lock()) return p->x();
187  return 0;
188  }
virtual std::weak_ptr< Port > ports(std::size_t i) const
callback to be run when item deleted from group
Definition: item.h:180
Here is the call graph for this function:

◆ portY()

float minsky::Item::portY ( std::size_t  i)
inline

Definition at line 190 of file item.h.

References ports().

190  {
191  if (auto p=ports(i).lock()) return p->y();
192  return 0;
193  }
virtual std::weak_ptr< Port > ports(std::size_t i) const
callback to be run when item deleted from group
Definition: item.h:180
Here is the call graph for this function:

◆ resize()

void minsky::Item::resize ( const LassoBox b)
virtual

resize this item on the canvas

Reimplemented in minsky::Group, minsky::VariableBase, minsky::PlotWidget, minsky::Ravel, minsky::GodleyIcon, minsky::OperationBase, and minsky::IntOp.

Definition at line 333 of file item.cc.

References f, minsky::LassoBox::x0, minsky::LassoBox::x1, minsky::LassoBox::y0, and minsky::LassoBox::y1.

334  {
335  // Set initial iWidth() and iHeight() to initial Pango determined values. This resize method is not very reliable. Probably a Pango issue.
336  const float w=iWidth(width()), h=iHeight(height()), invZ=1/zoomFactor();
337  moveTo(0.5*(b.x0+b.x1), 0.5*(b.y0+b.y1));
338  iWidth(abs(b.x1-b.x0)*invZ);
339  iHeight(abs(b.y1-b.y0)*invZ);
340  scaleFactor(std::max(1.0f,std::min(iWidth()/w,iHeight()/h)));
341  }
function f
Definition: canvas.m:1
float iHeight() const
Definition: item.h:224
virtual float zoomFactor() const
Definition: item.cc:121
float width() const
Definition: item.h:242
float iWidth() const
Definition: item.h:217
virtual float scaleFactor() const
factor by which item has been resized
Definition: item.cc:128
float height() const
Definition: item.h:243
void moveTo(float x, float y)
Definition: item.cc:256

◆ resizeHandleSize()

float minsky::Item::resizeHandleSize ( ) const
inline

resize handles should be at least a percentage if the icon size (#1025)

Definition at line 255 of file item.h.

References f, height(), minsky::portRadius, width(), and zoomFactor().

Referenced by contains().

255 {return std::max(portRadius*zoomFactor(), std::max(0.02f*width(), 0.02f*height()));}
function f
Definition: canvas.m:1
virtual float zoomFactor() const
Definition: item.cc:121
float width() const
Definition: item.h:242
float height() const
Definition: item.h:243
constexpr float portRadius
radius of circle marking ports at zoom=1
Definition: item.h:69
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RESTProcess() [1/2]

void minsky::Item::RESTProcess ( classdesc::RESTProcess_t &  rp,
const std::string &  d 
)
inlineoverride

runs the RESTProcess descriptor suitable for this type

dummy definition for use with gui executable

Definition at line 333 of file item.h.

Referenced by RESTProcess().

334  {::RESTProcess(rp,d,*this);}
void RESTProcess(classdesc::RESTProcess_t &rp, const std::string &d) override
runs the RESTProcess descriptor suitable for this type
Definition: item.h:333
Here is the caller graph for this function:

◆ RESTProcess() [2/2]

void minsky::Item::RESTProcess ( classdesc::RESTProcess_t &  rp,
const std::string &  d 
) const
inlineoverride

Definition at line 335 of file item.h.

References RESTProcess().

336  {::RESTProcess(rp,d,*this);}
void RESTProcess(classdesc::RESTProcess_t &rp, const std::string &d) override
runs the RESTProcess descriptor suitable for this type
Definition: item.h:333
Here is the call graph for this function:

◆ right()

float minsky::Item::right ( ) const

Definition at line 170 of file item.cc.

Referenced by minsky::LassoBox::intersects(), and width().

171  {
172  auto right=x();
173  for (auto& p: corners())
174  if (p.x()>right) right=p.x();
175  return right;
176  }
float right() const
Definition: item.cc:170
virtual float x() const
Definition: item.cc:107
virtual std::vector< Point > corners() const
Definition: item.cc:153
Here is the caller graph for this function:

◆ rotation() [1/2]

◆ rotation() [2/2]

double minsky::Item::rotation ( const double &  r)
inline

Definition at line 212 of file item.h.

212 {return m_rotation=r;}

◆ rotationAsRadians()

std::pair< double, bool > minsky::Item::rotationAsRadians ( ) const

return the rotation as radians, and whether rotation should have additional straight angle added for text that stays upright.

Definition at line 92 of file item.cc.

References minsky::flipped(), and M_PI.

Referenced by minsky::IntOp::draw(), and minsky::VariableBase::draw().

93  {
94  // if rotation is in 1st or 3rd quadrant, rotate as
95  // normal, otherwise flip the text so it reads L->R
96  return {rotation() * M_PI / 180.0, flipped(rotation())};
97  }
#define M_PI
some useful geometry types, defined from boost::geometry
Definition: geometry.h:29
bool flipped(double rotation)
returns if the angle (in degrees) is in the second or third quadrant
Definition: geometry.h:102
double rotation() const
Definition: item.h:211
Here is the call graph for this function:
Here is the caller graph for this function:

◆ scaleFactor() [1/2]

float minsky::Item::scaleFactor ( ) const
virtual

factor by which item has been resized

Reimplemented in minsky::OperationBase.

Definition at line 128 of file item.cc.

Referenced by minsky::GodleyIcon::bottomMargin(), and minsky::GodleyIcon::leftMargin().

129  {
130  return m_sf;
131  }
float m_sf
scale factor of item on canvas, or within group
Definition: item.h:174
Here is the caller graph for this function:

◆ scaleFactor() [2/2]

float minsky::Item::scaleFactor ( const float &  sf)
virtual

Definition at line 133 of file item.cc.

133  {
134  m_sf=sf;
135  bb.update(*this);
136  return m_sf;
137  }
float m_sf
scale factor of item on canvas, or within group
Definition: item.h:174
BoundingBox bb
canvas bounding box.
Definition: item.h:195
void update(const Item &x)
Definition: item.cc:46

◆ select()

virtual std::shared_ptr<Item> minsky::Item::select ( float  x,
float  y 
) const
inlinevirtual

returns the variable if point (x,y) is within a visible variable icon, null otherwise.

Reimplemented in minsky::Group, and minsky::GodleyIcon.

Definition at line 328 of file item.h.

328 {return {};}

◆ TCL_obj()

virtual void minsky::Item::TCL_obj ( classdesc::TCL_obj_t &  t,
const std::string &  d 
)
inlinevirtual

◆ throw_error()

void minsky::Item::throw_error ( const std::string &  msg) const

mark item on canvas, then throw

Definition at line 86 of file item.cc.

References minsky::cminsky(), and minsky::Minsky::displayErrorItem().

Referenced by MathDAG::LockDAG::addEvalOps(), minsky::anonymous_namespace{operation.cc}::CheckConsistent::CheckConsistent(), minsky::UserFunction::compile(), MathDAG::LockDAG::derivative(), minsky::VariableBase::importFromCSV(), minsky::VariableBase::units(), and units().

87  {
88  cminsky().displayErrorItem(*this);
89  throw runtime_error(msg);
90  }
void displayErrorItem(const Item &op) const
indicate operation item has error, if visible, otherwise contining group
Definition: minsky.cc:1230
const Minsky & cminsky()
const version to help in const correctness
Definition: minsky.h:549
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggleEditorMode()

virtual void minsky::Item::toggleEditorMode ( )
inlinevirtual

Reimplemented in minsky::Ravel, and minsky::GodleyIcon.

Definition at line 346 of file item.h.

346 {}

◆ top()

float minsky::Item::top ( ) const

Definition at line 177 of file item.cc.

Referenced by contains(), height(), and minsky::LassoBox::intersects().

178  {
179  auto top=y();
180  for (auto& p: corners())
181  if (p.y()<top) top=p.y();
182  return top;
183  }
virtual float y() const
Definition: item.cc:114
float top() const
Definition: item.cc:177
virtual std::vector< Point > corners() const
Definition: item.cc:153
Here is the caller graph for this function:

◆ units()

virtual Units minsky::Item::units ( bool  check = false) const
inlinevirtual

compute the dimensional units

Parameters
check- if true, then perform consistency checks
Exceptions
ifcheck=true and dimensions inconsistent

Reimplemented in minsky::Ravel, minsky::VariableBase, minsky::OperationBase, minsky::Copy, minsky::Derivative, minsky::Time, minsky::IntOp, minsky::SwitchIcon, minsky::DataOp, minsky::UserFunction, and minsky::Lock.

Definition at line 352 of file item.h.

References throw_error().

Referenced by checkUnits().

352  {
353  if (check) throw_error("units not implemented");
354  return {};
355  }
void throw_error(const std::string &) const
mark item on canvas, then throw
Definition: item.cc:86
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateBoundingBox()

void minsky::Item::updateBoundingBox ( )
inlineoverridevirtual

Reimplemented from minsky::NoteBase.

Definition at line 201 of file item.h.

References bb, and minsky::BoundingBox::update().

Referenced by minsky::Ravel::applyState(), minsky::VariableBase::init(), and minsky::PhillipsStock::PhillipsStock().

201 {bb.update(*this);}
BoundingBox bb
canvas bounding box.
Definition: item.h:195
void update(const Item &x)
Definition: item.cc:46
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateIcon()

virtual void minsky::Item::updateIcon ( double  t)
inlinevirtual

update display after a step()

Reimplemented in minsky::PlotWidget.

Definition at line 309 of file item.h.

309 {}

◆ value()

virtual double minsky::Item::value ( ) const
inlinevirtual

current value of output port

Reimplemented in minsky::VariableBase, minsky::OperationBase, and minsky::SwitchIcon.

Definition at line 209 of file item.h.

209 {return 0;}

◆ visible()

bool minsky::Item::visible ( ) const
virtual

whether this item is visible on the canvas.

Reimplemented in minsky::VariableBase.

Definition at line 250 of file item.cc.

Referenced by minsky::VariableBase::visible().

251  {
252  auto g=group.lock();
253  return (!g || g->displayContents());
254  }
Definition: group.tcl:84
Here is the caller graph for this function:

◆ width()

float minsky::Item::width ( ) const
inline

Definition at line 242 of file item.h.

References left(), and right().

Referenced by minsky::PhillipsStock::draw(), minsky::anonymous_namespace{autoLayout.cc}::minD(), resizeHandleSize(), minsky::Minsky::setDefinition(), and minsky::PlotWidget::width().

242 {return right()-left();}
float right() const
Definition: item.cc:170
float left() const
Definition: item.cc:163
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x()

float minsky::Item::x ( ) const
virtual

Definition at line 107 of file item.cc.

Referenced by minsky::Group::addBookmarkXY(), minsky::VariableBase::clickType(), minsky::VariableBase::detailedText(), minsky::Ravel::displayDelayedTooltip(), minsky::IntOp::draw(), minsky::PhillipsStock::draw(), minsky::Ravel::draw(), minsky::VariableBase::draw(), minsky::VariableBase::enableSlider(), minsky::RenderVariable::inImage(), minsky::VariableBase::init(), minsky::Ravel::inItem(), minsky::IntOp::IntOp(), minsky::Ravel::onMouseDown(), minsky::Ravel::onMouseMotion(), minsky::VariableBase::onMouseMotion(), minsky::Ravel::onMouseOver(), minsky::Ravel::onMouseUp(), minsky::anonymous_namespace{godleyIcon.cc}::DrawVars::operator()(), minsky::SwitchIcon::operator=(), minsky::IntOp::operator=(), minsky::Operation< minsky::OperationType::integrate >::operator=(), minsky::Variable< VariableType::constant >::operator=(), minsky::IntOp::pack(), minsky::Ravel::setDisplayFilterCaliper(), minsky::Ravel::setSortOrder(), minsky::VariableBase::setUnits(), minsky::VariableBase::sliderMax(), minsky::VariableBase::sliderMin(), minsky::VariableBase::sliderStep(), minsky::VariableBase::sliderStepRel(), minsky::SwitchIcon::SwitchIcon(), minsky::VariableBase::tooltip(), minsky::IntOp::unpack(), minsky::VariableBase::value(), minsky::VarConstant::value(), minsky::GodleyIcon::valueId(), and minsky::VariableInstanceList::VariableInstanceList().

108  {
109  if (auto g=group.lock())
110  return zoomFactor()*m_x+g->x();
111  return m_x;
112  }
virtual float zoomFactor() const
Definition: item.cc:121
Definition: group.tcl:84
float m_x
Definition: item.h:173
Here is the caller graph for this function:

◆ y()

◆ zoomFactor()

Member Data Documentation

◆ bb

◆ deleteCallback

std::string minsky::Item::deleteCallback

Definition at line 177 of file item.h.

Referenced by minsky::MinskyTCL::runItemDeletedCallback().

◆ m_height

double minsky::Item::m_height =10
protected

Definition at line 155 of file item.h.

Referenced by iHeight().

◆ m_ports

◆ m_sf

float minsky::Item::m_sf =1

scale factor of item on canvas, or within group

Definition at line 174 of file item.h.

Referenced by schema3::populateItem().

◆ m_width

double minsky::Item::m_width =10
protected

Definition at line 155 of file item.h.

Referenced by iWidth().

◆ m_x

float minsky::Item::m_x =0

Definition at line 173 of file item.h.

Referenced by schema3::populateItem().

◆ m_y

float minsky::Item::m_y =0

position in canvas, or within group

Definition at line 173 of file item.h.

Referenced by schema3::populateItem().

◆ memoisedRotator

minsky::Item::MemoisedRotator minsky::Item::memoisedRotator
protected

◆ onBorder

bool minsky::Item::onBorder =false

true to indicate mouse hovering over border

Definition at line 176 of file item.h.

Referenced by minsky::Ravel::draw().

◆ onResizeHandles

bool minsky::Item::onResizeHandles =false
mutable

set to true to indicate mouse is ovcaler resize handles

Definition at line 175 of file item.h.

Referenced by minsky::IntOp::draw(), minsky::VariableBase::draw(), and minsky::BoundingBox::update().


The documentation for this class was generated from the following files: