Commit 0450aeb9 authored by claes's avatar claes

Postscript print of highlight added

parent e8b14a2f
...@@ -30,7 +30,7 @@ void FlowAnnot::traverse( int x, int y) ...@@ -30,7 +30,7 @@ void FlowAnnot::traverse( int x, int y)
p.traverse( x, y); p.traverse( x, y);
} }
void FlowAnnot::print( void *pos, void *node) void FlowAnnot::print( void *pos, void *node, int highlight)
{ {
if ( !(display_level & ctx->display_level)) if ( !(display_level & ctx->display_level))
return; return;
......
...@@ -26,7 +26,7 @@ class FlowAnnot : public FlowArrayElem { ...@@ -26,7 +26,7 @@ class FlowAnnot : public FlowArrayElem {
void conpoint_select( void *pos, int x, int y, double *distance, void conpoint_select( void *pos, int x, int y, double *distance,
void **cp) {}; void **cp) {};
int event_handler( void *pos, flow_eEvent event, int x, int y, void *node); int event_handler( void *pos, flow_eEvent event, int x, int y, void *node);
void print( void *pos, void *node); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int hot, void *node);
......
...@@ -43,7 +43,7 @@ void FlowAnnotPixmap::traverse( int x, int y) ...@@ -43,7 +43,7 @@ void FlowAnnotPixmap::traverse( int x, int y)
p.traverse( x, y); p.traverse( x, y);
} }
void FlowAnnotPixmap::print( void *pos, void *node) void FlowAnnotPixmap::print( void *pos, void *node, int highlight)
{ {
if ( !((FlowNode *) node)->annotpixmapv[number]) if ( !((FlowNode *) node)->annotpixmapv[number])
return; return;
......
...@@ -23,7 +23,7 @@ class FlowAnnotPixmap : public FlowArrayElem { ...@@ -23,7 +23,7 @@ class FlowAnnotPixmap : public FlowArrayElem {
int event_handler( void *pos, flow_eEvent event, int x, int y, void *node); int event_handler( void *pos, flow_eEvent event, int x, int y, void *node);
void conpoint_select( void *pos, int x, int y, double *distance, void conpoint_select( void *pos, int x, int y, double *distance,
void **cp) {}; void **cp) {};
void print( void *pos, void *node); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int hot, void *node);
......
...@@ -29,7 +29,7 @@ void FlowArc::traverse( int x, int y) ...@@ -29,7 +29,7 @@ void FlowArc::traverse( int x, int y)
ur.traverse( x, y); ur.traverse( x, y);
} }
void FlowArc::print( void *pos, void *node) void FlowArc::print( void *pos, void *node, int highlight)
{ {
double idx = ctx->print_zoom_factor / ctx->base_zoom_factor * double idx = ctx->print_zoom_factor / ctx->base_zoom_factor *
line_width; line_width;
...@@ -38,7 +38,7 @@ void FlowArc::print( void *pos, void *node) ...@@ -38,7 +38,7 @@ void FlowArc::print( void *pos, void *node)
ctx->print_ps->arc( ll.print_z_x + ((FlowPoint *)pos)->print_z_x, ctx->print_ps->arc( ll.print_z_x + ((FlowPoint *)pos)->print_z_x,
ll.print_z_y + ((FlowPoint *)pos)->print_z_y, ll.print_z_y + ((FlowPoint *)pos)->print_z_y,
ur.print_z_x - ll.print_z_x, ur.print_z_y - ll.print_z_y, angel1, angel2, ur.print_z_x - ll.print_z_x, ur.print_z_y - ll.print_z_y, angel1, angel2,
draw_type, idx); draw_type, idx, highlight);
} }
void FlowArc::save( ofstream& fp, flow_eSaveMode mode) void FlowArc::save( ofstream& fp, flow_eSaveMode mode)
......
...@@ -26,7 +26,7 @@ class FlowArc : public FlowArrayElem { ...@@ -26,7 +26,7 @@ class FlowArc : public FlowArrayElem {
int event_handler( void *pos, flow_eEvent event, int x, int y, void *node); int event_handler( void *pos, flow_eEvent event, int x, int y, void *node);
void conpoint_select( void *pos, int x, int y, double *distance, void conpoint_select( void *pos, int x, int y, double *distance,
void **cp) {}; void **cp) {};
void print( void *pos, void *node); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int hot, void *node);
......
...@@ -571,13 +571,13 @@ void FlowArray::conpoint_select( void *pos, int x, int y, double *distance, ...@@ -571,13 +571,13 @@ void FlowArray::conpoint_select( void *pos, int x, int y, double *distance,
} }
} }
void FlowArray::print( void *pos, void *node) void FlowArray::print( void *pos, void *node, int highlight)
{ {
int i; int i;
for ( i = 0; i < a_size; i++) for ( i = 0; i < a_size; i++)
{ {
a[i]->print( pos, node); a[i]->print( pos, node, highlight);
} }
} }
......
...@@ -25,7 +25,7 @@ class FlowArray { ...@@ -25,7 +25,7 @@ class FlowArray {
void zoom(); void zoom();
void nav_zoom(); void nav_zoom();
void print_zoom(); void print_zoom();
void print( void *pos, void *node); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( void *ctx, ifstream& fp); void open( void *ctx, ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int hot, void *node);
......
...@@ -23,7 +23,7 @@ class FlowArrayElem { ...@@ -23,7 +23,7 @@ class FlowArrayElem {
virtual void print( double ll_x, double ll_y, double ur_x, double ur_y) {}; virtual void print( double ll_x, double ll_y, double ur_x, double ur_y) {};
virtual void save( ofstream& fp, flow_eSaveMode mode) {}; virtual void save( ofstream& fp, flow_eSaveMode mode) {};
virtual void open( ifstream& fp) {}; virtual void open( ifstream& fp) {};
virtual void print( void *pos, void *node) {}; virtual void print( void *pos, void *node, int highlight) {};
virtual void draw( int ll_x, int ll_y, int ur_x, int ur_y) {}; virtual void draw( int ll_x, int ll_y, int ur_x, int ur_y) {};
virtual void draw( void *pos, int highlight, int hot, void *node) {}; virtual void draw( void *pos, int highlight, int hot, void *node) {};
virtual void erase() {}; virtual void erase() {};
......
...@@ -90,7 +90,7 @@ void FlowArrow::traverse( int x, int y) ...@@ -90,7 +90,7 @@ void FlowArrow::traverse( int x, int y)
p2.traverse( x, y); p2.traverse( x, y);
} }
void FlowArrow::print( void *pos, void *node) void FlowArrow::print( void *pos, void *node, int highlight)
{ {
double idx = ctx->print_zoom_factor / ctx->base_zoom_factor * double idx = ctx->print_zoom_factor / ctx->base_zoom_factor *
line_width; line_width;
......
...@@ -20,7 +20,7 @@ class FlowArrow : public FlowArrayElem { ...@@ -20,7 +20,7 @@ class FlowArrow : public FlowArrayElem {
int event_handler( void *pos, flow_eEvent event, int x, int y, void *node); int event_handler( void *pos, flow_eEvent event, int x, int y, void *node);
void conpoint_select( void *pos, int x, int y, double *distance, void conpoint_select( void *pos, int x, int y, double *distance,
void **cp) {}; void **cp) {};
void print( void *pos, void *node); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int hightlight, int hot, void *node); void draw( void *pos, int hightlight, int hot, void *node);
......
...@@ -778,14 +778,14 @@ void FlowCon::print( double ll_x, double ll_y, double ur_x, double ur_y) ...@@ -778,14 +778,14 @@ void FlowCon::print( double ll_x, double ll_y, double ur_x, double ur_y)
y_low <= ur_y) y_low <= ur_y)
{ {
if ( temporary_ref || cc->con_type == flow_eConType_Reference) if ( temporary_ref || cc->con_type == flow_eConType_Reference)
ref_a.print( &cc->zero, NULL); ref_a.print( &cc->zero, NULL, highlight);
else else
{ {
for ( i = 0; i < l_num; i++) for ( i = 0; i < l_num; i++)
((FlowLine *)line_a[i])->print( &cc->zero, NULL); ((FlowLine *)line_a[i])->print( &cc->zero, NULL, highlight);
for ( i = 0; i < a_num; i++) for ( i = 0; i < a_num; i++)
((FlowArc *)arc_a[i])->print( &cc->zero, NULL); ((FlowArc *)arc_a[i])->print( &cc->zero, NULL, highlight);
arrow_a.print( &cc->zero, NULL); arrow_a.print( &cc->zero, NULL, highlight);
} }
} }
} }
......
...@@ -569,8 +569,11 @@ int FlowCtx::print_region( double ll_x, double ll_y, double ur_x, ...@@ -569,8 +569,11 @@ int FlowCtx::print_region( double ll_x, double ll_y, double ur_x,
int sts; int sts;
print_ps = new FlowPscript( filename, this, 0, &sts); print_ps = new FlowPscript( filename, this, 0, &sts);
if ( ODD(sts)) if ( ODD(sts)) {
if ( trace_started)
print_ps->set_showred(1);
print_ps->print_page( ll_x, ll_y, ur_x, ur_y); print_ps->print_page( ll_x, ll_y, ur_x, ur_y);
}
delete print_ps; delete print_ps;
return sts; return sts;
......
...@@ -108,7 +108,7 @@ void FlowImage::traverse( int x, int y) ...@@ -108,7 +108,7 @@ void FlowImage::traverse( int x, int y)
ur.traverse( x, y); ur.traverse( x, y);
} }
void FlowImage::print( void *pos, void *node) void FlowImage::print( void *pos, void *node, int highlight)
{ {
if ( !(display_level & ctx->display_level)) if ( !(display_level & ctx->display_level))
return; return;
...@@ -124,7 +124,7 @@ void FlowImage::print( void *pos, void *node) ...@@ -124,7 +124,7 @@ void FlowImage::print( void *pos, void *node)
ctx->print_ps->rect( ll.print_z_x + ((FlowPoint *)pos)->print_z_x, ctx->print_ps->rect( ll.print_z_x + ((FlowPoint *)pos)->print_z_x,
ll.print_z_y + ((FlowPoint *)pos)->print_z_y, ll.print_z_y + ((FlowPoint *)pos)->print_z_y,
ur.print_z_x - ll.print_z_x, ur.print_z_y - ll.print_z_y, ur.print_z_x - ll.print_z_x, ur.print_z_y - ll.print_z_y,
draw_type, idx); draw_type, idx, 0);
else else
ctx->print_ps->filled_rect( ll.print_z_x + ((FlowPoint *)pos)->print_z_x, ctx->print_ps->filled_rect( ll.print_z_x + ((FlowPoint *)pos)->print_z_x,
ll.print_z_y + ((FlowPoint *)pos)->print_z_y, ll.print_z_y + ((FlowPoint *)pos)->print_z_y,
......
...@@ -21,7 +21,7 @@ class FlowImage : public FlowArrayElem { ...@@ -21,7 +21,7 @@ class FlowImage : public FlowArrayElem {
int event_handler( void *pos, flow_eEvent event, int x, int y, void *node); int event_handler( void *pos, flow_eEvent event, int x, int y, void *node);
void conpoint_select( void *pos, int x, int y, double *distance, void conpoint_select( void *pos, int x, int y, double *distance,
void **cp) {}; void **cp) {};
void print( void *pos, void *node); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int hightlight, int hot, void *node); void draw( void *pos, int hightlight, int hot, void *node);
......
...@@ -28,7 +28,7 @@ void FlowLine::traverse( int x, int y) ...@@ -28,7 +28,7 @@ void FlowLine::traverse( int x, int y)
p2.traverse( x, y); p2.traverse( x, y);
} }
void FlowLine::print( void *pos, void *node) void FlowLine::print( void *pos, void *node, int highlight)
{ {
if ( p1.print_z_x == p2.print_z_x && p1.print_z_y == p2.print_z_y) if ( p1.print_z_x == p2.print_z_x && p1.print_z_y == p2.print_z_y)
return; return;
...@@ -40,7 +40,7 @@ void FlowLine::print( void *pos, void *node) ...@@ -40,7 +40,7 @@ void FlowLine::print( void *pos, void *node)
p1.print_z_y + ((FlowPoint *)pos)->print_z_y, p1.print_z_y + ((FlowPoint *)pos)->print_z_y,
p2.print_z_x + ((FlowPoint *)pos)->print_z_x, p2.print_z_x + ((FlowPoint *)pos)->print_z_x,
p2.print_z_y + ((FlowPoint *)pos)->print_z_y, p2.print_z_y + ((FlowPoint *)pos)->print_z_y,
draw_type, idx); draw_type, idx, highlight);
} }
void FlowLine::save( ofstream& fp, flow_eSaveMode mode) void FlowLine::save( ofstream& fp, flow_eSaveMode mode)
......
...@@ -25,7 +25,7 @@ class FlowLine : public FlowArrayElem { ...@@ -25,7 +25,7 @@ class FlowLine : public FlowArrayElem {
int event_handler( void *pos, flow_eEvent event, int x, int y, void *node); int event_handler( void *pos, flow_eEvent event, int x, int y, void *node);
void conpoint_select( void *pos, int x, int y, double *distance, void conpoint_select( void *pos, int x, int y, double *distance,
void **cp) {}; void **cp) {};
void print( void *pos, void *node); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int hot, void *node);
......
...@@ -213,7 +213,7 @@ void FlowNode::print( double ll_x, double ll_y, double ur_x, double ur_y) ...@@ -213,7 +213,7 @@ void FlowNode::print( double ll_x, double ll_y, double ur_x, double ur_y)
x_left <= ur_x && x_left <= ur_x &&
y_high >= ll_y && y_high >= ll_y &&
y_low <= ur_y) y_low <= ur_y)
nc->print( &pos, (void *)this); nc->print( &pos, (void *)this, highlight);
} }
void FlowNode::save( ofstream& fp, flow_eSaveMode mode) void FlowNode::save( ofstream& fp, flow_eSaveMode mode)
...@@ -395,13 +395,25 @@ void FlowNode::draw_inverse() ...@@ -395,13 +395,25 @@ void FlowNode::draw_inverse()
else else
x_r = x_right; x_r = x_right;
flow_draw_fill_rect( ctx,
if ( nc->group == flow_eNodeGroup_Document) {
flow_draw_fill_rect( ctx,
int( obst_x_left * ctx->zoom_factor - ctx->offset_x),
int( obst_y_low * ctx->zoom_factor - ctx->offset_y),
int( obst_x_right * ctx->zoom_factor - obst_x_left * ctx->zoom_factor),
int( obst_y_high * ctx->zoom_factor - obst_y_low * ctx->zoom_factor),
flow_eDrawType_Line);
nc->draw( &pos, highlight, hot, (void *)this);
}
else {
flow_draw_fill_rect( ctx,
int( x_left * ctx->zoom_factor - ctx->offset_x), int( x_left * ctx->zoom_factor - ctx->offset_x),
int( y_low * ctx->zoom_factor - ctx->offset_y), int( y_low * ctx->zoom_factor - ctx->offset_y),
int( x_r * ctx->zoom_factor - x_left * ctx->zoom_factor), int( x_r * ctx->zoom_factor - x_left * ctx->zoom_factor),
int( y_high * ctx->zoom_factor - y_low * ctx->zoom_factor), int( y_high * ctx->zoom_factor - y_low * ctx->zoom_factor),
flow_eDrawType_Line); flow_eDrawType_Line);
nc->draw_inverse( &pos, 0, (void *)this); nc->draw_inverse( &pos, 0, (void *)this);
}
} }
void FlowNode::erase() void FlowNode::erase()
...@@ -416,12 +428,22 @@ void FlowNode::erase() ...@@ -416,12 +428,22 @@ void FlowNode::erase()
else else
x_r = x_right; x_r = x_right;
flow_draw_fill_rect( ctx, if ( nc->group == flow_eNodeGroup_Document) {
flow_draw_fill_rect( ctx,
int( obst_x_left * ctx->zoom_factor - ctx->offset_x),
int( obst_y_low * ctx->zoom_factor - ctx->offset_y),
int( obst_x_right * ctx->zoom_factor - obst_x_left * ctx->zoom_factor),
int( obst_y_high * ctx->zoom_factor - obst_y_low * ctx->zoom_factor),
flow_eDrawType_LineErase);
}
else {
flow_draw_fill_rect( ctx,
int( x_left * ctx->zoom_factor - ctx->offset_x), int( x_left * ctx->zoom_factor - ctx->offset_x),
int( y_low * ctx->zoom_factor - ctx->offset_y), int( y_low * ctx->zoom_factor - ctx->offset_y),
int( x_r * ctx->zoom_factor - x_left * ctx->zoom_factor), int( x_r * ctx->zoom_factor - x_left * ctx->zoom_factor),
int( y_high * ctx->zoom_factor - y_low * ctx->zoom_factor), int( y_high * ctx->zoom_factor - y_low * ctx->zoom_factor),
flow_eDrawType_LineErase); flow_eDrawType_LineErase);
}
} }
} }
...@@ -498,13 +520,24 @@ void FlowNode::set_inverse( int on) ...@@ -498,13 +520,24 @@ void FlowNode::set_inverse( int on)
else else
x_r = x_right; x_r = x_right;
flow_draw_fill_rect( ctx, if ( nc->group == flow_eNodeGroup_Document) {
flow_draw_fill_rect( ctx,
int( obst_x_left * ctx->zoom_factor - ctx->offset_x),
int( obst_y_low * ctx->zoom_factor - ctx->offset_y),
int( obst_x_right * ctx->zoom_factor - obst_x_left * ctx->zoom_factor),
int( obst_y_high * ctx->zoom_factor - obst_y_low * ctx->zoom_factor),
flow_eDrawType_LineErase);
nc->draw( &pos, highlight, hot, (void *)this);
}
else {
flow_draw_fill_rect( ctx,
int( x_left * ctx->zoom_factor - ctx->offset_x), int( x_left * ctx->zoom_factor - ctx->offset_x),
int( y_low * ctx->zoom_factor - ctx->offset_y), int( y_low * ctx->zoom_factor - ctx->offset_y),
int( x_r * ctx->zoom_factor - x_left * ctx->zoom_factor), int( x_r * ctx->zoom_factor - x_left * ctx->zoom_factor),
int( y_high * ctx->zoom_factor - y_low * ctx->zoom_factor + 1), int( y_high * ctx->zoom_factor - y_low * ctx->zoom_factor + 1),
flow_eDrawType_LineErase); flow_eDrawType_LineErase);
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, hot, (void *)this);
}
} }
else else
{ {
......
...@@ -15,13 +15,13 @@ FlowNodeClass::FlowNodeClass( FlowCtx *flow_ctx, char *name, ...@@ -15,13 +15,13 @@ FlowNodeClass::FlowNodeClass( FlowCtx *flow_ctx, char *name,
strcpy( nc_name, name); strcpy( nc_name, name);
} }
void FlowNodeClass::print( FlowPoint *pos, void *node) void FlowNodeClass::print( FlowPoint *pos, void *node, int highlight)
{ {
int i; int i;
for ( i = 0; i < a.a_size; i++) for ( i = 0; i < a.a_size; i++)
{ {
a.a[i]->print( pos, node); a.a[i]->print( pos, node, highlight);
} }
} }
......
...@@ -24,7 +24,7 @@ class FlowNodeClass : public FlowArrayElem { ...@@ -24,7 +24,7 @@ class FlowNodeClass : public FlowArrayElem {
void get_obstacle_borders( double pos_x, double pos_y, double *x_right, void get_obstacle_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node); double *x_left, double *y_high, double *y_low, void *node);
int event_handler( void *pos, flow_eEvent event, int x, int y, void *node); int event_handler( void *pos, flow_eEvent event, int x, int y, void *node);
void print( FlowPoint *pos, void *node); void print( FlowPoint *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( FlowPoint *pos, int highlight, int hot, void *node); void draw( FlowPoint *pos, int highlight, int hot, void *node);
......
...@@ -46,7 +46,7 @@ void FlowPixmap::traverse( int x, int y) ...@@ -46,7 +46,7 @@ void FlowPixmap::traverse( int x, int y)
p.traverse( x, y); p.traverse( x, y);
} }
void FlowPixmap::print( void *pos, void *node) void FlowPixmap::print( void *pos, void *node, int highlight)
{ {
int idx = int( ctx->print_zoom_factor / ctx->base_zoom_factor * int idx = int( ctx->print_zoom_factor / ctx->base_zoom_factor *
(pixmap_size +4) - 4); (pixmap_size +4) - 4);
......
...@@ -23,7 +23,7 @@ class FlowPixmap : public FlowArrayElem { ...@@ -23,7 +23,7 @@ class FlowPixmap : public FlowArrayElem {
int event_handler( void *pos, flow_eEvent event, int x, int y, void *node); int event_handler( void *pos, flow_eEvent event, int x, int y, void *node);
void conpoint_select( void *pos, int x, int y, double *distance, void conpoint_select( void *pos, int x, int y, double *distance,
void **cp) {}; void **cp) {};
void print( void *pos, void *node); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int hot, void *node);
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#include "flow_ctx.h" #include "flow_ctx.h"
FlowPscript::FlowPscript( char *filename, void *flow_ctx, int page_border, FlowPscript::FlowPscript( char *filename, void *flow_ctx, int page_border,
int *sts) : int *sts) :
border(page_border), ctx(flow_ctx) border(page_border), ctx(flow_ctx), show_red(1)
{ {
strcpy( fname, filename); strcpy( fname, filename);
file = fopen( fname, "w"); file = fopen( fname, "w");
...@@ -100,7 +100,7 @@ int FlowPscript::print_page( double ll_x, double ll_y, double ur_x, double ur_y) ...@@ -100,7 +100,7 @@ int FlowPscript::print_page( double ll_x, double ll_y, double ur_x, double ur_y)
} }
int FlowPscript::rect( double x, double y, double width, double height, flow_eDrawType type, int FlowPscript::rect( double x, double y, double width, double height, flow_eDrawType type,
double idx) double idx, int highlight)
{ {
if ( type == flow_eDrawType_LineDashed) if ( type == flow_eDrawType_LineDashed)
{ {
...@@ -112,6 +112,10 @@ int FlowPscript::rect( double x, double y, double width, double height, flow_eDr ...@@ -112,6 +112,10 @@ int FlowPscript::rect( double x, double y, double width, double height, flow_eDr
fprintf( file, "gsave\n"); fprintf( file, "gsave\n");
fprintf( file, "0.5 setgray\n"); fprintf( file, "0.5 setgray\n");
} }
if ( highlight && show_red) {
fprintf( file, "gsave\n");
fprintf( file, "0 1 1 0 setcmykcolor\n");
}
setlinewidth( idx); setlinewidth( idx);
fprintf( file, "newpath\n"); fprintf( file, "newpath\n");
...@@ -125,6 +129,8 @@ int FlowPscript::rect( double x, double y, double width, double height, flow_eDr ...@@ -125,6 +129,8 @@ int FlowPscript::rect( double x, double y, double width, double height, flow_eDr
if ( type == flow_eDrawType_LineDashed || type == flow_eDrawType_LineGray) if ( type == flow_eDrawType_LineDashed || type == flow_eDrawType_LineGray)
fprintf( file, "grestore\n"); fprintf( file, "grestore\n");
if ( highlight && show_red)
fprintf( file, "grestore\n");
return 1; return 1;
} }
...@@ -155,7 +161,7 @@ int FlowPscript::filled_rect( double x, double y, double width, double height, f ...@@ -155,7 +161,7 @@ int FlowPscript::filled_rect( double x, double y, double width, double height, f
} }
int FlowPscript::arc( double x, double y, double width, double height, int angel1, int angel2, int FlowPscript::arc( double x, double y, double width, double height, int angel1, int angel2,
flow_eDrawType type, double idx) flow_eDrawType type, double idx, int highlight)
{ {
double r = 0.5*width; double r = 0.5*width;
double pi = 3.14159; double pi = 3.14159;
...@@ -170,6 +176,10 @@ int FlowPscript::arc( double x, double y, double width, double height, int angel ...@@ -170,6 +176,10 @@ int FlowPscript::arc( double x, double y, double width, double height, int angel
fprintf( file, "gsave\n"); fprintf( file, "gsave\n");
fprintf( file, "0.5 setgray\n"); fprintf( file, "0.5 setgray\n");
} }
if ( highlight && show_red) {
fprintf( file, "gsave\n");
fprintf( file, "0 1 1 0 setcmykcolor\n");
}
setlinewidth( idx); setlinewidth( idx);
fprintf( file, "newpath\n"); fprintf( file, "newpath\n");
...@@ -192,11 +202,13 @@ int FlowPscript::arc( double x, double y, double width, double height, int angel ...@@ -192,11 +202,13 @@ int FlowPscript::arc( double x, double y, double width, double height, int angel
if ( type == flow_eDrawType_LineDashed || type == flow_eDrawType_LineGray) if ( type == flow_eDrawType_LineDashed || type == flow_eDrawType_LineGray)
fprintf( file, "grestore\n"); fprintf( file, "grestore\n");
if ( highlight && show_red)
fprintf( file, "grestore\n");
return 1; return 1;
} }
int FlowPscript::line( double x1, double y1, double x2, double y2, flow_eDrawType type, int FlowPscript::line( double x1, double y1, double x2, double y2, flow_eDrawType type,
double idx) double idx, int highlight)
{ {
if ( type == flow_eDrawType_LineDashed) if ( type == flow_eDrawType_LineDashed)
{ {
...@@ -208,6 +220,10 @@ int FlowPscript::line( double x1, double y1, double x2, double y2, flow_eDrawTyp ...@@ -208,6 +220,10 @@ int FlowPscript::line( double x1, double y1, double x2, double y2, flow_eDrawTyp
fprintf( file, "gsave\n"); fprintf( file, "gsave\n");
fprintf( file, "0.5 setgray\n"); fprintf( file, "0.5 setgray\n");
} }
if ( highlight && show_red) {
fprintf( file, "gsave\n");
fprintf( file, "0 1 1 0 setcmykcolor\n");
}
setlinewidth( idx); setlinewidth( idx);
fprintf( file, "newpath\n"); fprintf( file, "newpath\n");
...@@ -219,6 +235,8 @@ int FlowPscript::line( double x1, double y1, double x2, double y2, flow_eDrawTyp ...@@ -219,6 +235,8 @@ int FlowPscript::line( double x1, double y1, double x2, double y2, flow_eDrawTyp
if ( type == flow_eDrawType_LineDashed || type == flow_eDrawType_LineGray) if ( type == flow_eDrawType_LineDashed || type == flow_eDrawType_LineGray)
fprintf( file, "grestore\n"); fprintf( file, "grestore\n");
if ( highlight && show_red)
fprintf( file, "grestore\n");
return 1; return 1;
} }
......
...@@ -9,11 +9,11 @@ class FlowPscript { ...@@ -9,11 +9,11 @@ class FlowPscript {
FlowPscript( char *filename, void *flow_ctx, int page_border, int *sts); FlowPscript( char *filename, void *flow_ctx, int page_border, int *sts);
~FlowPscript(); ~FlowPscript();
int print_page( double ll_x, double ll_y, double ur_x, double ur_y); int print_page( double ll_x, double ll_y, double ur_x, double ur_y);
int rect( double x, double y, double width, double height, flow_eDrawType type, double idx); int rect( double x, double y, double width, double height, flow_eDrawType type, double idx, int highlight);
int filled_rect( double x, double y, double width, double height, flow_eDrawType type, double idx); int filled_rect( double x, double y, double width, double height, flow_eDrawType type, double idx);
int arc( double x, double y, double width, double height, int angel1, int angel2, int arc( double x, double y, double width, double height, int angel1, int angel2,
flow_eDrawType type, double idx); flow_eDrawType type, double idx, int highlight);
int line( double x1, double y1, double x2, double y2, flow_eDrawType type, double idx); int line( double x1, double y1, double x2, double y2, flow_eDrawType type, double idx, int highlight);
int text( double x, double y, char *text, int len, flow_eDrawType type, int size); int text( double x, double y, char *text, int len, flow_eDrawType type, int size);
int pixmap( double x, double y, flow_sPixmapDataElem *data, flow_eDrawType type); int pixmap( double x, double y, flow_sPixmapDataElem *data, flow_eDrawType type);
int arrow( double x1, double y1, double x2, double y2, int arrow( double x1, double y1, double x2, double y2,
...@@ -21,12 +21,14 @@ class FlowPscript { ...@@ -21,12 +21,14 @@ class FlowPscript {
void move( double x, double y); void move( double x, double y);
void setlinewidth( double idx); void setlinewidth( double idx);
void rowbreak(); void rowbreak();
void set_showred( int show) { show_red = show;}
double offset_x; double offset_x;
double offset_y; double offset_y;
FILE *file; FILE *file;
char fname[80]; char fname[80];
int border; int border;
void *ctx; void *ctx;
int show_red;
}; };
#endif #endif
...@@ -31,7 +31,7 @@ void FlowRadiobutton::traverse( int x, int y) ...@@ -31,7 +31,7 @@ void FlowRadiobutton::traverse( int x, int y)
ur.traverse( x, y); ur.traverse( x, y);
} }
void FlowRadiobutton::print( void *pos, void *node) void FlowRadiobutton::print( void *pos, void *node, int highlight)
{ {
int ll_x, ll_y, ur_x, ur_y; int ll_x, ll_y, ur_x, ur_y;
int idx = 0; int idx = 0;
...@@ -42,30 +42,30 @@ void FlowRadiobutton::print( void *pos, void *node) ...@@ -42,30 +42,30 @@ void FlowRadiobutton::print( void *pos, void *node)
ur_x = int( ll_x + ur.print_z_x - ll.print_z_x); ur_x = int( ll_x + ur.print_z_x - ll.print_z_x);
ur_y = int( ll_y + ur.print_z_y - ll.print_z_y); ur_y = int( ll_y + ur.print_z_y - ll.print_z_y);
ctx->print_ps->rect( ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, ctx->print_ps->rect( ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
draw_type, idx); draw_type, idx, 0);
if ( ((FlowNode *)node)->rbuttonv[number]) if ( ((FlowNode *)node)->rbuttonv[number])
{ {
ctx->print_ps->line( ll_x + sc*1, ll_y + sc*1, ur_x - sc*1, ll_y + sc*1, ctx->print_ps->line( ll_x + sc*1, ll_y + sc*1, ur_x - sc*1, ll_y + sc*1,
flow_eDrawType_LineGray, idx); flow_eDrawType_LineGray, idx, 0);
ctx->print_ps->line( ll_x + sc*2, ll_y + sc*2, ur_x - sc*2, ll_y + sc*2, ctx->print_ps->line( ll_x + sc*2, ll_y + sc*2, ur_x - sc*2, ll_y + sc*2,
flow_eDrawType_LineGray, idx); flow_eDrawType_LineGray, idx, 0);
ctx->print_ps->line( ll_x + sc*1, ll_y + sc*1, ll_x + sc*1, ur_y - sc*1, ctx->print_ps->line( ll_x + sc*1, ll_y + sc*1, ll_x + sc*1, ur_y - sc*1,
flow_eDrawType_LineGray, idx); flow_eDrawType_LineGray, idx, 0);
ctx->print_ps->line( ll_x + sc*2, ll_y + sc*2, ll_x + sc*2, ur_y - sc*2, ctx->print_ps->line( ll_x + sc*2, ll_y + sc*2, ll_x + sc*2, ur_y - sc*2,
flow_eDrawType_LineGray, idx); flow_eDrawType_LineGray, idx, 0);
ctx->print_ps->filled_rect( ll_x + sc*3, ll_y + sc*3, ur_x - ll_x - sc*5, ctx->print_ps->filled_rect( ll_x + sc*3, ll_y + sc*3, ur_x - ll_x - sc*5,
ur_y - ll_y - sc*5, flow_eDrawType_Line, idx); ur_y - ll_y - sc*5, flow_eDrawType_Line, idx);
} }
else else
{ {
ctx->print_ps->line( ur_x - sc*1, ur_y - sc*1, ll_x + sc*1, ur_y - sc*1, ctx->print_ps->line( ur_x - sc*1, ur_y - sc*1, ll_x + sc*1, ur_y - sc*1,
flow_eDrawType_LineGray, idx); flow_eDrawType_LineGray, idx, 0);
ctx->print_ps->line( ur_x - sc*2, ur_y - sc*2, ll_x + sc*2, ur_y - sc*2, ctx->print_ps->line( ur_x - sc*2, ur_y - sc*2, ll_x + sc*2, ur_y - sc*2,
flow_eDrawType_LineGray, idx); flow_eDrawType_LineGray, idx, 0);
ctx->print_ps->line( ur_x - sc*1, ur_y - sc*1, ur_x - sc*1, ll_y + sc*1, ctx->print_ps->line( ur_x - sc*1, ur_y - sc*1, ur_x - sc*1, ll_y + sc*1,
flow_eDrawType_LineGray, idx); flow_eDrawType_LineGray, idx, 0);
ctx->print_ps->line( ur_x - sc*2, ur_y - sc*2, ur_x - sc*2, ll_y + sc*2, ctx->print_ps->line( ur_x - sc*2, ur_y - sc*2, ur_x - sc*2, ll_y + sc*2,
flow_eDrawType_LineGray, idx); flow_eDrawType_LineGray, idx, 0);
} }
} }
......
...@@ -25,7 +25,7 @@ class FlowRadiobutton : public FlowArrayElem { ...@@ -25,7 +25,7 @@ class FlowRadiobutton : public FlowArrayElem {
int event_handler( void *pos, flow_eEvent event, int x, int y, void *node); int event_handler( void *pos, flow_eEvent event, int x, int y, void *node);
void conpoint_select( void *pos, int x, int y, double *distance, void conpoint_select( void *pos, int x, int y, double *distance,
void **cp) {}; void **cp) {};
void print( void *pos, void *node); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int hightlight, int hot, void *node); void draw( void *pos, int hightlight, int hot, void *node);
......
...@@ -29,7 +29,7 @@ void FlowRect::traverse( int x, int y) ...@@ -29,7 +29,7 @@ void FlowRect::traverse( int x, int y)
ur.traverse( x, y); ur.traverse( x, y);
} }
void FlowRect::print( void *pos, void *node) void FlowRect::print( void *pos, void *node, int highlight)
{ {
if ( !(display_level & ctx->display_level)) if ( !(display_level & ctx->display_level))
return; return;
...@@ -40,11 +40,12 @@ void FlowRect::print( void *pos, void *node) ...@@ -40,11 +40,12 @@ void FlowRect::print( void *pos, void *node)
double idx = ctx->print_zoom_factor / ctx->base_zoom_factor * line_width; double idx = ctx->print_zoom_factor / ctx->base_zoom_factor * line_width;
idx = MAX( 0.5, idx); idx = MAX( 0.5, idx);
idx = MIN( idx, DRAW_TYPE_SIZE-1); idx = MIN( idx, DRAW_TYPE_SIZE-1);
if ( !fill) if ( !fill)
ctx->print_ps->rect( ll.print_z_x + ((FlowPoint *)pos)->print_z_x, ctx->print_ps->rect( ll.print_z_x + ((FlowPoint *)pos)->print_z_x,
ll.print_z_y + ((FlowPoint *)pos)->print_z_y, ll.print_z_y + ((FlowPoint *)pos)->print_z_y,
ur.print_z_x - ll.print_z_x, ur.print_z_y - ll.print_z_y, ur.print_z_x - ll.print_z_x, ur.print_z_y - ll.print_z_y,
draw_type, idx); draw_type, idx, highlight);
else else
ctx->print_ps->filled_rect( ll.print_z_x + ((FlowPoint *)pos)->print_z_x, ctx->print_ps->filled_rect( ll.print_z_x + ((FlowPoint *)pos)->print_z_x,
ll.print_z_y + ((FlowPoint *)pos)->print_z_y, ll.print_z_y + ((FlowPoint *)pos)->print_z_y,
......
...@@ -27,7 +27,7 @@ class FlowRect : public FlowArrayElem { ...@@ -27,7 +27,7 @@ class FlowRect : public FlowArrayElem {
int event_handler( void *pos, flow_eEvent event, int x, int y, void *node); int event_handler( void *pos, flow_eEvent event, int x, int y, void *node);
void conpoint_select( void *pos, int x, int y, double *distance, void conpoint_select( void *pos, int x, int y, double *distance,
void **cp) {}; void **cp) {};
void print( void *pos, void *node); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int hightlight, int hot, void *node); void draw( void *pos, int hightlight, int hot, void *node);
......
...@@ -25,7 +25,7 @@ void FlowText::traverse( int x, int y) ...@@ -25,7 +25,7 @@ void FlowText::traverse( int x, int y)
p.traverse( x, y); p.traverse( x, y);
} }
void FlowText::print( void *pos, void *node) void FlowText::print( void *pos, void *node, int highlight)
{ {
int idx = int( ctx->print_zoom_factor / ctx->base_zoom_factor * int idx = int( ctx->print_zoom_factor / ctx->base_zoom_factor *
(text_size +4) - 4); (text_size +4) - 4);
......
...@@ -22,7 +22,7 @@ class FlowText : public FlowArrayElem { ...@@ -22,7 +22,7 @@ class FlowText : public FlowArrayElem {
int event_handler( void *pos, flow_eEvent event, int x, int y, void *node); int event_handler( void *pos, flow_eEvent event, int x, int y, void *node);
void conpoint_select( void *pos, int x, int y, double *distance, void conpoint_select( void *pos, int x, int y, double *distance,
void **cp) {}; void **cp) {};
void print( void *pos, void *node); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int hot, void *node);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment