MorphoGraphX  2.0-1-227
DivisionAnalysis2D.hpp
Go to the documentation of this file.
1 #ifndef DIVISION_ANALYSIS_2D_HPP
2 #define DIVISION_ANALYSIS_2D_HPP
3 
4 #include <Process.hpp>
6 #include <CellDivision.hpp>
7 
9 
10 namespace mgx {
11 
12 
20  {
21  public:
22  FlatDivisionPlane2D(const Process& process) : Process(process)
23  {
24  setName("Mesh/Division Analysis/Analysis 2D/Division Plane Approximation");
25  setDesc("Display a planar approximation plane of a wall between two cells");
26  setIcon(QIcon(":/images/DivisionPlane.png"));
27 
28  addParm("Display Plane","Overwrite the non-active mesh and display the plane","Yes",booleanChoice());
29  addParm("Plane Size","Plane Size","10.0");
30  addParm("Reset Mesh","Reset Mesh","No",booleanChoice());
31 
32  }
33 
34  bool run()
35  {
36  Mesh *m = currentMesh();
37  Mesh *m2;
38  if(currentMesh() == mesh(0))
39  m2 = mesh(1);
40  else
41  m2 = mesh(0);
42  return run(m, m2, stringToBool(parm("Display Plane")), parm("Plane Size").toDouble(), stringToBool(parm("Reset Mesh")));
43  }
44  bool run(Mesh *m, Mesh *m2, bool display, double planeSize, bool resetMesh, int label = 0);
45 
46  };
47 
55  {
56  public:
57  TestDivisionPlanes2D(const Process& process) : Process(process)
58  {
59  setName("Mesh/Division Analysis/Analysis 2D/Division Analysis");
60  setDesc("Finds the shortest wall of a cell PRE division \n"
61  "(needs a single cell as input)\n"
62  "The result will appear in (and overwrite) the non-active mesh.");
63  setIcon(QIcon(":/images/CHull.png"));
64 
65  addParm("Nr of Planes","Approx number of planes to be tested","1000");
66  addParm("Steps Center Displacement","Displacement steps from the cell center","0");
67  addParm("Stepsize Center Displacement","Displacement step size from the cell center","0.0");
68  addParm("Division Point","Division Point", "Centroid",QStringList() << "Centroid" << "Center Actual" << "Custom Vertex");
69 
70  }
71 
72  bool run()
73  {
74  Mesh *m = currentMesh();
75  Mesh *m2;
76  if(currentMesh() == mesh(0))
77  m2 = mesh(1);
78  else
79  m2 = mesh(0);
80  return run(m, m2, parm("Nr of Planes").toInt(), parm("Steps Center Displacement").toInt(), parm("Stepsize Center Displacement").toDouble(),
81  parm("Division Point"), -1);
82  }
83  bool run(Mesh *m, Mesh *m2, int divPlanes, int centerDisplSteps, double centerDisplStepSize, QString divCenter, int parentLabel);
84 
85  };
93  {
94  public:
95  DivisionAnalysisMulti2D(const Process& process) : Process(process)
96  {
97  setName("Mesh/Division Analysis/Analysis 2D/Division Analysis Multi");
98  setDesc("Multi cell analysis of divisions in 2D meshes");
99  setIcon(QIcon(":/images/CHull.png"));
100 
101  addParm("Test Single","Test Single","No",booleanChoice());
102  addParm("Test Double","Test Double","Yes",booleanChoice());
103  }
104 
105  bool run()
106  {
107  Mesh *m = currentMesh();
108  Mesh *m2;
109  if(currentMesh() == mesh(0))
110  m2 = mesh(1);
111  else
112  m2 = mesh(0);
113  return run(m, m2, stringToBool(parm("Test Single")), stringToBool(parm("Test Double")));
114  }
115  bool run(Mesh *m, Mesh *m2, bool singleCells, bool doubleCells);
116 
117  };
118 
119 
120 
121 }
122 
123 #endif
mgx::FlatDivisionPlane2D
Definition: DivisionAnalysis2D.hpp:19
mgx::ProcessParms::addParm
bool addParm(const QString &parmName, const QString &desc, const QString &def, const QStringList &choices=QStringList())
Add a parameter to the list.
Process.hpp
DivisionAnalysisData.hpp
mgx::FlatDivisionPlane2D::FlatDivisionPlane2D
FlatDivisionPlane2D(const Process &process)
Definition: DivisionAnalysis2D.hpp:22
mgx::ProcessParms::booleanChoice
static QStringList booleanChoice()
Helper function that provides a list of choices for a boolean argument.
Definition: ProcessParms.hpp:83
mgx::TestDivisionPlanes2D
Definition: DivisionAnalysis2D.hpp:54
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::ProcessParms::setIcon
bool setIcon(const QIcon &icon)
Set the icon.
CellDivision.hpp
mgx::Process
Definition: Process.hpp:219
mgx::stringToBool
mgx_EXPORT bool stringToBool(const QString &string)
Helper function converting a string into a boolean.
mgx::DivisionAnalysisMulti2D
Definition: DivisionAnalysis2D.hpp:92
mgx::DivisionAnalysisMulti2D::DivisionAnalysisMulti2D
DivisionAnalysisMulti2D(const Process &process)
Definition: DivisionAnalysis2D.hpp:95
mgx::ProcessParms::setDesc
bool setDesc(const QString &description)
Set the description.
mgx::Mesh
Definition: Mesh.hpp:54
mgx::TestDivisionPlanes2D::TestDivisionPlanes2D
TestDivisionPlanes2D(const Process &process)
Definition: DivisionAnalysis2D.hpp:57
mgx::Process::mesh
Mesh * mesh(int i)
Returns the ith mesh.
mgx::ProcessParms::setName
bool setName(const QString &name)
Set the name.
mgx::ProcessParms::parm
QString parm(const QString &name) const
Get a single parameter value by name.
mgx::TestDivisionPlanes2D::run
bool run()
Runs the process.
Definition: DivisionAnalysis2D.hpp:72
mgx::Process::currentMesh
Mesh * currentMesh()
Returns the current mesh (i.e.
mgx::DivisionAnalysisMulti2D::run
bool run()
Runs the process.
Definition: DivisionAnalysis2D.hpp:105
DivisionAnalysisProcesses.hpp
mgx::FlatDivisionPlane2D::run
bool run()
Runs the process.
Definition: DivisionAnalysis2D.hpp:34