Adaption of FreeCAD to QuarterWidget

-removes all soqtviewer references
-create a quarter adaptor class which implements missing functionality
-adopts freecad code to make use of SoRenderManager and changed View3DInventorViewer  interface
This commit is contained in:
Stefan Tröger
2014-07-19 15:18:14 +02:00
committed by wmayer
parent e1265c874d
commit 72cab0c002
74 changed files with 1855 additions and 1180 deletions

View File

@@ -487,13 +487,13 @@ void GLFlagWindow::addFlag(Flag* item, FlagLayout::Position pos)
{
if (!_flagLayout) {
_flagLayout = new FlagLayout(3);
_viewer->getGLWidget()->setLayout(_flagLayout);
_viewer->setLayout(_flagLayout);
}
item->setParent(_viewer->getGLWidget());
item->setParent(_viewer);
_flagLayout->addWidget(item, pos);
item->show();
_viewer->scheduleRedraw();
_viewer->getSoRenderManager()->scheduleRedraw();
}
void GLFlagWindow::removeFlag(Flag* item)
@@ -525,13 +525,13 @@ void GLFlagWindow::paintGL()
{
// draw lines for the flags
if (_flagLayout) {
// it can happen that the GL widget gets replaced internally by SoQt which
// it can happen that the GL widget gets replaced internally (SoQt only, not with quarter) which
// causes to destroy the FlagLayout instance
int ct = _flagLayout->count();
const SbViewportRegion vp = _viewer->getViewportRegion();
const SbViewportRegion vp = _viewer->getSoRenderManager()->getViewportRegion();
SbVec2s size = vp.getViewportSizePixels();
float aspectratio = float(size[0])/float(size[1]);
SbViewVolume vv = _viewer->getCamera()->getViewVolume(aspectratio);
float aspectratio = float(size[0])/float(size[1]);
SbViewVolume vv = _viewer->getSoRenderManager()->getCamera()->getViewVolume(aspectratio);
for (int i=0; i<ct;i++) {
Flag* flag = qobject_cast<Flag*>(_flagLayout->itemAt(i)->widget());
if (flag) {