+ fix author note, fix various crashes, improve mesh selection stuff

This commit is contained in:
wmayer
2014-08-01 16:39:59 +02:00
parent 4032a88c2d
commit 7a3ddd5bae
10 changed files with 31 additions and 10 deletions

View File

@@ -754,7 +754,7 @@ void MeshEvalSelfIntersection::GetIntersections(std::vector<std::pair<unsigned l
}
}
bool MeshFixSelfIntersection::Fixup()
std::vector<unsigned long> MeshFixSelfIntersection::GetFacets() const
{
std::vector<unsigned long> indices;
const MeshFacetArray& rFaces = _rclMesh.GetFacets();
@@ -781,8 +781,12 @@ bool MeshFixSelfIntersection::Fixup()
std::sort(indices.begin(), indices.end());
indices.erase(std::unique(indices.begin(), indices.end()), indices.end());
_rclMesh.DeleteFacets(indices);
return indices;
}
bool MeshFixSelfIntersection::Fixup()
{
_rclMesh.DeleteFacets(GetFacets());
return true;
}

View File

@@ -309,6 +309,7 @@ public:
MeshFixSelfIntersection (MeshKernel &rclB, const std::vector<std::pair<unsigned long, unsigned long> >& si)
: MeshValidation(rclB), selfIntersectons(si) {}
virtual ~MeshFixSelfIntersection () {}
std::vector<unsigned long> GetFacets() const;
bool Fixup();
private:

View File

@@ -1129,8 +1129,7 @@ void MeshObject::removeSelfIntersections()
if (!selfIntersections.empty()) {
MeshCore::MeshFixSelfIntersection cMeshFix(_kernel, selfIntersections);
cMeshFix.Fixup();
this->_segments.clear();
deleteFacets(cMeshFix.GetFacets());
}
}

View File

@@ -198,8 +198,10 @@ void MeshSelection::startDeselection()
void MeshSelection::stopSelection()
{
Gui::View3DInventorViewer* viewer = getViewer();
if (viewer)
if (viewer) {
stopInteractiveCallback(viewer);
viewer->navigationStyle()->stopSelection();
}
}
void MeshSelection::fullSelection()
@@ -317,9 +319,10 @@ void MeshSelection::selectTriangle()
Gui::View3DInventorViewer* viewer = this->getViewer();
if (viewer) {
viewer->setEditingCursor(QCursor(Qt::OpenHandCursor));
stopInteractiveCallback(viewer);
viewer->navigationStyle()->stopSelection();
startInteractiveCallback(viewer, pickFaceCallback);
viewer->setEditingCursor(QCursor(Qt::PointingHandCursor));
}
}
@@ -329,9 +332,10 @@ void MeshSelection::deselectTriangle()
Gui::View3DInventorViewer* viewer = this->getViewer();
if (viewer) {
viewer->setEditingCursor(QCursor(Qt::OpenHandCursor));
stopInteractiveCallback(viewer);
viewer->navigationStyle()->stopSelection();
startInteractiveCallback(viewer, pickFaceCallback);
viewer->setEditingCursor(QCursor(Qt::PointingHandCursor));
}
}