diff --git a/src/Gui/MDIView.h b/src/Gui/MDIView.h index 3a787b5fa..eb086c53b 100644 --- a/src/Gui/MDIView.h +++ b/src/Gui/MDIView.h @@ -77,10 +77,7 @@ public: /** @name Printing */ //@{ public Q_SLOTS: - virtual void setOverrideCursor(const QCursor&); - virtual void restoreOverrideCursor(); virtual void print(QPrinter* printer); - public: /** Print content of view */ virtual void print(); @@ -107,6 +104,10 @@ public: virtual void setCurrentViewMode(ViewMode mode); ViewMode currentViewMode() const { return currentMode; } +public Q_SLOTS: + virtual void setOverrideCursor(const QCursor&); + virtual void restoreOverrideCursor(); + Q_SIGNALS: void message(const QString&, int); diff --git a/src/Gui/SelectionObjectPyImp.cpp b/src/Gui/SelectionObjectPyImp.cpp index 5cd52a9f3..34200b241 100644 --- a/src/Gui/SelectionObjectPyImp.cpp +++ b/src/Gui/SelectionObjectPyImp.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2009 Juergen Riegel (FreeCAD@juergen-riegel.net) * + * Copyright (c) 2009 Juergen Riegel (FreeCAD@juergen-riegel.net) * * * * This file is part of the FreeCAD CAx development system. * * * diff --git a/src/Gui/SoAxisCrossKit.h b/src/Gui/SoAxisCrossKit.h index 488c51ee8..644cd6452 100644 --- a/src/Gui/SoAxisCrossKit.h +++ b/src/Gui/SoAxisCrossKit.h @@ -26,6 +26,7 @@ #include #include +#include #include #include #include diff --git a/src/Gui/View3DInventor.cpp b/src/Gui/View3DInventor.cpp index 1b2b934ca..e1a44f3d7 100644 --- a/src/Gui/View3DInventor.cpp +++ b/src/Gui/View3DInventor.cpp @@ -772,12 +772,9 @@ bool View3DInventor::hasClippingPlane() const return _viewer->hasClippingPlane(); } -void View3DInventor::setOverlayWidget(GLOverlayWidget* widget) +void View3DInventor::setOverlayWidget(QWidget* widget) { removeOverlayWidget(); - QGLWidget* w = static_cast(_viewer->getGLWidget()); - QImage img = w->grabFrameBuffer(); - widget->setImage(img); stack->addWidget(widget); stack->setCurrentIndex(1); } diff --git a/src/Gui/View3DInventor.h b/src/Gui/View3DInventor.h index e6aba94f2..de3bc9249 100644 --- a/src/Gui/View3DInventor.h +++ b/src/Gui/View3DInventor.h @@ -100,7 +100,7 @@ public: void toggleClippingPlane(); bool hasClippingPlane() const; - void setOverlayWidget(GLOverlayWidget*); + void setOverlayWidget(QWidget*); void removeOverlayWidget(); View3DInventorViewer *getViewer(void) const {return _viewer;} diff --git a/src/Mod/Image/App/ImageBase.cpp b/src/Mod/Image/App/ImageBase.cpp index fa078faf9..d3177a180 100644 --- a/src/Mod/Image/App/ImageBase.cpp +++ b/src/Mod/Image/App/ImageBase.cpp @@ -123,7 +123,7 @@ void ImageBase::clear() _setColorFormat(IB_CF_GREY8, 8); } -// Sets the color format and the dependant parameters +// Sets the color format and the dependent parameters // Returns 0 for OK, -1 for invalid color format int ImageBase::_setColorFormat(int format, unsigned short numSigBitsPerSample) { @@ -235,7 +235,7 @@ int ImageBase::createCopy(void* pSrcPixelData, unsigned long width, unsigned lon // Clear any existing data clear(); - // Set the color format and the dependant parameters + // Set the color format and the dependent parameters if (_setColorFormat(format, numSigBitsPerSample) != 0) return -1; @@ -273,7 +273,7 @@ int ImageBase::pointTo(void* pSrcPixelData, unsigned long width, unsigned long h // Clear any existing data clear(); - // Set the color format and the dependant parameters + // Set the color format and the dependent parameters if (_setColorFormat(format, numSigBitsPerSample) != 0) return -1; @@ -324,15 +324,15 @@ int ImageBase::getSample(int x, int y, unsigned short sampleIndex, double &value case IB_CF_RGBA64: case IB_CF_BGRA64: { - unsigned short* pPix16 = (unsigned short *)_pPixelData; - unsigned short* pSample = pPix16 + _numSamples * (y * _width + x) + sampleIndex; + uint16_t* pPix16 = (uint16_t *)_pPixelData; + uint16_t* pSample = pPix16 + _numSamples * (y * _width + x) + sampleIndex; value = (double)(*pSample); } break; case IB_CF_GREY32: { - unsigned long* pPix32 = (unsigned long *)_pPixelData; - unsigned long* pSample = pPix32 + y * _width + x; + uint32_t* pPix32 = (uint32_t *)_pPixelData; + uint32_t* pSample = pPix32 + y * _width + x; value = (double)(*pSample); } break; diff --git a/src/Mod/Image/App/ImageBase.h b/src/Mod/Image/App/ImageBase.h index 44b061c11..144699c71 100644 --- a/src/Mod/Image/App/ImageBase.h +++ b/src/Mod/Image/App/ImageBase.h @@ -71,7 +71,7 @@ protected: int _format; // colour format of the pixel data unsigned short _numSigBitsPerSample;// number of significant bits per sample (always <= _numBitsPerSample) - // Dependant parameters + // Dependent parameters unsigned short _numSamples; // number of samples per pixel (e.g. 1 for grey, 3 for rgb, 4 for rgba) unsigned short _numBitsPerSample; // number of bits per sample (e.g. 8 for Grey8) unsigned short _numBytesPerPixel; // number of bytes per pixel (e.g. 1 for Grey8) diff --git a/src/Mod/Image/Gui/GLImageBox.cpp b/src/Mod/Image/Gui/GLImageBox.cpp index bfb54eec0..e29c400cf 100644 --- a/src/Mod/Image/Gui/GLImageBox.cpp +++ b/src/Mod/Image/Gui/GLImageBox.cpp @@ -45,6 +45,8 @@ using namespace ImageGui; #pragma warning(disable:4305) // init: truncation from const double to float #endif +bool GLImageBox::haveMesa = false; + /* TRANSLATOR ImageGui::GLImageBox */ // Constructor @@ -81,7 +83,13 @@ GLImageBox::~GLImageBox() // Set up the OpenGL rendering state void GLImageBox::initializeGL() { - qglClearColor( Qt::black ); // Let OpenGL clear to black + qglClearColor( Qt::black ); // Let OpenGL clear to black + static bool init = false; + if (!init) { + init = true; + std::string ver = (const char*)(glGetString(GL_VERSION)); + haveMesa = (ver.find("Mesa") != std::string::npos); + } } @@ -170,7 +178,7 @@ void GLImageBox::drawImage() // Load the color map if present if (_pColorMap != 0) { - glPixelTransferf(GL_MAP_COLOR, 1.0); + if (!haveMesa) glPixelTransferf(GL_MAP_COLOR, 1.0); glPixelMapfv(GL_PIXEL_MAP_R_TO_R, _numMapEntries, _pColorMap); glPixelMapfv(GL_PIXEL_MAP_G_TO_G, _numMapEntries, _pColorMap + _numMapEntries); glPixelMapfv(GL_PIXEL_MAP_B_TO_B, _numMapEntries, _pColorMap + _numMapEntries * 2); diff --git a/src/Mod/Image/Gui/GLImageBox.h b/src/Mod/Image/Gui/GLImageBox.h index 91b6ca9dc..0aeb5121b 100644 --- a/src/Mod/Image/Gui/GLImageBox.h +++ b/src/Mod/Image/Gui/GLImageBox.h @@ -105,6 +105,7 @@ private: float* _pColorMap; // a RGBA color map (to alter the intensity or colors) int _numMapEntries; // number of entries in color map + static bool haveMesa; }; diff --git a/src/Mod/Image/Gui/Workbench.cpp b/src/Mod/Image/Gui/Workbench.cpp index c07043da9..ed972cecd 100644 --- a/src/Mod/Image/Gui/Workbench.cpp +++ b/src/Mod/Image/Gui/Workbench.cpp @@ -58,7 +58,6 @@ Gui::ToolBarItem* Workbench::setupToolBars() const Gui::ToolBarItem* Workbench::setupCommandBars() const { - // Part tools Gui::ToolBarItem* root = new Gui::ToolBarItem; Gui::ToolBarItem* img = new Gui::ToolBarItem(root); img->setCommand("Image");