Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
a0e6d66a
Commit
a0e6d66a
authored
Sep 25, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print to pdf
parent
e5c03a7e
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
378 additions
and
57 deletions
+378
-57
xtt/lib/flow/src/flow_annot.cpp
xtt/lib/flow/src/flow_annot.cpp
+4
-4
xtt/lib/flow/src/flow_annotpixmap.cpp
xtt/lib/flow/src/flow_annotpixmap.cpp
+2
-2
xtt/lib/flow/src/flow_api.cpp
xtt/lib/flow/src/flow_api.cpp
+7
-1
xtt/lib/flow/src/flow_api.h
xtt/lib/flow/src/flow_api.h
+3
-1
xtt/lib/flow/src/flow_arc.cpp
xtt/lib/flow/src/flow_arc.cpp
+2
-2
xtt/lib/flow/src/flow_arrow.cpp
xtt/lib/flow/src/flow_arrow.cpp
+2
-2
xtt/lib/flow/src/flow_browctx.cpp
xtt/lib/flow/src/flow_browctx.cpp
+5
-5
xtt/lib/flow/src/flow_ctx.cpp
xtt/lib/flow/src/flow_ctx.cpp
+22
-6
xtt/lib/flow/src/flow_ctx.h
xtt/lib/flow/src/flow_ctx.h
+6
-3
xtt/lib/flow/src/flow_image.cpp
xtt/lib/flow/src/flow_image.cpp
+3
-3
xtt/lib/flow/src/flow_line.cpp
xtt/lib/flow/src/flow_line.cpp
+2
-2
xtt/lib/flow/src/flow_pdf.cpp
xtt/lib/flow/src/flow_pdf.cpp
+192
-0
xtt/lib/flow/src/flow_pdf.h
xtt/lib/flow/src/flow_pdf.h
+57
-0
xtt/lib/flow/src/flow_pixmap.cpp
xtt/lib/flow/src/flow_pixmap.cpp
+2
-2
xtt/lib/flow/src/flow_print.h
xtt/lib/flow/src/flow_print.h
+44
-0
xtt/lib/flow/src/flow_pscript.cpp
xtt/lib/flow/src/flow_pscript.cpp
+4
-4
xtt/lib/flow/src/flow_pscript.h
xtt/lib/flow/src/flow_pscript.h
+4
-3
xtt/lib/flow/src/flow_radiobutton.cpp
xtt/lib/flow/src/flow_radiobutton.cpp
+11
-11
xtt/lib/flow/src/flow_rect.cpp
xtt/lib/flow/src/flow_rect.cpp
+3
-3
xtt/lib/flow/src/flow_text.cpp
xtt/lib/flow/src/flow_text.cpp
+3
-3
No files found.
xtt/lib/flow/src/flow_annot.cpp
View file @
a0e6d66a
/*
* Proview $Id: flow_annot.cpp,v 1.
6 2007-01-04 07:53:34
claes Exp $
* Proview $Id: flow_annot.cpp,v 1.
7 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -73,7 +73,7 @@ void FlowAnnot::print( void *pos, void *node, int highlight)
}
else
x
=
p
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
;
ctx
->
print_ps
->
text
(
x
,
ctx
->
current_print
->
text
(
x
,
p
.
print_z_y
+
((
FlowPoint
*
)
pos
)
->
print_z_y
,
((
FlowNode
*
)
node
)
->
annotv
[
number
],
strlen
(((
FlowNode
*
)
node
)
->
annotv
[
number
]),
draw_type
,
size
);
...
...
@@ -94,7 +94,7 @@ void FlowAnnot::print( void *pos, void *node, int highlight)
if
(
*
s
==
10
)
{
if
(
len
)
ctx
->
print_ps
->
text
(
z_x
,
z_y
+
line_cnt
*
z_height
,
line
,
len
,
ctx
->
current_print
->
text
(
z_x
,
z_y
+
line_cnt
*
z_height
,
line
,
len
,
draw_type
,
size
);
len
=
0
;
line
=
s
+
1
;
...
...
@@ -104,7 +104,7 @@ void FlowAnnot::print( void *pos, void *node, int highlight)
len
++
;
}
if
(
len
)
ctx
->
print_ps
->
text
(
z_x
,
z_y
+
line_cnt
*
z_height
,
line
,
ctx
->
current_print
->
text
(
z_x
,
z_y
+
line_cnt
*
z_height
,
line
,
len
,
draw_type
,
size
);
break
;
}
...
...
xtt/lib/flow/src/flow_annotpixmap.cpp
View file @
a0e6d66a
/*
* Proview $Id: flow_annotpixmap.cpp,v 1.
5 2007-01-04 07:53:34
claes Exp $
* Proview $Id: flow_annotpixmap.cpp,v 1.
6 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -82,7 +82,7 @@ void FlowAnnotPixmap::print( void *pos, void *node, int highlight)
}
else
x
=
p
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
;
ctx
->
print_ps
->
pixmap
(
x
,
ctx
->
current_print
->
pixmap
(
x
,
p
.
print_z_y
+
((
FlowPoint
*
)
pos
)
->
print_z_y
,
&
((
FlowNode
*
)
node
)
->
annotpixmapv
[
number
]
->
pixmap_data
[
pixmap_size
],
draw_type
);
...
...
xtt/lib/flow/src/flow_api.cpp
View file @
a0e6d66a
/*
* Proview $Id: flow_api.cpp,v 1.1
0 2007-07-18 09:26:43
claes Exp $
* Proview $Id: flow_api.cpp,v 1.1
1 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -432,6 +432,12 @@ int flow_PrintRegion( flow_tCtx ctx, double ll_x, double ll_y,
return
ctx
->
print_region
(
ll_x
,
ll_y
,
ur_x
,
ur_y
,
filename
);
}
int
flow_PrintPdfRegion
(
flow_tCtx
ctx
,
double
ll_x
,
double
ll_y
,
double
ur_x
,
double
ur_y
,
char
*
filename
)
{
return
ctx
->
print_pdf_region
(
ll_x
,
ll_y
,
ur_x
,
ur_y
,
filename
);
}
void
flow_GetUserData
(
flow_tObject
object
,
void
**
user_data
)
{
((
FlowArrayElem
*
)
object
)
->
get_user_data
(
user_data
);
...
...
xtt/lib/flow/src/flow_api.h
View file @
a0e6d66a
/*
* Proview $Id: flow_api.h,v 1.1
0 2007-07-18 09:26:43
claes Exp $
* Proview $Id: flow_api.h,v 1.1
1 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -183,6 +183,8 @@ void flow_MeasureNode( flow_tNode node, double *ll_x, double *ll_y,
double
*
ur_x
,
double
*
ur_y
);
int
flow_PrintRegion
(
flow_tCtx
ctx
,
double
ll_x
,
double
ll_y
,
double
ur_x
,
double
ur_y
,
char
*
filename
);
int
flow_PrintPdfRegion
(
flow_tCtx
ctx
,
double
ll_x
,
double
ll_y
,
double
ur_x
,
double
ur_y
,
char
*
filename
);
void
flow_GetUserData
(
flow_tObject
object
,
void
**
user_data
);
void
flow_SetUserData
(
flow_tObject
object
,
void
*
user_data
);
void
flow_GetCtxUserData
(
flow_tCtx
ctx
,
void
**
user_data
);
...
...
xtt/lib/flow/src/flow_arc.cpp
View file @
a0e6d66a
/*
* Proview $Id: flow_arc.cpp,v 1.
6 2007-01-04 07:53:34
claes Exp $
* Proview $Id: flow_arc.cpp,v 1.
7 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -54,7 +54,7 @@ void FlowArc::print( void *pos, void *node, int highlight)
line_width
;
idx
=
MAX
(
0.5
,
idx
);
idx
=
MIN
(
idx
,
DRAW_TYPE_SIZE
-
1
);
ctx
->
print_ps
->
arc
(
ll
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
ctx
->
current_print
->
arc
(
ll
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
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
,
draw_type
,
idx
,
highlight
);
...
...
xtt/lib/flow/src/flow_arrow.cpp
View file @
a0e6d66a
/*
* Proview $Id: flow_arrow.cpp,v 1.
6 2007-01-04 07:53:34
claes Exp $
* Proview $Id: flow_arrow.cpp,v 1.
7 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -115,7 +115,7 @@ void FlowArrow::print( void *pos, void *node, int highlight)
line_width
;
idx
=
MAX
(
0.5
,
idx
);
idx
=
MIN
(
idx
,
DRAW_TYPE_SIZE
-
1
);
ctx
->
print_ps
->
arrow
(
ctx
->
current_print
->
arrow
(
p_dest
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
p_dest
.
print_z_y
+
((
FlowPoint
*
)
pos
)
->
print_z_y
,
p1
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
...
...
xtt/lib/flow/src/flow_browctx.cpp
View file @
a0e6d66a
/*
* Proview $Id: flow_browctx.cpp,v 1.
6 2007-01-04 07:53:34
claes Exp $
* Proview $Id: flow_browctx.cpp,v 1.
7 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -178,10 +178,10 @@ int BrowCtx::print( char *filename)
width
=
height
/
0.70
;
}
print_ps
=
new
FlowPscript
(
filename
,
this
,
1
,
&
sts
);
current_print
=
new
FlowPscript
(
filename
,
this
,
1
,
&
sts
);
if
(
EVEN
(
sts
))
{
delete
print_ps
;
delete
current_print
;
return
0
;
}
...
...
@@ -194,9 +194,9 @@ int BrowCtx::print( char *filename)
if
(
ll_y
>
y_high
)
break
;
print_ps
->
print_page
(
ll_x
,
ll_y
,
ur_x
,
ur_y
);
current_print
->
print_page
(
ll_x
,
ll_y
,
ur_x
,
ur_y
);
}
delete
print_ps
;
delete
current_print
;
return
1
;
}
...
...
xtt/lib/flow/src/flow_ctx.cpp
View file @
a0e6d66a
/*
* Proview $Id: flow_ctx.cpp,v 1.1
1 2007-07-18 09:26:43
claes Exp $
* Proview $Id: flow_ctx.cpp,v 1.1
2 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -592,17 +592,33 @@ void FlowCtx::print_zoom()
}
int
FlowCtx
::
print_region
(
double
ll_x
,
double
ll_y
,
double
ur_x
,
double
ur_y
,
char
*
filename
)
double
ur_y
,
char
*
filename
)
{
int
sts
;
print_ps
=
new
FlowPscript
(
filename
,
this
,
0
,
&
sts
);
current_print
=
new
FlowPscript
(
filename
,
this
,
0
,
&
sts
);
if
(
ODD
(
sts
))
{
if
(
trace_started
)
print_ps
->
set_showred
(
1
);
print_ps
->
print_page
(
ll_x
,
ll_y
,
ur_x
,
ur_y
);
current_print
->
set_showred
(
1
);
current_print
->
print_page
(
ll_x
,
ll_y
,
ur_x
,
ur_y
);
}
delete
print_ps
;
delete
current_print
;
return
sts
;
}
int
FlowCtx
::
print_pdf_region
(
double
ll_x
,
double
ll_y
,
double
ur_x
,
double
ur_y
,
char
*
filename
)
{
int
sts
;
current_print
=
new
FlowPdf
(
filename
,
this
,
0
,
&
sts
);
if
(
ODD
(
sts
))
{
if
(
trace_started
)
current_print
->
set_showred
(
1
);
current_print
->
print_page
(
ll_x
,
ll_y
,
ur_x
,
ur_y
);
}
delete
current_print
;
return
sts
;
}
...
...
xtt/lib/flow/src/flow_ctx.h
View file @
a0e6d66a
/*
* Proview $Id: flow_ctx.h,v 1.
7 2007-07-18 09:26:43
claes Exp $
* Proview $Id: flow_ctx.h,v 1.
8 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -24,6 +24,7 @@
#include "flow.h"
#include "flow_pscript.h"
#include "flow_pdf.h"
#include "flow_array.h"
class
FlowDraw
;
...
...
@@ -250,9 +251,11 @@ class FlowCtx {
double
grid_size_x
;
double
grid_size_y
;
int
grid_on
;
FlowP
script
*
print_ps
;
FlowP
rint
*
current_print
;
int
print_region
(
double
ll_x
,
double
ll_y
,
double
ur_x
,
double
ur_y
,
char
*
filename
);
double
ur_y
,
char
*
filename
);
int
print_pdf_region
(
double
ll_x
,
double
ll_y
,
double
ur_x
,
double
ur_y
,
char
*
filename
);
double
draw_delta
;
double
grafcet_con_delta
;
int
refcon_cnt
;
...
...
xtt/lib/flow/src/flow_image.cpp
View file @
a0e6d66a
/*
* Proview $Id: flow_image.cpp,v 1.
8 2007-02-05 09:42:57
claes Exp $
* Proview $Id: flow_image.cpp,v 1.
9 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -96,12 +96,12 @@ void FlowImage::print( void *pos, void *node, int highlight)
idx
=
MAX
(
0
,
idx
);
idx
=
MIN
(
idx
,
DRAW_TYPE_SIZE
-
1
);
if
(
!
fill
)
ctx
->
print_ps
->
rect
(
ll
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
ctx
->
current_print
->
rect
(
ll
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
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
,
draw_type
,
idx
,
0
);
else
ctx
->
print_ps
->
filled_rect
(
ll
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
ctx
->
current_print
->
filled_rect
(
ll
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
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
,
draw_type
,
idx
);
...
...
xtt/lib/flow/src/flow_line.cpp
View file @
a0e6d66a
/*
* Proview $Id: flow_line.cpp,v 1.
6 2007-01-04 07:53:35
claes Exp $
* Proview $Id: flow_line.cpp,v 1.
7 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -55,7 +55,7 @@ void FlowLine::print( void *pos, void *node, int highlight)
line_width
;
idx
=
MAX
(
0
,
idx
);
idx
=
MIN
(
idx
,
DRAW_TYPE_SIZE
-
1
);
ctx
->
print_ps
->
line
(
p1
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
ctx
->
current_print
->
line
(
p1
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
p1
.
print_z_y
+
((
FlowPoint
*
)
pos
)
->
print_z_y
,
p2
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
p2
.
print_z_y
+
((
FlowPoint
*
)
pos
)
->
print_z_y
,
...
...
xtt/lib/flow/src/flow_pdf.cpp
0 → 100644
View file @
a0e6d66a
/*
* Proview $Id: flow_pdf.cpp,v 1.1 2007-09-25 13:11:00 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#include "flow_std.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <float.h>
#include "flow_ctx.h"
#include "flow_pdf.h"
#include "cnv_topdf.h"
FlowPdf
::
FlowPdf
(
char
*
filename
,
void
*
flow_ctx
,
int
page_border
,
int
*
sts
)
:
border
(
page_border
),
ctx
(
flow_ctx
),
show_red
(
1
),
topdf
(
0
)
{
topdf
=
new
CnvToPdf
();
topdf
->
set_filename
(
pdf_eFile_Body
,
filename
);
topdf
->
set_useoutlines
(
0
);
*
sts
=
1
;
}
FlowPdf
::~
FlowPdf
()
{
if
(
topdf
)
{
topdf
->
close
();
delete
topdf
;
}
}
int
FlowPdf
::
print_page
(
double
ll_x
,
double
ll_y
,
double
ur_x
,
double
ur_y
)
{
FlowCtx
*
cx
=
(
FlowCtx
*
)
ctx
;
if
(
ur_x
-
ll_x
>
ur_y
-
ll_y
)
cx
->
print_zoom_factor
=
730
/
(
ur_x
-
ll_x
);
else
cx
->
print_zoom_factor
=
730
/
(
ur_y
-
ll_y
);
cx
->
print_zoom
();
offset_x
=
ll_x
*
cx
->
print_zoom_factor
;
offset_y
=
ur_y
*
cx
->
print_zoom_factor
;
#if 0
if ( ur_x - ll_x > ur_y - ll_y)
{
/* Landscape orientation */
fprintf( file, "%f %f translate\n", (ur_y - ll_y) *
cx->print_zoom_factor + 40, 20.0);
fprintf( file, "90 rotate\n");
}
else
fprintf( file, "%f %f translate\n", 40.0, 20.0);
/* Clip the region */
fprintf( file, "newpath\n");
fprintf( file, "%f %f moveto\n", ll_x * cx->print_zoom_factor - offset_x,
offset_y - ll_y * cx->print_zoom_factor);
fprintf( file, "%f %f lineto\n", ll_x * cx->print_zoom_factor - offset_x,
offset_y - ur_y * cx->print_zoom_factor);
fprintf( file, "%f %f lineto\n", ur_x * cx->print_zoom_factor - offset_x,
offset_y - ur_y * cx->print_zoom_factor);
fprintf( file, "%f %f lineto\n", ur_x * cx->print_zoom_factor - offset_x,
offset_y - ll_y * cx->print_zoom_factor);
fprintf( file, "%f %f lineto\n", ll_x * cx->print_zoom_factor - offset_x,
offset_y - ll_y * cx->print_zoom_factor);
fprintf( file, "closepath\n");
fprintf( file, "clip\n");
#endif
((
FlowCtx
*
)
ctx
)
->
current_print
=
this
;
topdf
->
set_confpass
(
true
);
topdf
->
open
();
((
FlowCtx
*
)
ctx
)
->
print
(
ll_x
,
ll_y
,
ur_x
,
ur_y
);
//topdf->print_pagebreak(0);
topdf
->
set_confpass
(
false
);
topdf
->
open
();
((
FlowCtx
*
)
ctx
)
->
print
(
ll_x
,
ll_y
,
ur_x
,
ur_y
);
//topdf->print_pagebreak(0);
return
1
;
}
int
FlowPdf
::
rect
(
double
x
,
double
y
,
double
width
,
double
height
,
flow_eDrawType
type
,
double
idx
,
int
highlight
)
{
topdf
->
draw_rect
(
idx
,
x
-
offset_x
,
offset_y
-
y
-
height
,
width
,
height
);
return
1
;
}
int
FlowPdf
::
filled_rect
(
double
x
,
double
y
,
double
width
,
double
height
,
flow_eDrawType
type
,
double
idx
)
{
return
1
;
}
int
FlowPdf
::
arc
(
double
x
,
double
y
,
double
width
,
double
height
,
int
angel1
,
int
angel2
,
flow_eDrawType
type
,
double
idx
,
int
highlight
)
{
topdf
->
draw_arc
(
idx
,
x
-
offset_x
,
offset_y
-
y
-
height
,
width
,
height
,
angel1
,
angel2
);
return
1
;
}
int
FlowPdf
::
text
(
double
x
,
double
y
,
char
*
text
,
int
len
,
flow_eDrawType
type
,
double
size
)
{
char
t
[
500
];
int
tlen
=
len
<
int
(
sizeof
(
t
)
-
1
)
?
len
:
sizeof
(
t
)
-
1
;
strncpy
(
t
,
text
,
tlen
);
t
[
tlen
]
=
0
;
int
bold
=
(
type
==
flow_eDrawType_TextHelveticaBold
);
topdf
->
draw_text
(
x
-
offset_x
,
offset_y
-
y
,
t
,
bold
,
0.87
*
size
);
return
1
;
}
int
FlowPdf
::
pixmap
(
double
x
,
double
y
,
flow_sPixmapDataElem
*
data
,
flow_eDrawType
type
)
{
return
1
;
}
int
FlowPdf
::
line
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
flow_eDrawType
type
,
double
idx
,
int
hightlight
)
{
topdf
->
draw_line
(
idx
,
x1
-
offset_x
,
offset_y
-
y1
,
x2
-
offset_x
,
offset_y
-
y2
,
type
==
flow_eDrawType_LineDashed
,
type
==
flow_eDrawType_LineGray
);
return
1
;
}
int
FlowPdf
::
arrow
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
double
x3
,
double
y3
,
flow_eDrawType
type
,
double
idx
)
{
topdf
->
draw_arrow
(
x1
-
offset_x
,
offset_y
-
y1
,
x2
-
offset_x
,
offset_y
-
y2
,
x3
-
offset_x
,
offset_y
-
y3
,
type
==
flow_eDrawType_LineGray
);
#if 0
if ( type == flow_eDrawType_LineGray)
{
fprintf( file, "gsave\n");
fprintf( file, "0.5 setgray\n");
}
setlinewidth( idx);
fprintf( file, "newpath\n");
fprintf( file, "%f %f moveto\n", x1-offset_x, offset_y-y1);
fprintf( file, "%f %f lineto\n", x2-offset_x, offset_y-y2);
fprintf( file, "%f %f lineto\n", x3-offset_x, offset_y-y3);
fprintf( file, "%f %f lineto\n", x1-offset_x, offset_y-y1);
fprintf( file, "closepath\n");
fprintf( file, "fill\n");
if ( type == flow_eDrawType_LineGray)
fprintf( file, "grestore\n");
#endif
return
1
;
}
void
FlowPdf
::
move
(
double
x
,
double
y
)
{
fprintf
(
file
,
"%f %f moveto"
,
x
,
y
);
}
void
FlowPdf
::
setlinewidth
(
double
idx
)
{
fprintf
(
file
,
"%f setlinewidth
\n
"
,
idx
);
}
xtt/lib/flow/src/flow_pdf.h
0 → 100644
View file @
a0e6d66a
/*
* Proview $Id: flow_pdf.h,v 1.1 2007-09-25 13:11:00 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef flow_pdf_h
#define flow_pdf_h
#include <stdio.h>
#include "flow.h"
#include "flow_print.h"
class
CnvToPdf
;
class
FlowPdf
:
public
FlowPrint
{
public:
FlowPdf
(
char
*
filename
,
void
*
flow_ctx
,
int
page_border
,
int
*
sts
);
~
FlowPdf
();
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
highlight
);
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
,
flow_eDrawType
type
,
double
idx
,
int
highlight
);
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
,
double
size
);
int
pixmap
(
double
x
,
double
y
,
flow_sPixmapDataElem
*
data
,
flow_eDrawType
type
);
int
arrow
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
double
x3
,
double
y3
,
flow_eDrawType
type
,
double
idx
);
void
move
(
double
x
,
double
y
);
void
setlinewidth
(
double
idx
);
void
rowbreak
();
void
set_showred
(
int
show
)
{
show_red
=
show
;}
double
offset_x
;
double
offset_y
;
FILE
*
file
;
char
fname
[
80
];
int
border
;
void
*
ctx
;
int
show_red
;
CnvToPdf
*
topdf
;
};
#endif
xtt/lib/flow/src/flow_pixmap.cpp
View file @
a0e6d66a
/*
* Proview $Id: flow_pixmap.cpp,v 1.
5 2007-01-04 07:53:35
claes Exp $
* Proview $Id: flow_pixmap.cpp,v 1.
6 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -75,7 +75,7 @@ void FlowPixmap::print( void *pos, void *node, int highlight)
return
;
idx
=
MIN
(
idx
,
DRAW_TYPE_SIZE
-
1
);
ctx
->
print_ps
->
pixmap
(
p
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
ctx
->
current_print
->
pixmap
(
p
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
p
.
print_z_y
+
((
FlowPoint
*
)
pos
)
->
print_z_y
,
&
pixmap_data
[
pixmap_size
],
draw_type
);
...
...
xtt/lib/flow/src/flow_print.h
0 → 100644
View file @
a0e6d66a
/*
* Proview $Id: flow_print.h,v 1.1 2007-09-25 13:11:00 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef flow_print_h
#define flow_print_h
#include <stdio.h>
#include "flow.h"
class
FlowPrint
{
public:
FlowPrint
()
{};
FlowPrint
(
char
*
filename
,
void
*
flow_ctx
,
int
page_border
,
int
*
sts
)
{}
virtual
~
FlowPrint
()
{}
virtual
int
print_page
(
double
ll_x
,
double
ll_y
,
double
ur_x
,
double
ur_y
)
{
return
1
;}
virtual
int
rect
(
double
x
,
double
y
,
double
width
,
double
height
,
flow_eDrawType
type
,
double
idx
,
int
highlight
)
{
return
1
;}
virtual
int
filled_rect
(
double
x
,
double
y
,
double
width
,
double
height
,
flow_eDrawType
type
,
double
idx
)
{
return
1
;}
virtual
int
arc
(
double
x
,
double
y
,
double
width
,
double
height
,
int
angel1
,
int
angel2
,
flow_eDrawType
type
,
double
idx
,
int
highlight
)
{
return
1
;}
virtual
int
line
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
flow_eDrawType
type
,
double
idx
,
int
highlight
)
{
return
1
;}
virtual
int
text
(
double
x
,
double
y
,
char
*
text
,
int
len
,
flow_eDrawType
type
,
double
size
)
{
return
1
;}
virtual
int
pixmap
(
double
x
,
double
y
,
flow_sPixmapDataElem
*
data
,
flow_eDrawType
type
)
{
return
1
;}
virtual
int
arrow
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
double
x3
,
double
y3
,
flow_eDrawType
type
,
double
idx
)
{
return
1
;}
virtual
void
set_showred
(
int
show
)
{}
};
#endif
xtt/lib/flow/src/flow_pscript.cpp
View file @
a0e6d66a
/*
* Proview $Id: flow_pscript.cpp,v 1.
5 2007-01-24 12:35:54
claes Exp $
* Proview $Id: flow_pscript.cpp,v 1.
6 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -111,7 +111,7 @@ int FlowPscript::print_page( double ll_x, double ll_y, double ur_x, double ur_y)
fprintf
(
file
,
"stroke
\n
"
);
fprintf
(
file
,
"newpath
\n
"
);
((
FlowCtx
*
)
ctx
)
->
print_ps
=
this
;
((
FlowCtx
*
)
ctx
)
->
current_print
=
this
;
((
FlowCtx
*
)
ctx
)
->
print
(
ll_x
,
ll_y
,
ur_x
,
ur_y
);
fprintf
(
file
,
"showpage
\n\n
"
);
...
...
@@ -261,7 +261,7 @@ int FlowPscript::line( double x1, double y1, double x2, double y2, flow_eDrawTyp
}
int
FlowPscript
::
text
(
double
x
,
double
y
,
char
*
text
,
int
len
,
flow_eDrawType
type
,
int
size
)
double
size
)
{
char
font
[
40
];
char
c
;
...
...
@@ -280,7 +280,7 @@ int FlowPscript::text( double x, double y, char *text, int len, flow_eDrawType t
}
fprintf
(
file
,
"/%s findfont
\n
"
,
font
);
fprintf
(
file
,
"%d scalefont
\n
"
,
size
);
fprintf
(
file
,
"%d scalefont
\n
"
,
(
int
)
size
);
fprintf
(
file
,
"setfont
\n
"
);
fprintf
(
file
,
"newpath
\n
"
);
fprintf
(
file
,
"%f %f moveto
\n
"
,
x
-
offset_x
,
offset_y
-
y
);
...
...
xtt/lib/flow/src/flow_pscript.h
View file @
a0e6d66a
/*
* Proview $Id: flow_pscript.h,v 1.
4 2005-09-01 14:56:12
claes Exp $
* Proview $Id: flow_pscript.h,v 1.
5 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -22,8 +22,9 @@
#include <stdio.h>
#include "flow.h"
#include "flow_print.h"
class
FlowPscript
{
class
FlowPscript
:
public
FlowPrint
{
public:
FlowPscript
(
char
*
filename
,
void
*
flow_ctx
,
int
page_border
,
int
*
sts
);
~
FlowPscript
();
...
...
@@ -33,7 +34,7 @@ class FlowPscript {
int
arc
(
double
x
,
double
y
,
double
width
,
double
height
,
int
angel1
,
int
angel2
,
flow_eDrawType
type
,
double
idx
,
int
highlight
);
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
,
double
size
);
int
pixmap
(
double
x
,
double
y
,
flow_sPixmapDataElem
*
data
,
flow_eDrawType
type
);
int
arrow
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
double
x3
,
double
y3
,
flow_eDrawType
type
,
double
idx
);
...
...
xtt/lib/flow/src/flow_radiobutton.cpp
View file @
a0e6d66a
/*
* Proview $Id: flow_radiobutton.cpp,v 1.
4 2007-01-04 07:53:35
claes Exp $
* Proview $Id: flow_radiobutton.cpp,v 1.
5 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -60,30 +60,30 @@ void FlowRadiobutton::print( void *pos, void *node, int highlight)
ll_y
=
int
(
ll
.
print_z_y
+
((
FlowPoint
*
)
pos
)
->
print_z_y
);
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
);
ctx
->
print_ps
->
rect
(
ll_x
,
ll_y
,
ur_x
-
ll_x
,
ur_y
-
ll_y
,
ctx
->
current_print
->
rect
(
ll_x
,
ll_y
,
ur_x
-
ll_x
,
ur_y
-
ll_y
,
draw_type
,
idx
,
0
);
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
->
current_print
->
line
(
ll_x
+
sc
*
1
,
ll_y
+
sc
*
1
,
ur_x
-
sc
*
1
,
ll_y
+
sc
*
1
,
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
->
current_print
->
line
(
ll_x
+
sc
*
2
,
ll_y
+
sc
*
2
,
ur_x
-
sc
*
2
,
ll_y
+
sc
*
2
,
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
->
current_print
->
line
(
ll_x
+
sc
*
1
,
ll_y
+
sc
*
1
,
ll_x
+
sc
*
1
,
ur_y
-
sc
*
1
,
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
->
current_print
->
line
(
ll_x
+
sc
*
2
,
ll_y
+
sc
*
2
,
ll_x
+
sc
*
2
,
ur_y
-
sc
*
2
,
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
->
current_print
->
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
);
}
else
{
ctx
->
print_ps
->
line
(
ur_x
-
sc
*
1
,
ur_y
-
sc
*
1
,
ll_x
+
sc
*
1
,
ur_y
-
sc
*
1
,
ctx
->
current_print
->
line
(
ur_x
-
sc
*
1
,
ur_y
-
sc
*
1
,
ll_x
+
sc
*
1
,
ur_y
-
sc
*
1
,
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
->
current_print
->
line
(
ur_x
-
sc
*
2
,
ur_y
-
sc
*
2
,
ll_x
+
sc
*
2
,
ur_y
-
sc
*
2
,
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
->
current_print
->
line
(
ur_x
-
sc
*
1
,
ur_y
-
sc
*
1
,
ur_x
-
sc
*
1
,
ll_y
+
sc
*
1
,
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
->
current_print
->
line
(
ur_x
-
sc
*
2
,
ur_y
-
sc
*
2
,
ur_x
-
sc
*
2
,
ll_y
+
sc
*
2
,
flow_eDrawType_LineGray
,
idx
,
0
);
}
}
...
...
xtt/lib/flow/src/flow_rect.cpp
View file @
a0e6d66a
/*
* Proview $Id: flow_rect.cpp,v 1.
7 2007-05-11 15:07:21
claes Exp $
* Proview $Id: flow_rect.cpp,v 1.
8 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -62,12 +62,12 @@ void FlowRect::print( void *pos, void *node, int highlight)
idx
=
MIN
(
idx
,
DRAW_TYPE_SIZE
-
1
);
if
(
!
fill
)
ctx
->
print_ps
->
rect
(
ll
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
ctx
->
current_print
->
rect
(
ll
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
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
,
draw_type
,
idx
,
highlight
);
else
ctx
->
print_ps
->
filled_rect
(
ll
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
ctx
->
current_print
->
filled_rect
(
ll
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
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
,
draw_type
,
idx
);
...
...
xtt/lib/flow/src/flow_text.cpp
View file @
a0e6d66a
/*
* Proview $Id: flow_text.cpp,v 1.
5 2007-01-04 07:53:35
claes Exp $
* Proview $Id: flow_text.cpp,v 1.
6 2007-09-25 13:11:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -48,12 +48,12 @@ void FlowText::print( void *pos, void *node, int highlight)
{
int
idx
=
int
(
ctx
->
print_zoom_factor
/
ctx
->
base_zoom_factor
*
(
text_size
+
4
)
-
4
);
int
size
=
int
(
8.0
+
6.0
/
3
*
idx
)
;
double
size
=
8.0
+
6.0
/
3
*
idx
;
if
(
size
<=
0
)
return
;
idx
=
MIN
(
idx
,
DRAW_TYPE_SIZE
-
1
);
ctx
->
print_ps
->
text
(
p
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
ctx
->
current_print
->
text
(
p
.
print_z_x
+
((
FlowPoint
*
)
pos
)
->
print_z_x
,
p
.
print_z_y
+
((
FlowPoint
*
)
pos
)
->
print_z_y
,
text
,
strlen
(
text
),
draw_type
,
size
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment