23 #define DISPLAY_POW_UPSIDE_DOWN 25 #define BOOST_GEOMETRY_DISABLE_DEPRECATED_03_WARNING 26 #include <boost/geometry/geometry.hpp> 37 #include <boost/locale.hpp> 40 using ecolab::cairo::CairoSave;
47 cairo::Surface
dummySurf(cairo_image_surface_create(CAIRO_FORMAT_A1, 100,100));
59 if (val.engExp==-3) val.
engExp=0;
62 catch (
const std::exception& ex)
67 h=0.5*Pango::height();
73 h=0.5*Pango::height();
91 const float dx=x-
var.
x(), dy=y-
var.
y();
94 return rx>=-
w && rx<=w && ry>=-
h && ry <=
h;
101 vv->adjustSliderBounds();
102 assert(vv->sliderMin<vv->sliderMax);
103 return (
w<0.5*
var.
iWidth()? 0.5*
var.
iWidth() :
w)*(vv->value()-0.5*(vv->sliderMin+vv->sliderMax))/(vv->sliderMax-vv->sliderMin);
110 (cairo_t* cairo,
double x,
double y,
const cairo::Colour& col,
double angle)
112 const CairoSave cs(cairo);
113 cairo_new_path(cairo);
114 cairo_set_source_rgba(cairo,col.r,col.g,col.b,col.a);
115 cairo_translate(cairo,x,y);
116 cairo_rotate(cairo, angle);
117 cairo_move_to(cairo,10,0);
118 cairo_line_to(cairo,0,-3);
119 cairo_line_to(cairo,0,3);
#define M_PI
some useful geometry types, defined from boost::geometry
std::string expMultiplier(int exp)
std::string latexToPango(const char *s)
virtual Type type() const =0
cairo::Surface dummySurf(cairo_image_surface_create(CAIRO_FORMAT_A1, 100, 100))
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky's state cha...
bool ioVar() const override
indicates this is a group I/O variable
bool inImage(float x, float y)
return the boost geometry corresponding to this variable's shape
EngNotation engExp() const
return formatted mantissa and exponent in engineering format
virtual std::string name() const
variable displayed name
std::string mantissa(const EngNotation &e, int digits=3) const
void drawTriangle(cairo_t *cairo, double x, double y, const ecolab::cairo::Colour &col, double angle=0)
void draw(cairo_t *) const override
std::shared_ptr< VariableValue > vValue() const
variableValue associated with this. nullptr if not associated with a variableValue ...
void draw()
render the cairo image