MorphoGraphX
MeshProcessCellAxis.hpp
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_CELLAXIS_HPP
12 #define MESH_PROCESSS_CELLAXIS_HPP
13 
14 #include <Process.hpp>
15 
16 #include <MeshProcessCellMesh.hpp>
17 
18 namespace mgx {
19 namespace process {
22 
25 class mgxBase_EXPORT SaveCellAxis : public MeshProcess {
26 public:
28  : Process(process)
29  , MeshProcess(process)
30  {
31  }
32 
33  bool initialize(QStringList& parms, QWidget* parent);
34 
35  bool operator()(const QStringList& parms)
36  {
37  if(!checkState().mesh(MESH_NON_EMPTY))
38  return false;
39  return (*this)(currentMesh(), parms[0]);
40  }
41 
42  bool operator()(Mesh* mesh, const QString& filename);
43 
44  QString folder() const {
45  return "Cell Axis";
46  }
47  QString name() const {
48  return "Cell Axis Save";
49  }
50  QString description() const {
51  return "Save PDG, Fibril Orientations or Curvature to a spreadsheet file.";
52  }
54  return QStringList() << "Output File";
55  }
57  return QStringList() << "Path to output file";
58  }
60  return QStringList() << "";
61  }
62  QIcon icon() const {
63  return QIcon(":/images/CellAxisSave.png");
64  }
65 };
66 
70 class mgxBase_EXPORT LoadCellAxis : public MeshProcess {
71 public:
73  : Process(process)
74  , MeshProcess(process)
75  {
76  }
77 
78  bool initialize(QStringList& parms, QWidget* parent);
79 
80  bool operator()(const QStringList& parms)
81  {
82  if(!checkState().mesh(MESH_NON_EMPTY))
83  return false;
84  return (*this)(currentMesh(), parms[0], parms[1]);
85  }
86 
87  bool operator()(Mesh* mesh, const QString& type, const QString& filename);
88 
89  QString folder() const {
90  return "Cell Axis";
91  }
92  QString name() const {
93  return "Cell Axis Load";
94  }
95  QString description() const {
96  return "Load cell axis from a spreadsheet file.";
97  }
99  {
100  return QStringList() << "Type"
101  << "Input File";
102  }
104  {
105  return QStringList() << "Load PDG, Fibril Orientations or Curvature from a spreadsheet file."
106  << "Path to input file. If empty, a browser will open.";
107  }
109  {
110  return QStringList() << "PDG"
111  << "";
112  }
114  {
115  ParmChoiceMap map;
116  map[0] = QStringList() << "PDG"
117  << "fibril"
118  << "curvature";
119  return map;
120  }
121  QIcon icon() const {
122  return QIcon(":/images/CellAxisOpen.png");
123  }
124 };
125 
131 class mgxBase_EXPORT ClearCellAxis : public MeshProcess {
132 public:
134  : Process(process)
135  , MeshProcess(process)
136  {
137  }
138 
139  bool operator()(const QStringList&)
140  {
141  if(!checkState().mesh(MESH_NON_EMPTY))
142  return false;
143  return (*this)(currentMesh());
144  }
145 
146  bool operator()(Mesh* mesh);
147 
148  QString folder() const {
149  return "Cell Axis";
150  }
151  QString name() const {
152  return "Cell Axis Clear";
153  }
155  return "Remove any cell axis information from the current mesh.";
156  }
158  return QStringList();
159  }
161  return QStringList();
162  }
163  QIcon icon() const {
164  return QIcon(":/images/CellAxisClear.png");
165  }
166 };
167 
173 class mgxBase_EXPORT HideCellAxis : public MeshProcess {
174 public:
176  : Process(process)
177  , MeshProcess(process)
178  {
179  }
180 
181  bool operator()(const QStringList& )
182  {
183  if(!checkState().mesh(MESH_NON_EMPTY))
184  return false;
185  return (*this)(currentMesh());
186  }
187 
188  bool operator()(Mesh* mesh);
189 
190  QString folder() const {
191  return "Cell Axis";
192  }
193  QString name() const {
194  return "Cell Axis Hide";
195  }
197  return "Hide the cell axis on the current mesh.";
198  }
200  return QStringList();
201  }
203  return QStringList();
204  }
205  QIcon icon() const {
206  return QIcon(":/images/CellAxisHide.png");
207  }
208 };
210 } // namespace process
211 } // namespace mgx
212 #endif
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessCellAxis.hpp:53
QString name() const
Returns the name of the process.
Definition: MeshProcessCellAxis.hpp:47
QString name() const
Returns the name of the process.
Definition: MeshProcessCellAxis.hpp:151
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessCellAxis.hpp:202
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessCellAxis.hpp:59
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessCellAxis.hpp:80
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessCellAxis.hpp:50
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessCellAxis.hpp:103
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessCellAxis.hpp:121
Definition: MeshProcessCellAxis.hpp:25
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessCellAxis.hpp:62
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessCellAxis.hpp:95
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessCellAxis.hpp:160
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessCellAxis.hpp:205
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessCellAxis.hpp:199
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessCellAxis.hpp:35
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessCellAxis.hpp:98
QString folder() const
Folder in which to place the process.
Definition: MeshProcessCellAxis.hpp:190
This class holds the actual mesh as a VV Graph and all sort of properties for it, including visualiza...
Definition: Mesh.hpp:177
QString folder() const
Folder in which to place the process.
Definition: MeshProcessCellAxis.hpp:148
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: MeshProcessCellAxis.hpp:113
This namespace contains all the API of MorphoGraphX.
Definition: Assert.hpp:26
Definition: MeshProcessCellAxis.hpp:70
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessCellAxis.hpp:139
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessCellAxis.hpp:181
File containing the definition of a Process.
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessCellAxis.hpp:56
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessCellAxis.hpp:163
This is the main process class, the one all process inherit from.
Definition: Process.hpp:258
Definition: MeshProcessCellAxis.hpp:131
This namespace contains all the classes needed to define processes.
QString name() const
Returns the name of the process.
Definition: MeshProcessCellAxis.hpp:92
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessCellAxis.hpp:154
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessCellAxis.hpp:108
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessCellAxis.hpp:157
QString folder() const
Folder in which to place the process.
Definition: MeshProcessCellAxis.hpp:44
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessCellAxis.hpp:196
Hide the cell axis on the mesh.
Definition: MeshProcessCellAxis.hpp:173
QString folder() const
Folder in which to place the process.
Definition: MeshProcessCellAxis.hpp:89
Mesh processes have mutable access to meshes and non-mutable access to stacks.
Definition: Process.hpp:865
QString name() const
Returns the name of the process.
Definition: MeshProcessCellAxis.hpp:193