Minsky
|
#include <cairoItems.h>
Public Member Functions | |
RenderVariable (const VariableBase &var, cairo_t *cairo=NULL) | |
void | draw () |
render the cairo image More... | |
float | width () const |
half width of unrotated image More... | |
float | height () const |
half height of unrotated image More... | |
bool | inImage (float x, float y) |
return the boost geometry corresponding to this variable's shape More... | |
double | handlePos () const |
Private Attributes | |
const VariableBase & | var |
cairo_t * | cairo |
float | w |
float | h |
float | hoffs |
class that renders a variable into a cairo context. A user can also query the size of the unrotated rendered image
Definition at line 34 of file cairoItems.h.
RenderVariable::RenderVariable | ( | const VariableBase & | var, |
cairo_t * | cairo = NULL |
||
) |
Definition at line 50 of file cairoItems.cc.
References minsky::VariableType::constant, minsky::EngNotation::engExp, minsky::VariableBase::engExp(), minsky::expMultiplier(), h, hoffs, minsky::VariableBase::ioVar(), minsky::latexToPango(), minsky::VariableBase::mantissa(), minsky::VariableBase::name(), minsky::VariableBase::type(), var, and w.
void RenderVariable::draw | ( | ) |
render the cairo image
Definition at line 83 of file cairoItems.cc.
References cairo, minsky::VariableBase::draw(), and var.
Referenced by minsky::IntOp::draw(), minsky::VariablePaneCell::show(), and minsky::VariablePaneCell::VariablePaneCell().
double RenderVariable::handlePos | ( | ) | const |
Definition at line 97 of file cairoItems.cc.
References minsky::Item::iWidth(), var, minsky::VariableBase::vValue(), and w.
Referenced by minsky::VariableBase::clickType().
|
inline |
half height of unrotated image
Definition at line 47 of file cairoItems.h.
References h.
Referenced by minsky::anonymous_namespace{godleyIcon.cc}::accumulateWidthHeight(), minsky::VariableBase::clickType(), minsky::Canvas::copyVars(), and minsky::IntOp::draw().
bool RenderVariable::inImage | ( | float | x, |
float | y | ||
) |
return the boost geometry corresponding to this variable's shape
true if (x,y) within rendered image x coordinate of the slider handle in the unrotated/unscaled frame of reference
Definition at line 89 of file cairoItems.cc.
References MathDAG::cos(), h, M_PI, minsky::Item::rotation(), MathDAG::sin(), var, w, minsky::Item::x(), and minsky::Item::y().
Referenced by minsky::Group::select().
|
inline |
half width of unrotated image
Definition at line 45 of file cairoItems.h.
References w.
Referenced by minsky::anonymous_namespace{godleyIcon.cc}::accumulateWidthHeight(), minsky::Canvas::copyVars(), minsky::IntOp::draw(), and minsky::VariableBase::onMouseMotion().
|
private |
Definition at line 37 of file cairoItems.h.
Referenced by draw().
|
private |
Definition at line 38 of file cairoItems.h.
Referenced by height(), inImage(), and RenderVariable().
|
private |
Definition at line 38 of file cairoItems.h.
Referenced by RenderVariable().
|
private |
Definition at line 36 of file cairoItems.h.
Referenced by draw(), handlePos(), inImage(), and RenderVariable().
|
private |
Definition at line 38 of file cairoItems.h.
Referenced by handlePos(), inImage(), RenderVariable(), and width().