write custom action class to notify shape node about vbo changes
This commit is contained in:
@@ -247,6 +247,12 @@ void SoBrepFaceSet::doAction(SoAction* action)
|
||||
}
|
||||
}
|
||||
}
|
||||
// The recommended way to set 'updateVbo' is to reimplement the method 'notify'
|
||||
// but the class made this method private so that we can't override it.
|
||||
// So, the alternative way is to write a custom SoAction class.
|
||||
else if (action->getTypeId() == Gui::SoUpdateVBOAction::getClassTypeId()) {
|
||||
this->updateVbo = true;
|
||||
}
|
||||
|
||||
inherited::doAction(action);
|
||||
}
|
||||
|
||||
@@ -143,9 +143,7 @@ private:
|
||||
|
||||
// Define some VBO pointer for the current mesh
|
||||
SbBool vboAvailable;
|
||||
public:
|
||||
SbBool updateVbo;
|
||||
private:
|
||||
uint32_t myvbo[2];
|
||||
SbBool vboLoaded;
|
||||
uint32_t indice_array;
|
||||
|
||||
@@ -106,6 +106,7 @@
|
||||
#include <App/Document.h>
|
||||
|
||||
#include <Gui/SoFCUnifiedSelection.h>
|
||||
#include <Gui/SoFCSelectionAction.h>
|
||||
#include <Gui/Selection.h>
|
||||
#include <Gui/View3DInventorViewer.h>
|
||||
#include <Gui/Utilities.h>
|
||||
@@ -800,8 +801,8 @@ void ViewProviderPartExt::reload()
|
||||
void ViewProviderPartExt::updateData(const App::Property* prop)
|
||||
{
|
||||
if (prop->getTypeId() == Part::PropertyPartShape::getClassTypeId()) {
|
||||
// vejmarie: Force VBO update of the part
|
||||
this->faceset->updateVbo = true;
|
||||
Gui::SoUpdateVBOAction action;
|
||||
action.apply(this->faceset);
|
||||
|
||||
// get the shape to show
|
||||
const TopoDS_Shape &cShape = static_cast<const Part::PropertyPartShape*>(prop)->getValue();
|
||||
|
||||
Reference in New Issue
Block a user