+ fix author note, fix various crashes, improve mesh selection stuff
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -1129,8 +1129,7 @@ void MeshObject::removeSelfIntersections()
|
||||
|
||||
if (!selfIntersections.empty()) {
|
||||
MeshCore::MeshFixSelfIntersection cMeshFix(_kernel, selfIntersections);
|
||||
cMeshFix.Fixup();
|
||||
this->_segments.clear();
|
||||
deleteFacets(cMeshFix.GetFacets());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user