Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
+ fix whitespaces
  • Loading branch information
wwmayer committed Oct 10, 2014
1 parent 4a3838f commit 39f2132
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 45 deletions.
8 changes: 4 additions & 4 deletions src/Gui/Quarter/QuarterWidget.cpp
Expand Up @@ -128,13 +128,13 @@ using namespace SIM::Coin3D::Quarter;
#endif

//We need to avoid buffer swaping when initializing a QPainter on this widget
class QUARTER_DLL_API CustomGLWidget : public QGLWidget {
class CustomGLWidget : public QGLWidget {
public:
CustomGLWidget(const QGLFormat& fo, QWidget* parent = 0, const QGLWidget* shareWidget = 0, Qt::WindowFlags f = 0)
: QGLWidget(fo, parent, shareWidget, f) {
: QGLWidget(fo, parent, shareWidget, f)
{
setAutoBufferSwap(false);
};
}
};

/*! constructor */
Expand Down
26 changes: 13 additions & 13 deletions src/Gui/View3DInventor.cpp
Expand Up @@ -116,14 +116,14 @@ View3DInventor::View3DInventor(Gui::Document* pcDocument, QWidget* parent, Qt::W
switch( hGrp->GetInt("AntiAliasing",0) ) {
case View3DInventorViewer::MSAA2x:
f.setSampleBuffers(true);
f.setSamples(2);
f.setSamples(2);
break;
case View3DInventorViewer::MSAA4x:
f.setSampleBuffers(true);
f.setSampleBuffers(true);
f.setSamples(4);
break;
case View3DInventorViewer::MSAA8x:
f.setSampleBuffers(true);
f.setSampleBuffers(true);
f.setSamples(8);
break;
case View3DInventorViewer::None:
Expand Down Expand Up @@ -360,23 +360,23 @@ void View3DInventor::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M
else if (strcmp(Reason, "DimensionsVisible") == 0)
{
if (rGrp.GetBool("DimensionsVisible", true))
_viewer->turnAllDimensionsOn();
_viewer->turnAllDimensionsOn();
else
_viewer->turnAllDimensionsOff();
_viewer->turnAllDimensionsOff();
}
else if (strcmp(Reason, "Dimensions3dVisible") == 0)
{
if (rGrp.GetBool("Dimensions3dVisible", true))
_viewer->turn3dDimensionsOn();
_viewer->turn3dDimensionsOn();
else
_viewer->turn3dDimensionsOff();
_viewer->turn3dDimensionsOff();
}
else if (strcmp(Reason, "DimensionsDeltaVisible") == 0)
{
if (rGrp.GetBool("DimensionsDeltaVisible", true))
_viewer->turnDeltaDimensionsOn();
_viewer->turnDeltaDimensionsOn();
else
_viewer->turnDeltaDimensionsOff();
_viewer->turnDeltaDimensionsOff();
}
else{
unsigned long col1 = rGrp.GetUnsigned("BackgroundColor",3940932863UL);
Expand All @@ -388,7 +388,7 @@ void View3DInventor::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M
r2 = ((col2 >> 24) & 0xff) / 255.0; g2 = ((col2 >> 16) & 0xff) / 255.0; b2 = ((col2 >> 8) & 0xff) / 255.0;
r3 = ((col3 >> 24) & 0xff) / 255.0; g3 = ((col3 >> 16) & 0xff) / 255.0; b3 = ((col3 >> 8) & 0xff) / 255.0;
r4 = ((col4 >> 24) & 0xff) / 255.0; g4 = ((col4 >> 16) & 0xff) / 255.0; b4 = ((col4 >> 8) & 0xff) / 255.0;
_viewer->setBackgroundColor(QColor::fromRgbF(r1, g1, b1));
_viewer->setBackgroundColor(QColor::fromRgbF(r1, g1, b1));
if (rGrp.GetBool("UseBackgroundColorMid",false) == false)
_viewer->setGradientBackgroundColor(SbColor(r2, g2, b2), SbColor(r3, g3, b3));
else
Expand Down Expand Up @@ -557,8 +557,8 @@ bool View3DInventor::onMsg(const char* pMsg, const char** ppReturn)
return true;
}
else if (strcmp("ViewVR",pMsg) == 0) {
// call the VR portion of the viewer
_viewer->viewVR();
// call the VR portion of the viewer
_viewer->viewVR();
return true;
}
else if(strcmp("ViewSelection",pMsg) == 0) {
Expand Down Expand Up @@ -724,7 +724,7 @@ bool View3DInventor::onHasMsg(const char* pMsg) const
#ifdef BUILD_VR
return true;
#else
return false;
return false;
#endif
else if(strcmp("ViewSelection",pMsg) == 0)
return true;
Expand Down
48 changes: 20 additions & 28 deletions src/Gui/View3DInventorViewer.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2004 J?rgen Riegel <juergen.riegel@web.de> *
* Copyright (c) 2004 Juergen Riegel <juergen.riegel@web.de> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
Expand All @@ -19,6 +19,8 @@
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/


#include "PreCompiled.h"
#ifndef _PreComp_
# include <float.h>
Expand Down Expand Up @@ -203,48 +205,39 @@ while the progress bar is running.
*/
class Gui::ViewerEventFilter : public QObject
{

public:
ViewerEventFilter() {};
~ViewerEventFilter() {};
ViewerEventFilter() {}
~ViewerEventFilter() {}

bool eventFilter(QObject* obj, QEvent* event) {
// Bug #0000607: Some mices also support horizontal scrolling which however might
// lead to some unwanted zooming when pressing the MMB for panning.
// Thus, we filter out horizontal scrolling.
if(event->type() == QEvent::Wheel) {
if (event->type() == QEvent::Wheel) {
QWheelEvent* we = static_cast<QWheelEvent*>(event);

if(we->orientation() == Qt::Horizontal)
if (we->orientation() == Qt::Horizontal)
return true;
}

if(event->type() == QEvent::KeyPress) {
else if (event->type() == QEvent::KeyPress) {
QKeyEvent* ke = static_cast<QKeyEvent*>(event);

if(ke->matches(QKeySequence::SelectAll)) {
if (ke->matches(QKeySequence::SelectAll)) {
static_cast<View3DInventorViewer*>(obj)->selectAll();
return true;
}
}

if(Base::Sequencer().isRunning() &&
Base::Sequencer().isBlocking())
if (Base::Sequencer().isRunning() && Base::Sequencer().isBlocking())
return false;

if(event->type() == Spaceball::ButtonEvent::ButtonEventType) {
if (event->type() == Spaceball::ButtonEvent::ButtonEventType) {
Spaceball::ButtonEvent* buttonEvent = static_cast<Spaceball::ButtonEvent*>(event);

if(!buttonEvent) {
if (!buttonEvent) {
Base::Console().Log("invalid spaceball button event\n");
return true;
}
}

if(event->type() == Spaceball::MotionEvent::MotionEventType) {
else if (event->type() == Spaceball::MotionEvent::MotionEventType) {
Spaceball::MotionEvent* motionEvent = static_cast<Spaceball::MotionEvent*>(event);

if(!motionEvent) {
if (!motionEvent) {
Base::Console().Log("invalid spaceball motion event\n");
return true;
}
Expand All @@ -254,16 +247,15 @@ class Gui::ViewerEventFilter : public QObject
}
};

class SpaceNavigatorDevice : public Quarter::InputDevice {
class SpaceNavigatorDevice : public Quarter::InputDevice {
public:
SpaceNavigatorDevice(void) {};
virtual ~SpaceNavigatorDevice() {};
SpaceNavigatorDevice(void) {}
virtual ~SpaceNavigatorDevice() {}
virtual const SoEvent* translateEvent(QEvent* event) {

if(event->type() == Spaceball::MotionEvent::MotionEventType) {
if (event->type() == Spaceball::MotionEvent::MotionEventType) {
Spaceball::MotionEvent* motionEvent = static_cast<Spaceball::MotionEvent*>(event);

if(!motionEvent) {
if (!motionEvent) {
Base::Console().Log("invalid spaceball motion event\n");
return NULL;
}
Expand All @@ -288,7 +280,7 @@ class SpaceNavigatorDevice : public Quarter::InputDevice {

return motion3Event;
}

return NULL;
};
};
Expand Down

0 comments on commit 39f2132

Please sign in to comment.