MorphoGraphX
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MeshProcessLineage.hpp
1 #ifndef MESH_PROCESS_LINEAGE_HPP
2 #define MESH_PROCESS_LINEAGE_HPP
3 
4 #include <Process.hpp>
5 
6 namespace mgx { namespace process {
7 
10 
15  class mgxBase_EXPORT CorrectParents : public MeshProcess {
16  public:
17  CorrectParents(const MeshProcess& process) : Process(process), MeshProcess(process) {}
18 
19  bool operator()(const QStringList& )
20  {
21  if(!checkState().mesh(MESH_NON_EMPTY, 0).mesh(MESH_NON_EMPTY, 1))
22  return false;
23  Mesh* mesh1, *mesh2;
24  if(currentMesh() == mesh(0)) {
25  mesh2 = mesh(0);
26  mesh1 = mesh(1);
27  } else if(currentMesh() == mesh(1)) {
28  mesh2 = mesh(1);
29  mesh1 = mesh(0);
30  } else
31  return false;
32 
33  bool res = (*this)(mesh1, mesh2);
34  return res;
35  }
36 
37  bool operator()(Mesh* mesh1, Mesh* mesh2);
38 
39  QString folder() const { return "Lineage Tracking"; }
40  QString name() const { return "Correct Parents"; }
41  QString description() const { return "Take out non-existing labels from parent map."; }
42  QStringList parmNames() const { return QStringList(); }
43  QStringList parmDescs() const { return QStringList(); }
44  QIcon icon() const { return QIcon(":/images/ParentsCheck.png"); }
45  };
46 
53  public:
54  HeatMapDaughterCells(const MeshProcess& process) : Process(process), MeshProcess(process) {}
55 
56  bool operator()(const QStringList& )
57  {
59  setErrorMessage("The current mesh must have show parents selected.");
60  return false;
61  }
62  Mesh* m = currentMesh();
63 
64  bool res = (*this)(m);
65  if(res)
66  m->showHeat();
67  return res;
68  }
69 
70  bool operator()(Mesh* m);
71 
72  QString folder() const { return "Lineage Tracking"; }
73  QString name() const { return "Heat Map Daughter Cells"; }
74  QString description() const { return
75  "Compute the heat map that shows how may daughter cells a parent cell has."; }
76  QStringList parmNames() const { return QStringList(); }
77  QStringList parmDescs() const { return QStringList(); }
78  QStringList parmDefaults() const { return QStringList(); }
79  QIcon icon() const { return QIcon(":/images/HeatMapDaughterCells.png"); }
80  };
81 
88  public:
89  CopyParentsToLabels(const MeshProcess& process) : Process(process), MeshProcess(process) {}
90 
91  bool operator()(const QStringList& )
92  {
94  setErrorMessage("The current mesh must have show parents selected.");
95  return false;
96  }
97  Mesh* m = currentMesh();
98 
99  bool res = (*this)(m);
100  if(res)
101  m->showLabel();
102  return res;
103  }
104 
105  bool operator()(Mesh* m);
106 
107  QString folder() const { return "Lineage Tracking"; }
108  QString name() const { return "Copy Parents to Labels"; }
109  QString description() const { return "Copy parents to labels, and clear parent table."; }
110  QStringList parmNames() const { return QStringList(); }
111  QStringList parmDescs() const { return QStringList(); }
112  QStringList parmDefaults() const { return QStringList(); }
113  QIcon icon() const { return QIcon(":/images/ParentsCopyToLabel.png"); }
114  };
116 
117 }}
118 
119 #endif
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessLineage.hpp:77
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessLineage.hpp:111
QString name() const
Returns the name of the process.
Definition: MeshProcessLineage.hpp:108
Take out non-existing labels from parent map.
Definition: MeshProcessLineage.hpp:15
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessLineage.hpp:78
QString name() const
Returns the name of the process.
Definition: MeshProcessLineage.hpp:40
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessLineage.hpp:42
Process()
Default constructor.
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessLineage.hpp:109
QString name() const
Returns the name of the process.
Definition: MeshProcessLineage.hpp:73
CheckState checkState()
Call this function and convert the result to a boolean.
This class holds the actual mesh as a VV Graph and all sort of properties for it, including visualiza...
Definition: Mesh.hpp:167
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessLineage.hpp:74
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessLineage.hpp:56
Compute the heap map that shows how many daughter cells a parent cell has.
Definition: MeshProcessLineage.hpp:52
Copy parents to labels, and clear parent table.
Definition: MeshProcessLineage.hpp:87
bool setErrorMessage(const QString &str)
Set an error message that will be displayed if the process returns false.
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessLineage.hpp:43
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessLineage.hpp:19
void showLabel()
Show the labels of the surface triangles.
Definition: Mesh.hpp:810
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessLineage.hpp:41
QString folder() const
Folder in which to place the process.
Definition: MeshProcessLineage.hpp:107
File containing the definition of a Process.
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessLineage.hpp:91
Mesh * mesh(int i)
Returns the ith mesh.
This is the main process class, the one all process inherit from.
Definition: Process.hpp:248
Show the parent label.
Definition: Process.hpp:693
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessLineage.hpp:113
void showHeat()
Show the color of the surface.
Definition: Mesh.hpp:816
QString folder() const
Folder in which to place the process.
Definition: MeshProcessLineage.hpp:72
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessLineage.hpp:110
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessLineage.hpp:79
Non-empty mesh.
Definition: Process.hpp:664
Mesh * currentMesh()
Returns the current mesh (i.e.
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessLineage.hpp:76
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessLineage.hpp:44
QString folder() const
Folder in which to place the process.
Definition: MeshProcessLineage.hpp:39
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessLineage.hpp:112
Mesh processes have mutable access to meshes and non-mutable access to stacks.
Definition: Process.hpp:855