Commit bcda6b71 authored by Jan Möbius's avatar Jan Möbius

More cleanup

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15721 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 5ace52bc
......@@ -299,13 +299,6 @@ void MeshRepairPlugin::pluginsInitialized() {
// TODO: Check and update
emit setSlotDescription("flipOrientation(int)",tr("Flips the normals of all faces by changing the vertex order in each face"),
QStringList(tr("objectId")),
QStringList(tr("ID of an object")));
emit setSlotDescription("removeSelectedEdges(int)",tr("Remove the selected edges"),
QStringList(tr("objectId")),
QStringList(tr("ID of an object")));
......@@ -318,9 +311,7 @@ void MeshRepairPlugin::pluginsInitialized() {
QString(tr("objectId,angle")).split(","),
QString(tr("ID of an object;Minimum threshold angle for fold-overs")).split(";"));
emit setSlotDescription("detectTriangleAspect(int,float)",tr("Selects all vertices that have a minimum aspect."),
QString(tr("objectId,aspect")).split(","),
QString(tr("ID of an object;The minimum aspect ratio")).split(";"));
emit setSlotDescription("selectEdgesShorterThan(int,double)",tr("Selects all edges of an object which are shorter than the given length"),
QString(tr("objectId,length")).split(","),
......@@ -339,6 +330,22 @@ void MeshRepairPlugin::pluginsInitialized() {
QString(tr("ID of an object;Minimum angle threshold")).split(";"));
// ===============================
// Edge Operations
// ===============================
// ===============================
// Face Operations
// ===============================
emit setSlotDescription("detectTriangleAspect(int,float)",tr("Selects all faces that have a larger aspect ratio than the given one."),
QString(tr("objectId,aspect")).split(","),
QString(tr("ID of an object;The minimal aspect ratio to select")).split(";"));
emit setSlotDescription("flipOrientation(int)",tr("Flips the normals of all faces by changing the vertex order in each face"),
QStringList(tr("objectId")),
QStringList(tr("ID of an object")));
// ===============================
......
......@@ -191,12 +191,6 @@ public slots:
/// Detect folded-over configurations
void detectFoldover(int _objectId, float _angle);
/// Detect triangle with aspect of _aspect and select candidates
void detectTriangleAspect(int _objectId, float _aspect);
/// Flips the normals of all faces by changing the vertex order
void flipOrientation(int _objectId);
/// Selects all edges of an object which are shorter than the given length
void selectEdgesShorterThan(int _objectId,double _length);
......@@ -206,6 +200,22 @@ public slots:
/// Detect valence 3 vertices with faces that lie in the plane of their adjacent triangles
void detectFlatValence3Vertices(int _objectId, double _angle);
// ==================================================
// Face operations
// ==================================================
/** \brief Detect triangles with aspect ratio greater than _aspect and select them
*
* @param _objectId Id of the object
* @param _aspect Minimal aspect ratio to select
*/
void detectTriangleAspect(int _objectId, float _aspect);
/** \brief Flips the normals of all selected faces by changing the vertex order
*
* @param _objectId Id of the object
*/
void flipOrientation(int _objectId);
// ==================================================
// Normal recomputations
......@@ -267,7 +277,6 @@ public slots:
*/
void fixMesh(int _objectId, double _epsilon);
/** @} */
private:
......@@ -280,7 +289,6 @@ private:
*/
void selectionEdgeLength(int _objectId, double _length, bool _larger);
/** \brief flip orientation of selected faces.
*
* flips the orientation of selected faces.
......@@ -291,13 +299,9 @@ private:
template<typename MeshT>
void flipOrientationSelected(MeshT *_mesh);
template<typename MeshT>
inline unsigned n_verticesPerFace();
public slots:
QString version() {
return QString("1.2");
};
QString version() { return QString("1.3"); };
};
#if defined(INCLUDE_TEMPLATES) && !defined(MESHREPAIRPLUGINT_CC)
......
......@@ -2,24 +2,6 @@
#include "MeshRepairPlugin.hh"
//-----------------------------------------------------------------------------
template<typename MeshT>
inline unsigned MeshRepairPlugin::n_verticesPerFace()
{
// Reserve for a quad mesh, might be to small!
return 4;
}
//-----------------------------------------------------------------------------
template<>
inline unsigned MeshRepairPlugin::n_verticesPerFace<TriMesh>()
{
return 3;
}
//-----------------------------------------------------------------------------
template<typename MeshT>
......@@ -30,7 +12,9 @@ void MeshRepairPlugin::flipOrientationSelected(MeshT *_mesh)
std::vector< typename MeshT::VertexHandle > handles;
std::vector< uint > valence;
handles.reserve( _mesh->n_faces() * n_verticesPerFace<MeshT>() );
const unsigned int n_VerticesPerFace = _mesh->is_trimesh() ? 3 : 4;
handles.reserve( _mesh->n_faces() * n_VerticesPerFace );
valence.reserve( _mesh->n_faces() );
OpenMesh::FPropHandleT< bool > orientation; //inidcates the orientation. true = new orientation. false = old orientation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment