First Qt5 compatible NaviCube attempt

This commit is contained in:
Kustaa Nyholm
2017-11-18 13:02:38 +02:00
committed by wmayer
parent 934603b604
commit 13a4f84145
5 changed files with 1373 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ if (BUILD_ADDONMGR)
endif(BUILD_ADDONMGR)
include_directories(
${EIGEN3_INCLUDE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/Quarter
@@ -826,6 +827,7 @@ SET(View3D_CPP_SRCS
CoinRiftWidget.cpp
View3DPy.cpp
View3DViewerPy.cpp
NaviCube.cpp
)
SET(View3D_SRCS
${View3D_CPP_SRCS}
@@ -842,6 +844,7 @@ SET(View3D_SRCS
View3DInventorRiftViewer.h
CoinRiftWidget.h
View3DViewerPy.h
NaviCube.h
)
SOURCE_GROUP("View3D" FILES ${View3D_SRCS})

1316
src/Gui/NaviCube.cpp Normal file

File diff suppressed because it is too large Load Diff

48
src/Gui/NaviCube.h Normal file
View File

@@ -0,0 +1,48 @@
/***************************************************************************
* Copyright (c) 2017 Kustaa Nyholm <kustaa.nyholm@sparetimelabs.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef SRC_GUI_NAVICUBE_H_
#define SRC_GUI_NAVICUBE_H_
namespace Gui {
class View3DInventorViewer;
}
class NaviCubeImplementation;
class NaviCube {
public:
NaviCube(Gui::View3DInventorViewer* viewer) ;
virtual ~NaviCube();
void drawNaviCube() ;
bool processSoEvent(const SoEvent* ev) ;
private:
NaviCubeImplementation* m_NaviCubeImplementation;
};
class HuuhaaClassPy : public Py::PythonExtension<HuuhaaClassPy> {
public:
Py::Object huuhaa(const Py::Tuple&);
static void init_type() ;
};
#endif /* SRC_GUI_NAVICUBE_H_ */

View File

@@ -532,6 +532,7 @@ void View3DInventorViewer::init()
cursor = QBitmap::fromData(QSize(PAN_WIDTH, PAN_HEIGHT), pan_bitmap);
mask = QBitmap::fromData(QSize(PAN_WIDTH, PAN_HEIGHT), pan_mask_bitmap);
panCursor = QCursor(cursor, mask, PAN_HOT_X, PAN_HOT_Y);
naviCube = new NaviCube(this);
}
View3DInventorViewer::~View3DInventorViewer()
@@ -1731,6 +1732,8 @@ void View3DInventorViewer::renderScene(void)
draw2DString(stream.str().c_str(), SbVec2s(10,10), SbVec2f(0.1f,0.1f));
}
naviCube->drawNaviCube();
#if 0 // this breaks highlighting of edges
glEnable(GL_LIGHTING);
glEnable(GL_DEPTH_TEST);
@@ -1812,6 +1815,8 @@ void View3DInventorViewer::selectAll()
bool View3DInventorViewer::processSoEvent(const SoEvent* ev)
{
if (naviCube->processSoEvent(ev))
return true;
if (isRedirectedToSceneGraph()) {
SbBool processed = inherited::processSoEvent(ev);

View File

@@ -38,6 +38,7 @@
#include <QImage>
#include <Gui/Selection.h>
#include <Gui/NaviCube.h>
class SoTranslation;
class SoTransform;