MorphoGraphX  2.0-1-227
Mesh.hpp
Go to the documentation of this file.
1 //
2 // This file is part of MorphoGraphX - http://www.MorphoGraphX.org
3 // Copyright (C) 2012-2016 Richard S. Smith and collaborators.
4 //
5 // If you use MorphoGraphX in your work, please cite:
6 // http://dx.doi.org/10.7554/eLife.05864
7 //
8 // MorphoGraphX is free software, and is licensed under under the terms of the
9 // GNU General (GPL) Public License version 2.0, http://www.gnu.org/licenses.
10 //
11 #ifndef MESH_HPP
12 #define MESH_HPP
13 
20 #include <Config.hpp>
21 
22 #include <Types.hpp>
23 #include <Attributes.hpp>
24 
25 #include <cuda/CudaExport.hpp>
26 #include <CellTissue.hpp>
27 #include <Stack.hpp>
28 #include <TransferFunction.hpp>
29 
30 #include <omp.h>
31 #include <QImage>
32 #include <string.h>
33 #include <typeinfo>
34 
35 namespace mgx
36 {
38  typedef std::unordered_map<int, HVec3U> IntHVec3uMap;
40  typedef std::pair<int, HVec3U> IntHVec3uPair;
41 
42  class SetupProcess;
43 
54  class mgx_EXPORT Mesh
55  {
56  friend class SetupProcess;
57 
58  public:
62  enum SurfView
63  {
67  SURF_VIEW_COUNT
68  };
69 
73  //Mesh(const Stack* stack);
74 
78  Mesh(int id, const Stack* stack);
79 
83  //Mesh(const Mesh &copy);
84 
88  ~Mesh();
89 
91 
100  int id() const { return _id; }
101 
107  void setId(int i) { _id = i; }
108 
114  int userId() const { return _id + 1; }
115 
119  const Stack* stack() const { return _stack; }
120 
124  const QString &file() const { return _file; }
125 
132  void setFile(const QString &file = QString());
133 
137  bool scaled() const { return _scaled; }
138 
142  void setScaled(bool on = true) { _scaled = on; }
143 
147  bool transformed() const { return _transformed; }
148 
152  void setTransformed(bool on = true) { _transformed = on; }
153 
157  bool showBBox() const { return _showBBox; }
158 
162  void setShowBBox(bool on = true) { _showBBox = on; }
163 
167  int viewLabel() const { return T.viewLabel(); }
168 
172  void setLabel(int l) { T.setLabel(l); }
173 
177  int nextLabel() { return T.nextLabel(); }
178 
180 
182 
187  const Attributes &attributes() const
188  {
189  return _attributes;
190  }
191 
193  {
194  return _attributes;
195  }
196 
201  {
202  return _attributes.attrMap<int, int>("Cell Parent");
203  }
204 
208  const QString &meshType()
209  {
210  return T.meshType();
211  }
212 
216  const QString &setMeshType(const QString &mType)
217  {
218  return T.setMeshType(mType);
219  }
220 
224  bool mesh3D()
225  {
226  if(meshType() == "MGX3D")
227  return true;
228  return false;
229  }
230 
239  {
240  return _attributes.attrMap<int, Point3f>("Cell Center");
241  }
242 
251  {
252  return _attributes.attrMap<int, Point3f>("Cell Normal");
253  }
254 
263  {
264  return _attributes.attrMap<int, Point3f>("Cell CenterVis");
265  }
266 
275  {
276  return _attributes.attrMap<int, Point3f>("Cell NormalVis");
277  }
278 
287  {
288  return _attributes.attrMap<int, Point3f>("Parent Center");
289  }
290 
299  {
300  return _attributes.attrMap<int, Point3f>("Parent Normal");
301  }
302 
311  {
312  return _attributes.attrMap<int, Point3f>("Parent CenterVis");
313  }
314 
323  {
324  return _attributes.attrMap<int, Point3f>("Parent NormalVis");
325  }
326 
327 
333  {
334  return _attributes.attrMap<vertex, Point2f>("Vertex TexCoord2D");
335  }
336 
346  void reset();
348 
350 
355  vvGraph &graph() { return T.S; }
356 
360  const vvGraph &graph() const { return T.S; }
361 
365  vvGraph &junctions() { return T.J; }
366 
370  const vvGraph &junctions() const { return T.J; }
371 
375  const CellTissue &tissue() const { return T; }
376 
380  CellTissue &tissue() { return T; }
381 
385  cellGraph &cells() { return T.C; }
386 
390  const cellGraph &cells() const { return T.C; }
391 
395  bool empty() const { return T.S.empty() && T.C.empty(); }
396 
400  CellTissue::DistNhbdS &nhbdS() { return T.nhbdS; }
401 
405  CellTissue::DistNhbdC &nhbdC() { return T.nhbdC; }
406 
410  //size_t size() const { return T.S.size(); }
411 
415  int getLabel(const vertex &v1, const vertex &v2, const vertex &v3,
416  const IntIntAttr &parents);
420  int getLabel(int label, const IntIntAttr &parents);
421 
427  bool chkGraph(vvGraph &S) { return T.chkGraph(S); }
428  bool chkGraph() { return T.chkGraph(T.S); }
429 
443  IntIntVIdSetMap &wallVId() { return _wallVId; }
444 
448  const IntIntVIdSetMap &wallVId() const { return _wallVId; }
449 
460  {
461  return _attributes.attrMap<IntIntPair, float>("Wall Geom");
462  }
463 
472  IntIntSetMap &labelNeighbors() { return _labelNeighbors; }
473 
477  const IntIntSetMap &labelNeighbors() const { return _labelNeighbors; }
478 
484  void updateWallGeometry(float borderSize);
485 
491  bool isBordTriangle(int label, vertex v, vertex n, vertex m, IntIntPair &rp) const;
492 
497  void markBorder(float borderSize);
498 
503  void updateCentersNormals();
504 
506 
508 
512  TransferFunction surfFct() const { return _surf_fct; }
513 
518  {
519  if(_surf_fct != f) {
520  _surf_fct = f;
521  changed_surf_function = true;
522  }
523  }
528  bool surfFctChanged() const { return changed_surf_function; }
529 
533  TransferFunction heatFct() const { return _heat_fct; }
534 
539  {
540  if(_heat_fct != f) {
541  _heat_fct = f;
542  changed_heat_function = true;
543  }
544  }
549  bool heatFctChanged() const { return changed_heat_function; }
550 
554  float opacity() const { return _opacity; }
555 
559  void setOpacity(float f)
560  {
561  if(f < 0)
562  _opacity = 0;
563  else if(f > 1)
564  _opacity = 1;
565  else
566  _opacity = f;
567  }
571  float brightness() const { return _brightness; }
572 
576  void setBrightness(float f)
577  {
578  if(f < 0.0)
579  _brightness = 0.0;
580  else if(f > 1.0)
581  _brightness = 1.0;
582  else
583  _brightness = f;
584  }
585 
589  bool showSurface() const { return _showSurface; }
590 
594  void setShowSurface(bool val = true) { _showSurface = val; }
595 
599  void setShowVertex(const QString &s = "", bool setView = true)
600  {
601  if(setView)
602  _surfView = SURF_VERTEX;
603  if(s != "")
604  _surfVertexView = s;
605  }
606 
610  void setShowTriangle(const QString &s = "", bool setView = true)
611  {
612  if(setView)
613  _surfView = SURF_TRIANGLE;
614  if(s != "")
615  _surfTriangleView = s;
616  }
617 
621  void setShowLabel(const QString &s = "", bool setView = true)
622  {
623  if(setView)
624  _surfView = SURF_LABEL;
625  if(s != "")
626  _surfLabelView = s;
627  }
628 
632  bool culling() const { return _culling; }
633 
637  void setCulling(bool cul) { _culling = cul; }
638 
642  bool blending() const { return _blending; }
643 
647  void setBlending(bool b) { _blending = b; }
648 
652  SurfView surfView() const { return _surfView; }
653 
657  void setSurfView(SurfView view) { _surfView = view; }
658 
662  QString surfVertexView() const { return _surfVertexView; }
663 
667  QString surfTriangleView() const { return _surfTriangleView; }
668 
672  QString surfLabelView() const { return _surfLabelView; }
673 
677  bool showSignal() const { return showSurface() and surfView() == SURF_VERTEX and surfVertexView() == "Signal"; }
678  bool showLabels() const { return showSurface() and surfView() == SURF_LABEL and surfLabelView() == "Label"; }
679  bool showHeat() const { return showSurface() and surfView() == SURF_LABEL and surfLabelView() == "Label Heat"; }
680  bool showWallHeat() const { return showSurface() and surfView() == SURF_LABEL and surfLabelView() == "Wall Heat"; }
681  bool showTriangleValue() const { return showSurface() and surfView() == SURF_TRIANGLE and surfTriangleView() == "Triangle Value"; }
682 
686  bool useParents() { return _useParents; }
687 
691  void setUseParents(bool val) { _useParents = val; }
692 
696  bool &hasImgTex()
697  {
698  return _attributes.attrMap<QString, bool>("HasImageTex")["HasImageTex"];
699  }
700 
704  const QImage &imgTex() const { return _image; }
705  QImage &imgTex() { return _image; }
706 
710  void setImgTex(const QImage &img)
711  {
712  hasImgTex() = true;
713  _image = img;
714  }
715 
719  void clearImgTex()
720  {
721  _imgtex = false;
722  _attributes.attrMap<QString, QByteArray>("ImageTex").erase("ImageTex");
723  _image = QImage();
724  }
725 
727 
729 
733  bool showMesh() const { return _showMesh; }
734 
738  QString meshView() const { return _meshView; }
739 
743  void setShowMesh(bool show = true) { _showMesh = show; }
744 
748  void setMeshView(const QString &s, bool setShow = true)
749  {
750  if(setShow)
751  _showMesh = true;
752  _meshView = s;
753  }
754 
758  bool showAxis() const { return _showAxis; }
759 
763  QString axisView() const { return _axisView; }
764 
768  void setShowAxis(bool show = true) { _showAxis = show; }
769 
773  void setAxisView(const QString &s, bool setShow = true)
774  {
775  if(setShow)
776  _showAxis = true;
777  _axisView = s;
778  }
779 
783  bool showMeshLines() const { return _showMeshLines; }
784 
788  bool showMeshPoints() const { return _showMeshPoints; }
789 
793  bool showMeshCellMap() const { return _showMeshCellMap; }
794 
798  void setShowMeshLines(bool show) { _showMeshLines = show; }
799 
803  void setShowMeshPoints(bool show) { _showMeshPoints = show; }
804 
808  void setShowMeshCellMap(bool show) { _showMeshCellMap = show; }
809 
813  std::vector<vertex> selectedVertices() const;
814 
818  int selectedCount() const;
819 
825  std::vector<vertex> activeVertices() const;
826 
827  // These next two should really be algorithms for the graph as they don't rely on
828  // any Mesh variables.
832  void getConnectedVertices(const vvGraph &S, vvGraph &vSet) const;
833 
837  int getConnectedRegions(const vvGraph &S, VVGraphVec &cellVId, VtxIntMap &vtxCell) const;
838 
842  static void getNhbd(const vvGraph &S, const vertex &v, float radius, VtxSet &nbs);
848  bool clearSelection();
859  void correctSelection(bool inclusive);
860 
862 
864 
868  void updateAll();
872  void updateTriangles();
876  void updateLines();
880  void updatePositions();
884  void updateSelection();
888  int changes() const { return _changed; }
890 
892 
902  {
903  return _attributes.attrMap<int, float>("Cell Heat");
904  }
905 
911  QString &heatMapUnit()
912  {
913  return _attributes.attrMap<QString, QString>("Cell Heat Unit")["Cell Heat Unit"];
914  }
915 
916  QString &heatMapScaling()
917  {
918  return _attributes.attrMap<QString, QString>("Cell Heat Unit")["Cell Heat Scaling"];
919  }
920 
925  {
926  return _attributes.attrMap<QString, Point2f>("Cell Heat Bounds")["Cell Heat Bounds"];
927  }
928 
932  Point2f calcHeatMapBounds();
933 
938  {
939  return _attributes.attrMap<IntIntPair, float>("Wall Heat");
940  }
941 
946  {
947  return _attributes.attrMap<QString, Point2f>("Wall Heat Bounds")["Wall Heat Bounds"];
948  }
949 
953  QString &wallHeatUnit()
954  {
955  return _attributes.attrMap<QString, QString>("Wall Heat Unit")["Wall Heat Unit"];
956  }
958 
960 
964  {
965  return _attributes.attrMap<Triangle, Vec3Colorb>("Triangle Color");
966  }
967 
972  {
973  return _attributes.attrMap<Triangle, int>("Triangle Index");
974  }
975 
980  {
981  return _attributes.attrMap<Triangle, float>("Triangle Value");
982  }
983 
988  {
989  return _attributes.attrMap<QString, ColorbVec>("Triangle Value Color Map")["Triangle Value Color Map"];
990  }
991 
996  {
997  AttrMap<QString, Point2f> &a = _attributes.attrMap<QString, Point2f>("Triangle Value Bounds");
998  a.defaultVal() = Point2f(0,1);
999  return a["Triangle Value Bounds"];
1000  }
1001 
1007  QString &triangleValueUnit()
1008  {
1009  return _attributes.attrMap<QString, QString>("Triangle Value Unit")["Triangle Value Unit"];
1010  }
1011 
1016  {
1017  return _attributes.attrMap<QString, ColorbVec>("Triangle Index Color Map")["Triangle Index Color Map"];
1018  }
1019 
1024  {
1025  return _attributes.attrMap<cell, Vec2Colorb>("Cell Color");
1026  }
1028 
1030  // Axis methods
1031 
1035  bool setAxisColor(const Colorb &pos, const Colorb &neg, const SymmetricTensor &s, Vec3Colorb &color);
1036 
1037  /*
1038  * Returns the axis line width
1039  */
1040  float axisWidth()
1041  {
1042  float width = _attributes.attrMap<QString, float>("Axis Width")["Axis Width"];
1043  if(width < 1.0)
1044  width = 1.0;
1045  return width;
1046  }
1047 
1048  /*
1049  * Set the axis line width
1050  */
1051  float setAxisWidth(float width)
1052  {
1053  if(width < 1.0)
1054  width = 1.0;
1055  _attributes.attrMap<QString, float>("Axis Width")["Axis Width"] = width;
1056  return width;
1057  }
1058 
1059  /*
1060  * Returns the axis z-offset for drawing
1061  */
1062  float axisOffset()
1063  {
1064  return _attributes.attrMap<QString, float>("Axis Offset")["Axis Offset"];
1065  }
1066 
1067  /*
1068  * Sets the axis z-offset for drawing
1069  */
1070  float setAxisOffset(float offset)
1071  {
1072  _attributes.attrMap<QString, float>("Axis Offset")["Axis Offset"] = offset;
1073  return offset;
1074  }
1076 
1078 
1088  {
1089  return _attributes.attrMap<int, SymmetricTensor>("Cell Axis");
1090  }
1091 
1096  {
1097  return _attributes.attrMap<int, Matrix3f>("Cell Axis Vis");
1098  }
1099 
1104  {
1105  return _attributes.attrMap<int, Vec3Colorb>("Cell Axis Color");
1106  }
1107 
1111  bool setCellAxisColor(const Colorb &pos, const Colorb &neg);
1112 
1118  QString cellAxisType()
1119  {
1120  return _attributes.attrMap<QString, QString>("Axis Type")["Axis Type"];
1121  }
1122 
1128  QString setCellAxisType(const QString &s)
1129  {
1130  _attributes.attrMap<QString, QString>("Axis Type")["Axis Type"] = s;
1131  return s;
1132  }
1133 
1137  QString cellAxisUnit()
1138  {
1139  return _attributes.attrMap<QString, QString>("Axis Unit")["Axis Unit"];
1140  }
1141 
1145  QString setCellAxisUnit(const QString &s)
1146  {
1147  _attributes.attrMap<QString, QString>("Axis Unit")["Axis Unit"] = s;
1148  return s;
1149  }
1150 
1154  void clearCellAxis();
1156 
1158 
1168  {
1169  return _attributes.attrMap<Triangle, SymmetricTensor>("Triangle Axis");
1170  }
1171 
1176  {
1177  return _attributes.attrMap<Triangle, Matrix3f>("Triangle Axis Vis");
1178  }
1179 
1184  {
1185  return _attributes.attrMap<Triangle, Vec3Colorb>("Triangle Axis Color");
1186  }
1190  bool setTriangleAxisColor(const Colorb &pos, const Colorb &neg);
1192 
1194 
1203  typedef std::pair<vertex, SymmetricTensor> VtxSymTensorPair;
1204 
1206  {
1207  return _attributes.attrMap<vertex, SymmetricTensor>("Vertex Axis");
1208  }
1209 
1214  {
1215  return _attributes.attrMap<vertex, Matrix3f>("Vertex Axis Vis");
1216  }
1217 
1222  {
1223  return _attributes.attrMap<vertex, Vec3Colorb>("Vertex Axis Color");
1224  }
1225 
1229  bool setVertexAxisColor(const Colorb &pos, const Colorb &neg);
1230 
1236  {
1237  return _VVCorrespondence;
1238  }
1239 
1240  /*
1241  * Returns a boolean for visualization of lines between corresponding vertices
1242  */
1244  {
1245  return _showVVCorrespondence;
1246  }
1248 
1250 
1262  QString &signalUnit()
1263  {
1264  return _attributes.attrMap<QString, QString>("Vertex Signal Unit")["Vertex Signal Unit"];
1265  }
1266 
1273  {
1274  return _attributes.attrMap<QString, Point2f>("Vertex Signal Bounds")["Vertex Signal Bounds"];
1275  }
1277 
1281  const BoundingBox3f &boundingBox() const
1282  {
1283  return _bbox;
1284  }
1286  {
1287  return _bbox;
1288  }
1292  void setBoundingBox(const BoundingBox3f &bbox)
1293  {
1294  _bbox = bbox;
1295  }
1299  void updateBBox();
1303  int &ccTab()
1304  {
1305  return _ccTab;
1306  }
1310  QString &ccName()
1311  {
1312  return _ccName;
1313  }
1317  QString &deleteProcessName(QString &meshType)
1318  {
1319  return _attributes.attrMap<QString, QString>("Delete Process Name")[meshType];
1320  }
1321 
1341  static bool meshFromTriangles(vvGraph &S, const std::vector<vertex> &vertices,
1342  const std::vector<Point3i> &triangles, bool checkUnique = true);
1343 
1347  IntVtxMap &vMap() { return _vMap; }
1348 
1352  IntCellMap &cMap() { return _cMap; }
1353 
1357  bool readVertices(QIODevice &file, VtxVec &V, bool transform);
1358 
1362  bool readVertexList(QIODevice &file, vvGraph &S);
1363 
1367  bool readNhbds(QIODevice &file, vvGraph &S);
1368 
1372  bool readCellMesh(QIODevice &file, bool transform);
1373 
1377  bool read(QIODevice &file, bool transform);
1378 
1382  bool writeVertices(QIODevice &file, const vvGraph &S, bool transform);
1383 
1387  bool writeVertexList(QIODevice &file, const vvGraph &S);
1388 
1392  bool writeNhbds(QIODevice &file, const vvGraph &S);
1393 
1397  bool writeCellMesh(QIODevice &file, bool transform);
1398 
1402  bool write(QIODevice &file, bool transform);
1403 
1404  // Draw a cell
1405  //void drawCell(const cell &c);
1406 
1407  // Draw the nrmls
1408  //void drawNormals(double s);
1409 
1410  // Draw all the lines in the S graph
1411  //void drawGraph();
1412 
1413  // Draw the cell graph
1414  //void drawCellGraph()
1415 
1417  //double calcQuad(const vertex &c, const vertex &k, const vertex &l);
1418  // Draw a cell face
1419  //void drawCellFace(const cell &c);
1420 
1421  // Draw a cell border
1422  //void drawCellBorder(const cell &c);
1423 
1424  //Palette &palette; // color palette
1425  //int currLabel;
1426  //
1427  private:
1428  void init();
1429  void resetModified();
1430 
1431  CellTissue T;
1432  Attributes _attributes;
1433 
1434  TransferFunction _surf_fct, _heat_fct;
1435  IntMatrix3fMap _VVCorrespondence;
1436  bool _showVVCorrespondence;
1437  IntIntSetMap _labelNeighbors;
1438  IntIntVIdSetMap _wallVId;
1439  bool changed_surf_function, changed_heat_function;
1440  int _changed;
1441  bool _culling, _blending;
1442  bool _showSurface, _showMesh, _showAxis;
1443  float _opacity, _brightness;
1444  SurfView _surfView;
1445  QString _surfVertexView, _surfTriangleView, _surfLabelView;
1446  QString _meshView, _axisView;
1447  bool _showMeshLines, _showMeshPoints, _showMeshCellMap;
1448  bool _useParents;
1449  bool _imgtex;
1450  QString _file;
1451  bool _scaled;
1452  bool _transformed;
1453  bool _showBBox;
1454  int _id;
1455  const Stack* _stack;
1456  QImage _image;
1457 
1458  BoundingBox3f _bbox;
1459  int _ccTab;
1460  QString _ccName;
1461  QString _deleteProcess;
1462 
1463  IntVtxMap _vMap; // Map vertex saveId to vertex
1464  IntCellMap _cMap; // Map cell saveId to vertex
1465  };
1466 }
1467 
1468 #endif
mgx::Mesh::deleteProcessName
QString & deleteProcessName(QString &meshType)
Process use to to delete cells or vertices from different mesh types.
Definition: Mesh.hpp:1317
mgx::Mesh::triangleIndexColors
ColorbVec & triangleIndexColors()
Return the colormap for the triangle values.
Definition: Mesh.hpp:1015
mgx::Mesh::showLabels
bool showLabels() const
Definition: Mesh.hpp:678
Attributes.hpp
mgx::Mesh::labelCenter
IntPoint3fAttr & labelCenter()
Reference to the map from label to a center position.
Definition: Mesh.hpp:238
mgx::Mesh::labelNormal
IntPoint3fAttr & labelNormal()
Reference to the map from label to a normal.
Definition: Mesh.hpp:250
mgx::Mesh::setShowMeshPoints
void setShowMeshPoints(bool show)
Set if the mesh points are visible.
Definition: Mesh.hpp:803
mgx::Mesh::setBlending
void setBlending(bool b)
Set the blending attribute.
Definition: Mesh.hpp:647
mgx::Mesh::axisOffset
float axisOffset()
Definition: Mesh.hpp:1062
mgx::Mesh::id
int id() const
Id of the current mesh.
Definition: Mesh.hpp:100
mgx::Mesh::surfLabelView
QString surfLabelView() const
Returns the label visualization.
Definition: Mesh.hpp:672
mgx::vertex
vvGraph::vertex_t vertex
Type of a vertex.
Definition: Misc.hpp:50
mgx::Mesh::transformed
bool transformed() const
Returns true if the mesh is transformed.
Definition: Mesh.hpp:147
mgx::Attributes
Holds a set of attributes.
Definition: Attributes.hpp:917
mgx::Mesh::heatMapScaling
QString & heatMapScaling()
Definition: Mesh.hpp:916
mgx::Mesh::triangleAxis
TriSymTensorAttr & triangleAxis()
Tensor quantity for each triangle.
Definition: Mesh.hpp:1167
mgx::VtxVec
std::vector< vertex > VtxVec
Vector of vertices.
Definition: Types.hpp:135
mgx::Mesh::chkGraph
bool chkGraph()
Definition: Mesh.hpp:428
mgx::Mesh::SURF_LABEL
@ SURF_LABEL
Label level rendering.
Definition: Mesh.hpp:65
mgx::Mesh::viewLabel
int viewLabel() const
Returns the current label, without modifying it.
Definition: Mesh.hpp:167
TransferFunction.hpp
mgx::Mesh::attributes
const Attributes & attributes() const
Get the mesh attributes.
Definition: Mesh.hpp:187
mgx::Mesh::axisView
QString axisView() const
Return the current view mode for the axis.
Definition: Mesh.hpp:763
mgx::Mesh::junctions
const vvGraph & junctions() const
Get the VV junction graph.
Definition: Mesh.hpp:370
mgx::Mesh::showTriangleValue
bool showTriangleValue() const
Definition: Mesh.hpp:681
mgx::Mesh::showMesh
bool showMesh() const
Is the mesh currently visible to the user.
Definition: Mesh.hpp:733
mgx::Mesh::cellAxisColor
IntVec3ColorbAttr & cellAxisColor()
Returns the map from label to cells axis colors (array of 3 Point3f)
Definition: Mesh.hpp:1103
mgx::Mesh::setShowBBox
void setShowBBox(bool on=true)
Set if the bounding box is shown.
Definition: Mesh.hpp:162
mgx::Mesh::SURF_TRIANGLE
@ SURF_TRIANGLE
Triangle level rendering.
Definition: Mesh.hpp:66
mgx::Mesh::setShowLabel
void setShowLabel(const QString &s="", bool setView=true)
Set the surface label display.
Definition: Mesh.hpp:621
mgx::Mesh::heatFct
TransferFunction heatFct() const
Return the transfer function used to draw the surface in heat mode.
Definition: Mesh.hpp:533
mgx::Mesh::graph
const vvGraph & graph() const
Get the VV graph of the mesh.
Definition: Mesh.hpp:360
mgx::Mesh::meshView
QString meshView() const
Return the current view mode for the mesh.
Definition: Mesh.hpp:738
mgx::Mesh::parentCenterVis
IntPoint3fAttr & parentCenterVis()
Reference to the map from parent label to a position.
Definition: Mesh.hpp:310
mgx::Mesh::setLabel
void setLabel(int l)
Sets the current label.
Definition: Mesh.hpp:172
mgx::Mesh::setTransformed
void setTransformed(bool on=true)
Set if the mesh is transformed.
Definition: Mesh.hpp:152
mgx::Mesh::vMap
IntVtxMap & vMap()
Map vertex saveId to vertex.
Definition: Mesh.hpp:1347
mgx::IntIntSetMap
std::map< int, IntSet > IntIntSetMap
Map of an integer to a set of integers.
Definition: Types.hpp:88
mgx::Mesh::showSurface
bool showSurface() const
True if the surface is currently visible to the user.
Definition: Mesh.hpp:589
mgx::SymmetricTensor
Definition: SymmetricTensor.hpp:59
mgx::Mesh::triangleValueBounds
Point2f & triangleValueBounds()
Return the upper and lower bounds for the triangle value.
Definition: Mesh.hpp:995
mgx::Mesh::texCoord2d
VtxPoint2fAttr & texCoord2d()
Reference to a map of 2D texture coordinates, this is used to load 3D images like that from the Keyan...
Definition: Mesh.hpp:332
n
#define n
Definition: Eigenvalues.hpp:36
mgx::Mesh::showWallHeat
bool showWallHeat() const
Definition: Mesh.hpp:680
mgx::Mesh::setSurfFct
void setSurfFct(const TransferFunction &f)
Change the transfer function used to draw the surface in normal mode.
Definition: Mesh.hpp:517
mgx::Mesh::setAxisView
void setAxisView(const QString &s, bool setShow=true)
Set the axis display and view.
Definition: Mesh.hpp:773
mgx::CellTissue
Definition: CellTissue.hpp:46
mgx::Mesh::ccTab
int & ccTab()
Cell complex tab.
Definition: Mesh.hpp:1303
mgx::Mesh::setCulling
void setCulling(bool cul)
Cull the back surface.
Definition: Mesh.hpp:637
mgx::TransferFunction
Definition: TransferFunction.hpp:34
mgx::Mesh::stack
const Stack * stack() const
Returns the stack associated to this mesh.
Definition: Mesh.hpp:119
mgx::Mesh::setShowSurface
void setShowSurface(bool val=true)
Show the surface to the user.
Definition: Mesh.hpp:594
mgx::IntVtxMap
std::unordered_map< int, vertex > IntVtxMap
Int to vertex map.
Definition: Types.hpp:146
mgx::Mesh::hasImgTex
bool & hasImgTex()
True if the surface has a texture attached to it.
Definition: Mesh.hpp:696
mgx::Mesh::setShowMeshLines
void setShowMeshLines(bool show)
Set if the mesh lines are visible.
Definition: Mesh.hpp:798
mgx::Mesh::nextLabel
int nextLabel()
Increment the current label and return.
Definition: Mesh.hpp:177
mgx::Mesh::labelNeighbors
IntIntSetMap & labelNeighbors()
Reference to the map from labels to the set of neighbor labels.
Definition: Mesh.hpp:472
mgx::Mesh::opacity
float opacity() const
Get the current opacity level of the surface.
Definition: Mesh.hpp:554
mgx::Mesh::imgTex
QImage & imgTex()
Definition: Mesh.hpp:705
mgx::Mesh::triangleValue
TriFloatAttr & triangleValue()
Triangle value for interpolated color map mode.
Definition: Mesh.hpp:979
mgx::Mesh::userId
int userId() const
Id as seen by the user.
Definition: Mesh.hpp:114
mgx::Mesh::cells
cellGraph & cells()
Get the cell graph.
Definition: Mesh.hpp:385
mgx::Mesh::wallHeatUnit
QString & wallHeatUnit()
Wall heat unit.
Definition: Mesh.hpp:953
mgx::Mesh::tissue
CellTissue & tissue()
Get the Cell Tissue.
Definition: Mesh.hpp:380
mgx::Mesh::setAxisWidth
float setAxisWidth(float width)
Definition: Mesh.hpp:1051
mgx::Mesh::vertexAxis
VtxSymTensorAttr & vertexAxis()
Definition: Mesh.hpp:1205
mgx::Mesh::empty
bool empty() const
True if the mesh is empty (i.e.
Definition: Mesh.hpp:395
mgx::Mesh::cellAxis
IntSymTensorAttr & cellAxis()
Cell axis tensor quantity for each cell.
Definition: Mesh.hpp:1087
mgx::Stack
Definition: Stack.hpp:33
mgx::Mesh::wallGeom
IntIntFloatAttr & wallGeom()
Reference to the map from each wall to the length of the wall.
Definition: Mesh.hpp:459
mgx::Mesh::culling
bool culling() const
Returns if the back surface is culled.
Definition: Mesh.hpp:632
mgx::Mesh::triangleAxisVis
TriMatrix3fAttr & triangleAxisVis()
Cell axis for visualization.
Definition: Mesh.hpp:1175
mgx::Mesh::SURF_VERTEX
@ SURF_VERTEX
Vertex level rendering such as projected signal.
Definition: Mesh.hpp:64
mgx::Mesh::nhbdC
CellTissue::DistNhbdC & nhbdC()
Get the neighborhood object for the cell graph.
Definition: Mesh.hpp:405
mgx::Mesh::wallHeat
IntIntFloatAttr & wallHeat()
Reference to map of heat data by wall (i.e.
Definition: Mesh.hpp:937
mgx::Mesh::setShowMesh
void setShowMesh(bool show=true)
Set the mesh visibility.
Definition: Mesh.hpp:743
mgx::Information::init
mgx_EXPORT void init(QMainWindow *wnd)
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::Mesh::setBrightness
void setBrightness(float f)
Change the current brightness of the surface.
Definition: Mesh.hpp:576
mgx::Mesh::signalUnit
QString & signalUnit()
Reference to the unit used for the signal.
Definition: Mesh.hpp:1262
mgx::Mesh::labelNeighbors
const IntIntSetMap & labelNeighbors() const
Returns the map from labels to the set of neighbors labels.
Definition: Mesh.hpp:477
mgx::Mesh::signalBounds
Point2f & signalBounds()
Reference to the upper and lower bounds for the signal.
Definition: Mesh.hpp:1272
mgx::Mesh::cMap
IntCellMap & cMap()
Map cell saveId to cell.
Definition: Mesh.hpp:1352
mgx::Mesh::heatMapUnit
QString & heatMapUnit()
Reference to the unit used for the current heat map.
Definition: Mesh.hpp:911
mgx::Mesh::surfTriangleView
QString surfTriangleView() const
Returns the triangle visualization.
Definition: Mesh.hpp:667
mgx::Mesh::surfFctChanged
bool surfFctChanged() const
Returns true if the normal transfer function has been changed during the current process.
Definition: Mesh.hpp:528
mgx::Mesh::scaled
bool scaled() const
Returns true if the mesh is scaled.
Definition: Mesh.hpp:137
mgx::Mesh::mesh3D
bool mesh3D()
Convenience function to tell if a 3D mesh (from viewpoint of rendering)
Definition: Mesh.hpp:224
CellTissue.hpp
mgx::IntIntPair
std::pair< int, int > IntIntPair
Element in IntIntMap.
Definition: Types.hpp:66
mgx::getLabel
mgx_EXPORT int getLabel(const vertex &v1, const vertex &v2, const vertex &v3)
Return the label for a triangle.
mgx::Mesh::parentCenter
IntPoint3fAttr & parentCenter()
Reference to the map from parent label to a position.
Definition: Mesh.hpp:286
mgx::Mesh::junctions
vvGraph & junctions()
Get the VV junction graph.
Definition: Mesh.hpp:365
mgx::Mesh::surfFct
TransferFunction surfFct() const
Return the transfer function used to draw the surface in normal mode.
Definition: Mesh.hpp:512
mgx::Mesh::showSignal
bool showSignal() const
Convenience functions.
Definition: Mesh.hpp:677
mgx::Mesh::setHeatFct
void setHeatFct(const TransferFunction &f)
Change the transfer function used to draw the surface in heat mode.
Definition: Mesh.hpp:538
mgx::Mesh::setShowTriangle
void setShowTriangle(const QString &s="", bool setView=true)
Set the surface triangle display.
Definition: Mesh.hpp:610
mgx::Mesh::heatFctChanged
bool heatFctChanged() const
Returns true if the heat transfer function has been changed during the current process.
Definition: Mesh.hpp:549
mgx::Mesh::setUseParents
void setUseParents(bool val)
Show the color of the surface.
Definition: Mesh.hpp:691
mgx::Mesh::tissue
const CellTissue & tissue() const
Get the Cell Tissue.
Definition: Mesh.hpp:375
mgx::Mesh::cellAxisVis
IntMatrix3fAttr & cellAxisVis()
Cell axis for visualization.
Definition: Mesh.hpp:1095
mgx::Mesh::triangleValueColors
ColorbVec & triangleValueColors()
Return the colormap for the triangle values.
Definition: Mesh.hpp:987
mgx::IntHVec3uMap
std::unordered_map< int, HVec3U > IntHVec3uMap
Map of an integer to a host vector of 3 unsigned integers.
Definition: Mesh.hpp:38
mgx::Mesh::labelNormalVis
IntPoint3fAttr & labelNormalVis()
Reference to the map from label to a normal.
Definition: Mesh.hpp:274
mgx::ColorbVec
std::vector< Colorb > ColorbVec
Definition: Color.hpp:319
mgx::IntHVec3uPair
std::pair< int, HVec3U > IntHVec3uPair
Element in IntHVec3uMap.
Definition: Mesh.hpp:40
mgx::Mesh::setCellAxisType
QString setCellAxisType(const QString &s)
Set the type of the current cell axis.
Definition: Mesh.hpp:1128
mgx::IntMatrix3fMap
std::unordered_map< int, Matrix3f > IntMatrix3fMap
Map of an integer to a 3x3 matrix.
Definition: Types.hpp:100
mgx::Mesh::setCellAxisUnit
QString setCellAxisUnit(const QString &s)
Unit for the length of the cell axis.
Definition: Mesh.hpp:1145
mgx::Mesh::parents
IntIntAttr & parents()
Reference to the map from each label to its parent.
Definition: Mesh.hpp:200
mgx::Mesh::vertexAxisColor
VtxVec3ColorbAttr & vertexAxisColor()
Returns the map from label to cells axis colors (array of 3 Point3f)
Definition: Mesh.hpp:1221
mgx::Mesh::meshType
const QString & meshType()
Returns the mesh type.
Definition: Mesh.hpp:208
mgx::Mesh::setShowMeshCellMap
void setShowMeshCellMap(bool show)
Set if the cell numbers are visible.
Definition: Mesh.hpp:808
mgx::Triangle
class Triangle Triangle.hpp <Triangle.hpp>
Definition: Triangle.hpp:31
mgx::Mesh::wallVId
const IntIntVIdSetMap & wallVId() const
Returns the map from each wall to the list of vertexes in the wall.
Definition: Mesh.hpp:448
mgx::Mesh::showAxis
bool showAxis() const
Is the axis currently visible to the user.
Definition: Mesh.hpp:758
mgx::Mesh::wallHeatBounds
Point2f & wallHeatBounds()
Upper and lower bounds for the heat.
Definition: Mesh.hpp:945
mgx::Mesh::wallVId
IntIntVIdSetMap & wallVId()
Reference to the map from each wall to the list of vertexes in the wall.
Definition: Mesh.hpp:443
mgx::AttrMap::defaultVal
const ValueT & defaultVal() const
Get a reference to the default value.
Definition: Attributes.hpp:767
CudaExport.hpp
mgx::Mesh::cellAxisUnit
QString cellAxisUnit()
Unit for the length of the cell axis.
Definition: Mesh.hpp:1137
mgx::Mesh::setBoundingBox
void setBoundingBox(const BoundingBox3f &bbox)
Set the mesh bounding box.
Definition: Mesh.hpp:1292
mgx::Mesh::brightness
float brightness() const
Get the current brightness of the surface.
Definition: Mesh.hpp:571
mgx::Mesh::vertexAxisVis
VtxMatrix3fAttr & vertexAxisVis()
Cell axis for visualization.
Definition: Mesh.hpp:1213
mgx::Mesh::clearImgTex
void clearImgTex()
Remove any texture attached to the surface.
Definition: Mesh.hpp:719
mgx::cell
cellGraph::vertex_t cell
Type of a vertex.
Definition: Types.hpp:122
mgx::Mesh::labelHeat
IntFloatAttr & labelHeat()
Reference to map of heat data by label.
Definition: Mesh.hpp:901
mgx::Mesh::file
const QString & file() const
Returns the name of the mesh file.
Definition: Mesh.hpp:124
mgx::Mesh
Definition: Mesh.hpp:54
mgx::Mesh::triangleColor
TriVec3ColorbAttr & triangleColor()
Triangle colors.
Definition: Mesh.hpp:963
mgx::DistNhbd< vvGraph >
mgx::Mesh::setScaled
void setScaled(bool on=true)
Set if the mesh is scaled.
Definition: Mesh.hpp:142
mgx::Mesh::VtxSymTensorPair
std::pair< vertex, SymmetricTensor > VtxSymTensorPair
Tensor quantity for each vertex.
Definition: Mesh.hpp:1203
mgx::Mesh::setShowAxis
void setShowAxis(bool show=true)
Set the axis display.
Definition: Mesh.hpp:768
mgx::Point2f
Vector< 2, float > Point2f
Definition: ColorMap.hpp:19
mgx::Mesh::setOpacity
void setOpacity(float f)
Change the current opactity level of the surface.
Definition: Mesh.hpp:559
mgx::Mesh::graph
vvGraph & graph()
Get the VV graph of the mesh.
Definition: Mesh.hpp:355
mgx::Mesh::ccName
QString & ccName()
Current cell complex.
Definition: Mesh.hpp:1310
mgx::Mesh::blending
bool blending() const
Return if the surface is rendered blended or not.
Definition: Mesh.hpp:642
mgx::Mesh::surfView
SurfView surfView() const
Returns the current visualization for the surface.
Definition: Mesh.hpp:652
mgx::Mesh::labelCenterVis
IntPoint3fAttr & labelCenterVis()
Reference to the map from label to a position.
Definition: Mesh.hpp:262
mgx::Mesh::showMeshCellMap
bool showMeshCellMap() const
Are cell numbers visible.
Definition: Mesh.hpp:793
mgx::Vector< 3, float >
mgx::Mesh::setAxisOffset
float setAxisOffset(float offset)
Definition: Mesh.hpp:1070
mgx::Mesh::showMeshPoints
bool showMeshPoints() const
Are mesh points visible.
Definition: Mesh.hpp:788
mgx::Mesh::triangleValueUnit
QString & triangleValueUnit()
Reference to the unit used for triangle values.
Definition: Mesh.hpp:1007
mgx::Mesh::SurfView
SurfView
Surface visualization type.
Definition: Mesh.hpp:62
mgx::Mesh::vvCorrespondence
IntMatrix3fMap & vvCorrespondence()
Returns a reference to the map of correspondence between vertices in mesh1 and mesh2 (store vertices ...
Definition: Mesh.hpp:1235
mgx::Mesh::triangleIndex
TriIntAttr & triangleIndex()
Triangle index for indexed color map mode.
Definition: Mesh.hpp:971
mgx::Mesh::nhbdS
CellTissue::DistNhbdS & nhbdS()
Get the neighborhood object for the S graph.
Definition: Mesh.hpp:400
mgx::IntCellMap
std::unordered_map< int, cell > IntCellMap
Int to cell map.
Definition: Types.hpp:176
mgx::Color
A utility class to encapsulate color data.
Definition: Color.hpp:34
mgx::Mesh::boundingBox
BoundingBox3f & boundingBox()
Definition: Mesh.hpp:1285
mgx::Mesh::cells
const cellGraph & cells() const
Get the cell graph.
Definition: Mesh.hpp:390
mgx::VtxIntMap
std::unordered_map< vertex, int > VtxIntMap
Map of vertex to int.
Definition: Types.hpp:154
Types.hpp
mgx::Mesh::heatMapBounds
Point2f & heatMapBounds()
Return the upper and lower bounds for the heat.
Definition: Mesh.hpp:924
mgx::Mesh::showVVCorrespondence
bool & showVVCorrespondence()
Definition: Mesh.hpp:1243
mgx::Mesh::imgTex
const QImage & imgTex() const
Get the current texture attached to the surface.
Definition: Mesh.hpp:704
mgx::Mesh::surfVertexView
QString surfVertexView() const
Returns the vertex visualization.
Definition: Mesh.hpp:662
mgx::Mesh::attributes
Attributes & attributes()
Definition: Mesh.hpp:192
mgx::Mesh::setId
void setId(int i)
Change the id of the mesh.
Definition: Mesh.hpp:107
mgx::Mesh::changes
int changes() const
Returns what changed in the current process.
Definition: Mesh.hpp:888
mgx::Mesh::axisWidth
float axisWidth()
Definition: Mesh.hpp:1040
mgx::VtxSet
std::set< vertex > VtxSet
Set of vertices.
Definition: Types.hpp:131
mgx::VVGraph< VertexData, EdgeData >
mgx::Mesh::showMeshLines
bool showMeshLines() const
Are mesh lines visible.
Definition: Mesh.hpp:783
mgx::Mesh::setShowVertex
void setShowVertex(const QString &s="", bool setView=true)
Set the surface vertex display.
Definition: Mesh.hpp:599
mgx::Matrix
Definition: Matrix.hpp:39
mgx::Mesh::boundingBox
const BoundingBox3f & boundingBox() const
Reference to the mesh bounding box.
Definition: Mesh.hpp:1281
mgx::IntIntVIdSetMap
std::map< IntIntPair, VIdSet > IntIntVIdSetMap
Map of a pair of integers to a set of vertex ids.
Definition: Types.hpp:97
mgx::Mesh::chkGraph
bool chkGraph(vvGraph &S)
Check the graph for consistency.
Definition: Mesh.hpp:427
mgx::Mesh::triangleAxisColor
TriVec3ColorbAttr & triangleAxisColor()
Returns the map from label to cells axis colors (array of 3 Point3f)
Definition: Mesh.hpp:1183
mgx::offset
CU_HOST_DEVICE size_t offset(uint x, uint y, uint z, uint xsz, uint ysz)
Definition: Geometry.hpp:431
mgx::Mesh::showHeat
bool showHeat() const
Definition: Mesh.hpp:679
mgx::Mesh::parentNormalVis
IntPoint3fAttr & parentNormalVis()
Reference to the map from parent label to a normal.
Definition: Mesh.hpp:322
mgx::Mesh::useParents
bool useParents()
Returns if we should use parents or labels.
Definition: Mesh.hpp:686
mgx::VVGraphVec
std::vector< vvGraph > VVGraphVec
Vector of vvGraphs.
Definition: Types.hpp:137
mgx::Mesh::setMeshType
const QString & setMeshType(const QString &mType)
Set the mesh type.
Definition: Mesh.hpp:216
mgx::Mesh::cellColor
CellVec2ColorbAttr & cellColor()
Cell colors.
Definition: Mesh.hpp:1023
mgx::Mesh::setSurfView
void setSurfView(SurfView view)
Change the view mode.
Definition: Mesh.hpp:657
mgx::Mesh::cellAxisType
QString cellAxisType()
Return the type of the current cell axis.
Definition: Mesh.hpp:1118
mgx::Mesh::setImgTex
void setImgTex(const QImage &img)
Set the texture attached to the surface.
Definition: Mesh.hpp:710
mgx::BoundingBox< 3, float >
mgx::Mesh::setMeshView
void setMeshView(const QString &s, bool setShow=true)
Set the mesh display and view.
Definition: Mesh.hpp:748
Stack.hpp
mgx::AttrMap
Attribute map wraps std::map.
Definition: Attributes.hpp:686
mgx::Mesh::parentNormal
IntPoint3fAttr & parentNormal()
Reference to the map from parent label to a normal.
Definition: Mesh.hpp:298
mgx::Mesh::showBBox
bool showBBox() const
Returns true if the bounding box is shown.
Definition: Mesh.hpp:157
mgx::Vertex
Definition: Vertex.hpp:58