Gui: add support of selection context

The patch implements context-aware selection and rendering in 3D view.

Please check [here](https://git.io/fjiY5) for more details, including
the following 'Render Caching' section.

The patch also includes modification of View3DInventorViewer to support
always-on-top selection rendering using the secondary selection context
and the new coin node SoFCPathAnnotation.

Another small change in SoQtQuarterAdaptor for more responsive frame
rate display. The original implementation reports skewed frame rate
in the presence of long idle period.
This commit is contained in:
Zheng, Lei
2019-07-07 16:08:38 +08:00
committed by wmayer
parent c88e1335d8
commit c9ba972d26
25 changed files with 3500 additions and 957 deletions

View File

@@ -57,6 +57,7 @@
#include "View3DInventorViewer.h"
#include "SoFCDB.h"
#include "ViewProviderExtension.h"
#include "SoFCUnifiedSelection.h"
#include "ViewParams.h"
#include <boost/bind.hpp>
@@ -84,7 +85,7 @@ ViewProvider::ViewProvider()
{
setStatus(UpdateData, true);
pcRoot = new SoSeparator();
pcRoot = new SoFCSeparator;
pcRoot->ref();
pcModeSwitch = new SoSwitch();
pcModeSwitch->ref();
@@ -94,6 +95,8 @@ ViewProvider::ViewProvider()
pcRoot->addChild(pcModeSwitch);
sPixmap = "px";
pcModeSwitch->whichChild = _iActualMode;
setRenderCacheMode(ViewParams::instance()->getRenderCache());
}
ViewProvider::~ViewProvider()
@@ -974,6 +977,11 @@ void ViewProvider::beforeDelete() {
ext->extensionBeforeDelete();
}
void ViewProvider::setRenderCacheMode(int mode) {
pcRoot->renderCaching =
mode==0?SoSeparator::AUTO:(mode==1?SoSeparator::ON:SoSeparator::OFF);
}
Base::BoundBox3d ViewProvider::getBoundingBox(const char *subname, bool transform, MDIView *view) const {
if(!pcRoot || !pcModeSwitch || pcRoot->findChild(pcModeSwitch)<0)
return Base::BoundBox3d();