+ fix gradient background issue when creating snapshot, remove superfluous signal from FileOptionsDialog

This commit is contained in:
wmayer 2014-11-08 14:50:27 +01:00
parent bedd2b15a7
commit 97696aadfa
4 changed files with 18 additions and 23 deletions

View File

@ -345,10 +345,6 @@ FileOptionsDialog::FileOptionsDialog( QWidget* parent, Qt::WFlags fl )
#endif
connect(extensionButton, SIGNAL(clicked()), this, SLOT(toggleExtension()));
// get the filter combobox to connect its activated() signal with our filterSelected() signal
QComboBox* box = this->findChildren<QComboBox*>().last();
connect(box, SIGNAL(activated(const QString&)), this, SIGNAL(filterSelected(const QString&)));
}
FileOptionsDialog::~FileOptionsDialog()

View File

@ -94,9 +94,6 @@ public:
protected Q_SLOTS:
void toggleExtension();
Q_SIGNALS:
void filterSelected(const QString&);
private:
QPushButton* extensionButton;
};

View File

@ -632,7 +632,7 @@ void View3DInventorViewer::updateOverrideMode(const std::string& mode)
overrideMode = mode;
}
void setViewportRegionCB(void* userdata, SoAction* action)
void View3DInventorViewer::setViewportCB(void* userdata, SoAction* action)
{
// Make sure to override the value set inside SoOffscreenRenderer::render()
if (action->isOfType(SoGLRenderAction::getClassTypeId())) {
@ -643,7 +643,7 @@ void setViewportRegionCB(void* userdata, SoAction* action)
}
}
void View3DInventorViewer::clearBuffer(void* userdata, SoAction* action)
void View3DInventorViewer::clearBufferCB(void* userdata, SoAction* action)
{
if (action->isOfType(SoGLRenderAction::getClassTypeId())) {
// do stuff specific for GL rendering here.
@ -651,7 +651,7 @@ void View3DInventorViewer::clearBuffer(void* userdata, SoAction* action)
}
}
void View3DInventorViewer::setGLWidget(void* userdata, SoAction* action)
void View3DInventorViewer::setGLWidgetCB(void* userdata, SoAction* action)
{
//FIXME: This causes the Coin error message:
// Coin error in SoNode::GLRenderS(): GL error: 'GL_STACK_UNDERFLOW', nodetype:
@ -823,7 +823,7 @@ void View3DInventorViewer::savePicture(int w, int h, int eBackgroundType, QImage
else {
useBackground = true;
cb = new SoCallback;
cb->setCallback(clearBuffer);
cb->setCallback(clearBufferCB);
}
break;
@ -846,6 +846,15 @@ void View3DInventorViewer::savePicture(int w, int h, int eBackgroundType, QImage
SoSeparator* root = new SoSeparator;
root->ref();
#if (COIN_MAJOR_VERSION >= 4)
// The behaviour in Coin4 has changed so that when using the same instance of 'SoFCOffscreenRenderer'
// multiple times internally the biggest viewport size is stored and set to the SoGLRenderAction.
// The trick is to add a callback node and override the viewport size with wath we want.
SoCallback* cbvp = new SoCallback;
cbvp->setCallback(setViewportCB);
root->addChild(cbvp);
#endif
SoCamera* camera = getSoRenderManager()->getCamera();
if (useBackground) {
@ -853,19 +862,10 @@ void View3DInventorViewer::savePicture(int w, int h, int eBackgroundType, QImage
root->addChild(cb);
}
#if (COIN_MAJOR_VERSION >= 4)
// The behaviour in Coin4 has changed so that when using the same instance of 'SoFCOffscreenRenderer'
// multiple times internally the biggest viewport size is stored and set to the SoGLRenderAction.
// The trick is to add a callback node and override the viewport size with wath we want.
SoCallback* cbvp = new SoCallback;
cbvp->setCallback(setViewportRegionCB);
root->addChild(cbvp);
#endif
root->addChild(getHeadlight());
root->addChild(camera);
SoCallback* gl = new SoCallback;
gl->setCallback(setGLWidget, this->getGLWidget());
gl->setCallback(setGLWidgetCB, this->getGLWidget());
root->addChild(gl);
root->addChild(pcViewProviderRoot);

View File

@ -365,8 +365,10 @@ protected:
void printDimension();
void selectAll();
static void clearBuffer(void * userdata, SoAction * action);
static void setGLWidget(void * userdata, SoAction * action);
private:
static void setViewportCB(void * userdata, SoAction * action);
static void clearBufferCB(void * userdata, SoAction * action);
static void setGLWidgetCB(void * userdata, SoAction * action);
static void handleEventCB(void * userdata, SoEventCallback * n);
static void interactionStartCB(void * data, Quarter::SoQTQuarterAdaptor * viewer);
static void interactionFinishCB(void * data, Quarter::SoQTQuarterAdaptor * viewer);