MorphoGraphX  2.0-1-227
MeshProcessTriangleData.hpp
Go to the documentation of this file.
1 //
2 // This file is part of MorphoGraphX - http://www.MorphoGraphX.org
3 // Copyright (C) 2012-2015 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_PROCESSS_TRI_DATA_HPP
12 #define MESH_PROCESSS_TRI_DATA_HPP
13 
14 #include <Process.hpp>
15 
16 
17 namespace mgx
18 {
21 
24  class mgxBase_EXPORT StatsTriangleValues : public Process
25  {
26  public:
27  StatsTriangleValues(const Process& process) : Process(process)
28  {
29  setName("Mesh/Triangle Data/Average Tri Value");
30  setDesc("Compute average of triangle values.");
31  setIcon(QIcon(":/images/MakeHeatMap.png"));
32 
33  addParm("Selection only","Compute only for selected triangles","Yes",booleanChoice());
34  addParm("Statistic","Type of statistic computed","Percentile", QStringList() << "WeightedAverage" << "Percentile");
35  addParm("Percentile","Value for percentile","50");
36  }
37 
38  bool initialize(); // , QWidget* parent);
39 
40  bool run()
41  {
42  if(!checkState().mesh(MESH_NON_EMPTY))
43  return false;
44  return run(currentMesh(), stringToBool(parm("Selection only")), parm("Statistic"), parm("Percentile").toFloat());
45  }
46 
47  bool run(Mesh* mesh, bool selection, QString stat, float prc);
48  };
49 }
50 #endif
Process.hpp
mgx::StatsTriangleValues
Definition: MeshProcessTriangleData.hpp:24
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::Process
Definition: Process.hpp:219
mgx::stringToBool
mgx_EXPORT bool stringToBool(const QString &string)
Helper function converting a string into a boolean.
mgx::Mesh
Definition: Mesh.hpp:54
mgx::StatsTriangleValues::run
bool run()
Runs the process.
Definition: MeshProcessTriangleData.hpp:40
mgx::StatsTriangleValues::StatsTriangleValues
StatsTriangleValues(const Process &process)
Definition: MeshProcessTriangleData.hpp:27