1599 |
|
|
1600 |
{ |
{ |
1601 |
"Type": "2", |
"Type": "2", |
1602 |
|
"Name": "ContinuousLine", |
1603 |
|
"Data": """ |
1604 |
|
int textId; |
1605 |
|
float width; |
1606 |
|
vector<float> points; |
1607 |
|
vector<float> color; |
1608 |
|
""", |
1609 |
|
"Params": """ |
1610 |
|
int textId, |
1611 |
|
float width, |
1612 |
|
float[] points, |
1613 |
|
float[] colors |
1614 |
|
|
1615 |
|
""", |
1616 |
|
"ParamCode": """ |
1617 |
|
this->textId = textId; |
1618 |
|
this->width = width; |
1619 |
|
|
1620 |
|
""", |
1621 |
|
"ExtraClass" : """ |
1622 |
|
/* |
1623 |
|
template<class Coords> struct Vertexer { |
1624 |
|
const Coords &c; |
1625 |
|
float scale; |
1626 |
|
ZPt orig; |
1627 |
|
|
1628 |
|
Vertexer(Coords &c, float scale, ZPt orig) : |
1629 |
|
c(c), scale(scale), orig(orig) { } |
1630 |
|
|
1631 |
|
template<class T> void operator()(const T &x, const T &y) { |
1632 |
|
|
1633 |
|
ZPt tmp(x*scale, y*scale, 0); |
1634 |
|
|
1635 |
|
tmp.x += orig.x; |
1636 |
|
tmp.y += orig.y; |
1637 |
|
|
1638 |
|
c.vertex(tmp); |
1639 |
|
} |
1640 |
|
}; |
1641 |
|
*/ |
1642 |
|
""", |
1643 |
|
"RenderCode" : """ |
1644 |
|
|
1645 |
|
/* |
1646 |
|
// UNABLE TO IMPLEMENT AS LONG AS GL IS UNCOMPILABLE |
1647 |
|
|
1648 |
|
DBG(dbg_continuous_line) |
1649 |
|
<< "ContinuousLine - linewidth: " << width << "\\n"; |
1650 |
|
|
1651 |
|
glPushAttrib(GL_ENABLE_BIT); |
1652 |
|
glEnable(GL_BLEND); |
1653 |
|
glDisable(GL_TEXTURE_2D); |
1654 |
|
|
1655 |
|
if (color.size() >= 3) |
1656 |
|
glColor3f(color[0], color[1], color[2]; |
1657 |
|
|
1658 |
|
|
1659 |
|
// Linewidth |
1660 |
|
ZPt a = coords1.transform(ZPt(0,0,0)); |
1661 |
|
ZPt b = coords1.transform(ZPt(0,linewidth,0)); |
1662 |
|
float line_w = (b-a).length(); |
1663 |
|
|
1664 |
|
Lines::ContinuousLine line(textId, "foo", line_w ); |
1665 |
|
|
1666 |
|
|
1667 |
|
for (unsigned int i=0; i+2<points.size(); i+=3) { |
1668 |
|
line.add(points[i], points[i+1], points[i+2]); |
1669 |
|
} |
1670 |
|
|
1671 |
|
|
1672 |
|
|
1673 |
|
// left -vert |
1674 |
|
line.draw( |
1675 |
|
coords1.transform( ZPt(0.0, 0.0, 0.0) ), |
1676 |
|
coords1.transform( ZPt(0.0, weeks + weekday_h + month_name_h, 0.0) ) |
1677 |
|
); |
1678 |
|
|
1679 |
|
glColor3f(0.0, 0.0, 0.0); |
1680 |
|
|
1681 |
|
glPopAttrib(); |
1682 |
|
*/ |
1683 |
|
if (dbg) cout << "ContinuousLine done\\n"; |
1684 |
|
""" |
1685 |
|
}, |
1686 |
|
|
1687 |
|
{ |
1688 |
|
"Type": "2", |
1689 |
"Name": "CalendarPaper", |
"Name": "CalendarPaper", |
1690 |
"Data": """ |
"Data": """ |
1691 |
TextRenderer *r_date; |
TextRenderer *r_date; |
1816 |
ZPt b = coords1.transform(ZPt(0,linewidth,0)); |
ZPt b = coords1.transform(ZPt(0,linewidth,0)); |
1817 |
float line_w = (b-a).length(); |
float line_w = (b-a).length(); |
1818 |
|
|
1819 |
Lines::Lines line(line_w); |
Lines::SimpleLine line(line_w); |
1820 |
|
|
1821 |
// left -vert |
// left -vert |
1822 |
line.draw( |
line.draw( |