Skip to content

Commit

Permalink
+ fix more Quarter port issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Oct 19, 2014
1 parent 5912342 commit ab66d0a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
21 changes: 15 additions & 6 deletions src/Gui/ManualAlignment.cpp
Expand Up @@ -28,6 +28,7 @@
# include <QLabel>
# include <QMenu>
# include <QMessageBox>
# include <QGLWidget>
# include <QPainter>
# include <QSplitter>
# include <QStatusBar>
Expand Down Expand Up @@ -60,6 +61,7 @@
#include <Gui/MainWindow.h>
#include <Gui/Selection.h>
#include <Gui/SplitView3DInventor.h>
#include <Gui/View3DInventor.h>
#include <Gui/View3DInventorViewer.h>
#include <Gui/ViewProviderGeometryObject.h>
#include <Gui/WaitCursor.h>
Expand Down Expand Up @@ -330,14 +332,14 @@ class AlignmentView : public Gui::AbstractSplitView
public:
QLabel* myLabel;

AlignmentView(Gui::Document* pcDocument, QWidget* parent, Qt::WFlags wflags=0)
AlignmentView(Gui::Document* pcDocument, QWidget* parent, QGLWidget* shareWidget=0, Qt::WFlags wflags=0)
: AbstractSplitView(pcDocument, parent, wflags)
{
QSplitter* mainSplitter=0;
mainSplitter = new QSplitter(Qt::Horizontal, this);
_viewer.push_back(new View3DInventorViewer(mainSplitter));
_viewer.push_back(new View3DInventorViewer(mainSplitter, shareWidget));
_viewer.back()->setDocument(pcDocument);
_viewer.push_back(new View3DInventorViewer(mainSplitter));
_viewer.push_back(new View3DInventorViewer(mainSplitter, shareWidget));
_viewer.back()->setDocument(pcDocument);

QFrame* vbox = new QFrame(this);
Expand Down Expand Up @@ -367,9 +369,9 @@ class AlignmentView : public Gui::AbstractSplitView
// apply the user settings
setupSettings();

static_cast<SoGroup*>(getViewer(0)->getSceneGraph())->
static_cast<SoGroup*>(getViewer(0)->getSoRenderManager()->getSceneGraph())->
addChild(setupHeadUpDisplay(tr("Movable object")));
static_cast<SoGroup*>(getViewer(1)->getSceneGraph())->
static_cast<SoGroup*>(getViewer(1)->getSoRenderManager()->getSceneGraph())->
addChild(setupHeadUpDisplay(tr("Fixed object")));
}
~AlignmentView()
Expand Down Expand Up @@ -722,8 +724,15 @@ void ManualAlignment::startAlignment(Base::Type mousemodel)
if (myAlignModel.isEmpty())
return;

QGLWidget* shareWidget = 0;
std::list<MDIView*> theViews = myDocument->getMDIViewsOfType(View3DInventor::getClassTypeId());
if (!theViews.empty()) {
shareWidget = qobject_cast<QGLWidget*>(static_cast<View3DInventor*>
(theViews.front())->getViewer()->getGLWidget());
}

// create a splitted window for picking the points
myViewer = new AlignmentView(myDocument,Gui::getMainWindow());
myViewer = new AlignmentView(myDocument,Gui::getMainWindow(),shareWidget);
myViewer->setWindowTitle(tr("Alignment[*]"));
myViewer->setWindowIcon(QApplication::windowIcon());
myViewer->resize(400, 300);
Expand Down
16 changes: 7 additions & 9 deletions src/Gui/View3DInventorViewer.cpp
Expand Up @@ -774,11 +774,9 @@ void View3DInventorViewer::setSceneGraph(SoNode* root)
//we want the rendered scene with all lights and cameras, viewer->getSceneGraph would return
//the geometry scene only
SoNode* scene = this->getSoRenderManager()->getSceneGraph();

if(scene && scene->getTypeId().isDerivedFrom(SoSeparator::getClassTypeId())) {
if (scene && scene->getTypeId().isDerivedFrom(SoSeparator::getClassTypeId())) {
sa.apply(scene);

if(!sa.getPath())
if (!sa.getPath())
static_cast<SoSeparator*>(scene)->insertChild(this->backlight, 0);
}
}
Expand Down Expand Up @@ -895,7 +893,7 @@ void View3DInventorViewer::saveGraphic(int pagesize, int eBackgroundType, SoVect
SbVec2s vpsize = this->getSoRenderManager()->getViewportRegion().getViewportSizePixels();
float vpratio = ((float)vpsize[0]) / ((float)vpsize[1]);

if(vpratio > 1.0f) {
if (vpratio > 1.0f) {
va->setOrientation(SoVectorizeAction::LANDSCAPE);
vpratio = 1.0f / vpratio;
}
Expand All @@ -911,7 +909,7 @@ void View3DInventorViewer::saveGraphic(int pagesize, int eBackgroundType, SoVect
float pageratio = size[0] / size[1];
float xsize, ysize;

if(pageratio < vpratio) {
if (pageratio < vpratio) {
xsize = size[0];
ysize = xsize / vpratio;
}
Expand Down Expand Up @@ -1230,7 +1228,7 @@ void View3DInventorViewer::renderToFramebuffer(QGLFramebufferObject* fbo)
gl.apply(this->getSoRenderManager()->getSceneGraph());
gl.apply(this->foregroundroot);

if(this->axiscrossEnabled) {
if (this->axiscrossEnabled) {
this->drawAxisCross();
}

Expand Down Expand Up @@ -1699,7 +1697,7 @@ bool View3DInventorViewer::pickPoint(const SbVec2s& pos,SbVec3f& point,SbVec3f&
rp.apply(getSoRenderManager()->getSceneGraph());
SoPickedPoint* Point = rp.getPickedPoint();

if(Point) {
if (Point) {
point = Point->getObjectPoint();
norm = Point->getObjectNormal();
return true;
Expand Down Expand Up @@ -1728,7 +1726,7 @@ SoPickedPoint* View3DInventorViewer::pickPoint(const SbVec2s& pos) const

const SoPickedPoint* View3DInventorViewer::getPickedPoint(SoEventCallback* n) const
{
if(selectionRoot)
if (selectionRoot)
return selectionRoot->getPickedPoint(n->getAction());
else
return n->getPickedPoint();
Expand Down

0 comments on commit ab66d0a

Please sign in to comment.