9 glRotatef(
rtod(a), 0, 0, 1);
27 float sample_spacing = w / (float)len;
28 float yscale = h / (max - min);
32 glBegin(GL_LINE_STRIP);
34 for (
unsigned int i = 0; i < len; i++)
35 glVertex3f(x + (
float)i * sample_spacing, y + (data[(i + offset) % len] - min) * yscale, 0.01);
41 snprintf(buf, 63,
"%.2f", min);
43 snprintf(buf, 63,
"%.2f", max);
50 float smallest = 1e16;
51 float largest = -1e16;
53 for (
size_t i = 0; i < len; i++) {
54 smallest = std::min(smallest, data[i]);
55 largest = std::max(largest, data[i]);
58 draw_array(x, y, w, h, data, len, offset, smallest, largest);
63 glRasterPos3f(x, y, z);
66 glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID, &b);
80 gl_draw(str, x, y, w, h, align);
94 glVertex2f(w + 2 * m, m);
95 glVertex2f(w + 2 * m, h + m);
96 glVertex2f(m + w, h + 2 * m);
97 glVertex2f(m, h + 2 * m);
109 glVertex2f(x + m + w, y);
110 glVertex2f(x + w + 2 * m, y + m);
111 glVertex2f(x + w + 2 * m, y + h + m);
112 glVertex2f(x + m + w, y + h + 2 * m);
113 glVertex2f(x + m, y + h + 2 * m);
114 glVertex2f(x, y + h + m);
115 glVertex2f(x, y + m);
116 glVertex2f(x + m, y);
122 glRectf(x - 0.5 * dx, y - 0.5 * dy, x + 0.5 * dx, y + 0.5 * dy);
144 for (
double i = floor(vol.
x.
min); i < vol.
x.
max; i++) {
145 glVertex2f(i, vol.
y.
min);
146 glVertex2f(i, vol.
y.
max);
149 for (
double i = floor(vol.
y.
min); i < vol.
y.
max; i++) {
150 glVertex2f(vol.
x.
min, i);
151 glVertex2f(vol.
x.
max, i);
158 for (
double i = floor(vol.
x.
min); i < vol.
x.
max; i++) {
159 snprintf(str, 16,
"%d", (
int)i);
163 for (
double i = floor(vol.
y.
min); i < vol.
y.
max; i++) {
164 snprintf(str, 16,
"%d", (
int)i);
void coord_shift(double x, double y, double z, double a)
Bounds y
volume extent along y axis, initially zero
double max
largest value in range, initially zero
The Stage library uses its own namespace.
double min
smallest value in range, initially zero
void draw_origin(double len)
void draw_string_multiline(float x, float y, float w, float h, const char *string, Fl_Align align)
meters_t z
location in 3 axes
void pose_inverse_shift(const Pose &pose)
void draw_array(float x, float y, float w, float h, float *data, size_t len, size_t offset, float min, float max)
void draw_centered_rect(float x, float y, float dx, float dy)
void draw_grid(bounds3d_t vol)
void draw_vector(double x, double y, double z)
void pose_shift(const Pose &pose)
void draw_string(float x, float y, float z, const char *string)
Bounds x
volume extent along x axis, intially zero
void draw_speech_bubble(float x, float y, float z, const char *str)
void draw_octagon(float w, float h, float m)
radians_t a
rotation about the z axis.