11 #ifndef CELL_TISSUE_HPP
12 #define CELL_TISSUE_HPP
36 pCellWallWidth, pCellWallCorner, pCellColorBegin, pCellColorEnd, pCellColorCenter, pCellBorderColor,
37 pCellPolWidth, pCellPolCorner, pCellPolColorBegin, pCellPolColorEnd, pCellNormalColor, pCellGraphColor,
38 pCellLineColor, pCellLineWidth, pNumParms };
43 enum ParmNames { pCellMaxArea, pCellDivAlg, pCellWallSample, pCellPinch, pCellMaxPinch, pCellWallMin, pNumParms };
57 enum DivAlg {SHORTEST_WALL = 0, CLOSEST_MID = 1, CLOSEST_WALL = 2, SHORTEST_DIR = 3, PREDEFINED_DIR = 4};
62 enum UpdGeom {UPD_AREA = 1, UPD_LENGTH = 2, UPD_CENTER = 4, UPD_NORMAL = 8, UPD_VOLUME = 16, UPD_WALLSZ = 32};
75 CellTissue() : nhbdS(S), nhbdC(C), CellMaxArea(25), CellDivAlg(SHORTEST_WALL),
76 CellWallSample(.05), CellPinch(.2), CellMaxPinch(1.0), CellWallMin(.1), CellUpdGeomMode(63),
77 CellWallWidth(0.025), CellWallCorner(0.15), CellColorBegin(1), CellColorEnd(2),
78 CellColorCenter(0.3), CellBorderColor(0), CellPolWidth(0.0), CellPolCorner(0.3), CellPolColorBegin(3),
79 CellPolColorEnd(4), CellNormalColor(5), CellGraphColor( 5), CellLineColor(5), CellLineWidth(1.0),
80 _meshType(
"MGXM"), _currLabel(0) {}
91 const QString &
meshType() {
return _meshType; }
93 const QString &setMeshType(
const QString &meshType);
113 bool chkGraph(
const vvGraph &S)
const;
119 void updGeometry(
int mode);
125 void updGeometry(
const cell &c,
int mode);
133 if(s.toUpper() ==
"CLOSEST MIDPOINT")
135 else if(s.toUpper() ==
"CLOSEST WALL")
137 else if(s.toUpper() ==
"SHORTEST DIRECTION")
139 else if(s.toUpper() ==
"PREDEFINED DIRECTION")
140 return PREDEFINED_DIR;
142 return SHORTEST_WALL;
148 bool divideCell(
const cell &c,
Subdivide *sDiv, DivAlg divAlg = SHORTEST_WALL);
153 bool divideCell(
const cell &c,
Subdivide *sDiv, DivAlg divAlg, std::vector<Point3d> &nrmls);
158 void deleteCell(
const cell &c);
163 void processParms(
const QStringList &parms);
164 void processParmsDivide(
const QStringList &parms);
169 bool addCell(std::vector<vertex> poly);
180 bool toMgxc(
double wallMax = 0);
185 bool toMgx2d(
double wallMax = 0);
192 void getNeighborhoodMap3D(std::map<IntInt, double>& neighborMap);
193 bool toMgx3d(
double tolerance = 0,
double neighborMinArea = 0);
198 void updateAllGraph();
208 bool loadCellTissueFromText(
const QString &fileName);
213 bool saveCellTissueToText(
const QString &fileName);
256 vertex &p_v1,
vertex &p_v2,
double &su,
double &sv, std::vector<Point3d> &nrmls);
260 vertex &p_u2,
vertex &p_v1,
vertex &p_v2,
double &su,
double &sv, std::vector<Point3d> &nrmls);
263 double CellWallSample;
269 double CellWallWidth;
270 double CellWallCorner;
273 double CellColorCenter;
277 double CellPolCorner;
278 int CellPolColorBegin;
284 double CellLineWidth;