1050 uint baseRows=
p->base.computeRows();
1051 uint superRows=
p->super.computeRows();
1052 uint baseMaxX, baseMaxLabelWidth, superMaxX, superMaxLabelWidth;
1053 p->base.computeExtremes(&baseMaxLabelWidth,&baseMaxX);
1054 p->super.computeExtremes(&superMaxLabelWidth,&superMaxX);
1056 uint rows=std::max(1u,baseRows+superRows-1);
1060 uint estHeight = rows*40;
1061 uint estWidth = cols*(20+std::max(baseMaxLabelWidth,superMaxLabelWidth));
1064 const float pageWidth = 14.0f;
1069 float realHeight =
static_cast<float>(std::min(rows,12u));
1070 float realWidth = realHeight * estWidth/
static_cast<float>(estHeight);
1071 if (realWidth>pageWidth)
1073 realHeight*=pageWidth/realWidth;
1077 output <<
"\\begin{figure}[H]\n"
1080 output <<
"\\includegraphics[height=" << realHeight <<
"cm]{"
1081 << fileName <<
"}\n";
1082 output <<
"\\end{center}\n"
1088 QCString epsName=epsBaseName+
".eps";
1089 std::ofstream f(epsName.
str(),std::ofstream::out | std::ofstream::binary);
1092 term(
"Could not open file %s for writing\n",
qPrint(epsName));
1102 t <<
"%!PS-Adobe-2.0 EPSF-2.0\n";
1103 t <<
"%%Title: ClassName\n";
1104 t <<
"%%Creator: Doxygen\n";
1105 t <<
"%%CreationDate: Time\n";
1107 t <<
"%Magnification: 1.00\n";
1108 t <<
"%%Orientation: Portrait\n";
1109 t <<
"%%BoundingBox: 0 0 500 " << estHeight*500.0f/(float)estWidth <<
"\n";
1110 t <<
"%%Pages: 0\n";
1111 t <<
"%%BeginSetup\n";
1112 t <<
"%%EndSetup\n";
1113 t <<
"%%EndComments\n";
1115 t <<
"% ----- variables -----\n";
1117 t <<
"/boxwidth 0 def\n";
1118 t <<
"/boxheight 40 def\n";
1119 t <<
"/fontheight 24 def\n";
1120 t <<
"/marginwidth 10 def\n";
1121 t <<
"/distx 20 def\n";
1122 t <<
"/disty 40 def\n";
1123 t <<
"/boundaspect " << estWidth/(float)estHeight <<
" def % aspect ratio of the BoundingBox (width/height)\n";
1124 t <<
"/boundx 500 def\n";
1125 t <<
"/boundy boundx boundaspect div def\n";
1126 t <<
"/xspacing 0 def\n";
1127 t <<
"/yspacing 0 def\n";
1128 t <<
"/rows " << rows <<
" def\n";
1129 t <<
"/cols " << cols <<
" def\n";
1130 t <<
"/scalefactor 0 def\n";
1131 t <<
"/boxfont /Times-Roman findfont fontheight scalefont def\n";
1133 t <<
"% ----- procedures -----\n";
1135 t <<
"/dotted { [1 4] 0 setdash } def\n";
1136 t <<
"/dashed { [5] 0 setdash } def\n";
1137 t <<
"/solid { [] 0 setdash } def\n";
1139 t <<
"/max % result = MAX(arg1,arg2)\n";
1141 t <<
" /a exch def\n";
1142 t <<
" /b exch def\n";
1143 t <<
" a b gt {a} {b} ifelse\n";
1146 t <<
"/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2)\n";
1148 t <<
" 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max\n";
1151 t <<
"/cw % boxwidth = MAX(boxwidth, stringwidth(arg1))\n";
1153 t <<
" /str exch def\n";
1154 t <<
" /boxwidth boxwidth str stringwidth pop max def\n";
1157 t <<
"/box % draws a box with text 'arg1' at grid pos (arg2,arg3)\n";
1159 t <<
" 2 setlinewidth\n";
1161 t <<
" exch xspacing mul xoffset add\n";
1162 t <<
" exch yspacing mul\n";
1164 t <<
" boxwidth 0 rlineto \n";
1165 t <<
" 0 boxheight rlineto \n";
1166 t <<
" boxwidth neg 0 rlineto \n";
1167 t <<
" 0 boxheight neg rlineto \n";
1168 t <<
" closepath\n";
1169 t <<
" dup stringwidth pop neg boxwidth add 2 div\n";
1170 t <<
" boxheight fontheight 2 div sub 2 div\n";
1171 t <<
" rmoveto show stroke\n";
1177 t <<
" exch xspacing mul xoffset add boxwidth add\n";
1178 t <<
" exch yspacing mul\n";
1180 t <<
" 0 boxheight 4 div rlineto\n";
1181 t <<
" boxheight neg 4 div boxheight neg 4 div rlineto\n";
1182 t <<
" closepath\n";
1190 t <<
" 3 -8 rlineto\n";
1191 t <<
" -6 0 rlineto\n";
1192 t <<
" 3 8 rlineto\n";
1193 t <<
" closepath\n";
1198 t <<
"/out % draws an output connector for the block at (arg1,arg2)\n";
1201 t <<
" exch xspacing mul xoffset add boxwidth 2 div add\n";
1202 t <<
" exch yspacing mul boxheight add\n";
1203 t <<
" /y exch def\n";
1204 t <<
" /x exch def\n";
1205 t <<
" x y moveto\n";
1206 t <<
" 0 disty 2 div rlineto \n";
1208 t <<
" 1 eq { x y disty 2 div add arrow } if\n";
1211 t <<
"/in % draws an input connector for the block at (arg1,arg2)\n";
1214 t <<
" exch xspacing mul xoffset add boxwidth 2 div add\n";
1215 t <<
" exch yspacing mul disty 2 div sub\n";
1216 t <<
" /y exch def\n";
1217 t <<
" /x exch def\n";
1218 t <<
" x y moveto\n";
1219 t <<
" 0 disty 2 div rlineto\n";
1221 t <<
" 1 eq { x y disty 2 div add arrow } if\n";
1226 t <<
" exch xspacing mul xoffset add boxwidth 2 div add\n";
1227 t <<
" exch yspacing mul boxheight 2 div sub\n";
1228 t <<
" /y exch def\n";
1229 t <<
" /x exch def\n";
1231 t <<
" x y moveto\n";
1232 t <<
" boxwidth 2 div distx add 0 rlineto\n";
1235 t <<
" { newpath x boxwidth 2 div distx add add y moveto\n";
1236 t <<
" -8 3 rlineto\n";
1237 t <<
" 0 -6 rlineto\n";
1238 t <<
" 8 3 rlineto\n";
1239 t <<
" closepath\n";
1247 t <<
" /ye exch def\n";
1248 t <<
" /ys exch def\n";
1249 t <<
" /xs exch def\n";
1251 t <<
" xs xspacing mul xoffset add boxwidth 2 div add dup\n";
1252 t <<
" ys yspacing mul boxheight 2 div sub\n";
1254 t <<
" ye yspacing mul boxheight 2 div sub\n";
1259 t <<
"/conn % connections the blocks from col 'arg1' to 'arg2' of row 'arg3'\n";
1261 t <<
" /ys exch def\n";
1262 t <<
" /xe exch def\n";
1263 t <<
" /xs exch def\n";
1265 t <<
" xs xspacing mul xoffset add boxwidth 2 div add\n";
1266 t <<
" ys yspacing mul disty 2 div sub\n";
1268 t <<
" xspacing xe xs sub mul 0\n";
1273 t <<
"% ----- main ------\n";
1275 t <<
"boxfont setfont\n";
1276 t <<
"1 boundaspect scale\n";
1279 for (
const auto &dr :
p->base)
1282 for (
const auto &di : *dr)
1284 done=di->isInList();
1290 auto it =
p->super.begin();
1291 if (it!=
p->super.end()) ++it;
1292 for (;it!=
p->super.end();++it)
1294 const auto &dr = *it;
1296 for (
const auto &di : *dr)
1298 done=di->isInList();
1304 t <<
"/boxwidth boxwidth marginwidth 2 mul add def\n"
1305 <<
"/xspacing boxwidth distx add def\n"
1306 <<
"/yspacing boxheight disty add def\n"
1307 <<
"/scalefactor \n"
1308 <<
" boxwidth cols mul distx cols 1 sub mul add\n"
1309 <<
" boxheight rows mul disty rows 1 sub mul add boundaspect mul \n"
1311 <<
"boundx scalefactor div boundy scalefactor div scale\n";
1313 t <<
"\n% ----- classes -----\n\n";
1314 p->base.drawBoxes(t,0,
TRUE,
FALSE,baseRows,superRows,0,0);
1315 p->super.drawBoxes(t,0,
FALSE,
FALSE,baseRows,superRows,0,0);
1317 t <<
"\n% ----- relations -----\n\n";
1318 p->base.drawConnectors(t,0,
TRUE,
FALSE,baseRows,superRows,0,0);
1319 p->super.drawConnectors(t,0,
FALSE,
FALSE,baseRows,superRows,0,0);
1327 epstopdfArgs.sprintf(
"\"%s.eps\" --outfile=\"%s.pdf\"",
1333 err(
"Problems running epstopdf. Check your TeX installation!\n");