fix Qt5 build failure
This commit is contained in:
@@ -27,7 +27,6 @@ if (BUILD_ADDONMGR)
|
||||
endif(BUILD_ADDONMGR)
|
||||
|
||||
include_directories(
|
||||
${EIGEN3_INCLUDE_DIR}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Quarter
|
||||
@@ -40,6 +39,7 @@ include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Quarter
|
||||
${CMAKE_CURRENT_BINARY_DIR}/DAGView
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${EIGEN3_INCLUDE_DIR}
|
||||
${COIN3D_INCLUDE_DIRS}
|
||||
${PYTHON_INCLUDE_DIRS}
|
||||
${XercesC_INCLUDE_DIRS}
|
||||
|
||||
@@ -75,8 +75,6 @@
|
||||
# include <Inventor/SoPickedPoint.h>
|
||||
# include <Inventor/VRMLnodes/SoVRMLGroup.h>
|
||||
# include <QEventLoop>
|
||||
# include <QGLFramebufferObject>
|
||||
# include <QGLPixelBuffer>
|
||||
# include <QKeyEvent>
|
||||
# include <QWheelEvent>
|
||||
# include <QMessageBox>
|
||||
@@ -84,7 +82,6 @@
|
||||
# include <QStatusBar>
|
||||
# include <QBitmap>
|
||||
# include <QMimeData>
|
||||
# include <MainWindow.h>
|
||||
#endif
|
||||
|
||||
#include <sstream>
|
||||
@@ -98,6 +95,7 @@
|
||||
#include "View3DInventorViewer.h"
|
||||
#include "View3DInventor.h"
|
||||
#include "Application.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MDIView.h"
|
||||
#include "Command.h"
|
||||
|
||||
@@ -110,7 +108,13 @@
|
||||
#include <QImage>
|
||||
#include <QPainterPath>
|
||||
#include <QApplication>
|
||||
#include <QOpenGLTexture>
|
||||
|
||||
#if defined(HAVE_QT5_OPENGL)
|
||||
# include <QOpenGLTexture>
|
||||
#else
|
||||
# include <QGLFramebufferObject>
|
||||
#endif
|
||||
|
||||
//#include <OpenGL/glu.h>
|
||||
#include <Eigen/Dense>
|
||||
#include <vector>
|
||||
@@ -118,6 +122,7 @@
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Eigen;
|
||||
using namespace std;
|
||||
using namespace Gui;
|
||||
@@ -250,7 +255,7 @@ public:
|
||||
bool m_Dragging = false;
|
||||
bool m_MightDrag = false;
|
||||
|
||||
QGLFramebufferObject* m_PickingFramebuffer;
|
||||
QtGLFramebufferObject* m_PickingFramebuffer;
|
||||
|
||||
bool m_NaviCubeInitialised = false;
|
||||
|
||||
@@ -372,7 +377,7 @@ QOpenGLTexture* NaviCubeImplementation::createButtonTex(int button) {
|
||||
|
||||
QPainterPath path;
|
||||
|
||||
float as1 = 0.12; // arrow size
|
||||
float as1 = 0.12f; // arrow size
|
||||
float as3 = as1 / 3;
|
||||
|
||||
switch (button) {
|
||||
@@ -614,11 +619,11 @@ void NaviCubeImplementation::initNaviCube() {
|
||||
0, cs, -sn,
|
||||
0, sn, cs;
|
||||
|
||||
m_Textures[TEX_CORNER_FACE] = createCubeFaceTex(0, 0.5, NULL);
|
||||
m_Textures[TEX_BACK_FACE] = createCubeFaceTex(0.02, 0.3, NULL);
|
||||
m_Textures[TEX_CORNER_FACE] = createCubeFaceTex(0, 0.5f, NULL);
|
||||
m_Textures[TEX_BACK_FACE] = createCubeFaceTex(0.02f, 0.3f, NULL);
|
||||
|
||||
float gap = 0.12;
|
||||
float radius = 0.12;
|
||||
float gap = 0.12f;
|
||||
float radius = 0.12f;
|
||||
|
||||
m_Textures[TEX_FRONT] = createCubeFaceTex(gap, radius, "Front");
|
||||
m_Textures[TEX_REAR] = createCubeFaceTex(gap, radius, "Rear");
|
||||
@@ -659,8 +664,8 @@ void NaviCubeImplementation::initNaviCube() {
|
||||
z = r45z * r45x * z;
|
||||
x = r45z * r45x * x;
|
||||
|
||||
x *= 0.25; // corner face size
|
||||
z *= 1.45; // corner face position
|
||||
x *= 0.25f; // corner face size
|
||||
z *= 1.45f; // corner face position
|
||||
|
||||
addFace(x, z, TEX_CORNER_FACE, TEX_CORNER_FACE, TEX_CORNER_FACE, TEX_BOTTOM_RIGHT_REAR);
|
||||
|
||||
@@ -699,7 +704,7 @@ void NaviCubeImplementation::initNaviCube() {
|
||||
m_Buttons.push_back(TEX_ARROW_LEFT);
|
||||
m_Buttons.push_back(TEX_ARROW_RIGHT);
|
||||
|
||||
m_PickingFramebuffer = new QGLFramebufferObject(2*m_CubeWidgetSize,2* m_CubeWidgetSize, QGLFramebufferObject::CombinedDepthStencil);
|
||||
m_PickingFramebuffer = new QtGLFramebufferObject(2*m_CubeWidgetSize,2* m_CubeWidgetSize, QtGLFramebufferObject::CombinedDepthStencil);
|
||||
}
|
||||
|
||||
void NaviCubeImplementation::drawNaviCube() {
|
||||
@@ -825,7 +830,7 @@ void NaviCubeImplementation::drawNaviCube(bool pickMode) {
|
||||
if (!pickMode) {
|
||||
// Draw the axes
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
float a=1.1;
|
||||
float a=1.1f;
|
||||
|
||||
static GLubyte xbmp[] = { 0x11,0x11,0x0a,0x04,0x0a,0x11,0x11 };
|
||||
glColor3f(1, 0, 0);
|
||||
@@ -1053,7 +1058,7 @@ bool NaviCubeImplementation::mouseReleased(short x, short y) {
|
||||
m_MouseDown = false;
|
||||
if (!m_Dragging) {
|
||||
float rot = 45 ; //30;
|
||||
float tilt = 90-54.7356 ; //30; // 90 + deg(asin(-sqrt(1.0/3.0)))
|
||||
float tilt = 90-54.7356f ; //30; // 90 + deg(asin(-sqrt(1.0/3.0)))
|
||||
int pick = pickFace(x,y);
|
||||
switch (pick) {
|
||||
default:
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
#ifndef SRC_GUI_NAVICUBE_H_
|
||||
#define SRC_GUI_NAVICUBE_H_
|
||||
|
||||
#include <CXX/Extensions.hxx>
|
||||
|
||||
class SoEvent;
|
||||
|
||||
namespace Gui {
|
||||
class View3DInventorViewer;
|
||||
}
|
||||
@@ -33,8 +37,8 @@ class NaviCube {
|
||||
public:
|
||||
NaviCube(Gui::View3DInventorViewer* viewer) ;
|
||||
virtual ~NaviCube();
|
||||
void drawNaviCube() ;
|
||||
bool processSoEvent(const SoEvent* ev) ;
|
||||
void drawNaviCube();
|
||||
bool processSoEvent(const SoEvent* ev);
|
||||
private:
|
||||
NaviCubeImplementation* m_NaviCubeImplementation;
|
||||
};
|
||||
|
||||
@@ -537,6 +537,7 @@ void View3DInventorViewer::init()
|
||||
|
||||
View3DInventorViewer::~View3DInventorViewer()
|
||||
{
|
||||
delete naviCube;
|
||||
// cleanup
|
||||
this->backgroundroot->unref();
|
||||
this->backgroundroot = 0;
|
||||
|
||||
@@ -397,6 +397,7 @@ private:
|
||||
void setCursorRepresentation(int mode);
|
||||
|
||||
private:
|
||||
NaviCube* naviCube;
|
||||
std::set<ViewProvider*> _ViewProviderSet;
|
||||
std::map<SoSeparator*,ViewProvider*> _ViewProviderMap;
|
||||
std::list<GLGraphicsItem*> graphicsItems;
|
||||
|
||||
Reference in New Issue
Block a user