1062 uint baseMaxX, baseMaxLabelWidth, superMaxX, superMaxLabelWidth;
1063 base->computeExtremes(&baseMaxLabelWidth,&baseMaxX);
1066 uint rows=baseRows+superRows-1;
1070 uint estHeight = rows*40;
1071 uint estWidth = cols*(20+
QMAX(baseMaxLabelWidth,superMaxLabelWidth));
1074 const float pageWidth = 14.0f;
1079 float realHeight =
QMIN(rows,12);
1080 float realWidth = realHeight * estWidth/(
float)estHeight;
1081 if (realWidth>pageWidth)
1083 realHeight*=pageWidth/realWidth;
1084 realWidth=pageWidth;
1088 output <<
"\\begin{figure}[H]\n" 1091 output <<
"\\includegraphics[height=" << realHeight <<
"cm]{" 1093 output <<
"\\end{center}\n" 1099 QCString epsName=epsBaseName+
".eps";
1104 err(
"Could not open file %s for writing\n",f1.
name().
data());
1113 t <<
"%!PS-Adobe-2.0 EPSF-2.0\n";
1114 t <<
"%%Title: ClassName\n";
1115 t <<
"%%Creator: Doxygen\n";
1116 t <<
"%%CreationDate: Time\n";
1118 t <<
"%Magnification: 1.00\n";
1119 t <<
"%%Orientation: Portrait\n";
1120 t <<
"%%BoundingBox: 0 0 500 " << estHeight*500.0/(
float)estWidth <<
"\n";
1121 t <<
"%%Pages: 0\n";
1122 t <<
"%%BeginSetup\n";
1123 t <<
"%%EndSetup\n";
1124 t <<
"%%EndComments\n";
1126 t <<
"% ----- variables -----\n";
1128 t <<
"/boxwidth 0 def\n";
1129 t <<
"/boxheight 40 def\n";
1130 t <<
"/fontheight 24 def\n";
1131 t <<
"/marginwidth 10 def\n";
1132 t <<
"/distx 20 def\n";
1133 t <<
"/disty 40 def\n";
1134 t <<
"/boundaspect " << estWidth/(
float)estHeight <<
" def % aspect ratio of the BoundingBox (width/height)\n";
1135 t <<
"/boundx 500 def\n";
1136 t <<
"/boundy boundx boundaspect div def\n";
1137 t <<
"/xspacing 0 def\n";
1138 t <<
"/yspacing 0 def\n";
1139 t <<
"/rows " << rows <<
" def\n";
1140 t <<
"/cols " << cols <<
" def\n";
1141 t <<
"/scalefactor 0 def\n";
1142 t <<
"/boxfont /Times-Roman findfont fontheight scalefont def\n";
1144 t <<
"% ----- procedures -----\n";
1146 t <<
"/dotted { [1 4] 0 setdash } def\n";
1147 t <<
"/dashed { [5] 0 setdash } def\n";
1148 t <<
"/solid { [] 0 setdash } def\n";
1150 t <<
"/max % result = MAX(arg1,arg2)\n";
1152 t <<
" /a exch def\n";
1153 t <<
" /b exch def\n";
1154 t <<
" a b gt {a} {b} ifelse\n";
1157 t <<
"/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2)\n";
1159 t <<
" 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max\n";
1162 t <<
"/cw % boxwidth = MAX(boxwidth, stringwidth(arg1))\n";
1164 t <<
" /str exch def\n";
1165 t <<
" /boxwidth boxwidth str stringwidth pop max def\n";
1168 t <<
"/box % draws a box with text `arg1' at grid pos (arg2,arg3)\n";
1170 t <<
" 2 setlinewidth\n";
1172 t <<
" exch xspacing mul xoffset add\n";
1173 t <<
" exch yspacing mul\n";
1175 t <<
" boxwidth 0 rlineto \n";
1176 t <<
" 0 boxheight rlineto \n";
1177 t <<
" boxwidth neg 0 rlineto \n";
1178 t <<
" 0 boxheight neg rlineto \n";
1179 t <<
" closepath\n";
1180 t <<
" dup stringwidth pop neg boxwidth add 2 div\n";
1181 t <<
" boxheight fontheight 2 div sub 2 div\n";
1182 t <<
" rmoveto show stroke\n";
1188 t <<
" exch xspacing mul xoffset add boxwidth add\n";
1189 t <<
" exch yspacing mul\n";
1191 t <<
" 0 boxheight 4 div rlineto\n";
1192 t <<
" boxheight neg 4 div boxheight neg 4 div rlineto\n";
1193 t <<
" closepath\n";
1201 t <<
" 3 -8 rlineto\n";
1202 t <<
" -6 0 rlineto\n";
1203 t <<
" 3 8 rlineto\n";
1204 t <<
" closepath\n";
1209 t <<
"/out % draws an output connector for the block at (arg1,arg2)\n";
1212 t <<
" exch xspacing mul xoffset add boxwidth 2 div add\n";
1213 t <<
" exch yspacing mul boxheight add\n";
1214 t <<
" /y exch def\n";
1215 t <<
" /x exch def\n";
1216 t <<
" x y moveto\n";
1217 t <<
" 0 disty 2 div rlineto \n";
1219 t <<
" 1 eq { x y disty 2 div add arrow } if\n";
1222 t <<
"/in % draws an input connector for the block at (arg1,arg2)\n";
1225 t <<
" exch xspacing mul xoffset add boxwidth 2 div add\n";
1226 t <<
" exch yspacing mul disty 2 div sub\n";
1227 t <<
" /y exch def\n";
1228 t <<
" /x exch def\n";
1229 t <<
" x y moveto\n";
1230 t <<
" 0 disty 2 div rlineto\n";
1232 t <<
" 1 eq { x y disty 2 div add arrow } if\n";
1237 t <<
" exch xspacing mul xoffset add boxwidth 2 div add\n";
1238 t <<
" exch yspacing mul boxheight 2 div sub\n";
1239 t <<
" /y exch def\n";
1240 t <<
" /x exch def\n";
1242 t <<
" x y moveto\n";
1243 t <<
" boxwidth 2 div distx add 0 rlineto\n";
1246 t <<
" { newpath x boxwidth 2 div distx add add y moveto\n";
1247 t <<
" -8 3 rlineto\n";
1248 t <<
" 0 -6 rlineto\n";
1249 t <<
" 8 3 rlineto\n";
1250 t <<
" closepath\n";
1258 t <<
" /ye exch def\n";
1259 t <<
" /ys exch def\n";
1260 t <<
" /xs exch def\n";
1262 t <<
" xs xspacing mul xoffset add boxwidth 2 div add dup\n";
1263 t <<
" ys yspacing mul boxheight 2 div sub\n";
1265 t <<
" ye yspacing mul boxheight 2 div sub\n";
1270 t <<
"/conn % connections the blocks from col `arg1' to `arg2' of row `arg3'\n";
1272 t <<
" /ys exch def\n";
1273 t <<
" /xe exch def\n";
1274 t <<
" /xs exch def\n";
1276 t <<
" xs xspacing mul xoffset add boxwidth 2 div add\n";
1277 t <<
" ys yspacing mul disty 2 div sub\n";
1279 t <<
" xspacing xe xs sub mul 0\n";
1284 t <<
"% ----- main ------\n";
1286 t <<
"boxfont setfont\n";
1287 t <<
"1 boundaspect scale\n";
1293 for (;(dr=bit.current()) && !done;++bit)
1297 for (;(di=rit.current());++rit)
1300 t <<
"(" << di->
label() <<
") cw\n";
1306 for (;(dr=sit.current()) && !done;++sit)
1310 for (;(di=rit.current());++rit)
1313 t <<
"(" << di->
label() <<
") cw\n";
1317 t <<
"/boxwidth boxwidth marginwidth 2 mul add def\n" 1318 <<
"/xspacing boxwidth distx add def\n" 1319 <<
"/yspacing boxheight disty add def\n" 1320 <<
"/scalefactor \n" 1321 <<
" boxwidth cols mul distx cols 1 sub mul add\n" 1322 <<
" boxheight rows mul disty rows 1 sub mul add boundaspect mul \n" 1324 <<
"boundx scalefactor div boundy scalefactor div scale\n";
1326 t <<
"\n% ----- classes -----\n\n";
1330 t <<
"\n% ----- relations -----\n\n";
1331 base->drawConnectors(t,0,
TRUE,
FALSE,baseRows,superRows,0,0);
1338 epstopdfArgs.sprintf(
"\"%s.eps\" --outfile=\"%s.pdf\"",
1339 epsBaseName.
data(),epsBaseName.
data());
1344 err(
"Problems running epstopdf. Check your TeX installation!\n");
void computeExtremes(uint *labelWidth, uint *xpos)
void portable_sysTimerStop()
Simplified and optimized version of QTextStream.
void setName(const QString &name)
void portable_sysTimerStart()
const char * data() const
void drawConnectors(FTextStream &t, Image *image, bool doBase, bool bitmap, uint baseRows, uint superRows, uint cellWidth, uint cellheight)
const char * data() const
#define Config_getBool(val)
void err(const char *fmt,...)
The QFile class is an I/O device that operates on files.
void drawBoxes(FTextStream &t, Image *image, bool doBase, bool bitmap, uint baseRows, uint superRows, uint cellWidth, uint cellHeight, QCString relPath="", bool generateMap=TRUE)
QTextStream & endl(QTextStream &s)
int portable_system(const char *command, const char *args, bool commandHasConsole)