9 glRotatef(
rtod(a), 0,0,1 );
25 float* data,
size_t len,
size_t offset,
26 float min,
float max )
28 float sample_spacing = w / (float)len;
29 float yscale = h / (max-min);
33 glBegin( GL_LINE_STRIP );
35 for(
unsigned int i=0; i<len; i++ )
36 glVertex3f( x + (
float)i*sample_spacing, y+(data[(i+offset)%len]-min)*yscale, 0.01 );
42 snprintf( buf, 63,
"%.2f", min );
44 snprintf( buf, 63,
"%.2f", max );
50 float* data,
size_t len,
size_t offset )
53 float smallest = 1e16;
54 float largest = -1e16;
56 for(
size_t i=0; i<len; i++ )
58 smallest = std::min( smallest, data[i] );
59 largest = std::max( largest, data[i] );
62 draw_array( x,y,w,h,data,len,offset,smallest,largest );
67 glRasterPos3f( x, y, z );
70 glGetBooleanv( GL_CURRENT_RASTER_POSITION_VALID, &b );
74 if( b ) gl_draw( str );
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 );
123 glRectf( x-0.5*dx, y-0.5*dy, x+0.5*dx, y+0.5*dy );
145 for(
double i = floor(vol.
x.
min); i < vol.
x.
max; i++)
147 glVertex2f( i, vol.
y.
min );
148 glVertex2f( i, vol.
y.
max );
151 for(
double i = floor(vol.
y.
min); i < vol.
y.
max; i++)
153 glVertex2f( vol.
x.
min, i );
154 glVertex2f( vol.
x.
max, i );
161 for(
double i = floor(vol.
x.
min); i < vol.
x.
max; i++)
163 snprintf( str, 16,
"%d", (
int)i );
167 for(
double i = floor(vol.
y.
min); i < vol.
y.
max; i++)
169 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.