1 #ifndef MESH_PROCESS_STRUCTURE_HPP
2 #define MESH_PROCESS_STRUCTURE_HPP
23 std::vector<vertex>* vs = 0);
54 if(!checkState().mesh(MESH_NON_EMPTY))
68 float angle = parms[2].toFloat(&ok) * M_PI / 180.f;
70 return setErrorMessage(
"Error, the 'angle' parameter must be a number");
71 float scale = parms[3].toFloat(&ok);
73 return setErrorMessage(
"Error, the 'scale' parameter must be a number");
74 return (*
this)(currentMesh(), trans, rot, angle, scale);
77 bool operator()(
Mesh* mesh,
Point3f translation,
Point3f rotation_axis,
float rotation,
float scale);
83 return "Transform Mesh";
86 return "Apply an affine transformation to all vertices of a mesh";
96 return QStringList() <<
"Translation in micrometers. Enter x y z separated by spaces"
97 <<
"Vector representing the axis of rotation. Enter x y z separated by spaces"
98 <<
"Angle of rotation in degrees"
99 <<
"Global scaling factor";
109 return QIcon(
":/images/Resize.png");
128 if(!checkState().mesh(MESH_NON_EMPTY))
130 return (*
this)(currentMesh());
132 bool operator()(
Mesh* mesh);
138 return "Reverse Mesh";
141 return "Reverse orientation of the mesh";
153 return QIcon(
":/images/Invert.png");
172 if(!checkState().mesh(MESH_NON_EMPTY))
174 return (*
this)(currentMesh(), parms[0].toUInt());
177 bool operator()(
Mesh* mesh, uint passes);
183 return "Smooth Mesh";
186 return "Average each vertex position based on its neighbors.";
198 return QIcon(
":/images/SmoothMesh.png");
217 if(!checkState().mesh(MESH_NON_EMPTY))
219 return (*
this)(currentMesh(), parms[0].toFloat());
222 bool operator()(
Mesh* mesh,
float distance);
228 return "Shrink Mesh";
232 return "Displace each vertex towards the mesh center, perpendicular to the surface.";
238 return QStringList() <<
"Vertex displacement. If negtive, the mesh will expand.";
244 return QIcon(
":/images/ShrinkMesh.png");
263 if(!checkState().mesh(MESH_NON_EMPTY))
265 return (*
this)(currentMesh());
268 bool operator()(
Mesh* mesh);
274 return "Loop Subdivision";
277 return "Subdivide the mesh uniformly using Loop subdivision.";
286 return QIcon(
":/images/SubdivideTri.png");
305 if(!checkState().mesh(MESH_NON_EMPTY))
307 return (*
this)(currentMesh());
310 bool operator()(
Mesh* mesh);
319 return "Subdivide the mesh unifromly";
328 return QIcon(
":/images/SubdivideTri.png");
347 if(!checkState().mesh(MESH_NON_EMPTY))
349 return (*
this)(currentMesh(), parms[0].toFloat(), parms[1].toFloat());
352 bool operator()(
Mesh* mesh,
float cellMaxArea,
float borderDist);
358 return "Subdivide Adaptive Near Borders";
361 return "Subdivide triangles around cell borders";
370 <<
"Area threshold (in square microns) for subdivision, triangles smaller than this won't be subdivided"
371 <<
"Distance (in microns) from cell borders that triangles will be subdivided";
379 return QIcon(
":/images/SubdivideTriAdapt.png");
400 if(!checkState().mesh(MESH_NON_EMPTY))
402 return (*
this)(currentMesh(), parms[0].toFloat(), parms[1].toFloat());
405 bool operator()(
Mesh* mesh,
float cellMaxAreaLow,
float cellMaxAreaHigh);
411 return "Subdivide Adaptive by Signal";
415 return "Subdivide triangles depending on mesh signal. Triangle size\n"
416 "is determined by a high and low area, which is interpolated\n"
417 "based on the minimum and maximum signals";
425 return QStringList() <<
"Maximum area (square microns) for low instentity voxels"
426 <<
"Maximum area (square microns) for high instentity voxels";
434 return QIcon(
":/images/SubdivideTriAdapt.png");
453 if(!checkState().mesh(MESH_NON_EMPTY))
455 return (*
this)(currentMesh(), parms[0].toFloat());
458 bool operator()(
Mesh* mesh,
float cellMaxArea);
464 return "Subdivide with Bisection";
467 return "Subdivide triangles area with bisection";
479 return QIcon(
":/images/SubdivideTriAdapt.png");
498 if(!checkState().mesh(MESH_NON_EMPTY))
500 return (*
this)(currentMesh(), parms[0].toFloat(), parms[1].toFloat(), parms[2].toFloat());
503 bool operator()(
Mesh* mesh,
float scaleX,
float scaleY,
float scaleZ);
513 return "Scale Mesh, or a selected part of it.\n"
514 "It is possible to specify a negative number, in which case the dimension will be mirrored.\n"
515 "If either 1 or 3 axis are mirrored, then the whole mesh needs to be scaled, "
516 "as these triangles will change orientation";
537 return QIcon(
":/images/Scale.png");
556 if(!checkState().mesh(MESH_NON_EMPTY))
558 return (*
this)(currentMesh(), parms[0].toInt(), parms[1].toInt());
561 bool operator()(
Mesh* mesh,
int startValence,
int endValence);
567 return "Delete Mesh Vertices by Valence";
570 return "Delete mesh vertices that have valence within the specified range";
588 return QIcon(
":/images/DeleteValence");
618 return "Merge Vertices";
621 return "Merge selected vertices into one.";
633 return QIcon(
":/images/MergeVertices");
663 return "Delete Edge";
666 return "Delete edge between 2 selected vertices.";
678 return QIcon(
":/images/DeleteLabel.png");
697 if(!checkState().mesh(MESH_NON_EMPTY | MESH_SHOW_MESH))
699 return (*
this)(currentMesh());
702 bool operator()(
Mesh* m);
708 return "Delete Selection";
711 return "Delete vertices selected in the current mesh, preserving cells.";
720 return QIcon(
":/images/DeleteLabel.png");
739 if(!checkState().mesh(MESH_NON_EMPTY | MESH_SHOW_MESH))
742 return (*
this)(currentMesh(), keep);
745 bool operator()(
Mesh* m,
bool keep);
751 return "Keep Vertices";
755 return "Mark vertices so that they can survive as lines and points. Also prevents labels changing.";
769 map[0] = booleanChoice();
773 return QIcon(
":/images/KeepVertices.png");
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:763
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:373
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:563
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:695
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:747
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:419
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:357
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:496
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:234
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: MeshProcessStructure.hpp:766
Delete the edge between 2 selected vertices.
Definition: MeshProcessStructure.hpp:642
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:475
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:321
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:345
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:410
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:230
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:665
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:194
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:237
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:327
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:191
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:137
arg(const QString &a, int fieldWidth=0, const QChar &fillChar=QLatin1Char( ' ')
Subdivide triangles area with bisection.
Definition: MeshProcessStructure.hpp:443
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:469
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:243
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:318
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:185
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:710
Process()
Default constructor.
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:363
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:423
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:632
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:478
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:668
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:261
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:413
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:276
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:146
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:524
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:354
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:707
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:433
Scale the mesh.
Definition: MeshProcessStructure.hpp:488
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:614
Subdivide triangles around cell borders.
Definition: MeshProcessStructure.hpp:337
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:713
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:240
Mark vertices so that they can survive as lines and points.
Definition: MeshProcessStructure.hpp:729
Merge selected vertices into one.
Definition: MeshProcessStructure.hpp:597
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:466
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:134
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:757
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:367
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:677
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:737
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:554
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:626
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:197
CheckState checkState()
Call this function and convert the result to a boolean.
Subdivide triangles depending on mesh signal.
Definition: MeshProcessStructure.hpp:390
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:566
Displace each vertex towards the mesh center, perpendicular to the surface.
Definition: MeshProcessStructure.hpp:207
Subdivide the mesh uniformely, without displacing existing vertices.
Definition: MeshProcessStructure.hpp:295
This class holds the actual mesh as a VV Graph and all sort of properties for it, including visualiza...
Definition: Mesh.hpp:167
graph::VVGraph< VertexData, EdgeData > vvgraph
Type of the VV graph holding the actual mesh.
Definition: Mesh.hpp:36
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:605
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:149
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:407
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:227
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:152
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:536
vvgraph::vertex_t vertex
Type of a vertex.
Definition: Mesh.hpp:39
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:511
Subdivide the mesh uniformly using Loop subdivision.
Definition: MeshProcessStructure.hpp:253
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:572
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:753
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:428
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:587
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:378
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:704
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:315
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:182
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:360
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:282
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:650
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:674
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:170
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:451
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:273
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:126
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:460
Average each vertex position based on its neighbors.
Definition: MeshProcessStructure.hpp:162
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:629
Mesh * mesh(int i)
Returns the ith mesh.
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:569
This is the main process class, the one all process inherit from.
Definition: Process.hpp:248
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:179
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:617
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:750
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:285
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:508
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:143
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:140
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:398
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:224
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:760
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:772
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:215
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:279
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessStructure.hpp:303
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:472
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:716
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:671
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:662
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:312
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:530
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:270
Non-empty mesh.
Definition: Process.hpp:664
Delete vertices selected in the current mesh, preserving cells.
Definition: MeshProcessStructure.hpp:687
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:623
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:505
Mesh * currentMesh()
Returns the current mesh (i.e.
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessStructure.hpp:620
Delete vertices whose valence is wihin a given range.
Definition: MeshProcessStructure.hpp:546
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:324
Reverse the orientation of the mesh.
Definition: MeshProcessStructure.hpp:118
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessStructure.hpp:719
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:188
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessStructure.hpp:518
QString name() const
Returns the name of the process.
Definition: MeshProcessStructure.hpp:463
Mesh processes have mutable access to meshes and non-mutable access to stacks.
Definition: Process.hpp:855
QString folder() const
Folder in which to place the process.
Definition: MeshProcessStructure.hpp:659
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessStructure.hpp:577
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessStructure.hpp:582