+ 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

@ -1208,6 +1208,10 @@ void Application::initApplication(void)
("User parameter:BaseApp/Preferences/Units");
UnitsApi::setSchema((UnitSystem)hGrp->GetInt("UserSchema",0));
#if defined (_DEBUG)
Console().Log("Application is built with debug information\n");
#endif
// starting the init script
Console().Log("Run App init script\n");
Interpreter().runString(Base::ScriptFactory().ProduceScript("FreeCADInit"));

View File

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> *
* Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@ -58,6 +58,14 @@ AbstractSplitView::~AbstractSplitView()
}
}
void AbstractSplitView::deleteSelf()
{
for (std::vector<View3DInventorViewer*>::iterator it = _viewer.begin(); it != _viewer.end(); ++it) {
(*it)->setSceneGraph(0);
}
MDIView::deleteSelf();
}
void AbstractSplitView::setupSettings()
{
// attach Parameter Observer

View File

@ -51,6 +51,7 @@ public:
virtual bool onHasMsg(const char* pMsg) const;
virtual void OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::MessageType Reason);
virtual void onUpdate(void);
virtual void deleteSelf();
View3DInventorViewer *getViewer(unsigned int) const;

View File

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.de> *
* Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.de> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@ -70,7 +70,7 @@ public:
View3DInventor(Gui::Document* pcDocument, QWidget* parent, Qt::WFlags wflags=0);
~View3DInventor();
/// Mesage handler
/// Message handler
virtual bool onMsg(const char* pMsg, const char** ppReturn);
virtual bool onHasMsg(const char* pMsg) const;
virtual void deleteSelf();

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));
}
}