MorphoGraphX  2.0-1-227
CellDivision.hpp
Go to the documentation of this file.
1 #ifndef CellDivision_H
2 #define CellDivision_H
3 
4 
5 #include <GraphAlgorithms.hpp>
7 #include <Triangulate.hpp>
8 #include <MeshBuilder.hpp>
9 
10 
11 using namespace std;
12 
13 namespace mgx
14 {
15 
16 
17  // division plane properties
18  struct DivPlane{
20  double displ;
21 
22  double area;
23 
24  // for drawing
25  int label;
26  double size;
27  std::vector<vertex> vtxs;
28  std::vector<Point3i> tris;
29 
30  DivPlane() {}
31  DivPlane(Point3d nrml, Point3d pos, double displ): nrml(nrml), pos(pos), displ(displ) {}
32 
33  };
34 
35 
37 
38  public:
39 
41 
43  double volumeLeft, volumeRight, volumeRatio;
44  double betw, rwBetw;
47  int neighbAll, neighbLeft, neighbRight;
48 
49  // new stuff
53 
54  //Point3d cellNormal;
55 
56  int cellLabel;
57  bool isParent;
58 
61 
62  //double volumeRatio;
63  double planeArea;
66  double daughterRatio;
67 
68  double distanceActual, distanceCentroid;
69 
71 
72  //double rwBetw;
73  //double centrBetw;
74 
75  double angleActual;
76 
77  //bool actualDiv; // delete
78  double actualArea;
79 
81 
83 
84 
85  int div2d;
86 
88 
89  bool operator==(const CellDivisionAttr &other) const
90  {
91  if(planeNrml == other.planeNrml and planeDisplacement == other.planeDisplacement
92  and cellLabel == other.cellLabel and parentLabel == other.parentLabel
93  and volumeRatio == other.volumeRatio and planeArea == other.planeArea)
94  return true;
95  return false;
96  }
97 
98  double getValue(QString criteria)
99  {
100  if(criteria == "Wall Area")
101  return divPlane.area;
102  else if(criteria == "Volume Ratio")
103  return volumeRatio;
104  else if(criteria == "Betweenness Centrality" or criteria == "Betweenness Centrality (weighted)")
105  return betw;
106  else if(criteria == "Random Walk Betweenness" or criteria == "Random Walk Betweenness (weighted)")
107  return rwBetw;
108  else if(criteria == "Neighbor Count")
109  return neighbLeft+neighbRight;
110  else
111  return 0;
112 
113  }
114 
115 
116  };
117 
118  // Read/write attr map
119  bool inline readAttr(CellDivisionAttr &m, const QByteArray &ba, size_t &pos)
120  {
121  return readChar((char *)&m, sizeof(CellDivisionAttr), ba, pos);
122  }
123  bool inline writeAttr(const CellDivisionAttr &m, QByteArray &ba)
124  {
125  return writeChar((char *)&m, sizeof(CellDivisionAttr), ba);
126  }
127 
128 
129  // new class for attr maps (single cell)
131  {
132  public:
133 
134  std::vector<CellDivisionAttr> simulationData;
135 
137 
138  bool operator==(const DivisionDataNew &other) const
139  {
140  if(simulationData == other.simulationData)
141  return true;
142  return false;
143  }
144 
145 
146  };
147 
148  // Read/write attr map
149  bool inline readAttr(DivisionDataNew &dd, const QByteArray &ba, size_t &pos)
150  {
151 
152  uint sz;
153  readAttr(sz, ba, pos);
154  for(uint i = 0; i<sz; i++){
155  CellDivisionAttr cda;
156  readAttr(cda, ba, pos);
157  dd.simulationData.push_back(cda);
158  }
159 
160  return true;//readChar((char *)&m, sizeof(DivisionDataNew), ba, pos);
161  }
162  bool inline writeAttr(const DivisionDataNew &dd, QByteArray &ba)
163  {
164 
165  uint sz = dd.simulationData.size();
166  writeChar((char *)&sz, sizeof(uint), ba);
167  for(uint i = 0; i < sz; i++){
168  writeAttr(dd.simulationData[i], ba);
169  }
170 
171  return true;//writeChar((char *)&m, sizeof(DivisionDataNew), ba);
172  }
173 
174 
175 
177  public:
178 
179  // the cells: c = cell to be divided, dL, dR: the left and right daughter
180  cell c, dL, dR;
181 
183 
185 
186  std::vector<Triangle> trisLeft, trisRight, trisAll;
187  std::set<Triangle> trisSplit;
188  std::map<Triangle, std::pair<double,double> > splitTrisAreas;
189  std::map<IntInt, double> nbhdMap;
190 
191 
193 
194  //std::map<cell, std::vector<tri> > neighbTris;
195  //std::map<cell, double> neighbWallArea;
196  int labelLeft, labelRight;
197 
198  // map from a pair of vertices (edge in original vvgraph) to a new vertex that has to be introduced because the edge is cut by the division plane
199  std::map<VtxVtx, vertex> segmentsToBeSplit;
200 
201  std::map<vertex,int> vtxDaughterMap; // 1 for left, -1 for right
202 
203  std::map<IntInt, double> neighborMapOld;
204  std::map<Triangle, int> trisNeighbMap;
205 
206  // measures relevant for the division
207  int neighbAll, neighbLeft, neighbRight;
208  double volumeLeft, volumeRight, volumeRatio;
209  double betw, rwBetw;
210  std::map<IntInt, double> weights;
212 
214 
215  // for the actual division
218 
219  // new stuff to actually divide the cell
220  vector<vector<Point3d> > pointsPolygonMulti;
222 
223 
225  CellDivision(const cell& cellToDivide, DivPlane d, const cellGraph& C): c(cellToDivide), divPlane(d), C(C)
226  {
227  cellCenter = cellToDivide->pos;
228  }
229  CellDivision(P3dDouble plane, CellTissue& T, cell cellToDivide, int maxLabel)
230  {
231  T.updGeometry(c, 4);
232 
233  cellCenter = cellToDivide->pos;
234 
235  Point3d divPlanePoint = cellCenter + plane.second*plane.first;
236  double distanceToCenter = plane.second;
237 
238  DivPlane p(plane.first, divPlanePoint, distanceToCenter);
239 
240  CellTissue Sim;
241  copyCellGraph(T, Sim);
242 
243  c = cellToDivide;
244  divPlane = p;
245  C = Sim.C;
246  labelLeft = maxLabel+2;
247  labelRight = maxLabel+1;
248  }
249 
250  // label existing vertices according to their position regarding the division plane to find which daughter cell a vertex will belong to
251  void newLabelDaughters();
252 
253  // sorts tris of cell into 3 bins, all vtxs have one of two labels (left or right daughter cell)
254  void findCellTris();
255  void sortCellTris();
256  // write data to vec for saving as csv
257  void writeDataToVec(std::vector<double>& d);
258 
259  // update the neighborhoodmap (input for the graph measures)
260  void createUpdatedNeighborhoodMap();
261 
262  // update the neighborhoodmap (input for the graph measures)
263  void createUpdatedNeighborhoodMap(std::map<IntInt, double>& neighborMap, std::map<Triangle, int>& trisNeighbMap);
264 
265  vector<pair<Point3d, Point3d> > polygonCuttingSegs();
266 
267  // go through all trisToBeSplit, create a vector of all segments that are on the boundary of the new cell wall
268  //vector<pair<Point3d, Point3d> > polygonCuttingSegsSimple();
269  vector<vector<Point3d> > getCuttingPolygons();
270 
271  // split the segments of trisToBeSplit that are cut by the division plane
272  void splitCuttingSegs();
273 
274  void divideCellInCellGraph();
275 
276  // simulate a division: calculate divPlaneArea & volumes, update cell graph (but not mesh)
277  bool simulateDivision3D(std::map<IntInt, double> neighborMap, std::map<Triangle, int> trisNeighbMap);
278 
279  // do the proper division
280  bool divideCell3D(CellTissue &T);
281 
282  double getValue(QString criteria);
283 
284 
285 
286  private:
287 
288  // initialization of variables
289  void initialize();
290 
291  // returns true if the triangle vnm is cut by the divsion plane
292  bool triToBeSplit(const vertex& v, const vertex& m, const vertex& n);
293 
294  // creates the meshes of the daughter cells and updates the meshes of the neighbor cells
295  void createDaughterMeshes();
296 
297 
298  };
299 
300 
301 std::vector<Triangle> findCellTris(vvGraph& S, int cellLabel);
302 
304  public:
305 
306  std::vector<Triangle> cellTrisAll, cellTrisShared, cellTrisOutside;
307 
308  std::set<Triangle> trisSplit;
309  std::vector<Triangle> trisLeft, trisRight;
310 
311  std::set<vertex> cellVtxsOutside;
312  std::set<vertex> vtxsLeft, vtxsRight;
313 
314  std::map<vertex, int> vtxDaughterMap;
315 
316  std::map<Triangle, std::pair<double,double> > splitTrisAreas;
317 
318  vector<vector<Point3d> > pointsPolygonMulti;
319 
322 
324 
325 
326 
327  // map from a pair of vertices (edge in original vvgraph) to a new vertex that has to be introduced because the edge is cut by the division plane
328  std::map<VtxVtx, vertex> segmentsToBeSplit;
329 
331 
332  void initialize(Mesh *m, int parentLabel)
333  {
334  // requirement: cellTrisAll is set!
335 
336  // find tris of shared wall and remove it
337  cellTrisOutside = getOrRemoveCommonWall(m, cellTrisAll, true, true);
338  //cellTrisShared = getOrRemoveCommonWall(m, cellTrisAll, false, true);
339 
340  double volumeTotal = 0;
341  Point3d centroidP(0,0,0);
342 
343  forall(Triangle t, cellTrisOutside){
344  vertex v = t.v[0];
345  vertex n = t.v[1];
346  vertex m = t.v[2];
347  cellVtxsOutside.insert(v);
348  cellVtxsOutside.insert(n);
349  cellVtxsOutside.insert(m);
350 
351 
352  double volume = signedTetraVolume(t.v[0]->pos, t.v[1]->pos, t.v[2]->pos);
353  centroidP += volume * (t.v[0]->pos + t.v[1]->pos + t.v[2]->pos) / 4.0;
354  volumeTotal += volume;
355  }
356  centroidP /= volumeTotal;
357 
358  AttrMap<int, Point3d>& centroidsP = m->attributes().attrMap<int, Point3d>("Measure Label Vector ParentCentroids");
359  centroidsP[parentLabel]=centroidP;
360  std::cout << "pc " << centroidP << "/" << parentLabel << std::endl;
361  }
362 
363 
365  {
366  vtxDaughterMap.clear();
367  vtxsLeft.clear();
368  vtxsRight.clear();
369  trisSplit.clear();
370  trisLeft.clear();
371  trisRight.clear();
372  splitTrisAreas.clear();
373  }
374 
376  {
377  clearSimulatedData();
378  // requirement: initialize was ran!
379  labelLeft = 1;
380  labelRight = 2;
381 
382  Point3d divPlaneNrml = divPlane.first;
383  Point3d divPlanePos = divPos + divPlane.second * divPlane.first;
384 
385  // check on which side the vtxs lie
386  forall(const vertex& v, cellVtxsOutside){
387  double sP;
388  Point3d intersectP;
389  planeLineIntersect(divPlanePos, divPlaneNrml, v->pos, v->pos-divPlaneNrml, sP, intersectP);
390  if(sP<0){
391  vtxDaughterMap[v] = labelLeft;
392  vtxsLeft.insert(v);
393  } else {
394  vtxDaughterMap[v] = labelRight;
395  vtxsRight.insert(v);
396  }
397  }
398 
399  std::cout << "vtxs " << vtxsLeft.size() << "/" << vtxsRight.size() << std::endl;
400 
401  // find the tris that will be split by the plane
402  forall(Triangle& t, cellTrisOutside){
403  if(triToBeSplit(t.v[0],t.v[1],t.v[2])){
404  trisSplit.insert(t);
405  } else {
406  if(vtxDaughterMap[t.v[0]] == labelLeft){
407  trisLeft.push_back(t);
408  splitTrisAreas[t] = make_pair(triangleArea(t.v[0]->pos, t.v[1]->pos, t.v[2]->pos),0);
409  } else {
410  trisRight.push_back(t);
411  splitTrisAreas[t] = make_pair(0,triangleArea(t.v[0]->pos, t.v[1]->pos, t.v[2]->pos));
412  }
413  }
414  }
415 
416  // find the ploygon cutting segments
417  vector<pair<Point3d, Point3d> > segs = polygonCuttingSegs(divPlaneNrml, divPlanePos);
418 
419  // order the cutting segments
420  pointsPolygonMulti = orderPolygonSegsMulti(segs);
421 
422  // compute the plane area
423  double planeArea = divisionPlaneAreaMulti(divPlanePos, pointsPolygonMulti);
424 
425  double volumeLeft = calcVolume(trisLeft);
426  double volumeRight = calcVolume(trisRight);
427  double volumeRatio = calcRatio(volumeLeft, volumeRight);
428 
429  std::cout << "divTest " << divPlanePos << "/" << divPlaneNrml << "/" << planeArea << "/"<< volumeLeft << "/" << volumeRight << std::endl;
430 
431  CellDivisionAttr cda;
432  cda.div2d = 0;
433  cda.planeNrml = divPlaneNrml;
434  cda.planeDisplacement = divPlane.second;
435  cda.daughterRatio = volumeRatio;
436  cda.planeArea = planeArea;
437  cda.planePos = divPlanePos;
438 
439  return cda;
440  }
441 
442  // returns true if the triangle vnm is cut by the divsion plane
443  bool triToBeSplit(const vertex& v, const vertex& m, const vertex& n);
444 
445  vector<pair<Point3d, Point3d> > polygonCuttingSegs(Point3d planeNrml, Point3d planeP);
446 
447 
448  };
449 
450 }
451  #endif
mgx::CellDivisionAttr::CellDivisionAttr
CellDivisionAttr()
Definition: CellDivision.hpp:87
mgx::CellDivisionAttr::planeArea
double planeArea
Definition: CellDivision.hpp:63
mgx::calcVolume
double calcVolume(vector< Triangle > tris)
mgx::CellDivisionMGXM::segmentsToBeSplit
std::map< VtxVtx, vertex > segmentsToBeSplit
Definition: CellDivision.hpp:328
mgx::uint
unsigned int uint
Definition: Geometry.hpp:41
mgx::CellDivision::nbhdMap
std::map< IntInt, double > nbhdMap
Definition: CellDivision.hpp:189
mgx::CellDivisionMGXM::vtxDaughterMap
std::map< vertex, int > vtxDaughterMap
Definition: CellDivision.hpp:314
mgx::CellDivisionMGXM::trisSplit
std::set< Triangle > trisSplit
Definition: CellDivision.hpp:308
mgx::CellDivisionAttr::planeLabel
int planeLabel
Definition: CellDivision.hpp:60
mgx::CellDivisionMGXM::centroid
Point3d centroid
Definition: CellDivision.hpp:323
mgx::DivPlane::tris
std::vector< Point3i > tris
Definition: CellDivision.hpp:28
mgx::Mesh::attributes
const Attributes & attributes() const
Get the mesh attributes.
Definition: Mesh.hpp:187
mgx::CellTissue::DivAlg
DivAlg
Type of cell division SHORTEST WALL : CLOSEST MID : take midpoints of all wall segments and check whi...
Definition: CellTissue.hpp:57
mgx::CellDivision::labelRight
int labelRight
Definition: CellDivision.hpp:196
mgx::CellDivisionAttr::divPlane
DivPlane divPlane
Definition: CellDivision.hpp:40
mgx::CellDivision::trisSplit
std::set< Triangle > trisSplit
Definition: CellDivision.hpp:187
mgx::CellDivisionMGXM::vtxsRight
std::set< vertex > vtxsRight
Definition: CellDivision.hpp:312
mgx::CellDivisionAttr::planeDisplacement
double planeDisplacement
Definition: CellDivision.hpp:52
mgx::CellDivision::divPlane
DivPlane divPlane
Definition: CellDivision.hpp:182
mgx::CellDivision::trisNeighbMap
std::map< Triangle, int > trisNeighbMap
Definition: CellDivision.hpp:204
mgx::DivisionDataNew::DivisionDataNew
DivisionDataNew()
Definition: CellDivision.hpp:136
mgx::CellDivision::C
cellGraph C
Definition: CellDivision.hpp:192
mgx::CellDivisionMGXM::initialize
void initialize(Mesh *m, int parentLabel)
Definition: CellDivision.hpp:332
mgx::CellDivision::volumeRight
double volumeRight
Definition: CellDivision.hpp:208
mgx::signedTetraVolume
CU_HOST_DEVICE T signedTetraVolume(const Point3(T) &a, const Point3(T) &b, const Point3(T) &c)
Definition: Geometry.hpp:299
mgx::CellDivisionAttr::cellCenter
Point3d cellCenter
Definition: CellDivision.hpp:46
forall
#define forall
Definition: Forall.hpp:22
mgx::CellDivisionAttr::isParent
bool isParent
Definition: CellDivision.hpp:57
n
#define n
Definition: Eigenvalues.hpp:36
mgx::readAttr
bool readAttr(DivisionDataNew &dd, const QByteArray &ba, size_t &pos)
Definition: CellDivision.hpp:149
mgx::triangleArea
CU_HOST_DEVICE T triangleArea(const Point3(T) &a, const Point3(T) &b, const Point3(T) &c)
Definition: Geometry.hpp:293
mgx::CellTissue
Definition: CellTissue.hpp:46
mgx::CellDivision::neighborMapOld
std::map< IntInt, double > neighborMapOld
Definition: CellDivision.hpp:203
mgx::CellDivision::weights
std::map< IntInt, double > weights
Definition: CellDivision.hpp:210
mgx::CellDivision::vtxDaughterMap
std::map< vertex, int > vtxDaughterMap
Definition: CellDivision.hpp:201
mgx::CellDivisionAttr::daughterRatio
double daughterRatio
Definition: CellDivision.hpp:66
mgx::CellDivisionMGXM::CellDivisionMGXM
CellDivisionMGXM()
Definition: CellDivision.hpp:330
mgx::CellDivisionAttr::div2d
int div2d
Definition: CellDivision.hpp:85
mgx::CellDivisionAttr::planeAreaRelActual
double planeAreaRelActual
Definition: CellDivision.hpp:65
mgx::CellDivisionMGXM::trisRight
std::vector< Triangle > trisRight
Definition: CellDivision.hpp:309
mgx::CellTissue::updGeometry
void updGeometry()
Set area, length of cell walls, center and normal.
Definition: CellTissue.hpp:118
mgx::DivPlane::displ
double displ
Definition: CellDivision.hpp:20
mgx::CellDivision::cellCenter
Point3d cellCenter
Definition: CellDivision.hpp:221
mgx::CellDivisionMGXM
Definition: CellDivision.hpp:303
mgx::CellDivisionAttr::surfNrml
Point3d surfNrml
Definition: CellDivision.hpp:82
mgx::CellDivision::divAlg
mgx::CellTissue::DivAlg divAlg
Definition: CellDivision.hpp:217
mgx::CellDivision
Definition: CellDivision.hpp:176
mgx::CellDivisionAttr::normalizedArea
double normalizedArea
Definition: CellDivision.hpp:80
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::CellDivisionAttr::actualArea
double actualArea
Definition: CellDivision.hpp:78
mgx::CellDivision::subdiv
Subdivide * subdiv
Definition: CellDivision.hpp:216
mgx::CellDivisionAttr::rwBetw
double rwBetw
Definition: CellDivision.hpp:44
mgx::CellDivision::dR
cell dR
Definition: CellDivision.hpp:180
DivisionAnalysisUtils.hpp
mgx::CellTissue::C
cellGraph C
Definition: CellTissue.hpp:66
mgx::CellDivision::splitTrisAreas
std::map< Triangle, std::pair< double, double > > splitTrisAreas
Definition: CellDivision.hpp:188
Triangulate.hpp
mgx::CellDivision::CellDivision
CellDivision(const cell &cellToDivide, DivPlane d, const cellGraph &C)
Definition: CellDivision.hpp:225
mgx::calcRatio
double calcRatio(double value1, double value2)
return the ratio ( = bigger value divided by smaller value)
mgx::CellDivisionAttr::volumeRight
double volumeRight
Definition: CellDivision.hpp:43
mgx::CellDivisionAttr::angleActual
double angleActual
Definition: CellDivision.hpp:75
mgx::nrml
nrml
Definition: Geometry.hpp:240
mgx::orderPolygonSegsMulti
mgx_EXPORT std::vector< std::vector< Point3d > > orderPolygonSegsMulti(std::vector< std::pair< Point3d, Point3d > > &polygonSegs)
mgx::CellDivisionAttr::cellLabel
int cellLabel
Definition: CellDivision.hpp:56
mgx::P3dDouble
std::pair< Point3d, double > P3dDouble
Definition: DivisionAnalysisUtils.hpp:17
mgx::CellDivisionMGXM::clearSimulatedData
void clearSimulatedData()
Definition: CellDivision.hpp:364
mgx::DivPlane::DivPlane
DivPlane(Point3d nrml, Point3d pos, double displ)
Definition: CellDivision.hpp:31
mgx::DivPlane::label
int label
Definition: CellDivision.hpp:25
mgx::vvGraph
VVGraph< VertexData, EdgeData > vvGraph
Simpler names for the various containers and iterators related to vertices and VV.
Definition: Misc.hpp:47
mgx::Attributes::attrMap
AttrMap< KeyT, ValueT > & attrMap(const QString &name, bool saveRequired=true)
Get the attribute, if it does not exist create it and add to the set If it exists,...
Definition: Attributes.hpp:1116
mgx::CellDivision::cellNormal
Point3d cellNormal
Definition: CellDivision.hpp:184
mgx::CellDivision::CellDivision
CellDivision(P3dDouble plane, CellTissue &T, cell cellToDivide, int maxLabel)
Definition: CellDivision.hpp:229
mgx::DivPlane::pos
Point3d pos
Definition: CellDivision.hpp:19
mgx::CellDivisionAttr::cellNormal
Point3d cellNormal
Definition: CellDivision.hpp:42
mgx::Triangle::v
vertex v[3]
Definition: Triangle.hpp:108
mgx::DivisionDataNew::simulationData
std::vector< CellDivisionAttr > simulationData
Definition: CellDivision.hpp:134
mgx::DivPlane::area
double area
Definition: CellDivision.hpp:22
mgx::CellDivisionAttr::sharedTrisArea
double sharedTrisArea
Definition: CellDivision.hpp:70
mgx::CellDivisionAttr::parentLabel
int parentLabel
Definition: CellDivision.hpp:59
mgx::Triangle
class Triangle Triangle.hpp <Triangle.hpp>
Definition: Triangle.hpp:31
mgx::copyCellGraph
void copyCellGraph(CellTissue &orig, CellTissue &copy)
copies the cell graph, used for simulating cell division (without altering the original)
MeshBuilder.hpp
mgx::DivPlane
Definition: CellDivision.hpp:18
mgx::DivPlane::size
double size
Definition: CellDivision.hpp:26
mgx::getOrRemoveCommonWall
std::vector< vertex > getOrRemoveCommonWall(Mesh *m, std::vector< vertex > &cellVtxs, bool removeCommon, bool includeEdgeOfShared)
mgx::CellDivisionAttr::operator==
bool operator==(const CellDivisionAttr &other) const
Definition: CellDivision.hpp:89
mgx::CellDivisionMGXM::pointsPolygonMulti
vector< vector< Point3d > > pointsPolygonMulti
Definition: CellDivision.hpp:318
mgx::DivisionDataNew::operator==
bool operator==(const DivisionDataNew &other) const
Definition: CellDivision.hpp:138
mgx::CellDivisionAttr::planeNrml
Point3d planeNrml
Definition: CellDivision.hpp:50
mgx::Mesh
Definition: Mesh.hpp:54
mgx::CellDivisionAttr::planeAreaRelShortest
double planeAreaRelShortest
Definition: CellDivision.hpp:64
mgx::CellDivisionMGXM::cellTrisShared
std::vector< Triangle > cellTrisShared
Definition: CellDivision.hpp:306
mgx::CellDivision::cutLowDegreeNeighbor
double cutLowDegreeNeighbor
Definition: CellDivision.hpp:213
GraphAlgorithms.hpp
mgx::CellDivision::pointsPolygonMulti
vector< vector< Point3d > > pointsPolygonMulti
Definition: CellDivision.hpp:220
mgx::CellDivisionMGXM::simulateDivision3D
CellDivisionAttr simulateDivision3D(P3dDouble divPlane, Point3d divPos)
Definition: CellDivision.hpp:375
mgx::CellDivisionAttr::distanceCentroid
double distanceCentroid
Definition: CellDivision.hpp:68
mgx::Vector< 3, double >
mgx::CellDivision::rwBetw
double rwBetw
Definition: CellDivision.hpp:209
mgx::CellDivisionAttr::volumeRatio
double volumeRatio
Definition: CellDivision.hpp:43
mgx::CellDivisionMGXM::cellVtxsOutside
std::set< vertex > cellVtxsOutside
Definition: CellDivision.hpp:311
mgx::CellDivisionAttr::planePos
Point3d planePos
Definition: CellDivision.hpp:51
mgx::CellDivisionAttr
Definition: CellDivision.hpp:36
mgx::divisionPlaneAreaMulti
double divisionPlaneAreaMulti(Point3d cellCenter, const std::vector< std::vector< Point3d > > &vMulti)
returns the summed area of multiple polygons (=division planes)
mgx::CellDivisionMGXM::labelRight
int labelRight
Definition: CellDivision.hpp:321
mgx::CellDivision::neighbRight
int neighbRight
Definition: CellDivision.hpp:207
mgx::CellDivisionAttr::neighbRight
int neighbRight
Definition: CellDivision.hpp:47
mgx::CellDivision::trisRight
std::vector< Triangle > trisRight
Definition: CellDivision.hpp:186
mgx::CellDivisionMGXM::labelLeft
int labelLeft
Definition: CellDivision.hpp:320
mgx::VVGraph< mgx::CellData, mgx::WallData >
mgx::CellDivision::segmentsToBeSplit
std::map< VtxVtx, vertex > segmentsToBeSplit
Definition: CellDivision.hpp:199
mgx::Subdivide
Definition: Subdivide.hpp:25
mgx::CellDivisionMGXM::splitTrisAreas
std::map< Triangle, std::pair< double, double > > splitTrisAreas
Definition: CellDivision.hpp:316
mgx::CellDivisionAttr::cutLowDegreeNeighbor
double cutLowDegreeNeighbor
Definition: CellDivision.hpp:45
mgx::DivisionDataNew
Definition: CellDivision.hpp:130
mgx::CellDivision::idxSamples
int idxSamples
Definition: CellDivision.hpp:211
mgx::writeAttr
bool writeAttr(const DivisionDataNew &dd, QByteArray &ba)
Definition: CellDivision.hpp:162
mgx::CellDivisionAttr::getValue
double getValue(QString criteria)
Definition: CellDivision.hpp:98
mgx::DivPlane::DivPlane
DivPlane()
Definition: CellDivision.hpp:30
mgx::CellDivision::CellDivision
CellDivision()
Definition: CellDivision.hpp:224
mgx::DivPlane::vtxs
std::vector< vertex > vtxs
Definition: CellDivision.hpp:27
mgx::planeLineIntersect
CU_HOST_DEVICE bool planeLineIntersect(const Point3(T) &p, const Point3(T) &nrml, const Point3(T) &u1, const Point3(T) &u2, T &s, Point3(T) &u)
Plane-Line Intersection.
Definition: Geometry.hpp:217
mgx::AttrMap
Attribute map wraps std::map.
Definition: Attributes.hpp:686
mgx::Vertex
Definition: Vertex.hpp:58
mgx::findCellTris
std::vector< Triangle > findCellTris(vvGraph &S, int cellLabel)