42#include "MeshRepairPlugin.hh"
47MeshRepairPlugin::MeshRepairPlugin() :
55MeshRepairPlugin::~MeshRepairPlugin() {
108 toolIcon_ =
new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"meshrepair-toolbox.png");
109 tool_->repairCollapseEButton->setIcon(*toolIcon_);
110 tool_->repairFlipEButton->setIcon(*toolIcon_);
111 tool_->repairRemoveVButton->setIcon(*toolIcon_);
113 emit addToolbox( tr(
"Mesh Repair") ,
tool_, toolIcon_);
240 double length =
tool_->edgeSpin->value();
251 double length =
tool_->edgeSpin->value();
262 double angle =
tool_->valenceThreeSpinbox->value();
274 double eps =
tool_->snapBoundarySpinBox->value();
301 emit setSlotDescription(
"removeSelectedVal3Vertices(int)",tr(
"Remove all selected valence 3 vertices"),
302 QStringList(tr(
"objectId")),
303 QStringList(tr(
"ID of an object")));
305 emit setSlotDescription(
"detectFlatValence3Vertices(int,double)",tr(
"Selects all vertices that have valence 3 and the normals of their neighboring faces have an angle less then the given angle"),
306 QString(tr(
"objectId,angle")).split(
","),
307 QString(tr(
"ID of an object;the maximal angle between the adjacent faces")).split(
";"));
313 emit setSlotDescription(
"selectEdgesShorterThan(int,double)",tr(
"Selects all edges of an object which are shorter than the given length"),
314 QString(tr(
"objectId,length")).split(
","),
315 QString(tr(
"ID of an object;All edges shorter than this length will be selected")).split(
";"));
317 emit setSlotDescription(
"selectEdgesLongerThan(int,double)",tr(
"Selects all edges of an object which are longer than the given length"),
318 QString(tr(
"objectId,length")).split(
","),
319 QString(tr(
"ID of an object;All edges longer than this length will be selected")).split(
";"));
321 emit setSlotDescription(
"removeSelectedEdges(int)",tr(
"Remove the selected edges"),
322 QStringList(tr(
"objectId")),
323 QStringList(tr(
"ID of an object")));
325 emit setSlotDescription(
"detectSkinnyTriangleByAngle(int,double,bool)",tr(
"Select or remove skinny triangles (determined by a minimum angle threshold)."),
326 QString(tr(
"objectId,angle,remove")).split(
","),
327 QString(tr(
"ID of an object;Minimum angle threshold;Remove")).split(
";"));
329 emit setSlotDescription(
"detectFoldover(int,float)",tr(
"Selects edges that are incident to folded over faces."),
330 QString(tr(
"objectId,angle")).split(
","),
331 QString(tr(
"ID of an object;Minimum threshold angle for fold-overs")).split(
";"));
337 emit setSlotDescription(
"detectTriangleAspect(int,float)",tr(
"Selects all faces that have a larger aspect ratio than the given one."),
338 QString(tr(
"objectId,aspect")).split(
","),
339 QString(tr(
"ID of an object;The minimal aspect ratio to select")).split(
";"));
341 emit setSlotDescription(
"flipOrientation(int)",tr(
"Flips the normals of all faces by changing the vertex order in each face"),
342 QStringList(tr(
"objectId")),
343 QStringList(tr(
"ID of an object")));
350 emit setSlotDescription(
"updateFaceNormals(int)",tr(
"Recompute Face normals"),
351 QStringList(tr(
"objectId")),
352 QStringList(tr(
"ID of an object")));
354 emit setSlotDescription(
"updateHalfedgeNormals(int)",tr(
"Recompute Halfedge normals"),
355 QStringList(tr(
"objectId")),
356 QStringList(tr(
"ID of an object")));
358 emit setSlotDescription(
"updateVertexNormals(int)",tr(
"Recompute Vertex normals"),
359 QStringList(tr(
"objectId")),
360 QStringList(tr(
"ID of an object")));
362 emit setSlotDescription(
"updateNormals(int)",tr(
"Recompute Face and Vertex normals"),
363 QStringList(tr(
"objectId")),
364 QStringList(tr(
"ID of an object")));
371 emit setSlotDescription(
"snapBoundary(int,double)",tr(
"Snaps selected boundary vertices if the distance is less than the given maximal distance."),
372 QString(tr(
"objectId,epsilon")).split(
","),
373 QString(tr(
"ID of an object;Max Distance")).split(
";"));
375 emit setSlotDescription(
"(int)",tr(
"Fixes non manifold vertices."),
376 QString(tr(
"objectId")).split(
","),
377 QString(tr(
"ID of an object;Non manifold vertices are splitted.")).split(
";"));
379 emit setSlotDescription(
"fixMesh(int,double)",tr(
"Fixes a mesh."),
380 QString(tr(
"objectId,distance")).split(
","),
381 QString(tr(
"ID of an object;Vertices with distance lower than epsilon will be treated as one.")).split(
";"));
#define DATA_TRIANGLE_MESH
void removeSelectedEdges(int _objectId)
Removes all selected edges.
void fixMesh(int _objectId, double _epsilon)
Fix a mesh.
void slotDetectFoldover()
Button slot.
void updateNormals(int _objectId)
Recomputes the face and vertex normals of an object.
void slotUpdateFaceNormals()
Button slot.
void removeSelectedVal3Vertices(int _objectId)
Remove all selected valence 3 vertices.
void slotFlipOrientation()
Button slot.
void slotSnapBoundary()
Button slot.
void updateVertexNormals(int _objectId)
Recomputes the vertex normals of an object.
void slotFixNonManifoldVertices()
Button slot.
void updateHalfedgeNormals(int _objectId)
Recomputes the halfedge normals of an object.
void slotRemoveSelectedVal3Vertices()
Button slot.
void detectSkinnyTriangleByAngle(int _objectId, double _angle, bool _remove)
Detect/Remove edges where neighboring faces form angle > _angle degrees.
void slotFixMesh()
Button slot.
void detectFlatValence3Vertices(int _objectId, double _angle)
Detect valence 3 vertices with faces that lie in the plane of their adjacent triangles.
void fixNonManifoldVertices(int _objectId)
remove non-manifold vertices by duplicating them
void slotRemoveSelectedEdges()
Button slot.
void slotDetectEdgesLonger()
Button Slot.
void updateFaceNormals(int _objectId)
Recomputes the face normals of an object.
void slotDetectFlatValence3Vertices()
Button slot.
void flipOrientation(int _objectId)
Flips the normals of all selected faces by changing the vertex order.
void slotUpdateVertexNormals()
Button slot.
MeshRepairToolbarWidget * tool_
Widget for Toolbox.
void selectEdgesLongerThan(int _objectId, double _length)
Selects all edges of an object which are larger than the given length.
void slotDetectTriangleAspect()
Button slot.
void slotUpdateNormals()
Button slot.
void slotRemoveSkinnyTriangleByAngle()
Button slot.
void detectFoldover(int _objectId, float _angle)
Detect folded-over configurations by the dihedral angle.
void selectEdgesShorterThan(int _objectId, double _length)
Selects all edges of an object which are shorter than the given length.
void snapBoundary(int _objectId, double _eps)
Snaps selected vertices at boundaries.
void pluginsInitialized()
Initialization of the plugin when it is loaded by the core.
void detectTriangleAspect(int _objectId, float _aspect)
Detect triangles with aspect ratio greater than _aspect and select them.
void slotUpdateHalfedgeNormals()
Button slot.
void slotDetectEdgesShorter()
Button Slot.
void slotDetectSkinnyTriangleByAngle()
Button slot.
const QStringList TARGET_OBJECTS("target")
Iterable object range.
ObjectRange objects(IteratorRestriction _restriction, DataType _dataType)
Iterable object range.