support coloring of mesh segments
This commit is contained in:
@@ -28,6 +28,8 @@ link_directories(${OCC_LIBRARY_DIR})
|
||||
|
||||
set(MeshPartGui_LIBS
|
||||
MeshPart
|
||||
PartGui
|
||||
MeshGui
|
||||
FreeCADGui
|
||||
)
|
||||
|
||||
|
||||
@@ -30,11 +30,15 @@
|
||||
#ifdef FC_OS_WIN32
|
||||
# define MeshExport __declspec(dllimport)
|
||||
# define PartExport __declspec(dllimport)
|
||||
# define MeshGuiExport __declspec(dllimport)
|
||||
# define PartGuiExport __declspec(dllimport)
|
||||
# define MeshPartAppExport __declspec(dllimport)
|
||||
# define MeshPartGuiExport __declspec(dllexport)
|
||||
#else // for Linux
|
||||
# define MeshExport
|
||||
# define PartExport
|
||||
# define MeshGuiExport
|
||||
# define PartGuiExport
|
||||
# define MeshPartAppExport
|
||||
# define MeshPartGuiExport
|
||||
#endif
|
||||
@@ -45,8 +49,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef _PreComp_
|
||||
|
||||
// Python
|
||||
|
||||
// Python
|
||||
#include <Python.h>
|
||||
|
||||
// standard
|
||||
@@ -74,7 +78,7 @@
|
||||
#ifndef __Qt4All__
|
||||
# include <Gui/Qt4All.h>
|
||||
#endif
|
||||
|
||||
|
||||
#endif //_PreComp_
|
||||
|
||||
#endif // __PRECOMPILED_GUI__
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
#include <Gui/ViewProvider.h>
|
||||
#include <Gui/WaitCursor.h>
|
||||
#include <Mod/Part/App/PartFeature.h>
|
||||
#include <Mod/Mesh/Gui/ViewProvider.h>
|
||||
#include <Mod/Part/Gui/ViewProvider.h>
|
||||
|
||||
using namespace MeshPartGui;
|
||||
|
||||
@@ -327,6 +329,21 @@ bool Tessellation::accept()
|
||||
}
|
||||
}
|
||||
Gui::Command::doCommand(Gui::Command::Doc, (const char*)cmd.toUtf8());
|
||||
|
||||
// if Standard mesher is used and face colors should be applied
|
||||
if (method == 0) { // Standard
|
||||
if (ui->meshShapeColors->isChecked()) {
|
||||
Gui::ViewProvider* vpm = Gui::Application::Instance->getViewProvider
|
||||
(activeDoc->getActiveObject());
|
||||
Gui::ViewProvider* vpp = Gui::Application::Instance->getViewProvider
|
||||
(activeDoc->getObject(shape.toLatin1()));
|
||||
MeshGui::ViewProviderMesh* vpmesh = dynamic_cast<MeshGui::ViewProviderMesh*>(vpm);
|
||||
PartGui::ViewProviderPart* vppart = dynamic_cast<PartGui::ViewProviderPart*>(vpp);
|
||||
if (vpmesh && vppart) {
|
||||
vpmesh->highlightSegments(vppart->DiffuseColor.getValues());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
activeDoc->commitTransaction();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user