11 #ifndef MESH_PROCESS_STRUCTURE_HPP 12 #define MESH_PROCESS_STRUCTURE_HPP 33 std::vector<vertex>* vs = 0);
64 if(!checkState().mesh(MESH_NON_EMPTY))
78 float angle = parms[2].toFloat(&ok) * M_PI / 180.f;
80 return setErrorMessage(
"Error, the 'angle' parameter must be a number");
81 float scale = parms[3].toFloat(&ok);
83 return setErrorMessage(
"Error, the 'scale' parameter must be a number");
84 return (*
this)(currentMesh(), trans, rot, angle, scale);
87 bool operator()(
Mesh* mesh,
Point3f translation,
Point3f rotation_axis,
float rotation,
float scale);
93 return "Transform Mesh";
96 return "Apply an affine transformation to all vertices of a mesh";
106 return QStringList() <<
"Translation in micrometers. Enter x y z separated by spaces" 107 <<
"Vector representing the axis of rotation. Enter x y z separated by spaces" 108 <<
"Angle of rotation in degrees" 109 <<
"Global scaling factor";
119 return QIcon(
":/images/Resize.png");
138 if(!checkState().mesh(MESH_NON_EMPTY))
140 return (*
this)(currentMesh());
142 bool operator()(
Mesh* mesh);
148 return "Reverse Mesh";
151 return "Reverse orientation of the mesh";
163 return QIcon(
":/images/Invert.png");
182 if(!checkState().mesh(MESH_NON_EMPTY))
184 return (*
this)(currentMesh(), parms[0].toUInt());
187 bool operator()(
Mesh* mesh, uint passes);
193 return "Smooth Mesh";
196 return "Average each vertex position based on its neighbors.";
208 return QIcon(
":/images/SmoothMesh.png");
227 if(!checkState().mesh(MESH_NON_EMPTY))
229 return (*
this)(currentMesh(), parms[0].toFloat());
232 bool operator()(
Mesh* mesh,
float distance);
238 return "Shrink Mesh";
242 return "Displace each vertex towards the mesh center, perpendicular to the surface.";
248 return QStringList() <<
"Vertex displacement. If negtive, the mesh will expand.";
254 return QIcon(
":/images/ShrinkMesh.png");
273 if(!checkState().mesh(MESH_NON_EMPTY))
275 return (*
this)(currentMesh());
278 bool operator()(
Mesh* mesh);
284 return "Loop Subdivision";
287 return "Subdivide the mesh uniformly using Loop subdivision.";
296 return QIcon(
":/images/SubdivideTri.png");
315 if(!checkState().mesh(MESH_NON_EMPTY))
317 return (*
this)(currentMesh());
320 bool operator()(
Mesh* mesh);
329 return "Subdivide the mesh unifromly";
338 return QIcon(
":/images/SubdivideTri.png");
357 if(!checkState().mesh(MESH_NON_EMPTY))
359 return (*
this)(currentMesh(), parms[0].toFloat(), parms[1].toFloat());
362 bool operator()(
Mesh* mesh,
float cellMaxArea,
float borderDist);
368 return "Subdivide Adaptive Near Borders";
371 return "Subdivide triangles around cell borders";
380 <<
"Area threshold (in square microns) for subdivision, triangles smaller than this won't be subdivided" 381 <<
"Distance (in microns) from cell borders that triangles will be subdivided";
389 return QIcon(
":/images/SubdivideTriAdapt.png");
410 if(!checkState().mesh(MESH_NON_EMPTY))
412 return (*
this)(currentMesh(), parms[0].toFloat(), parms[1].toFloat());
415 bool operator()(
Mesh* mesh,
float cellMaxAreaLow,
float cellMaxAreaHigh);
421 return "Subdivide Adaptive by Signal";
425 return "Subdivide triangles depending on mesh signal. Triangle size\n" 426 "is determined by a high and low area, which is interpolated\n" 427 "based on the minimum and maximum signals";
435 return QStringList() <<
"Maximum area (square microns) for low instentity voxels" 436 <<
"Maximum area (square microns) for high instentity voxels";
444 return QIcon(
":/images/SubdivideTriAdapt.png");
463 if(!checkState().mesh(MESH_NON_EMPTY))
465 return (*
this)(currentMesh(), parms[0].toFloat());
468 bool operator()(
Mesh* mesh,
float cellMaxArea);
474 return "Subdivide with Bisection";
477 return "Subdivide triangles area with bisection";
489 return QIcon(
":/images/SubdivideTriAdapt.png");
508 if(!checkState().mesh(MESH_NON_EMPTY))
510 return (*
this)(currentMesh(), parms[0].toFloat(), parms[1].toFloat(), parms[2].toFloat());
513 bool operator()(
Mesh* mesh,
float scaleX,
float scaleY,
float scaleZ);
523 return "Scale Mesh, or a selected part of it.\n" 524 "It is possible to specify a negative number, in which case the dimension will be mirrored.\n" 525 "If either 1 or 3 axis are mirrored, then the whole mesh needs to be scaled, " 526 "as these triangles will change orientation";
547 return QIcon(
":/images/Scale.png");
566 if(!checkState().mesh(MESH_NON_EMPTY))
568 return (*
this)(currentMesh(), parms[0].toInt(), parms[1].toInt());
571 bool operator()(
Mesh* mesh,
int startValence,
int endValence);
577 return "Delete Mesh Vertices by Valence";
580 return "Delete mesh vertices that have valence within the specified range";
598 return QIcon(
":/images/DeleteValence");
617 if(!checkState().mesh(MESH_NON_EMPTY))
619 return operator()(currentMesh());
622 bool operator()(
Mesh* mesh);
628 return "Merge Vertices";
631 return "Merge selected vertices into one.";
643 return QIcon(
":/images/MergeVertices");
662 if(!checkState().mesh(MESH_NON_EMPTY))
664 return operator()(currentMesh());
667 bool operator()(
Mesh* mesh);
673 return "Delete Edge";
676 return "Delete edge between 2 selected vertices.";
688 return QIcon(
":/images/DeleteLabel.png");
707 if(!checkState().mesh(MESH_NON_EMPTY | MESH_SHOW_MESH))
709 return (*
this)(currentMesh());
712 bool operator()(
Mesh* m);
718 return "Delete Selection";
721 return "Delete vertices selected in the current mesh, preserving cells.";
730 return QIcon(
":/images/DeleteLabel.png");
749 if(!checkState().mesh(MESH_NON_EMPTY | MESH_SHOW_MESH))
752 return (*
this)(currentMesh(), keep);
755 bool operator()(
Mesh* m,
bool keep);
761 return "Keep Vertices";
765 return "Mark vertices so that they can survive as lines and points. Also prevents labels changing.";
779 map[0] = booleanChoice();
783 return QIcon(
":/images/KeepVertices.png");
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:773
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:383
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:573
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:705
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:757
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:429
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:367
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:506
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:244
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: MeshProcessStructure.hpp:776
Delete the edge between 2 selected vertices.
Definition: MeshProcessStructure.hpp:652
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:485
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:331
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:355
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:420
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:240
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:675
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:204
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:247
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:337
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:201
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:147
arg(const QString &a, int fieldWidth=0, const QChar &fillChar=QLatin1Char( ' ')
Subdivide triangles area with bisection.
Definition: MeshProcessStructure.hpp:453
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:479
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:253
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:328
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:195
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:720
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:373
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:433
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:642
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:488
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:678
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:271
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:423
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:286
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:156
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:534
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:364
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:717
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:443
Scale the mesh.
Definition: MeshProcessStructure.hpp:498
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:624
Subdivide triangles around cell borders.
Definition: MeshProcessStructure.hpp:347
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:723
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:250
Mark vertices so that they can survive as lines and points.
Definition: MeshProcessStructure.hpp:739
Merge selected vertices into one.
Definition: MeshProcessStructure.hpp:607
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:476
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:144
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:767
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:377
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:687
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:747
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:564
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:636
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:207
Subdivide triangles depending on mesh signal.
Definition: MeshProcessStructure.hpp:400
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:576
Displace each vertex towards the mesh center, perpendicular to the surface.
Definition: MeshProcessStructure.hpp:217
Subdivide the mesh uniformely, without displacing existing vertices.
Definition: MeshProcessStructure.hpp:305
This class holds the actual mesh as a VV Graph and all sort of properties for it, including visualiza...
Definition: Mesh.hpp:177
graph::VVGraph< VertexData, EdgeData > vvgraph
Type of the VV graph holding the actual mesh.
Definition: Mesh.hpp:46
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:615
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:159
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:417
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:237
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:162
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:546
vvgraph::vertex_t vertex
Type of a vertex.
Definition: Mesh.hpp:49
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:521
Subdivide the mesh uniformly using Loop subdivision.
Definition: MeshProcessStructure.hpp:263
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:582
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:763
This namespace contains all the API of MorphoGraphX.
Definition: Assert.hpp:26
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:438
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:597
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:388
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:714
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:325
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:192
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:370
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:292
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:660
mgxBase_EXPORT bool subdivideBisect(vvgraph &S, const vertex &v1, const vertex &v2, const vertex &v3, bool selected, std::vector< vertex > *vs=0)
Subdivide triangle by bi-sections.
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:684
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:180
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:461
File containing the definition of a Process.
mgxBase_EXPORT void markMargin(vvgraph &M, vvgraph &S, bool remborders)
Mark the cells and tissue margin vertices.
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:283
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:136
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:470
Average each vertex position based on its neighbors.
Definition: MeshProcessStructure.hpp:172
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:639
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:579
This is the main process class, the one all process inherit from.
Definition: Process.hpp:258
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:189
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:627
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:760
mgx_EXPORT bool stringToBool(const QString &string)
Helper function converting a string into a boolean.
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:295
This namespace contains all the classes needed to define processes.
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:518
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:153
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:150
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:408
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:234
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:770
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:782
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:225
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:289
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:313
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:482
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:726
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:681
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:672
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:322
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:540
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:280
Delete vertices selected in the current mesh, preserving cells.
Definition: MeshProcessStructure.hpp:697
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:633
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:515
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:630
Delete vertices whose valence is wihin a given range.
Definition: MeshProcessStructure.hpp:556
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:334
Reverse the orientation of the mesh.
Definition: MeshProcessStructure.hpp:128
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:729
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:198
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:528
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:473
Mesh processes have mutable access to meshes and non-mutable access to stacks.
Definition: Process.hpp:865
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:669
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:587
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:592