Qt4's qglobal.h defined TRUE and FALSE. Qt5 does not do it anymore. Replace it with true and false.

158f39ec78

This change is Qt4/Qt5 neutral.
This commit is contained in:
Mateusz Skowroński
2015-12-21 06:15:07 +01:00
committed by wmayer
parent db345cb624
commit 7d0e892d36
96 changed files with 560 additions and 560 deletions

View File

@@ -98,11 +98,11 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
this->lastmouseposition = posn;
// Set to TRUE if any event processing happened. Note that it is not
// Set to true if any event processing happened. Note that it is not
// necessary to restrict ourselves to only do one "action" for an
// event, we only need this flag to see if any processing happened
// at all.
SbBool processed = FALSE;
SbBool processed = false;
const ViewerMode curmode = this->currentmode;
ViewerMode newmode = curmode;
@@ -123,13 +123,13 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
if (!processed && !viewer->isEditing()) {
processed = handleEventInForeground(ev);
if (processed)
return TRUE;
return true;
}
// Keyboard handling
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
switch (event->getKey()) {
case SoKeyboardEvent::LEFT_CONTROL:
case SoKeyboardEvent::RIGHT_CONTROL:
@@ -144,7 +144,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
this->altdown = press;
break;
case SoKeyboardEvent::H:
processed = TRUE;
processed = true;
viewer->saveHomePosition();
break;
case SoKeyboardEvent::S:
@@ -165,33 +165,33 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
const int button = event->getButton();
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
switch (button) {
case SoMouseButtonEvent::BUTTON1:
this->lockrecenter = TRUE;
this->lockrecenter = true;
this->button1down = press;
if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
newmode = NavigationStyle::SEEK_MODE;
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
processed = TRUE;
processed = true;
}
else if (!press && (this->currentmode == NavigationStyle::ZOOMING)) {
newmode = NavigationStyle::IDLE;
processed = TRUE;
processed = true;
}
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
this->setViewing(false);
processed = TRUE;
processed = true;
}
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
processed = TRUE;
processed = true;
}
break;
case SoMouseButtonEvent::BUTTON2:
// If we are in edit mode then simply ignore the RMB events
// to pass the event to the base class.
this->lockrecenter = TRUE;
this->lockrecenter = true;
if (!viewer->isEditing()) {
// If we are in zoom or pan mode ignore RMB events otherwise
// the canvas doesn't get any release events
@@ -211,11 +211,11 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
newmode = NavigationStyle::DRAGGING;
saveCursorPosition(ev);
this->centerTime = ev->getTime();
processed = TRUE;
processed = true;
}
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
newmode = NavigationStyle::IDLE;
processed = TRUE;
processed = true;
}
this->button2down = press;
break;
@@ -225,18 +225,18 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
float ratio = vp.getViewportAspectRatio();
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
this->lockrecenter = FALSE;
this->lockrecenter = false;
}
else if (!press && (this->currentmode == NavigationStyle::PANNING)) {
newmode = NavigationStyle::IDLE;
processed = TRUE;
processed = true;
}
this->button3down = press;
break;
case SoMouseButtonEvent::BUTTON4:
case SoMouseButtonEvent::BUTTON5:
doZoom(viewer->getSoRenderManager()->getCamera(), button == SoMouseButtonEvent::BUTTON4, posn);
processed = TRUE;
processed = true;
break;
default:
break;
@@ -259,7 +259,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
// Mouse Movement handling
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
this->lockrecenter = TRUE;
this->lockrecenter = true;
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
if (this->currentmode == NavigationStyle::ZOOMING) {
// OCCT uses horizontal mouse position, not vertical
@@ -268,18 +268,18 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
if (this->invertZoom)
value = -value;
zoom(viewer->getSoRenderManager()->getCamera(), value);
processed = TRUE;
processed = true;
}
else if (this->currentmode == NavigationStyle::PANNING) {
float ratio = vp.getViewportAspectRatio();
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
processed = TRUE;
processed = true;
}
else if (this->currentmode == NavigationStyle::DRAGGING) {
this->addToLog(event->getPosition(), event->getTime());
this->spin(posn);
moveCursorPosition();
processed = TRUE;
processed = true;
}
else if (combo == (CTRLDOWN|BUTTON1DOWN)) {
newmode = NavigationStyle::ZOOMING;
@@ -291,7 +291,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
if (event)
this->processMotionEvent(event);
processed = TRUE;
processed = true;
}
switch (combo) {
@@ -327,7 +327,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
if (/*(curmode == NavigationStyle::SELECTION || viewer->isEditing()) && */!processed)
processed = inherited::processSoEvent(ev);
else
return TRUE;
return true;
return processed;
}