MorphoGraphX
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Mesh.hpp
Go to the documentation of this file.
1 #ifndef MESH_HPP
2 #define MESH_HPP
3 
10 #include <Config.hpp>
11 
12 #include <cuda/CudaExport.hpp>
13 #include <EdgeData.hpp>
14 #include <Geometry.hpp>
15 #include <Stack.hpp>
16 #include <SymmetricTensor.hpp>
17 #include <TransferFunction.hpp>
18 #include <UnorderedMap.hpp>
19 #include <UnorderedSet.hpp>
20 #include <VertexData.hpp>
21 #include <VVGraph.hpp>
22 
23 #include <map>
24 #include <omp.h>
25 #include <QImage>
26 #include <QString>
27 #include <set>
28 #include <string.h>
29 #include <typeinfo>
30 
31 namespace mgx {
32 
37 
40 
43 
44  typedef unsigned short ushort;
45  typedef unsigned int uint;
46  typedef unsigned long ulong;
47 
48  typedef util::Color<float> Colorf;
49 
51 
53  typedef std::map<int, Point3f> IntPoint3fMap;
54  typedef std::unordered_map<int, Point3f> IntPoint3fUMap;
56  typedef std::pair<int, Point3f> IntPoint3fPair;
58  typedef std::map<int, float> IntFloatMap;
59  typedef std::unordered_map<int, float> IntFloatUMap;
61  typedef std::pair<int, float> IntFloatPair;
63  typedef std::map<int, int> IntIntMap;
64  typedef std::unordered_map<int, int> IntIntUMap;
66  typedef std::pair<int, int> IntIntPair;
68  typedef std::map<int, HVec3U> IntHVec3uMap;
69  typedef std::unordered_map<int, HVec3U> IntHVec3uUMap;
71  typedef std::pair<int, HVec3U> IntHVec3uPair;
73  typedef std::set<ulong> VIdSet;
74  typedef std::unordered_set<ulong> VIdUSet;
76  typedef std::set<vertex> VtxSet;
77  typedef std::unordered_set<vertex> VtxUSet;
79  typedef std::vector<vertex> VtxVec;
81  typedef std::vector<vvgraph> VVGraphVec;
83  typedef std::pair<int, vvgraph> IntVVGraphPair;
85  typedef std::map<int, vvgraph> IntVVGraphMap;
86  typedef std::unordered_map<int, vvgraph> IntVVGraphUMap;
88  typedef std::map<int, VIdSet> IntVIdSetMap;
89  typedef std::unordered_map<int, VIdSet> IntVIdSetUMap;
91  typedef std::pair<int, VIdSet> IntVIdSetPair;
93  typedef std::set<int> IntSet;
94  typedef std::unordered_set<int> IntUSet;
96  typedef std::vector<int> IntVec;
98  typedef std::vector<float> FloatVec;
100  typedef std::pair<int, IntSet> IntIntSetPair;
102  typedef std::map<int, IntSet> IntIntSetMap;
103  typedef std::unordered_map<int, IntSet> IntIntSetUMap;
105  typedef std::map<vertex, int> VIntMap;
106  typedef std::unordered_map<vertex, int> VIntUMap;
108  typedef std::pair<IntIntPair, VIdSet> IntIntVIdSetPair;
110  typedef std::pair<IntIntPair, float> IntIntFloatPair;
112  typedef std::map<IntIntPair, float> IntIntFloatMap;
113  typedef std::unordered_map<IntIntPair, float> IntIntFloatUMap;
115  typedef std::map<IntIntPair, VIdSet> IntIntVIdSetMap;
116  typedef std::unordered_map<IntIntPair, VIdSet> IntIntVIdSetUMap;
118  typedef std::map<int, Matrix3f> IntMatrix3x3fMap;
119  typedef std::unordered_map<int, Matrix3f> IntMatrix3x3fUMap;
121  typedef std::pair<int, Matrix3f> IntMatrix3x3fPair;
123  typedef std::map<int, util::SymmetricTensor> IntSymTensorMap;
124  typedef std::unordered_map<int, util::SymmetricTensor> IntSymTensorUMap;
126  typedef std::pair<int, util::SymmetricTensor> IntSymTensorPair;
128  typedef std::map<vertex, vertex> VtxVtxMap;
129  typedef std::unordered_map<vertex, vertex> VtxVtxUMap;
130 }
131 
132 namespace std {
133 #ifdef HASH_NEED_TR1
134 namespace tr1 {
135 #endif
136 
137 template <typename T1, typename T2> struct hash<std::pair<T1, T2> > {
138  size_t operator()(const std::pair<T1, T2>& v) const
139  {
140  std::hash<T1> h1;
141  std::hash<T2> h2;
142  return h1(v.first) ^ h2(v.second);
143  }
144 };
145 
146 #ifdef HASH_NEED_TR1
147 } // namspace tr1
148 #endif
149 } // namespace std
150 
151 namespace mgx {
152 
153  namespace process {
154  class SetupProcess;
155  }
156 
167  class mgx_EXPORT Mesh {
168  friend class process::SetupProcess;
169 
170  public:
174  enum SurfView {
178  PARENT
179  };
180 
184  enum MeshView {
188  SELECTED_MESH
189  };
190 
194  enum Color {
197  IMAGE
198  };
199 
203  Mesh(const Stack* stack);
204 
208  Mesh(int id, const Stack* stack);
209 
213  Mesh(const Mesh& copy);
214 
218  ~Mesh();
219 
221 
229  int id() const {
230  return _id;
231  }
232 
238  void setId(int i) {
239  _id = i;
240  }
241 
247  int userId() const {
248  return _id + 1;
249  }
250 
254  const Stack* stack() const {
255  return _stack;
256  }
257 
258  // For now, a mesh is always with the same stack
259  void setStack(const Stack* s);
260 
264  const QString& file() const {
265  return _file;
266  }
267 
271  const QString& parentFile() const {
272  return _parentFile;
273  }
274 
281  void setFile(const QString& file = QString());
282 
288  void setParentFile(const QString& file = QString());
289 
293  bool scaled() const {
294  return _scaled;
295  }
296 
300  void setScaled(bool on = true) {
301  _scaled = on;
302  }
303 
307  bool transformed() const {
308  return _transformed;
309  }
313  void setTransformed(bool on = true) {
314  _transformed = on;
315  }
316 
320  bool showBBox() const {
321  return _showBBox;
322  }
323 
327  void setShowBBox(bool on = true) {
328  _showBBox = on;
329  }
330 
334  int viewLabel() const {
335  return _currLabel;
336  }
340  void setLabel(int l)
341  {
342  changed_label = true;
343  _currLabel = l;
344  }
348  int nextLabel()
349  {
350  changed_label = true;
351  return ++_currLabel;
352  }
356  bool labelChanged() const {
357  return changed_label;
358  }
359 
364  return _parentLabel;
365  }
369  const IntIntMap& parentLabelMap() const {
370  return _parentLabel;
371  }
378  bool cells() const {
379  return _cells;
380  }
387  void setCells(bool value = true) {
388  _cells = value;
389  }
390 
398  void reset();
399 
401 
403 
409  return S;
410  }
414  const vvgraph& graph() const {
415  return S;
416  }
420  bool empty() const {
421  return S.empty();
422  }
426  size_t size() const {
427  return S.size();
428  }
429 
433  int getLabel(vertex v1, vertex v2, vertex v3, bool useParentLabel = true) const;
434 
441  bool uniqueTri(const vertex& v, const vertex& n, const vertex& m) const
442  {
443  if(v <= n or v <= m or n == m or !S.edge(v, n) or !S.edge(v, m) or !S.edge(n, m))
444  return false;
445  else
446  return true;
447  }
448 
454  bool setNormal(vertex v) {
455  return setNormal(S, v);
456  }
457 
463  static bool setNormal(vvgraph& S, vertex v);
464 
470  bool setNormals();
471 
480  return _labelCenter;
481  }
485  const IntPoint3fMap& labelCenter() const {
486  return _labelCenter;
487  }
488 
497  return _labelNormal;
498  }
502  const IntPoint3fMap& labelNormal() const {
503  return _labelNormal;
504  }
513  return _labelCenterVis;
514  }
518  const IntPoint3fMap& labelCenterVis() const {
519  return _labelCenterVis;
520  }
521 
530  return _labelNormalVis;
531  }
535  const IntPoint3fMap& labelNormalVis() const {
536  return _labelNormalVis;
537  }
538 
547  return _parentCenter;
548  }
552  const IntPoint3fMap& parentCenter() const {
553  return _parentCenter;
554  }
555 
564  return _parentNormal;
565  }
569  const IntPoint3fMap& parentNormal() const {
570  return _parentNormal;
571  }
580  return _parentCenterVis;
581  }
586  return _parentCenterVis;
587  }
588 
597  return _parentNormalVis;
598  }
603  return _parentNormalVis;
604  }
605 
615  return _labelNeighbors;
616  }
620  const IntIntSetMap& labelNeighbors() const {
621  return _labelNeighbors;
622  }
634  return _wallVId;
635  }
639  const IntIntVIdSetMap& wallVId() const {
640  return _wallVId;
641  }
652  return _wallGeom;
653  }
657  const IntIntFloatMap& wallGeom() const {
658  return _wallGeom;
659  }
660 
666  void updateWallGeometry(float borderSize);
667 
673  bool isBordTriangle(int label, vertex v, vertex n, vertex m, IntIntPair& rp) const;
674 
679  void markBorder(float borderSize);
680 
685  void updateCentersNormals();
686 
690  void prepareAxisDrawing(float scaleAxisLength, Colorf colorPositive, Colorf colorNegative,
691  const Point3b& showAxis = Point3b(true, true, true)); // ,float DisplayThreshold)
692 
694 
696 
701  return _surf_fct;
702  }
707  {
708  if(_surf_fct != f) {
709  _surf_fct = f;
710  changed_surf_function = true;
711  }
712  }
717  bool surfFctChanged() const {
718  return changed_surf_function;
719  }
720 
725  return _heat_fct;
726  }
731  {
732  if(_heat_fct != f) {
733  _heat_fct = f;
734  changed_heat_function = true;
735  }
736  }
741  bool heatFctChanged() const {
742  return changed_heat_function;
743  }
744 
748  float opacity() const {
749  return _opacity;
750  }
754  void setOpacity(float f)
755  {
756  if(f < 0)
757  _opacity = 0;
758  else if(f > 1)
759  _opacity = 1;
760  else
761  _opacity = f;
762  }
766  float brightness() const {
767  return _brightness;
768  }
772  void setBrightness(float f)
773  {
774  if(f < 0)
775  _brightness = 0;
776  else if(f > 1)
777  _brightness = 1;
778  else
779  _brightness = f;
780  }
781 
785  bool isSurfaceVisible() const {
786  return _isSurfaceVisible;
787  }
791  void showSurface() {
792  _isSurfaceVisible = true;
793  }
797  void hideSurface() {
798  _isSurfaceVisible = false;
799  }
800 
804  void showNormal() {
805  _show = NORMAL;
806  }
810  void showLabel() {
811  _show = LABEL;
812  }
816  void showHeat() {
817  _show = HEAT;
818  }
822  void showParent() {
823  _show = PARENT;
824  }
825 
829  void show(SurfView view) {
830  _show = view;
831  }
832 
836  void showSignal() {
837  _color = SIGNAL;
838  }
846  void showTexture() {
847  _color = TEXTURE;
848  }
849 
853  void showImage() {
854  _color = IMAGE;
855  }
856 
860  void show(Color color) {
861  _color = color;
862  }
863 
867  bool culling() const {
868  return _culling;
869  }
873  void setCulling(bool cul) {
874  _culling = cul;
875  }
876 
880  bool blending() const {
881  return _blending;
882  }
886  void setBlending(bool b) {
887  _blending = b;
888  }
889 
893  SurfView toShow() const {
894  return _show;
895  }
899  Color coloring() const {
900  return _color;
901  }
902 
906  bool hasImgTex() const {
907  return _imgtex;
908  }
912  const QImage& imgTex() const {
913  return _image;
914  }
918  void setImgTex(const QImage& img)
919  {
920  _imgtex = true;
921  _image = img;
922  }
926  void clearImgTex()
927  {
928  _imgtex = false;
929  _image = QImage();
930  }
931 
933 
935 
939  bool isMeshVisible() const {
940  return _isMeshVisible;
941  }
945  void showMesh() {
946  _isMeshVisible = true;
947  }
951  void hideMesh() {
952  _isMeshVisible = false;
953  }
954 
958  MeshView meshView() const {
959  return _meshView;
960  }
961 
965  void showAllMesh() {
966  _meshView = ALL_MESH;
967  }
971  void showCellMesh() {
972  _meshView = CELL_MESH;
973  }
977  void showBorderMesh() {
978  _meshView = BORDER_MESH;
979  }
984  _meshView = SELECTED_MESH;
985  }
986 
990  void show(MeshView view) {
991  _meshView = view;
992  }
993 
997  bool showMeshLines() const {
998  return _showMeshLines;
999  }
1003  bool showMeshPoints() const {
1004  return _showMeshPoints;
1005  }
1009  bool showMeshCellMap() const {
1010  return _showMeshCellMap;
1011  }
1012 
1016  void setShowMesh(bool show) {
1017  _isMeshVisible = show;
1018  }
1022  void setShowMeshLines(bool show) {
1023  _showMeshLines = show;
1024  }
1028  void setShowMeshPoints(bool show) {
1029  _showMeshPoints = show;
1030  }
1034  void setShowMeshCellMap(bool show) {
1035  _showMeshCellMap = show;
1036  }
1037 
1041  std::vector<vertex> selectedVertices() const;
1042 
1048  std::vector<vertex> activeVertices() const;
1049 
1050  // These next two should really be algorithms for the graph as they don't rely on
1051  // any Mesh variables.
1055  void getConnectedVertices(const vvgraph& S, vvgraph& vSet) const;
1056 
1060  int getConnectedRegions(const vvgraph& S, VVGraphVec& cellVId, VIntMap& vtxCell) const;
1061 
1065  static void getNhbd(const vvgraph& S, const vertex& v, float radius, VtxSet& nbs);
1066 
1077  void correctSelection(bool inclusive);
1078 
1080 
1082 
1086  void updateAll();
1090  void updateTriangles();
1094  void updateLines();
1098  void updatePositions();
1102  void updateSelection();
1105  int changes() const {
1106  return _changed;
1107  }
1109 
1111 
1122  return _labelHeat;
1123  }
1126  const IntFloatMap& labelHeat() const {
1127  return _labelHeat;
1128  }
1132  return _wallHeat;
1133  }
1136  const IntIntFloatMap& wallHeat() const {
1137  return _wallHeat;
1138  }
1145  return _heatMapUnit;
1146  }
1148  const QString& heatMapUnit() const {
1149  return _heatMapUnit;
1150  }
1153  return _heatMapBounds;
1154  }
1156  const Point2f& heatMapBounds() const {
1157  return _heatMapBounds;
1158  }
1159 
1167  return _cellAxis;
1168  }
1169 
1174  return _cellAxisScaled;
1175  } // added by ALR
1176 
1181  return _cellAxisColor;
1182  } // added by ALR
1183 
1186  float& cellAxisWidth() {
1187  return _cellAxisWidth;
1188  } // added by ALR
1191  float& cellAxisOffset() {
1192  return _cellAxisOffset;
1193  }
1199  const QString& cellAxisType() const {
1200  return _cellAxisType;
1201  }
1208  return _cellAxisType;
1209  }
1213  const QString& cellAxisUnit() const {
1214  return _cellAxisUnit;
1215  }
1220  return _cellAxisUnit;
1221  }
1225  void clearCellAxis();
1229  return _VVCorrespondance;
1230  } // added by ALR
1234  return _showVVCorrespondance;
1235  } // added by ALR
1236 
1238 
1240 
1251  return _signalUnit;
1252  }
1254  const QString& signalUnit() const {
1255  return _signalUnit;
1256  }
1259  return _signalBounds;
1260  }
1262  const Point2f& signalBounds() const {
1263  return _signalBounds;
1264  }
1266 
1267  bool needsColorbar() const
1268  {
1269  return (isSurfaceVisible() and ((toShow() == HEAT and (_labelHeat.size() > 1 or _wallHeat.size() > 1))
1270  or (toShow() == NORMAL and coloring() == SIGNAL)));
1271  }
1272 
1273  const BoundingBox3f& boundingBox() const {
1274  return _bbox;
1275  }
1276  BoundingBox3f& boundingBox() {
1277  return _bbox;
1278  }
1279  void setBoundingBox(const BoundingBox3f& bbox) {
1280  _bbox = bbox;
1281  }
1282  void updateBBox();
1283 
1284  private:
1285  void resetModified();
1286 
1287  vvgraph S;
1288  TransferFunction _surf_fct, _heat_fct;
1289  IntFloatMap _labelHeat;
1290  IntIntFloatMap _wallHeat;
1291  IntPoint3fMap _labelCenter;
1292  IntPoint3fMap _labelCenterVis;
1293  IntPoint3fMap _labelNormal;
1294  IntPoint3fMap _labelNormalVis;
1295  IntPoint3fMap _parentCenter;
1296  IntPoint3fMap _parentCenterVis;
1297  IntPoint3fMap _parentNormal;
1298  IntPoint3fMap _parentNormalVis;
1299  IntSymTensorMap _cellAxis;
1300  IntMatrix3x3fMap _cellAxisScaled;
1301  IntMatrix3x3fMap _cellAxisColor;
1302  float _cellAxisWidth;
1303  float _cellAxisOffset;
1304  QString _cellAxisType;
1305  QString _cellAxisUnit;
1306  IntMatrix3x3fMap _VVCorrespondance;
1307  bool _showVVCorrespondance;
1308  IntIntSetMap _labelNeighbors;
1309  IntIntVIdSetMap _wallVId;
1310  IntIntFloatMap _wallGeom;
1311  QString _signalUnit, _heatMapUnit;
1312  Point2f _signalBounds, _heatMapBounds;
1313  bool changed_surf_function, changed_heat_function;
1314  bool changed_label;
1315  int _changed;
1316  SurfView _show;
1317  Color _color;
1318  bool _culling, _blending;
1319  bool _isSurfaceVisible, _isMeshVisible;
1320  int _currLabel;
1321  IntIntMap _parentLabel;
1322  float _opacity, _brightness;
1323  MeshView _meshView;
1324  bool _showMeshLines, _showMeshPoints, _showMeshCellMap;
1325  bool _cells, _imgtex;
1326  QString _file;
1327  QString _parentFile;
1328  bool _scaled;
1329  bool _transformed;
1330  bool _showBBox;
1331  int _id;
1332  const Stack* _stack;
1333  QImage _image;
1334 
1335  BoundingBox3f _bbox;
1336 
1337  void init();
1338  };
1339 }
1340 
1341 #endif
const IntIntVIdSetMap & wallVId() const
Returns the map from each wall to the list of vertexes in the wall.
Definition: Mesh.hpp:639
std::set< int > IntSet
Set of integers.
Definition: Mesh.hpp:93
bool cells() const
Returns true if the mesh has a cell structure.
Definition: Mesh.hpp:378
bool scaled() const
Returns true if the mesh is scaled.
Definition: Mesh.hpp:293
Color
Enumeration of the coloring modes possible to display a normal surface.
Definition: Mesh.hpp:194
Show the current heat map.
Definition: Mesh.hpp:177
Point2f & heatMapBounds()
Reference on the upper and lower bounds for the heat.
Definition: Mesh.hpp:1152
MeshView
Enumeration of the possible visualisations for the Mesh.
Definition: Mesh.hpp:184
std::pair< int, float > IntFloatPair
Element in IntFloatMap.
Definition: Mesh.hpp:61
std::map< int, Point3f > IntPoint3fMap
Map of an integer to a 3D point.
Definition: Mesh.hpp:53
void showSurface()
Show the surface to the user.
Definition: Mesh.hpp:791
std::pair< IntIntPair, VIdSet > IntIntVIdSetPair
Element in IntIntVIdSetMap.
Definition: Mesh.hpp:108
int id() const
Id of the current mesh.
Definition: Mesh.hpp:229
Edge of a vv graph.
Definition: Edge.hpp:35
std::map< int, HVec3U > IntHVec3uMap
Map of an integer to a host vector of 3 unsigned integers.
Definition: Mesh.hpp:68
void showParent()
Show the color of the surface.
Definition: Mesh.hpp:822
void setCulling(bool cul)
Cull the back surface.
Definition: Mesh.hpp:873
void setImgTex(const QImage &img)
Set the texture attached to the surface.
Definition: Mesh.hpp:918
void hideMesh()
Hide the mesh from the user.
Definition: Mesh.hpp:951
QString & signalUnit()
Reference on the unit used for the signal.
Definition: Mesh.hpp:1250
bool transformed() const
Returns true if the mesh is transformed.
Definition: Mesh.hpp:307
std::set< vertex > VtxSet
Set of vertices.
Definition: Mesh.hpp:76
std::pair< int, VIdSet > IntVIdSetPair
Element in IntVIdSetMap.
Definition: Mesh.hpp:91
const QString & file() const
Returns the name of the mesh file.
Definition: Mesh.hpp:264
IntIntSetMap & labelNeighbors()
Reference on the map from labels to the set of neighbor labels.
Definition: Mesh.hpp:614
void setShowMesh(bool show)
Set if the mesh visible at all.
Definition: Mesh.hpp:1016
const IntIntFloatMap & wallHeat() const
Returns the map from wall (i.e.
Definition: Mesh.hpp:1136
IntMatrix3x3fMap & cellAxisScaled()
Returns the map from label to cells axis (array of 3 Point3f), scaled for visualisation.
Definition: Mesh.hpp:1173
std::map< IntIntPair, VIdSet > IntIntVIdSetMap
Map of a pair of integers to a set of vertex ids.
Definition: Mesh.hpp:115
const IntPoint3fMap & parentNormal() const
Returns the map from parent label to normal.
Definition: Mesh.hpp:569
IntIntFloatMap & wallGeom()
Reference on the map from each wall to the length of the wall.
Definition: Mesh.hpp:651
IntPoint3fMap & labelNormalVis()
Reference on the map from label to a normal.
Definition: Mesh.hpp:529
std::pair< int, IntSet > IntIntSetPair
Element in IntIntSetMap.
Definition: Mesh.hpp:100
std::map< IntIntPair, float > IntIntFloatMap
Map of a pair of integers to a float.
Definition: Mesh.hpp:112
This file contains the definition of a vertex.
bool labelChanged() const
Returns true if the curr label has been changed during this process.
Definition: Mesh.hpp:356
bool showMeshLines() const
Are mesh lines visible.
Definition: Mesh.hpp:997
std::map< int, float > IntFloatMap
Map of an integer to a float.
Definition: Mesh.hpp:58
QString & cellAxisType()
Return the type of the current cell axis.
Definition: Mesh.hpp:1207
const IntIntFloatMap & wallGeom() const
Reference on the map from each wall to the length of the wall.
Definition: Mesh.hpp:657
const QString & cellAxisType() const
Return the type of the current cell axis.
Definition: Mesh.hpp:1199
TransferFunction surfFct() const
Return the transfer function used to draw the surface in normal mode.
Definition: Mesh.hpp:700
void setShowMeshPoints(bool show)
Set if the mesh points are visible.
Definition: Mesh.hpp:1028
IntPoint3fMap & parentCenterVis()
Reference on the map from parent label to a position.
Definition: Mesh.hpp:579
void showAllMesh()
Set the mesh view to all.
Definition: Mesh.hpp:965
Show the whole mesh.
Definition: Mesh.hpp:185
IntPoint3fMap & labelNormal()
Reference on the map from label to a normal.
Definition: Mesh.hpp:496
Color using the signal stored on the vertices.
Definition: Mesh.hpp:195
void setBlending(bool b)
Set the blending attribute.
Definition: Mesh.hpp:886
const Stack * stack() const
Returns the stack associated to this mesh.
Definition: Mesh.hpp:254
IntMatrix3x3fMap & vvCorrespondance()
Returns a reference to the map of correspondence between vertices in mesh1 and mesh2 (store vertices ...
Definition: Mesh.hpp:1228
void setShowBBox(bool on=true)
Set if the bounding box is shown.
Definition: Mesh.hpp:327
size_t size() const
Returns the number of vertices in the mesh.
Definition: Mesh.hpp:426
void setId(int i)
Change the id of the mesh.
Definition: Mesh.hpp:238
bool surfFctChanged() const
Returns true if the normal transfer function has been changed during the current process.
Definition: Mesh.hpp:717
void setLabel(int l)
Sets the current label.
Definition: Mesh.hpp:340
const QString & signalUnit() const
Returns the unit used for the signal.
Definition: Mesh.hpp:1254
SurfView
Enumeration of the possible visualisations for the surface.
Definition: Mesh.hpp:174
std::map< int, util::SymmetricTensor > IntSymTensorMap
Map an integer to a symmetric tensor.
Definition: Mesh.hpp:123
void setSurfFct(const TransferFunction &f)
Change the transfer function used to draw the surface in normal mode.
Definition: Mesh.hpp:706
float brightness() const
Get the current brightness of the surface.
Definition: Mesh.hpp:766
void showBorderMesh()
Set the mesh view to mesh border only.
Definition: Mesh.hpp:977
bool isMeshVisible() const
Is the mesh currently visible to the user.
Definition: Mesh.hpp:939
bool hasImgTex() const
True if the surface has a texture attached to it.
Definition: Mesh.hpp:906
IntIntFloatMap & wallHeat()
Reference on the map from wall (i.e.
Definition: Mesh.hpp:1131
vvgraph & graph()
Get the VV graph representing the topology of the mesh.
Definition: Mesh.hpp:408
std::map< int, int > IntIntMap
Map of an integer to another one.
Definition: Mesh.hpp:63
void showSignal()
Set the current color to be the signal (i.e.
Definition: Mesh.hpp:836
Color coloring() const
Returns the current coloring for the surface.
Definition: Mesh.hpp:899
std::pair< int, util::SymmetricTensor > IntSymTensorPair
Element in IntSymTensorMap.
Definition: Mesh.hpp:126
void setHeatFct(const TransferFunction &f)
Change the transfer function used to draw the surface in heat mode.
Definition: Mesh.hpp:730
IntIntMap & parentLabelMap()
Reference on the map from each label to a label in a different mesh.
Definition: Mesh.hpp:363
std::pair< IntIntPair, float > IntIntFloatPair
Element in IntIntFloatMap.
Definition: Mesh.hpp:110
SurfView toShow() const
Returns the current visualisation for the surface.
Definition: Mesh.hpp:893
const IntPoint3fMap & parentCenterVis() const
Returns the map from parent label to position.
Definition: Mesh.hpp:585
Show only the mesh border.
Definition: Mesh.hpp:186
std::map< int, VIdSet > IntVIdSetMap
Map of an integer to a set of vertex ids.
Definition: Mesh.hpp:88
const IntPoint3fMap & labelNormal() const
Returns the map from label to normal.
Definition: Mesh.hpp:502
void setOpacity(float f)
Change the current opactity level of the surface.
Definition: Mesh.hpp:754
This class holds the actual mesh as a VV Graph and all sort of properties for it, including visualiza...
Definition: Mesh.hpp:167
bool blending() const
Return if the surface is rendered blended or not.
Definition: Mesh.hpp:880
graph::VVGraph< VertexData, EdgeData > vvgraph
Type of the VV graph holding the actual mesh.
Definition: Mesh.hpp:36
std::map< vertex, vertex > VtxVtxMap
Map of vertex to vertex.
Definition: Mesh.hpp:128
void hideSurface()
Hide the surface from the user.
Definition: Mesh.hpp:797
std::map< int, vvgraph > IntVVGraphMap
Map of an integer to a vvgraph.
Definition: Mesh.hpp:85
std::vector< int > IntVec
Vector of integers.
Definition: Mesh.hpp:96
bool showMeshCellMap() const
Are cell numbers visible.
Definition: Mesh.hpp:1009
Color using the 3D texture of the active stack.
Definition: Mesh.hpp:196
bool culling() const
Returns if the back surface is culled.
Definition: Mesh.hpp:867
std::pair< int, vvgraph > IntVVGraphPair
Integer, VVGraph pair.
Definition: Mesh.hpp:83
bool heatFctChanged() const
Returns true if the heat transfer function has been changed during the current process.
Definition: Mesh.hpp:741
const QString & cellAxisUnit() const
Unit for the length of the cell axis.
Definition: Mesh.hpp:1213
const Point2f & heatMapBounds() const
Return the upper and lower bounds for the heat.
Definition: Mesh.hpp:1156
Show the label of the triangles.
Definition: Mesh.hpp:176
void setShowMeshLines(bool show)
Set if the mesh lines are visible.
Definition: Mesh.hpp:1022
This file contains the definition of an edge data.
vvgraph::vertex_t vertex
Type of a vertex.
Definition: Mesh.hpp:39
Common definitions and utilities for all geometry algorithms This file is shared by cuda...
const IntPoint3fMap & parentNormalVis() const
Returns the map from parent label to position.
Definition: Mesh.hpp:602
IntSymTensorMap & cellAxis()
Return the mapping of tensors for each cell.
Definition: Mesh.hpp:1166
IntFloatMap & labelHeat()
Reference on the map from label to intensity.
Definition: Mesh.hpp:1121
std::map< int, Matrix3f > IntMatrix3x3fMap
Map of an integer to a 3x3 matrix.
Definition: Mesh.hpp:118
Vertex of a vv graph.
Definition: Vertex.hpp:57
void showNormal()
Show the heat map of the surface, if any.
Definition: Mesh.hpp:804
void showCellMesh()
Set the mesh view to cell border only.
Definition: Mesh.hpp:971
Namespace containing all the utility classes.
Definition: Vector.hpp:37
bool showBBox() const
Returns true if the bounding box is shown.
Definition: Mesh.hpp:320
MeshView meshView() const
Return the current view mode for the mesh.
Definition: Mesh.hpp:958
void showLabel()
Show the labels of the surface triangles.
Definition: Mesh.hpp:810
const IntPoint3fMap & labelNormalVis() const
Returns the map from label to position.
Definition: Mesh.hpp:535
const QImage & imgTex() const
Get the current texture attached to the surface.
Definition: Mesh.hpp:912
std::pair< int, HVec3U > IntHVec3uPair
Element in IntHVec3uMap.
Definition: Mesh.hpp:71
bool setNormal(vertex v)
Update the normal of the vertex v in the mesh.
Definition: Mesh.hpp:454
bool & showVVCorrespondance()
Returns a boolean for visualization of lines between corresponding vertices.
Definition: Mesh.hpp:1233
void showImage()
Set the current color to be the texture attached to the mesh.
Definition: Mesh.hpp:853
const IntPoint3fMap & labelCenter() const
Returns the map from label to position.
Definition: Mesh.hpp:485
QString & cellAxisUnit()
Unit for the length of the cell axis.
Definition: Mesh.hpp:1219
The Stack class represent the dimensions of the 3D data, and the frames transformations.
Definition: Stack.hpp:25
IntIntVIdSetMap & wallVId()
Reference on the map from each wall to the list of vertexes in the wall.
Definition: Mesh.hpp:633
float opacity() const
Get the current opacity level of the surface.
Definition: Mesh.hpp:748
IntPoint3fMap & labelCenter()
Reference on the map from label to a position.
Definition: Mesh.hpp:479
Show the color option.
Definition: Mesh.hpp:175
std::pair< int, int > IntIntPair
Element in IntIntMap.
Definition: Mesh.hpp:66
const IntIntSetMap & labelNeighbors() const
Returns the map from labels to the set of neighbors labels.
Definition: Mesh.hpp:620
IntPoint3fMap & labelCenterVis()
Reference on the map from label to a position.
Definition: Mesh.hpp:512
const QString & heatMapUnit() const
Returns the unit used for the current heat map.
Definition: Mesh.hpp:1148
int userId() const
Id as seen by the user.
Definition: Mesh.hpp:247
bool showMeshPoints() const
Are mesh points visible.
Definition: Mesh.hpp:1003
void showHeat()
Show the color of the surface.
Definition: Mesh.hpp:816
std::set< ulong > VIdSet
Set of vertex ids.
Definition: Mesh.hpp:73
const QString & parentFile() const
Returns the name of the parent label file.
Definition: Mesh.hpp:271
void setShowMeshCellMap(bool show)
Set if the cell numbers are visible.
Definition: Mesh.hpp:1034
void setScaled(bool on=true)
Set if the mesh is scaled.
Definition: Mesh.hpp:300
QString & heatMapUnit()
Reference on the unit used for the current heat map.
Definition: Mesh.hpp:1144
IntPoint3fMap & parentNormalVis()
Reference on the map from parent label to a normal.
Definition: Mesh.hpp:596
const IntIntMap & parentLabelMap() const
Const reference on the map from each label to a label in a different mesh.
Definition: Mesh.hpp:369
void show(MeshView view)
Change the mesh view mode.
Definition: Mesh.hpp:990
void showMesh()
Make the mesh visible to the user.
Definition: Mesh.hpp:945
std::map< vertex, int > VIntMap
Map of a vertex to an integer.
Definition: Mesh.hpp:105
const IntFloatMap & labelHeat() const
Returns the map from label to intensity.
Definition: Mesh.hpp:1126
void show(Color color)
Change the color mode.
Definition: Mesh.hpp:860
void showTexture()
Set the current color to be the 3D texture at the position of the point.
Definition: Mesh.hpp:846
const IntPoint3fMap & labelCenterVis() const
Returns the map from label to position.
Definition: Mesh.hpp:518
std::vector< float > FloatVec
Vector of floats.
Definition: Mesh.hpp:98
bool empty() const
True if the mesh is empty (i.e.
Definition: Mesh.hpp:420
int changes() const
Returns what changed in the current process.
Definition: Mesh.hpp:1105
Contain the definition of the VVGraph template class.
const IntPoint3fMap & parentCenter() const
Returns the map from parent label to position.
Definition: Mesh.hpp:552
int viewLabel() const
Returns the current label, without modifying it.
Definition: Mesh.hpp:334
void showSelectedMesh()
Set the mesh view to selected mesh only.
Definition: Mesh.hpp:983
IntPoint3fMap & parentNormal()
Reference on the map from parent label to a normal.
Definition: Mesh.hpp:563
void show(SurfView view)
Change the view mode.
Definition: Mesh.hpp:829
int nextLabel()
Increment the current label and return.
Definition: Mesh.hpp:348
std::vector< vvgraph > VVGraphVec
Vector of vvgraphs.
Definition: Mesh.hpp:81
bool uniqueTri(const vertex &v, const vertex &n, const vertex &m) const
Returns true if (v,n,m) correspond to a canonical triangle.
Definition: Mesh.hpp:441
void setTransformed(bool on=true)
Set if the mesh is transformed.
Definition: Mesh.hpp:313
TransferFunction heatFct() const
Return the transfer function used to draw the surface in heat mode.
Definition: Mesh.hpp:724
const vvgraph & graph() const
Get the VV graph representing the topology of the mesh.
Definition: Mesh.hpp:414
std::pair< int, Point3f > IntPoint3fPair
Element in IntPoint3fMap.
Definition: Mesh.hpp:56
std::vector< vertex > VtxVec
Vector of vertices.
Definition: Mesh.hpp:79
bool isSurfaceVisible() const
True if the surface is currently visible to the user.
Definition: Mesh.hpp:785
void clearImgTex()
Remove any texture attached to the surface.
Definition: Mesh.hpp:926
std::pair< int, Matrix3f > IntMatrix3x3fPair
Element in IntMatrix3x3fMap.
Definition: Mesh.hpp:121
Class defining a transfer function as linear interpolation between set values.
Definition: TransferFunction.hpp:23
IntPoint3fMap & parentCenter()
Reference on the map from parent label to a position.
Definition: Mesh.hpp:546
const Point2f & signalBounds() const
Return the upper and lower bounds for the signal.
Definition: Mesh.hpp:1262
float & cellAxisWidth()
Returns the cell axis width.
Definition: Mesh.hpp:1186
IntMatrix3x3fMap & cellAxisColor()
Returns the map from label to cells axis colors (array of 3 Point3f)
Definition: Mesh.hpp:1180
vvgraph::edge_t edge
Type of an edge.
Definition: Mesh.hpp:42
void setBrightness(float f)
Change the current brightness of the surface.
Definition: Mesh.hpp:772
void setCells(bool value=true)
Set if the mesh has a cell structure.
Definition: Mesh.hpp:387
Point2f & signalBounds()
Reference on the upper and lower bounds for the signal.
Definition: Mesh.hpp:1258
std::map< int, IntSet > IntIntSetMap
Map of an integer to a set of integers.
Definition: Mesh.hpp:102
float & cellAxisOffset()
Returns a reference to the cell axis z-offset for drawing.
Definition: Mesh.hpp:1191
Show only the cell borders (i.e. interface between labels)
Definition: Mesh.hpp:187