Fem: use SoAnnotation to highlight result pipeline objects
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
# include <QMenu>
|
||||
# include <QMessageBox>
|
||||
# include <QTextStream>
|
||||
# include <Inventor/nodes/SoAnnotation.h>
|
||||
#endif
|
||||
|
||||
#include <App/MaterialObject.h>
|
||||
@@ -55,6 +56,33 @@
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
ViewProviderFemHighlighter::ViewProviderFemHighlighter()
|
||||
{
|
||||
annotate = new SoAnnotation();
|
||||
annotate->ref();
|
||||
}
|
||||
|
||||
ViewProviderFemHighlighter::~ViewProviderFemHighlighter()
|
||||
{
|
||||
annotate->unref();
|
||||
}
|
||||
|
||||
void ViewProviderFemHighlighter::attach(ViewProviderFemAnalysis* view)
|
||||
{
|
||||
SoGroup* root = view->getRoot();
|
||||
root->addChild(annotate);
|
||||
}
|
||||
|
||||
void ViewProviderFemHighlighter::highlightView(Gui::ViewProviderDocumentObject* view)
|
||||
{
|
||||
annotate->removeAllChildren();
|
||||
|
||||
if (view) {
|
||||
annotate->addChild(view->getRoot());
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/* TRANSLATOR FemGui::ViewProviderFemAnalysis */
|
||||
|
||||
@@ -71,6 +99,17 @@ ViewProviderFemAnalysis::~ViewProviderFemAnalysis()
|
||||
|
||||
}
|
||||
|
||||
void ViewProviderFemAnalysis::attach(App::DocumentObject* obj)
|
||||
{
|
||||
Gui::ViewProviderDocumentObjectGroup::attach(obj);
|
||||
extension.attach(this);
|
||||
}
|
||||
|
||||
void ViewProviderFemAnalysis::highlightView(Gui::ViewProviderDocumentObject* view)
|
||||
{
|
||||
extension.highlightView(view);
|
||||
}
|
||||
|
||||
bool ViewProviderFemAnalysis::doubleClicked(void)
|
||||
{
|
||||
Gui::Command::assureWorkbench("FemWorkbench");
|
||||
@@ -244,7 +283,7 @@ bool ViewProviderFemAnalysis::canDelete(App::DocumentObject* obj) const
|
||||
// thus we can pass this action
|
||||
// we can warn the user if necessary in the object's ViewProvider in the onDelete() function
|
||||
Q_UNUSED(obj)
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Python feature -----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user