Core: Update color bar when changing preferences
This solves one part of issue #10717
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
#include <Gui/Selection.h>
|
||||
#include <Gui/SelectionObject.h>
|
||||
#include <Gui/SoFCColorBar.h>
|
||||
#include <Gui/SoFCColorBarNotifier.h>
|
||||
#include <Gui/TaskView/TaskDialog.h>
|
||||
#include <Gui/View3DInventor.h>
|
||||
#include <Gui/View3DInventorViewer.h>
|
||||
@@ -232,6 +233,7 @@ ViewProviderFemPostObject::ViewProviderFemPostObject()
|
||||
m_colorRoot->addChild(m_colorStyle);
|
||||
m_colorBar = new Gui::SoFCColorBar;
|
||||
m_colorBar->Attach(this);
|
||||
Gui::SoFCColorBarNotifier::instance().attach(m_colorBar);
|
||||
m_colorBar->ref();
|
||||
|
||||
// create the vtk algorithms we use for visualisation
|
||||
@@ -274,6 +276,7 @@ ViewProviderFemPostObject::~ViewProviderFemPostObject()
|
||||
m_material->unref();
|
||||
m_matPlainEdges->unref();
|
||||
m_switchMatEdges->unref();
|
||||
Gui::SoFCColorBarNotifier::instance().detach(m_colorBar);
|
||||
m_colorBar->Detach(this);
|
||||
m_colorBar->unref();
|
||||
m_colorStyle->unref();
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <Gui/Flag.h>
|
||||
#include <Gui/MainWindow.h>
|
||||
#include <Gui/SoFCColorBar.h>
|
||||
#include <Gui/SoFCColorBarNotifier.h>
|
||||
#include <Gui/View3DInventorViewer.h>
|
||||
#include <Gui/Widgets.h>
|
||||
#include <Mod/Inspection/App/InspectionFeature.h>
|
||||
@@ -95,6 +96,7 @@ ViewProviderInspection::ViewProviderInspection()
|
||||
// simple color bar
|
||||
pcColorBar = new Gui::SoFCColorBar;
|
||||
pcColorBar->Attach(this);
|
||||
Gui::SoFCColorBarNotifier::instance().attach(pcColorBar);
|
||||
pcColorBar->ref();
|
||||
pcColorBar->setRange(-0.1f, 0.1f, 3);
|
||||
pcLinkRoot = new SoGroup;
|
||||
@@ -113,6 +115,7 @@ ViewProviderInspection::~ViewProviderInspection()
|
||||
pcCoords->unref();
|
||||
pcMatBinding->unref();
|
||||
pcColorMat->unref();
|
||||
Gui::SoFCColorBarNotifier::instance().detach(pcColorBar);
|
||||
pcColorBar->Detach(this);
|
||||
pcColorBar->unref();
|
||||
pcLinkRoot->unref();
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include <Gui/MainWindow.h>
|
||||
#include <Gui/Selection.h>
|
||||
#include <Gui/SoFCColorBar.h>
|
||||
#include <Gui/SoFCColorBarNotifier.h>
|
||||
#include <Gui/SoFCSelection.h>
|
||||
#include <Gui/View3DInventorViewer.h>
|
||||
#include <Gui/Widgets.h>
|
||||
@@ -83,6 +84,7 @@ ViewProviderMeshCurvature::ViewProviderMeshCurvature()
|
||||
// simple color bar
|
||||
pcColorBar = new Gui::SoFCColorBar;
|
||||
pcColorBar->Attach(this);
|
||||
Gui::SoFCColorBarNotifier::instance().attach(pcColorBar);
|
||||
pcColorBar->ref();
|
||||
pcColorBar->setRange(-0.5f, 0.5f, 3);
|
||||
pcLinkRoot = new SoGroup;
|
||||
@@ -124,6 +126,7 @@ ViewProviderMeshCurvature::~ViewProviderMeshCurvature()
|
||||
{
|
||||
pcColorRoot->unref();
|
||||
pcColorMat->unref();
|
||||
Gui::SoFCColorBarNotifier::instance().detach(pcColorBar);
|
||||
pcColorBar->Detach(this);
|
||||
pcColorBar->unref();
|
||||
pcLinkRoot->unref();
|
||||
|
||||
Reference in New Issue
Block a user