#include <fstream>
#include <string>
#include <iostream>
#include <iomanip>
#include <vector>
Include dependency graph for basepacking.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Namespaces | |
namespace | basepacking_h |
Compounds | |
class | BasePacking |
class | HardBlockInfoType |
class | OrientedPacking |
Functions | |
ostream & | operator<< (ostream &outs, OrientedPacking::ORIENT) |
void | Save_bbb (ostream &outs, const OrientedPacking &pk) |
void | Read_bbb (istream &ins, const OrientedPacking &pk) |
void | PrintDimensions (double width, double height) |
void | PrintAreas (double deadspace, double blockArea) |
void | PrintUtilization (double deadspace, double blockArea) |
void | Read_bbb (istream &ins, OrientedPacking &pk) |
|
Definition at line 127 of file basepacking.h. References OrientedPacking::E, OrientedPacking::FE, OrientedPacking::FN, OrientedPacking::FS, OrientedPacking::FW, OrientedPacking::N, OrientedPacking::S, OrientedPacking::UNDEFINED, and OrientedPacking::W.
00129 { 00130 switch (orient) 00131 { 00132 case OrientedPacking::N: 00133 outs << "N"; 00134 break; 00135 case OrientedPacking::E: 00136 outs << "E"; 00137 break; 00138 case OrientedPacking::S: 00139 outs << "S"; 00140 break; 00141 case OrientedPacking::W: 00142 outs << "W"; 00143 break; 00144 case OrientedPacking::FN: 00145 outs << "FN"; 00146 break; 00147 case OrientedPacking::FE: 00148 outs << "FE"; 00149 break; 00150 case OrientedPacking::FS: 00151 outs << "FS"; 00152 break; 00153 case OrientedPacking::FW: 00154 outs << "FW"; 00155 break; 00156 case OrientedPacking::UNDEFINED: 00157 outs << "--"; 00158 break; 00159 default: 00160 cout << "ERROR in outputting orientations." << endl; 00161 exit(1); 00162 break; 00163 } 00164 return outs; 00165 } |
|
Definition at line 307 of file basepacking.h. Referenced by BTreeCompactSlice().
00308 { 00309 cout << "total area: " << setw(11) 00310 << deadspace + blockArea << endl; 00311 cout << "block area: " << setw(11) << blockArea << endl; 00312 cout << "dead space: " << setw(11) << deadspace 00313 << " (" << (deadspace / blockArea) * 100 << "%)" << endl; 00314 } |
|
Definition at line 301 of file basepacking.h. Referenced by BTreeCompactSlice().
00302 { 00303 cout << "width: " << width << endl; 00304 cout << "height: " << height << endl; 00305 } |
|
Definition at line 316 of file basepacking.h. Referenced by BTreeCompactSlice().
00317 { 00318 double totalArea = deadspace + blockArea; 00319 cout << "area usage (wrt. total area): " 00320 << ((1 - (deadspace / totalArea)) * 100) << "%" << endl; 00321 cout << "dead space % (wrt. total area): " 00322 << ((deadspace / totalArea) * 100) << "%" << endl; 00323 cout << "---------------------------" << endl; 00324 } |
|
Definition at line 190 of file basepacking.h. References BasePacking::height, OrientedPacking::N, OrientedPacking::orient, BasePacking::width, BasePacking::xloc, and BasePacking::yloc.
00192 { 00193 double width, height; 00194 ins >> width >> height; 00195 00196 int blocknum = -1; 00197 ins >> blocknum; 00198 00199 pk.xloc.resize(blocknum); 00200 pk.yloc.resize(blocknum); 00201 pk.width.resize(blocknum); 00202 pk.height.resize(blocknum); 00203 pk.orient.resize(blocknum); 00204 for (int i = 0; i < blocknum; i++) 00205 { 00206 ins >> pk.width[i] >> pk.height[i]; 00207 pk.orient[i] = OrientedPacking::N; 00208 } 00209 00210 for (int i = 0; i < blocknum; i++) 00211 ins >> pk.xloc[i] >> pk.yloc[i]; 00212 } |
|
|
|
Definition at line 167 of file basepacking.h. References BasePacking::height, BasePacking::width, BasePacking::xloc, and BasePacking::yloc. Referenced by BTreeCompactSlice().
00169 { 00170 double totalWidth = 0; 00171 double totalHeight = 0; 00172 int blocknum = pk.xloc.size(); 00173 for (int i = 0; i < blocknum; i++) 00174 { 00175 totalWidth = max(totalWidth, pk.xloc[i]+pk.width[i]); 00176 totalHeight = max(totalHeight, pk.yloc[i]+pk.height[i]); 00177 } 00178 00179 outs << totalWidth << endl; 00180 outs << totalHeight << endl; 00181 outs << blocknum << endl; 00182 for (int i = 0; i < blocknum; i++) 00183 outs << pk.width[i] << " " << pk.height[i] << endl; 00184 outs << endl; 00185 00186 for (int i = 0; i < blocknum; i++) 00187 outs << pk.xloc[i] << " " << pk.yloc[i] << endl; 00188 } |