+ fix whitespaces
This commit is contained in:
parent
4a3838fa44
commit
39f2132029
|
@ -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 */
|
||||
|
|
|
@ -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:
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
|
|
@ -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. *
|
||||
* *
|
||||
|
@ -19,6 +19,8 @@
|
|||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <float.h>
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -254,16 +247,15 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -288,7 +280,7 @@ public:
|
|||
|
||||
return motion3Event;
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user