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:
parent
db345cb624
commit
7d0e892d36
|
@ -70,9 +70,9 @@ public:
|
||||||
/// Convert the path name into a UCS-2 encoded wide string format.
|
/// Convert the path name into a UCS-2 encoded wide string format.
|
||||||
std::wstring toStdWString() const;
|
std::wstring toStdWString() const;
|
||||||
/** Returns the file's extension name.
|
/** Returns the file's extension name.
|
||||||
* If complete is TRUE (the default), extension() returns the string of all
|
* If complete is true (the default), extension() returns the string of all
|
||||||
* characters in the file name after (but not including) the first '.' character.
|
* characters in the file name after (but not including) the first '.' character.
|
||||||
* If complete is FALSE, extension() returns the string of all characters in
|
* If complete is false, extension() returns the string of all characters in
|
||||||
* the file name after (but not including) the last '.' character.
|
* the file name after (but not including) the last '.' character.
|
||||||
* Example:
|
* Example:
|
||||||
*@code
|
*@code
|
||||||
|
@ -111,7 +111,7 @@ public:
|
||||||
|
|
||||||
/** @name Directory management*/
|
/** @name Directory management*/
|
||||||
//@{
|
//@{
|
||||||
/// Creates a directory. Returns TRUE if successful; otherwise returns FALSE.
|
/// Creates a directory. Returns true if successful; otherwise returns false.
|
||||||
bool createDirectory( void ) const;
|
bool createDirectory( void ) const;
|
||||||
/// Get a list of the directory content
|
/// Get a list of the directory content
|
||||||
std::vector<Base::FileInfo> getDirectoryContent(void) const;
|
std::vector<Base::FileInfo> getDirectoryContent(void) const;
|
||||||
|
|
|
@ -107,16 +107,16 @@ bool BoundBox2D::Intersect(const Line2D &rclLine) const
|
||||||
bool BoundBox2D::Intersect(const BoundBox2D &rclBB) const
|
bool BoundBox2D::Intersect(const BoundBox2D &rclBB) const
|
||||||
{
|
{
|
||||||
//// compare bb2-points to this
|
//// compare bb2-points to this
|
||||||
//if (Contains (Vector2D (rclBB.fMinX, rclBB.fMinY))) return TRUE;
|
//if (Contains (Vector2D (rclBB.fMinX, rclBB.fMinY))) return true;
|
||||||
//if (Contains (Vector2D (rclBB.fMaxX, rclBB.fMinY))) return TRUE;
|
//if (Contains (Vector2D (rclBB.fMaxX, rclBB.fMinY))) return true;
|
||||||
//if (Contains (Vector2D (rclBB.fMaxX, rclBB.fMaxY))) return TRUE;
|
//if (Contains (Vector2D (rclBB.fMaxX, rclBB.fMaxY))) return true;
|
||||||
//if (Contains (Vector2D (rclBB.fMinX, rclBB.fMaxY))) return TRUE;
|
//if (Contains (Vector2D (rclBB.fMinX, rclBB.fMaxY))) return true;
|
||||||
//
|
//
|
||||||
//// compare this-points to bb2
|
//// compare this-points to bb2
|
||||||
//if (rclBB.Contains (Vector2D (fMinX, fMinY))) return TRUE;
|
//if (rclBB.Contains (Vector2D (fMinX, fMinY))) return true;
|
||||||
//if (rclBB.Contains (Vector2D (fMaxX, fMinY))) return TRUE;
|
//if (rclBB.Contains (Vector2D (fMaxX, fMinY))) return true;
|
||||||
//if (rclBB.Contains (Vector2D (fMaxX, fMaxY))) return TRUE;
|
//if (rclBB.Contains (Vector2D (fMaxX, fMaxY))) return true;
|
||||||
//if (rclBB.Contains (Vector2D (fMinX, fMaxY))) return TRUE;
|
//if (rclBB.Contains (Vector2D (fMinX, fMaxY))) return true;
|
||||||
|
|
||||||
if (fMinX < rclBB.fMaxX &&
|
if (fMinX < rclBB.fMaxX &&
|
||||||
rclBB.fMinX < fMaxX &&
|
rclBB.fMinX < fMaxX &&
|
||||||
|
@ -222,7 +222,7 @@ bool Line2D::Intersect (const Line2D& rclLine, Vector2D &rclV) const
|
||||||
rclV.fY = m1 * rclV.fX + b1;
|
rclV.fY = m1 * rclV.fX + b1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true; /*** RETURN TRUE (intersection) **********/
|
return true; /*** RETURN true (intersection) **********/
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Line2D::Intersect (const Vector2D &rclV, double eps) const
|
bool Line2D::Intersect (const Vector2D &rclV, double eps) const
|
||||||
|
|
|
@ -53,7 +53,7 @@ using namespace Gui;
|
||||||
|
|
||||||
TYPESYSTEM_SOURCE(Gui::BlenderNavigationStyle, Gui::UserNavigationStyle);
|
TYPESYSTEM_SOURCE(Gui::BlenderNavigationStyle, Gui::UserNavigationStyle);
|
||||||
|
|
||||||
BlenderNavigationStyle::BlenderNavigationStyle() : lockButton1(FALSE)
|
BlenderNavigationStyle::BlenderNavigationStyle() : lockButton1(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,11 +98,11 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
|
|
||||||
this->lastmouseposition = posn;
|
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
|
// necessary to restrict ourselves to only do one "action" for an
|
||||||
// event, we only need this flag to see if any processing happened
|
// event, we only need this flag to see if any processing happened
|
||||||
// at all.
|
// at all.
|
||||||
SbBool processed = FALSE;
|
SbBool processed = false;
|
||||||
|
|
||||||
const ViewerMode curmode = this->currentmode;
|
const ViewerMode curmode = this->currentmode;
|
||||||
ViewerMode newmode = curmode;
|
ViewerMode newmode = curmode;
|
||||||
|
@ -123,13 +123,13 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (!processed && !viewer->isEditing()) {
|
if (!processed && !viewer->isEditing()) {
|
||||||
processed = handleEventInForeground(ev);
|
processed = handleEventInForeground(ev);
|
||||||
if (processed)
|
if (processed)
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keyboard handling
|
// Keyboard handling
|
||||||
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
||||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
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()) {
|
switch (event->getKey()) {
|
||||||
case SoKeyboardEvent::LEFT_CONTROL:
|
case SoKeyboardEvent::LEFT_CONTROL:
|
||||||
case SoKeyboardEvent::RIGHT_CONTROL:
|
case SoKeyboardEvent::RIGHT_CONTROL:
|
||||||
|
@ -144,7 +144,7 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
this->altdown = press;
|
this->altdown = press;
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::H:
|
case SoKeyboardEvent::H:
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
viewer->saveHomePosition();
|
viewer->saveHomePosition();
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::S:
|
case SoKeyboardEvent::S:
|
||||||
|
@ -165,37 +165,37 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
const int button = event->getButton();
|
||||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
|
|
||||||
//SoDebugError::postInfo("processSoEvent", "button = %d", button);
|
//SoDebugError::postInfo("processSoEvent", "button = %d", button);
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case SoMouseButtonEvent::BUTTON1:
|
case SoMouseButtonEvent::BUTTON1:
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
this->button1down = press;
|
this->button1down = press;
|
||||||
if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
|
if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
|
||||||
newmode = NavigationStyle::SEEK_MODE;
|
newmode = NavigationStyle::SEEK_MODE;
|
||||||
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
//else if (press && (this->currentmode == NavigationStyle::IDLE)) {
|
//else if (press && (this->currentmode == NavigationStyle::IDLE)) {
|
||||||
// this->setViewing(true);
|
// this->setViewing(true);
|
||||||
// processed = TRUE;
|
// processed = true;
|
||||||
//}
|
//}
|
||||||
else if (press && (this->currentmode == NavigationStyle::PANNING ||
|
else if (press && (this->currentmode == NavigationStyle::PANNING ||
|
||||||
this->currentmode == NavigationStyle::ZOOMING)) {
|
this->currentmode == NavigationStyle::ZOOMING)) {
|
||||||
newmode = NavigationStyle::DRAGGING;
|
newmode = NavigationStyle::DRAGGING;
|
||||||
saveCursorPosition(ev);
|
saveCursorPosition(ev);
|
||||||
this->centerTime = ev->getTime();
|
this->centerTime = ev->getTime();
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
|
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON2:
|
case SoMouseButtonEvent::BUTTON2:
|
||||||
// If we are in edit mode then simply ignore the RMB events
|
// If we are in edit mode then simply ignore the RMB events
|
||||||
// to pass the event to the base class.
|
// to pass the event to the base class.
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
if (!viewer->isEditing()) {
|
if (!viewer->isEditing()) {
|
||||||
// If we are in zoom or pan mode ignore RMB events otherwise
|
// If we are in zoom or pan mode ignore RMB events otherwise
|
||||||
// the canvas doesn't get any release events
|
// the canvas doesn't get any release events
|
||||||
|
@ -215,7 +215,7 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
newmode = NavigationStyle::DRAGGING;
|
newmode = NavigationStyle::DRAGGING;
|
||||||
saveCursorPosition(ev);
|
saveCursorPosition(ev);
|
||||||
this->centerTime = ev->getTime();
|
this->centerTime = ev->getTime();
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
this->button2down = press;
|
this->button2down = press;
|
||||||
break;
|
break;
|
||||||
|
@ -225,7 +225,7 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
float ratio = vp.getViewportAspectRatio();
|
float ratio = vp.getViewportAspectRatio();
|
||||||
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
||||||
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
||||||
this->lockrecenter = FALSE;
|
this->lockrecenter = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SbTime tmp = (ev->getTime() - this->centerTime);
|
SbTime tmp = (ev->getTime() - this->centerTime);
|
||||||
|
@ -236,18 +236,18 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
panToCenter(panningplane, posn);
|
panToCenter(panningplane, posn);
|
||||||
this->interactiveCountDec();
|
this->interactiveCountDec();
|
||||||
}
|
}
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->button3down = press;
|
this->button3down = press;
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON4:
|
case SoMouseButtonEvent::BUTTON4:
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON5:
|
case SoMouseButtonEvent::BUTTON5:
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -256,22 +256,22 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
|
|
||||||
// Mouse Movement handling
|
// Mouse Movement handling
|
||||||
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
||||||
if (this->currentmode == NavigationStyle::ZOOMING) {
|
if (this->currentmode == NavigationStyle::ZOOMING) {
|
||||||
this->zoomByCursor(posn, prevnormalized);
|
this->zoomByCursor(posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (this->currentmode == NavigationStyle::PANNING) {
|
else if (this->currentmode == NavigationStyle::PANNING) {
|
||||||
float ratio = vp.getViewportAspectRatio();
|
float ratio = vp.getViewportAspectRatio();
|
||||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (this->currentmode == NavigationStyle::DRAGGING) {
|
else if (this->currentmode == NavigationStyle::DRAGGING) {
|
||||||
this->addToLog(event->getPosition(), event->getTime());
|
this->addToLog(event->getPosition(), event->getTime());
|
||||||
this->spin(posn);
|
this->spin(posn);
|
||||||
moveCursorPosition();
|
moveCursorPosition();
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
||||||
if (event)
|
if (event)
|
||||||
this->processMotionEvent(event);
|
this->processMotionEvent(event);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -304,8 +304,8 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
// The left mouse button has been released right now but
|
// The left mouse button has been released right now but
|
||||||
// we want to avoid that the event is procesed elsewhere
|
// we want to avoid that the event is procesed elsewhere
|
||||||
if (this->lockButton1) {
|
if (this->lockButton1) {
|
||||||
this->lockButton1 = FALSE;
|
this->lockButton1 = false;
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (curmode == NavigationStyle::DRAGGING) {
|
//if (curmode == NavigationStyle::DRAGGING) {
|
||||||
|
@ -351,14 +351,14 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
// but then button 3 is relaesed we shouldn't switch
|
// but then button 3 is relaesed we shouldn't switch
|
||||||
// into selection mode.
|
// into selection mode.
|
||||||
if (this->button1down && this->button3down)
|
if (this->button1down && this->button3down)
|
||||||
this->lockButton1 = TRUE;
|
this->lockButton1 = true;
|
||||||
|
|
||||||
// If not handled in this class, pass on upwards in the inheritance
|
// If not handled in this class, pass on upwards in the inheritance
|
||||||
// hierarchy.
|
// hierarchy.
|
||||||
if (/*(curmode == NavigationStyle::SELECTION || viewer->isEditing()) && */!processed)
|
if (/*(curmode == NavigationStyle::SELECTION || viewer->isEditing()) && */!processed)
|
||||||
processed = inherited::processSoEvent(ev);
|
processed = inherited::processSoEvent(ev);
|
||||||
else
|
else
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
return processed;
|
return processed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ using namespace Gui;
|
||||||
|
|
||||||
TYPESYSTEM_SOURCE(Gui::CADNavigationStyle, Gui::UserNavigationStyle);
|
TYPESYSTEM_SOURCE(Gui::CADNavigationStyle, Gui::UserNavigationStyle);
|
||||||
|
|
||||||
CADNavigationStyle::CADNavigationStyle() : lockButton1(FALSE)
|
CADNavigationStyle::CADNavigationStyle() : lockButton1(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,11 +102,11 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
|
|
||||||
this->lastmouseposition = posn;
|
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
|
// necessary to restrict ourselves to only do one "action" for an
|
||||||
// event, we only need this flag to see if any processing happened
|
// event, we only need this flag to see if any processing happened
|
||||||
// at all.
|
// at all.
|
||||||
SbBool processed = FALSE;
|
SbBool processed = false;
|
||||||
|
|
||||||
const ViewerMode curmode = this->currentmode;
|
const ViewerMode curmode = this->currentmode;
|
||||||
ViewerMode newmode = curmode;
|
ViewerMode newmode = curmode;
|
||||||
|
@ -127,13 +127,13 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (!processed && !viewer->isEditing()) {
|
if (!processed && !viewer->isEditing()) {
|
||||||
processed = handleEventInForeground(ev);
|
processed = handleEventInForeground(ev);
|
||||||
if (processed)
|
if (processed)
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keyboard handling
|
// Keyboard handling
|
||||||
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
||||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
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()) {
|
switch (event->getKey()) {
|
||||||
case SoKeyboardEvent::LEFT_CONTROL:
|
case SoKeyboardEvent::LEFT_CONTROL:
|
||||||
case SoKeyboardEvent::RIGHT_CONTROL:
|
case SoKeyboardEvent::RIGHT_CONTROL:
|
||||||
|
@ -148,7 +148,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
this->altdown = press;
|
this->altdown = press;
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::H:
|
case SoKeyboardEvent::H:
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
viewer->saveHomePosition();
|
viewer->saveHomePosition();
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::S:
|
case SoKeyboardEvent::S:
|
||||||
|
@ -169,12 +169,12 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
const int button = event->getButton();
|
||||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
|
|
||||||
// SoDebugError::postInfo("processSoEvent", "button = %d", button);
|
// SoDebugError::postInfo("processSoEvent", "button = %d", button);
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case SoMouseButtonEvent::BUTTON1:
|
case SoMouseButtonEvent::BUTTON1:
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
this->button1down = press;
|
this->button1down = press;
|
||||||
#if 0 // disable to avoid interferences where this key combination is used, too
|
#if 0 // disable to avoid interferences where this key combination is used, too
|
||||||
if (press && ev->wasShiftDown() &&
|
if (press && ev->wasShiftDown() &&
|
||||||
|
@ -183,7 +183,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
float ratio = vp.getViewportAspectRatio();
|
float ratio = vp.getViewportAspectRatio();
|
||||||
SbViewVolume vv = viewer->getCamera()->getViewVolume(ratio);
|
SbViewVolume vv = viewer->getCamera()->getViewVolume(ratio);
|
||||||
this->panningplane = vv.getPlane(viewer->getCamera()->focalDistance.getValue());
|
this->panningplane = vv.getPlane(viewer->getCamera()->focalDistance.getValue());
|
||||||
this->lockrecenter = FALSE;
|
this->lockrecenter = false;
|
||||||
}
|
}
|
||||||
else if (!press && ev->wasShiftDown() &&
|
else if (!press && ev->wasShiftDown() &&
|
||||||
(this->currentmode != NavigationStyle::SELECTION)) {
|
(this->currentmode != NavigationStyle::SELECTION)) {
|
||||||
|
@ -195,7 +195,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
panToCenter(panningplane, posn);
|
panToCenter(panningplane, posn);
|
||||||
this->interactiveCountDec();
|
this->interactiveCountDec();
|
||||||
}
|
}
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -203,18 +203,18 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
|
if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
|
||||||
newmode = NavigationStyle::SEEK_MODE;
|
newmode = NavigationStyle::SEEK_MODE;
|
||||||
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
//else if (press && (this->currentmode == NavigationStyle::IDLE)) {
|
//else if (press && (this->currentmode == NavigationStyle::IDLE)) {
|
||||||
// this->setViewing(true);
|
// this->setViewing(true);
|
||||||
// processed = TRUE;
|
// processed = true;
|
||||||
//}
|
//}
|
||||||
else if (press && (this->currentmode == NavigationStyle::PANNING ||
|
else if (press && (this->currentmode == NavigationStyle::PANNING ||
|
||||||
this->currentmode == NavigationStyle::ZOOMING)) {
|
this->currentmode == NavigationStyle::ZOOMING)) {
|
||||||
newmode = NavigationStyle::DRAGGING;
|
newmode = NavigationStyle::DRAGGING;
|
||||||
saveCursorPosition(ev);
|
saveCursorPosition(ev);
|
||||||
this->centerTime = ev->getTime();
|
this->centerTime = ev->getTime();
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
||||||
SbTime tmp = (ev->getTime() - this->centerTime);
|
SbTime tmp = (ev->getTime() - this->centerTime);
|
||||||
|
@ -222,16 +222,16 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (tmp.getValue() < dci) {
|
if (tmp.getValue() < dci) {
|
||||||
newmode = NavigationStyle::ZOOMING;
|
newmode = NavigationStyle::ZOOMING;
|
||||||
}
|
}
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
|
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON2:
|
case SoMouseButtonEvent::BUTTON2:
|
||||||
// If we are in edit mode then simply ignore the RMB events
|
// If we are in edit mode then simply ignore the RMB events
|
||||||
// to pass the event to the base class.
|
// to pass the event to the base class.
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
if (!viewer->isEditing()) {
|
if (!viewer->isEditing()) {
|
||||||
// If we are in zoom or pan mode ignore RMB events otherwise
|
// If we are in zoom or pan mode ignore RMB events otherwise
|
||||||
// the canvas doesn't get any release events
|
// the canvas doesn't get any release events
|
||||||
|
@ -251,7 +251,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
newmode = NavigationStyle::DRAGGING;
|
newmode = NavigationStyle::DRAGGING;
|
||||||
saveCursorPosition(ev);
|
saveCursorPosition(ev);
|
||||||
this->centerTime = ev->getTime();
|
this->centerTime = ev->getTime();
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
||||||
SbTime tmp = (ev->getTime() - this->centerTime);
|
SbTime tmp = (ev->getTime() - this->centerTime);
|
||||||
|
@ -259,7 +259,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (tmp.getValue() < dci) {
|
if (tmp.getValue() < dci) {
|
||||||
newmode = NavigationStyle::ZOOMING;
|
newmode = NavigationStyle::ZOOMING;
|
||||||
}
|
}
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
this->button2down = press;
|
this->button2down = press;
|
||||||
break;
|
break;
|
||||||
|
@ -269,7 +269,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
float ratio = vp.getViewportAspectRatio();
|
float ratio = vp.getViewportAspectRatio();
|
||||||
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
||||||
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
||||||
this->lockrecenter = FALSE;
|
this->lockrecenter = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SbTime tmp = (ev->getTime() - this->centerTime);
|
SbTime tmp = (ev->getTime() - this->centerTime);
|
||||||
|
@ -280,18 +280,18 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
panToCenter(panningplane, posn);
|
panToCenter(panningplane, posn);
|
||||||
this->interactiveCountDec();
|
this->interactiveCountDec();
|
||||||
}
|
}
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->button3down = press;
|
this->button3down = press;
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON4:
|
case SoMouseButtonEvent::BUTTON4:
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON5:
|
case SoMouseButtonEvent::BUTTON5:
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -300,22 +300,22 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
|
|
||||||
// Mouse Movement handling
|
// Mouse Movement handling
|
||||||
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
||||||
if (this->currentmode == NavigationStyle::ZOOMING) {
|
if (this->currentmode == NavigationStyle::ZOOMING) {
|
||||||
this->zoomByCursor(posn, prevnormalized);
|
this->zoomByCursor(posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (this->currentmode == NavigationStyle::PANNING) {
|
else if (this->currentmode == NavigationStyle::PANNING) {
|
||||||
float ratio = vp.getViewportAspectRatio();
|
float ratio = vp.getViewportAspectRatio();
|
||||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (this->currentmode == NavigationStyle::DRAGGING) {
|
else if (this->currentmode == NavigationStyle::DRAGGING) {
|
||||||
this->addToLog(event->getPosition(), event->getTime());
|
this->addToLog(event->getPosition(), event->getTime());
|
||||||
this->spin(posn);
|
this->spin(posn);
|
||||||
moveCursorPosition();
|
moveCursorPosition();
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
||||||
if (event)
|
if (event)
|
||||||
this->processMotionEvent(event);
|
this->processMotionEvent(event);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -348,8 +348,8 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
// The left mouse button has been released right now but
|
// The left mouse button has been released right now but
|
||||||
// we want to avoid that the event is procesed elsewhere
|
// we want to avoid that the event is procesed elsewhere
|
||||||
if (this->lockButton1) {
|
if (this->lockButton1) {
|
||||||
this->lockButton1 = FALSE;
|
this->lockButton1 = false;
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (curmode == NavigationStyle::DRAGGING) {
|
//if (curmode == NavigationStyle::DRAGGING) {
|
||||||
|
@ -424,14 +424,14 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
// but then button 3 is relaesed we shouldn't switch
|
// but then button 3 is relaesed we shouldn't switch
|
||||||
// into selection mode.
|
// into selection mode.
|
||||||
if (this->button1down && this->button3down)
|
if (this->button1down && this->button3down)
|
||||||
this->lockButton1 = TRUE;
|
this->lockButton1 = true;
|
||||||
|
|
||||||
// If not handled in this class, pass on upwards in the inheritance
|
// If not handled in this class, pass on upwards in the inheritance
|
||||||
// hierarchy.
|
// hierarchy.
|
||||||
if (/*(curmode == NavigationStyle::SELECTION || viewer->isEditing()) && */!processed)
|
if (/*(curmode == NavigationStyle::SELECTION || viewer->isEditing()) && */!processed)
|
||||||
processed = inherited::processSoEvent(ev);
|
processed = inherited::processSoEvent(ev);
|
||||||
else
|
else
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
return processed;
|
return processed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2147,7 +2147,7 @@ static void selectionCallback(void * ud, SoEventCallback * cb)
|
||||||
Gui::View3DInventorViewer* view = reinterpret_cast<Gui::View3DInventorViewer*>(cb->getUserData());
|
Gui::View3DInventorViewer* view = reinterpret_cast<Gui::View3DInventorViewer*>(cb->getUserData());
|
||||||
view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), selectionCallback, ud);
|
view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), selectionCallback, ud);
|
||||||
SoNode* root = view->getSceneGraph();
|
SoNode* root = view->getSceneGraph();
|
||||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(TRUE);
|
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(true);
|
||||||
|
|
||||||
std::vector<SbVec2f> picked = view->getGLPolygon();
|
std::vector<SbVec2f> picked = view->getGLPolygon();
|
||||||
SoCamera* cam = view->getSoRenderManager()->getCamera();
|
SoCamera* cam = view->getSoRenderManager()->getCamera();
|
||||||
|
@ -2202,7 +2202,7 @@ void StdBoxSelection::activated(int iMsg)
|
||||||
viewer->startSelection(View3DInventorViewer::Rubberband);
|
viewer->startSelection(View3DInventorViewer::Rubberband);
|
||||||
viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), selectionCallback);
|
viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), selectionCallback);
|
||||||
SoNode* root = viewer->getSceneGraph();
|
SoNode* root = viewer->getSceneGraph();
|
||||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(FALSE);
|
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgCustomActionsImp::DlgCustomActionsImp( QWidget* parent )
|
DlgCustomActionsImp::DlgCustomActionsImp( QWidget* parent )
|
||||||
: CustomizeActionPage(parent), bShown( false )
|
: CustomizeActionPage(parent), bShown( false )
|
||||||
|
|
|
@ -42,7 +42,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgActivateWindowImp::DlgActivateWindowImp(QWidget* parent, Qt::WindowFlags fl)
|
DlgActivateWindowImp::DlgActivateWindowImp(QWidget* parent, Qt::WindowFlags fl)
|
||||||
: QDialog(parent, fl), ui(new Ui_DlgActivateWindow)
|
: QDialog(parent, fl), ui(new Ui_DlgActivateWindow)
|
||||||
|
|
|
@ -58,7 +58,7 @@ struct GroupMap_find {
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgCustomCommandsImp::DlgCustomCommandsImp( QWidget* parent )
|
DlgCustomCommandsImp::DlgCustomCommandsImp( QWidget* parent )
|
||||||
: CustomizeActionPage(parent)
|
: CustomizeActionPage(parent)
|
||||||
|
|
|
@ -44,7 +44,7 @@ QList<QByteArray> DlgCustomizeImp::_pages;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgCustomizeImp::DlgCustomizeImp(QWidget* parent, Qt::WindowFlags fl)
|
DlgCustomizeImp::DlgCustomizeImp(QWidget* parent, Qt::WindowFlags fl)
|
||||||
: QDialog(parent, fl)
|
: QDialog(parent, fl)
|
||||||
|
|
|
@ -62,7 +62,7 @@ using namespace std;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgDisplayPropertiesImp::DlgDisplayPropertiesImp( QWidget* parent, Qt::WindowFlags fl )
|
DlgDisplayPropertiesImp::DlgDisplayPropertiesImp( QWidget* parent, Qt::WindowFlags fl )
|
||||||
: QDialog( parent, fl )
|
: QDialog( parent, fl )
|
||||||
|
|
|
@ -41,7 +41,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgEditFileIncludePropertyExternal::
|
DlgEditFileIncludePropertyExternal::
|
||||||
DlgEditFileIncludePropertyExternal(App::PropertyFileIncluded& Prop,
|
DlgEditFileIncludePropertyExternal(App::PropertyFileIncluded& Prop,
|
||||||
|
|
|
@ -51,7 +51,7 @@ struct DlgSettingsEditorP
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgSettingsEditorImp::DlgSettingsEditorImp( QWidget* parent )
|
DlgSettingsEditorImp::DlgSettingsEditorImp( QWidget* parent )
|
||||||
: PreferencePage( parent )
|
: PreferencePage( parent )
|
||||||
|
|
|
@ -46,7 +46,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgGeneralImp::DlgGeneralImp( QWidget* parent )
|
DlgGeneralImp::DlgGeneralImp( QWidget* parent )
|
||||||
: PreferencePage( parent ), watched(0)
|
: PreferencePage( parent ), watched(0)
|
||||||
|
|
|
@ -39,7 +39,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'f'.
|
* name 'name' and widget flags set to 'f'.
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgInputDialogImp::DlgInputDialogImp( const QString& labelTxt, QWidget* parent, bool modal, Type type )
|
DlgInputDialogImp::DlgInputDialogImp( const QString& labelTxt, QWidget* parent, bool modal, Type type )
|
||||||
: QDialog( parent )
|
: QDialog( parent )
|
||||||
|
@ -66,7 +66,7 @@ DlgInputDialogImp::~DlgInputDialogImp()
|
||||||
|
|
||||||
void DlgInputDialogImp::textChanged( const QString &s )
|
void DlgInputDialogImp::textChanged( const QString &s )
|
||||||
{
|
{
|
||||||
bool on = TRUE;
|
bool on = true;
|
||||||
|
|
||||||
if (lineEdit->validator()) {
|
if (lineEdit->validator()) {
|
||||||
QString str = lineEdit->text();
|
QString str = lineEdit->text();
|
||||||
|
|
|
@ -43,7 +43,7 @@ class GuiExport DlgInputDialogImp : public QDialog, public Ui_DlgInputDialog
|
||||||
public:
|
public:
|
||||||
enum Type { LineEdit, SpinBox, UIntBox, FloatSpinBox, ComboBox };
|
enum Type { LineEdit, SpinBox, UIntBox, FloatSpinBox, ComboBox };
|
||||||
|
|
||||||
DlgInputDialogImp( const QString& label, QWidget* parent = 0, bool modal = TRUE, Type = LineEdit );
|
DlgInputDialogImp( const QString& label, QWidget* parent = 0, bool modal = true, Type = LineEdit );
|
||||||
~DlgInputDialogImp();
|
~DlgInputDialogImp();
|
||||||
|
|
||||||
void setType( Type t );
|
void setType( Type t );
|
||||||
|
|
|
@ -61,7 +61,7 @@ struct GroupMap_find {
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgCustomKeyboardImp::DlgCustomKeyboardImp( QWidget* parent )
|
DlgCustomKeyboardImp::DlgCustomKeyboardImp( QWidget* parent )
|
||||||
: CustomizeActionPage(parent), firstShow(true)
|
: CustomizeActionPage(parent), firstShow(true)
|
||||||
|
|
|
@ -52,7 +52,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgMacroExecuteImp::DlgMacroExecuteImp( QWidget* parent, Qt::WindowFlags fl )
|
DlgMacroExecuteImp::DlgMacroExecuteImp( QWidget* parent, Qt::WindowFlags fl )
|
||||||
: QDialog( parent, fl ), WindowParameter( "Macro" )
|
: QDialog( parent, fl ), WindowParameter( "Macro" )
|
||||||
|
|
|
@ -45,7 +45,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgMacroRecordImp::DlgMacroRecordImp( QWidget* parent, Qt::WindowFlags fl )
|
DlgMacroRecordImp::DlgMacroRecordImp( QWidget* parent, Qt::WindowFlags fl )
|
||||||
: QDialog(parent, fl), WindowParameter("Macro")
|
: QDialog(parent, fl), WindowParameter("Macro")
|
||||||
|
|
|
@ -41,7 +41,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'f'.
|
* name 'name' and widget flags set to 'f'.
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgMaterialPropertiesImp::DlgMaterialPropertiesImp(const std::string& mat, QWidget* parent, Qt::WindowFlags fl)
|
DlgMaterialPropertiesImp::DlgMaterialPropertiesImp(const std::string& mat, QWidget* parent, Qt::WindowFlags fl)
|
||||||
: QDialog(parent, fl), material(mat)
|
: QDialog(parent, fl), material(mat)
|
||||||
|
|
|
@ -42,7 +42,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgOnlineHelpImp::DlgOnlineHelpImp( QWidget* parent )
|
DlgOnlineHelpImp::DlgOnlineHelpImp( QWidget* parent )
|
||||||
: PreferencePage(parent)
|
: PreferencePage(parent)
|
||||||
|
|
|
@ -54,7 +54,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgParameterImp::DlgParameterImp( QWidget* parent, Qt::WindowFlags fl )
|
DlgParameterImp::DlgParameterImp( QWidget* parent, Qt::WindowFlags fl )
|
||||||
: QDialog( parent, fl|Qt::WindowMinMaxButtonsHint )
|
: QDialog( parent, fl|Qt::WindowMinMaxButtonsHint )
|
||||||
|
|
|
@ -56,7 +56,7 @@ std::list<DlgPreferencesImp::TGroupPages> DlgPreferencesImp::_pages;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgPreferencesImp::DlgPreferencesImp( QWidget* parent, Qt::WindowFlags fl )
|
DlgPreferencesImp::DlgPreferencesImp( QWidget* parent, Qt::WindowFlags fl )
|
||||||
: QDialog(parent, fl), ui(new Ui_DlgPreferences), canEmbedScrollArea(true)
|
: QDialog(parent, fl), ui(new Ui_DlgPreferences), canEmbedScrollArea(true)
|
||||||
|
|
|
@ -44,7 +44,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'fl'.
|
* name 'name' and widget flags set to 'fl'.
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgProjectInformationImp::DlgProjectInformationImp(App::Document* doc, QWidget* parent, Qt::WindowFlags fl)
|
DlgProjectInformationImp::DlgProjectInformationImp(App::Document* doc, QWidget* parent, Qt::WindowFlags fl)
|
||||||
: QDialog(parent, fl), _doc(doc), ui(new Ui_DlgProjectInformation)
|
: QDialog(parent, fl), _doc(doc), ui(new Ui_DlgProjectInformation)
|
||||||
|
|
|
@ -39,7 +39,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgReportViewImp::DlgReportViewImp( QWidget* parent )
|
DlgReportViewImp::DlgReportViewImp( QWidget* parent )
|
||||||
: PreferencePage(parent)
|
: PreferencePage(parent)
|
||||||
|
|
|
@ -44,7 +44,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgRunExternal::DlgRunExternal( QWidget* parent, Qt::WindowFlags fl )
|
DlgRunExternal::DlgRunExternal( QWidget* parent, Qt::WindowFlags fl )
|
||||||
: QDialog(parent, fl),process(this),advancedHidden(true)
|
: QDialog(parent, fl),process(this),advancedHidden(true)
|
||||||
|
|
|
@ -48,7 +48,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgTipOfTheDayImp::DlgTipOfTheDayImp( QWidget* parent, Qt::WindowFlags fl )
|
DlgTipOfTheDayImp::DlgTipOfTheDayImp( QWidget* parent, Qt::WindowFlags fl )
|
||||||
: QDialog( parent, fl | Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
|
: QDialog( parent, fl | Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
|
||||||
|
|
|
@ -64,7 +64,7 @@ struct GroupMap_find {
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgCustomToolbars::DlgCustomToolbars(DlgCustomToolbars::Type t, QWidget* parent)
|
DlgCustomToolbars::DlgCustomToolbars(DlgCustomToolbars::Type t, QWidget* parent)
|
||||||
: CustomizeActionPage(parent), type(t)
|
: CustomizeActionPage(parent), type(t)
|
||||||
|
@ -645,7 +645,7 @@ void DlgCustomToolbars::changeEvent(QEvent *e)
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgCustomToolbarsImp::DlgCustomToolbarsImp( QWidget* parent )
|
DlgCustomToolbarsImp::DlgCustomToolbarsImp( QWidget* parent )
|
||||||
: DlgCustomToolbars(DlgCustomToolbars::Toolbar, parent)
|
: DlgCustomToolbars(DlgCustomToolbars::Toolbar, parent)
|
||||||
|
@ -894,7 +894,7 @@ void DlgCustomToolbarsImp::changeEvent(QEvent *e)
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgCustomToolBoxbarsImp::DlgCustomToolBoxbarsImp( QWidget* parent )
|
DlgCustomToolBoxbarsImp::DlgCustomToolBoxbarsImp( QWidget* parent )
|
||||||
: DlgCustomToolbars(DlgCustomToolbars::Toolboxbar, parent)
|
: DlgCustomToolbars(DlgCustomToolbars::Toolboxbar, parent)
|
||||||
|
|
|
@ -40,7 +40,7 @@ using namespace Gui::Dialog;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgUnitsCalculator::DlgUnitsCalculator( QWidget* parent, Qt::WindowFlags fl )
|
DlgUnitsCalculator::DlgUnitsCalculator( QWidget* parent, Qt::WindowFlags fl )
|
||||||
: QDialog( parent, fl )
|
: QDialog( parent, fl )
|
||||||
|
|
|
@ -192,7 +192,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
const int button = event->getButton();
|
||||||
const SbBool press //the button was pressed (if false -> released)
|
const SbBool press //the button was pressed (if false -> released)
|
||||||
= event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
= event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case SoMouseButtonEvent::BUTTON1:
|
case SoMouseButtonEvent::BUTTON1:
|
||||||
this->button1down = press;
|
this->button1down = press;
|
||||||
|
@ -268,7 +268,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
|
|
||||||
//----------all this were preparations. Now comes the event handling! ----------
|
//----------all this were preparations. Now comes the event handling! ----------
|
||||||
|
|
||||||
SbBool processed = FALSE;//a return value for the BlahblahblahNavigationStyle::processSoEvent
|
SbBool processed = false;//a return value for the BlahblahblahNavigationStyle::processSoEvent
|
||||||
bool propagated = false;//an internal flag indicating that the event has been already passed to inherited, to suppress the automatic doing of this at the end.
|
bool propagated = false;//an internal flag indicating that the event has been already passed to inherited, to suppress the automatic doing of this at the end.
|
||||||
//goto finalize = return processed. Might be important to do something before done (none now).
|
//goto finalize = return processed. Might be important to do something before done (none now).
|
||||||
|
|
||||||
|
@ -282,10 +282,10 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
// Mode-independent keyboard handling
|
// Mode-independent keyboard handling
|
||||||
if (evIsKeyboard) {
|
if (evIsKeyboard) {
|
||||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
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()) {
|
switch (event->getKey()) {
|
||||||
case SoKeyboardEvent::H:
|
case SoKeyboardEvent::H:
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
if(!press){
|
if(!press){
|
||||||
SbBool ret = NavigationStyle::lookAtPoint(event->getPosition());
|
SbBool ret = NavigationStyle::lookAtPoint(event->getPosition());
|
||||||
if(!ret){
|
if(!ret){
|
||||||
|
@ -306,7 +306,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
||||||
if (event)
|
if (event)
|
||||||
this->processMotionEvent(event);
|
this->processMotionEvent(event);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
if (processed)
|
if (processed)
|
||||||
goto finalize;
|
goto finalize;
|
||||||
|
@ -321,7 +321,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
//keyboard
|
//keyboard
|
||||||
if (evIsKeyboard) {
|
if (evIsKeyboard) {
|
||||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
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()){
|
switch(event->getKey()){
|
||||||
case SoKeyboardEvent::S:
|
case SoKeyboardEvent::S:
|
||||||
|
@ -335,15 +335,15 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::PAGE_UP:
|
case SoKeyboardEvent::PAGE_UP:
|
||||||
if(press){
|
if(press){
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||||
}
|
}
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::PAGE_DOWN:
|
case SoKeyboardEvent::PAGE_DOWN:
|
||||||
if(press){
|
if(press){
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||||
}
|
}
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -358,7 +358,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
const int button = event->getButton();
|
||||||
const SbBool press //the button was pressed (if false -> released)
|
const SbBool press //the button was pressed (if false -> released)
|
||||||
= event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
= event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
switch(button){
|
switch(button){
|
||||||
case SoMouseButtonEvent::BUTTON1:
|
case SoMouseButtonEvent::BUTTON1:
|
||||||
case SoMouseButtonEvent::BUTTON2:
|
case SoMouseButtonEvent::BUTTON2:
|
||||||
|
@ -399,7 +399,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON3://press the wheel
|
case SoMouseButtonEvent::BUTTON3://press the wheel
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
if(press){
|
if(press){
|
||||||
SbBool ret = NavigationStyle::lookAtPoint(event->getPosition());
|
SbBool ret = NavigationStyle::lookAtPoint(event->getPosition());
|
||||||
if(!ret){
|
if(!ret){
|
||||||
|
@ -409,12 +409,12 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON4: //(wheel?)
|
case SoMouseButtonEvent::BUTTON4: //(wheel?)
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON5: //(wheel?)
|
case SoMouseButtonEvent::BUTTON5: //(wheel?)
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -479,7 +479,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
const int button = event->getButton();
|
||||||
//const SbBool press //the button was pressed (if false -> released)
|
//const SbBool press //the button was pressed (if false -> released)
|
||||||
// = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
// = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
switch(button){
|
switch(button){
|
||||||
case SoMouseButtonEvent::BUTTON1:
|
case SoMouseButtonEvent::BUTTON1:
|
||||||
case SoMouseButtonEvent::BUTTON2:
|
case SoMouseButtonEvent::BUTTON2:
|
||||||
|
@ -502,23 +502,23 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
//const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
//const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
||||||
if (curmode == NavigationStyle::ZOOMING) {//doesn't happen
|
if (curmode == NavigationStyle::ZOOMING) {//doesn't happen
|
||||||
this->zoomByCursor(posn, prevnormalized);
|
this->zoomByCursor(posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
} else if (curmode == NavigationStyle::PANNING) {
|
} else if (curmode == NavigationStyle::PANNING) {
|
||||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
} else if (curmode == NavigationStyle::DRAGGING) {
|
} else if (curmode == NavigationStyle::DRAGGING) {
|
||||||
if (comboAfter & BUTTON1DOWN && comboAfter & BUTTON2DOWN) {
|
if (comboAfter & BUTTON1DOWN && comboAfter & BUTTON2DOWN) {
|
||||||
//two mouse buttons down - tilting!
|
//two mouse buttons down - tilting!
|
||||||
NavigationStyle::doRotate(viewer->getSoRenderManager()->getCamera(),
|
NavigationStyle::doRotate(viewer->getSoRenderManager()->getCamera(),
|
||||||
(posn - prevnormalized)[0]*(-2),
|
(posn - prevnormalized)[0]*(-2),
|
||||||
SbVec2f(0.5,0.5));
|
SbVec2f(0.5,0.5));
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
} else {//one mouse button - normal spinning
|
} else {//one mouse button - normal spinning
|
||||||
//this will also handle the single-finger drag (there's no gesture used, pseudomouse is enough)
|
//this will also handle the single-finger drag (there's no gesture used, pseudomouse is enough)
|
||||||
//this->addToLog(event->getPosition(), event->getTime());
|
//this->addToLog(event->getPosition(), event->getTime());
|
||||||
this->spin_simplified(viewer->getSoRenderManager()->getCamera(),
|
this->spin_simplified(viewer->getSoRenderManager()->getCamera(),
|
||||||
posn, prevnormalized);
|
posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -564,7 +564,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (evIsButton) {
|
if (evIsButton) {
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
const int button = event->getButton();
|
||||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
if (button == SoMouseButtonEvent::BUTTON1 && press) {
|
if (button == SoMouseButtonEvent::BUTTON1 && press) {
|
||||||
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
||||||
this->setViewingMode(NavigationStyle::SEEK_MODE);
|
this->setViewingMode(NavigationStyle::SEEK_MODE);
|
||||||
|
|
|
@ -95,8 +95,8 @@ TextBrowser::TextBrowser(QWidget * parent)
|
||||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
|
||||||
setAcceptDrops( TRUE );
|
setAcceptDrops( true );
|
||||||
viewport()->setAcceptDrops( TRUE );
|
viewport()->setAcceptDrops( true );
|
||||||
|
|
||||||
connect( d->http, SIGNAL(done(bool)), this, SLOT(done(bool)));
|
connect( d->http, SIGNAL(done(bool)), this, SLOT(done(bool)));
|
||||||
connect( d->http, SIGNAL(stateChanged(int)), this, SLOT(onStateChanged(int)));
|
connect( d->http, SIGNAL(stateChanged(int)), this, SLOT(onStateChanged(int)));
|
||||||
|
|
|
@ -98,11 +98,11 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
|
|
||||||
this->lastmouseposition = posn;
|
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
|
// necessary to restrict ourselves to only do one "action" for an
|
||||||
// event, we only need this flag to see if any processing happened
|
// event, we only need this flag to see if any processing happened
|
||||||
// at all.
|
// at all.
|
||||||
SbBool processed = FALSE;
|
SbBool processed = false;
|
||||||
|
|
||||||
const ViewerMode curmode = this->currentmode;
|
const ViewerMode curmode = this->currentmode;
|
||||||
ViewerMode newmode = curmode;
|
ViewerMode newmode = curmode;
|
||||||
|
@ -123,13 +123,13 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (!processed && !viewer->isEditing()) {
|
if (!processed && !viewer->isEditing()) {
|
||||||
processed = handleEventInForeground(ev);
|
processed = handleEventInForeground(ev);
|
||||||
if (processed)
|
if (processed)
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keyboard handling
|
// Keyboard handling
|
||||||
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
||||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
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()) {
|
switch (event->getKey()) {
|
||||||
case SoKeyboardEvent::LEFT_CONTROL:
|
case SoKeyboardEvent::LEFT_CONTROL:
|
||||||
case SoKeyboardEvent::RIGHT_CONTROL:
|
case SoKeyboardEvent::RIGHT_CONTROL:
|
||||||
|
@ -144,7 +144,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
this->altdown = press;
|
this->altdown = press;
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::H:
|
case SoKeyboardEvent::H:
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
viewer->saveHomePosition();
|
viewer->saveHomePosition();
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::S:
|
case SoKeyboardEvent::S:
|
||||||
|
@ -165,7 +165,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
const int button = event->getButton();
|
||||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
|
|
||||||
// SoDebugError::postInfo("processSoEvent", "button = %d", button);
|
// SoDebugError::postInfo("processSoEvent", "button = %d", button);
|
||||||
switch (button) {
|
switch (button) {
|
||||||
|
@ -177,7 +177,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
float ratio = vp.getViewportAspectRatio();
|
float ratio = vp.getViewportAspectRatio();
|
||||||
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
||||||
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
||||||
this->lockrecenter = FALSE;
|
this->lockrecenter = false;
|
||||||
}
|
}
|
||||||
else if (!press && ev->wasShiftDown() &&
|
else if (!press && ev->wasShiftDown() &&
|
||||||
(this->currentmode != NavigationStyle::SELECTION)) {
|
(this->currentmode != NavigationStyle::SELECTION)) {
|
||||||
|
@ -189,34 +189,34 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
panToCenter(panningplane, posn);
|
panToCenter(panningplane, posn);
|
||||||
this->interactiveCountDec();
|
this->interactiveCountDec();
|
||||||
}
|
}
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
|
else if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
|
||||||
newmode = NavigationStyle::SEEK_MODE;
|
newmode = NavigationStyle::SEEK_MODE;
|
||||||
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
}
|
}
|
||||||
else if (press && (this->currentmode == NavigationStyle::IDLE)) {
|
else if (press && (this->currentmode == NavigationStyle::IDLE)) {
|
||||||
this->setViewing(true);
|
this->setViewing(true);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
}
|
}
|
||||||
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
||||||
this->setViewing(false);
|
this->setViewing(false);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
}
|
}
|
||||||
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
|
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON2:
|
case SoMouseButtonEvent::BUTTON2:
|
||||||
// If we are in edit mode then simply ignore the RMB events
|
// If we are in edit mode then simply ignore the RMB events
|
||||||
// to pass the event to the base class.
|
// to pass the event to the base class.
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
if (!viewer->isEditing()) {
|
if (!viewer->isEditing()) {
|
||||||
// If we are in zoom or pan mode ignore RMB events otherwise
|
// If we are in zoom or pan mode ignore RMB events otherwise
|
||||||
// the canvas doesn't get any release events
|
// the canvas doesn't get any release events
|
||||||
|
@ -237,7 +237,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
float ratio = vp.getViewportAspectRatio();
|
float ratio = vp.getViewportAspectRatio();
|
||||||
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
||||||
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
||||||
this->lockrecenter = FALSE;
|
this->lockrecenter = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SbTime tmp = (ev->getTime() - this->centerTime);
|
SbTime tmp = (ev->getTime() - this->centerTime);
|
||||||
|
@ -248,18 +248,18 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
panToCenter(panningplane, posn);
|
panToCenter(panningplane, posn);
|
||||||
this->interactiveCountDec();
|
this->interactiveCountDec();
|
||||||
}
|
}
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->button3down = press;
|
this->button3down = press;
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON4:
|
case SoMouseButtonEvent::BUTTON4:
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON5:
|
case SoMouseButtonEvent::BUTTON5:
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -268,22 +268,22 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
|
|
||||||
// Mouse Movement handling
|
// Mouse Movement handling
|
||||||
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
||||||
if (this->currentmode == NavigationStyle::ZOOMING) {
|
if (this->currentmode == NavigationStyle::ZOOMING) {
|
||||||
this->zoomByCursor(posn, prevnormalized);
|
this->zoomByCursor(posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (this->currentmode == NavigationStyle::PANNING) {
|
else if (this->currentmode == NavigationStyle::PANNING) {
|
||||||
float ratio = vp.getViewportAspectRatio();
|
float ratio = vp.getViewportAspectRatio();
|
||||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (this->currentmode == NavigationStyle::DRAGGING) {
|
else if (this->currentmode == NavigationStyle::DRAGGING) {
|
||||||
this->addToLog(event->getPosition(), event->getTime());
|
this->addToLog(event->getPosition(), event->getTime());
|
||||||
this->spin(posn);
|
this->spin(posn);
|
||||||
moveCursorPosition();
|
moveCursorPosition();
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
||||||
if (event)
|
if (event)
|
||||||
this->processMotionEvent(event);
|
this->processMotionEvent(event);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -370,7 +370,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
viewer->isEditing()) && !processed)
|
viewer->isEditing()) && !processed)
|
||||||
processed = inherited::processSoEvent(ev);
|
processed = inherited::processSoEvent(ev);
|
||||||
else
|
else
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
return processed;
|
return processed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -489,7 +489,7 @@ public:
|
||||||
rot_cam1 = rot;
|
rot_cam1 = rot;
|
||||||
|
|
||||||
// copy the values
|
// copy the values
|
||||||
cam2->enableNotify(FALSE);
|
cam2->enableNotify(false);
|
||||||
cam2->nearDistance = cam1->nearDistance;
|
cam2->nearDistance = cam1->nearDistance;
|
||||||
cam2->farDistance = cam1->farDistance;
|
cam2->farDistance = cam1->farDistance;
|
||||||
cam2->focalDistance = cam1->focalDistance;
|
cam2->focalDistance = cam1->focalDistance;
|
||||||
|
@ -512,7 +512,7 @@ public:
|
||||||
static_cast<SoOrthographicCamera*>(cam1)->height;
|
static_cast<SoOrthographicCamera*>(cam1)->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
cam2->enableNotify(TRUE);
|
cam2->enableNotify(true);
|
||||||
}
|
}
|
||||||
static
|
static
|
||||||
void syncCameraCB(void * data, SoSensor * s)
|
void syncCameraCB(void * data, SoSensor * s)
|
||||||
|
|
|
@ -202,7 +202,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
const int button = event->getButton();
|
||||||
const SbBool press //the button was pressed (if false -> released)
|
const SbBool press //the button was pressed (if false -> released)
|
||||||
= event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
= event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case SoMouseButtonEvent::BUTTON1:
|
case SoMouseButtonEvent::BUTTON1:
|
||||||
this->button1down = press;
|
this->button1down = press;
|
||||||
|
@ -278,7 +278,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
|
|
||||||
//----------all this were preparations. Now comes the event handling! ----------
|
//----------all this were preparations. Now comes the event handling! ----------
|
||||||
|
|
||||||
SbBool processed = FALSE;//a return value for the BlahblahblahNavigationStyle::processSoEvent
|
SbBool processed = false;//a return value for the BlahblahblahNavigationStyle::processSoEvent
|
||||||
bool propagated = false;//an internal flag indicating that the event has been already passed to inherited, to suppress the automatic doing of this at the end.
|
bool propagated = false;//an internal flag indicating that the event has been already passed to inherited, to suppress the automatic doing of this at the end.
|
||||||
//goto finalize = return processed. Might be important to do something before done (none now).
|
//goto finalize = return processed. Might be important to do something before done (none now).
|
||||||
|
|
||||||
|
@ -292,10 +292,10 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
// Mode-independent keyboard handling
|
// Mode-independent keyboard handling
|
||||||
if (evIsKeyboard) {
|
if (evIsKeyboard) {
|
||||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
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()) {
|
switch (event->getKey()) {
|
||||||
case SoKeyboardEvent::H:
|
case SoKeyboardEvent::H:
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
if(!press){
|
if(!press){
|
||||||
SbBool ret = NavigationStyle::lookAtPoint(event->getPosition());
|
SbBool ret = NavigationStyle::lookAtPoint(event->getPosition());
|
||||||
if(!ret){
|
if(!ret){
|
||||||
|
@ -316,7 +316,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
||||||
if (event)
|
if (event)
|
||||||
this->processMotionEvent(event);
|
this->processMotionEvent(event);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
if (processed)
|
if (processed)
|
||||||
goto finalize;
|
goto finalize;
|
||||||
|
@ -331,7 +331,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
//keyboard
|
//keyboard
|
||||||
if (evIsKeyboard) {
|
if (evIsKeyboard) {
|
||||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
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()){
|
switch(event->getKey()){
|
||||||
case SoKeyboardEvent::S:
|
case SoKeyboardEvent::S:
|
||||||
|
@ -345,15 +345,15 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::PAGE_UP:
|
case SoKeyboardEvent::PAGE_UP:
|
||||||
if(press){
|
if(press){
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||||
}
|
}
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::PAGE_DOWN:
|
case SoKeyboardEvent::PAGE_DOWN:
|
||||||
if(press){
|
if(press){
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||||
}
|
}
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -368,7 +368,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
const int button = event->getButton();
|
||||||
const SbBool press //the button was pressed (if false -> released)
|
const SbBool press //the button was pressed (if false -> released)
|
||||||
= event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
= event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
switch(button){
|
switch(button){
|
||||||
case SoMouseButtonEvent::BUTTON1:
|
case SoMouseButtonEvent::BUTTON1:
|
||||||
case SoMouseButtonEvent::BUTTON2:
|
case SoMouseButtonEvent::BUTTON2:
|
||||||
|
@ -420,15 +420,15 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
"No object under cursor! Can't set new center of rotation.\n");
|
"No object under cursor! Can't set new center of rotation.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON4: //(wheel?)
|
case SoMouseButtonEvent::BUTTON4: //(wheel?)
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON5: //(wheel?)
|
case SoMouseButtonEvent::BUTTON5: //(wheel?)
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -516,23 +516,23 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (evIsLoc2 && ! this->inGesture && this->mouseMoveThresholdBroken) {
|
if (evIsLoc2 && ! this->inGesture && this->mouseMoveThresholdBroken) {
|
||||||
if (curmode == NavigationStyle::ZOOMING) {//doesn't happen
|
if (curmode == NavigationStyle::ZOOMING) {//doesn't happen
|
||||||
this->zoomByCursor(posn, prevnormalized);
|
this->zoomByCursor(posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
} else if (curmode == NavigationStyle::PANNING) {
|
} else if (curmode == NavigationStyle::PANNING) {
|
||||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
} else if (curmode == NavigationStyle::DRAGGING) {
|
} else if (curmode == NavigationStyle::DRAGGING) {
|
||||||
if (comboAfter & BUTTON1DOWN && comboAfter & BUTTON2DOWN) {
|
if (comboAfter & BUTTON1DOWN && comboAfter & BUTTON2DOWN) {
|
||||||
//two mouse buttons down - tilting!
|
//two mouse buttons down - tilting!
|
||||||
NavigationStyle::doRotate(viewer->getSoRenderManager()->getCamera(),
|
NavigationStyle::doRotate(viewer->getSoRenderManager()->getCamera(),
|
||||||
(posn - prevnormalized)[0]*(-2),
|
(posn - prevnormalized)[0]*(-2),
|
||||||
SbVec2f(0.5,0.5));
|
SbVec2f(0.5,0.5));
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
} else {//one mouse button - normal spinning
|
} else {//one mouse button - normal spinning
|
||||||
//this will also handle the single-finger drag (there's no gesture used, pseudomouse is enough)
|
//this will also handle the single-finger drag (there's no gesture used, pseudomouse is enough)
|
||||||
//this->addToLog(event->getPosition(), event->getTime());
|
//this->addToLog(event->getPosition(), event->getTime());
|
||||||
this->spin_simplified(viewer->getSoRenderManager()->getCamera(),
|
this->spin_simplified(viewer->getSoRenderManager()->getCamera(),
|
||||||
posn, prevnormalized);
|
posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -578,7 +578,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (evIsButton) {
|
if (evIsButton) {
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
const int button = event->getButton();
|
||||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
if (button == SoMouseButtonEvent::BUTTON1 && press) {
|
if (button == SoMouseButtonEvent::BUTTON1 && press) {
|
||||||
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
||||||
this->setViewingMode(NavigationStyle::SEEK_MODE);
|
this->setViewingMode(NavigationStyle::SEEK_MODE);
|
||||||
|
|
|
@ -90,7 +90,7 @@ int AbstractMouseSelection::handleEvent(const SoEvent* const ev, const SbViewpor
|
||||||
|
|
||||||
if (ev->getTypeId().isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
if (ev->getTypeId().isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
||||||
const SoMouseButtonEvent* const event = (const SoMouseButtonEvent*) ev;
|
const SoMouseButtonEvent* const event = (const SoMouseButtonEvent*) ev;
|
||||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
|
|
||||||
if (press) {
|
if (press) {
|
||||||
_clPoly.push_back(ev->getPosition());
|
_clPoly.push_back(ev->getPosition());
|
||||||
|
@ -311,7 +311,7 @@ int PolyPickerSelection::popupMenu()
|
||||||
int PolyPickerSelection::mouseButtonEvent(const SoMouseButtonEvent* const e, const QPoint& pos)
|
int PolyPickerSelection::mouseButtonEvent(const SoMouseButtonEvent* const e, const QPoint& pos)
|
||||||
{
|
{
|
||||||
const int button = e->getButton();
|
const int button = e->getButton();
|
||||||
const SbBool press = e->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
const SbBool press = e->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
|
|
||||||
if (press) {
|
if (press) {
|
||||||
switch(button)
|
switch(button)
|
||||||
|
@ -501,7 +501,7 @@ int BrushSelection::popupMenu()
|
||||||
int BrushSelection::mouseButtonEvent(const SoMouseButtonEvent* const e, const QPoint& pos)
|
int BrushSelection::mouseButtonEvent(const SoMouseButtonEvent* const e, const QPoint& pos)
|
||||||
{
|
{
|
||||||
const int button = e->getButton();
|
const int button = e->getButton();
|
||||||
const SbBool press = e->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
const SbBool press = e->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
|
|
||||||
if (press) {
|
if (press) {
|
||||||
switch(button)
|
switch(button)
|
||||||
|
@ -658,7 +658,7 @@ void RubberbandSelection::draw()
|
||||||
int RubberbandSelection::mouseButtonEvent(const SoMouseButtonEvent* const e, const QPoint& pos)
|
int RubberbandSelection::mouseButtonEvent(const SoMouseButtonEvent* const e, const QPoint& pos)
|
||||||
{
|
{
|
||||||
const int button = e->getButton();
|
const int button = e->getButton();
|
||||||
const SbBool press = e->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
const SbBool press = e->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
|
|
||||||
int ret = Continue;
|
int ret = Continue;
|
||||||
|
|
||||||
|
|
|
@ -64,9 +64,9 @@ struct NavigationStyleP {
|
||||||
{
|
{
|
||||||
this->animationsteps = 0;
|
this->animationsteps = 0;
|
||||||
this->sensitivity = 2.0f;
|
this->sensitivity = 2.0f;
|
||||||
this->resetcursorpos = FALSE;
|
this->resetcursorpos = false;
|
||||||
this->dragPointFound = FALSE;
|
this->dragPointFound = false;
|
||||||
this->dragAtCursor = FALSE;
|
this->dragAtCursor = false;
|
||||||
}
|
}
|
||||||
static void viewAnimationCB(void * data, SoSensor * sensor);
|
static void viewAnimationCB(void * data, SoSensor * sensor);
|
||||||
};
|
};
|
||||||
|
@ -81,7 +81,7 @@ public:
|
||||||
Trackball
|
Trackball
|
||||||
};
|
};
|
||||||
|
|
||||||
FCSphereSheetProjector(const SbSphere & sph, const SbBool orienttoeye = TRUE)
|
FCSphereSheetProjector(const SbSphere & sph, const SbBool orienttoeye = true)
|
||||||
: SbSphereSheetProjector(sph, orienttoeye), orbit(Trackball)
|
: SbSphereSheetProjector(sph, orienttoeye), orbit(Trackball)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,7 @@ void NavigationStyle::initialize()
|
||||||
{
|
{
|
||||||
this->currentmode = NavigationStyle::IDLE;
|
this->currentmode = NavigationStyle::IDLE;
|
||||||
this->prevRedrawTime = SbTime::getTimeOfDay();
|
this->prevRedrawTime = SbTime::getTimeOfDay();
|
||||||
this->spinanimatingallowed = TRUE;
|
this->spinanimatingallowed = true;
|
||||||
this->spinsamplecounter = 0;
|
this->spinsamplecounter = 0;
|
||||||
this->spinincrement = SbRotation::identity();
|
this->spinincrement = SbRotation::identity();
|
||||||
this->spinRotation.setValue(SbVec3f(0, 0, -1), 0);
|
this->spinRotation.setValue(SbVec3f(0, 0, -1), 0);
|
||||||
|
@ -223,13 +223,13 @@ void NavigationStyle::initialize()
|
||||||
this->log.time = new SbTime [ 16 ];
|
this->log.time = new SbTime [ 16 ];
|
||||||
this->log.historysize = 0;
|
this->log.historysize = 0;
|
||||||
|
|
||||||
this->menuenabled = TRUE;
|
this->menuenabled = true;
|
||||||
this->button1down = FALSE;
|
this->button1down = false;
|
||||||
this->button2down = FALSE;
|
this->button2down = false;
|
||||||
this->button3down = FALSE;
|
this->button3down = false;
|
||||||
this->ctrldown = FALSE;
|
this->ctrldown = false;
|
||||||
this->shiftdown = FALSE;
|
this->shiftdown = false;
|
||||||
this->altdown = FALSE;
|
this->altdown = false;
|
||||||
this->invertZoom = App::GetApplication().GetParameterGroupByPath
|
this->invertZoom = App::GetApplication().GetParameterGroupByPath
|
||||||
("User parameter:BaseApp/Preferences/View")->GetBool("InvertZoom",true);
|
("User parameter:BaseApp/Preferences/View")->GetBool("InvertZoom",true);
|
||||||
this->zoomAtCursor = App::GetApplication().GetParameterGroupByPath
|
this->zoomAtCursor = App::GetApplication().GetParameterGroupByPath
|
||||||
|
@ -305,7 +305,7 @@ void NavigationStyle::seekToPoint(const SbVec3f& scenepos)
|
||||||
SbBool NavigationStyle::lookAtPoint(const SbVec2s screenpos)
|
SbBool NavigationStyle::lookAtPoint(const SbVec2s screenpos)
|
||||||
{
|
{
|
||||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||||
if (cam == 0) return FALSE;
|
if (cam == 0) return false;
|
||||||
|
|
||||||
SoRayPickAction rpaction(viewer->getSoRenderManager()->getViewportRegion());
|
SoRayPickAction rpaction(viewer->getSoRenderManager()->getViewportRegion());
|
||||||
rpaction.setPoint(screenpos);
|
rpaction.setPoint(screenpos);
|
||||||
|
@ -315,20 +315,20 @@ SbBool NavigationStyle::lookAtPoint(const SbVec2s screenpos)
|
||||||
SoPickedPoint * picked = rpaction.getPickedPoint();
|
SoPickedPoint * picked = rpaction.getPickedPoint();
|
||||||
if (!picked) {
|
if (!picked) {
|
||||||
this->interactiveCountInc();
|
this->interactiveCountInc();
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SbVec3f hitpoint;
|
SbVec3f hitpoint;
|
||||||
hitpoint = picked->getPoint();
|
hitpoint = picked->getPoint();
|
||||||
lookAtPoint(hitpoint);
|
lookAtPoint(hitpoint);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigationStyle::lookAtPoint(const SbVec3f& pos)
|
void NavigationStyle::lookAtPoint(const SbVec3f& pos)
|
||||||
{
|
{
|
||||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||||
if (cam == 0) return;
|
if (cam == 0) return;
|
||||||
PRIVATE(this)->dragPointFound = FALSE;
|
PRIVATE(this)->dragPointFound = false;
|
||||||
|
|
||||||
// Find global coordinates of focal point.
|
// Find global coordinates of focal point.
|
||||||
SbVec3f direction;
|
SbVec3f direction;
|
||||||
|
@ -661,7 +661,7 @@ void NavigationStyle::panToCenter(const SbPlane & pplane, const SbVec2f & currpo
|
||||||
const SbViewportRegion & vp = viewer->getSoRenderManager()->getViewportRegion();
|
const SbViewportRegion & vp = viewer->getSoRenderManager()->getViewportRegion();
|
||||||
float ratio = vp.getViewportAspectRatio();
|
float ratio = vp.getViewportAspectRatio();
|
||||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, pplane, SbVec2f(0.5,0.5), currpos);
|
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, pplane, SbVec2f(0.5,0.5), currpos);
|
||||||
PRIVATE(this)->dragPointFound = FALSE;
|
PRIVATE(this)->dragPointFound = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Dependent on the camera type this will either shrink or expand the
|
/** Dependent on the camera type this will either shrink or expand the
|
||||||
|
@ -693,12 +693,12 @@ void NavigationStyle::zoom(SoCamera * cam, float diffvalue)
|
||||||
// frustum (similar to glFrustum())
|
// frustum (similar to glFrustum())
|
||||||
if (!t.isDerivedFrom(SoPerspectiveCamera::getClassTypeId()) &&
|
if (!t.isDerivedFrom(SoPerspectiveCamera::getClassTypeId()) &&
|
||||||
tname != "FrustumCamera") {
|
tname != "FrustumCamera") {
|
||||||
/* static SbBool first = TRUE;
|
/* static SbBool first = true;
|
||||||
if (first) {
|
if (first) {
|
||||||
SoDebugError::postWarning("SoGuiFullViewerP::zoom",
|
SoDebugError::postWarning("SoGuiFullViewerP::zoom",
|
||||||
"Unknown camera type, "
|
"Unknown camera type, "
|
||||||
"will zoom by moving position, but this might not be correct.");
|
"will zoom by moving position, but this might not be correct.");
|
||||||
first = FALSE;
|
first = false;
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -975,12 +975,12 @@ SbBool NavigationStyle::doSpin()
|
||||||
rot.getValue(axis, radians);
|
rot.getValue(axis, radians);
|
||||||
if ((radians > 0.01f) && (deltatime < 0.300)) {
|
if ((radians > 0.01f) && (deltatime < 0.300)) {
|
||||||
this->spinRotation = rot;
|
this->spinRotation = rot;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigationStyle::saveCursorPosition(const SoEvent * const ev)
|
void NavigationStyle::saveCursorPosition(const SoEvent * const ev)
|
||||||
|
@ -997,7 +997,7 @@ void NavigationStyle::saveCursorPosition(const SoEvent * const ev)
|
||||||
|
|
||||||
SoPickedPoint * picked = rpaction.getPickedPoint();
|
SoPickedPoint * picked = rpaction.getPickedPoint();
|
||||||
if (picked) {
|
if (picked) {
|
||||||
PRIVATE(this)->dragPointFound = TRUE;
|
PRIVATE(this)->dragPointFound = true;
|
||||||
PRIVATE(this)->startDragPoint = picked->getPoint();
|
PRIVATE(this)->startDragPoint = picked->getPoint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1064,7 +1064,7 @@ SbBool NavigationStyle::handleEventInForeground(const SoEvent* const e)
|
||||||
Decide if it should be possible to start a spin animation of the
|
Decide if it should be possible to start a spin animation of the
|
||||||
model in the viewer by releasing the mouse button while dragging.
|
model in the viewer by releasing the mouse button while dragging.
|
||||||
|
|
||||||
If the \a enable flag is \c FALSE and we're currently animating, the
|
If the \a enable flag is \c false and we're currently animating, the
|
||||||
spin will be stopped.
|
spin will be stopped.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
|
@ -1219,7 +1219,7 @@ void NavigationStyle::stopSelection()
|
||||||
|
|
||||||
SbBool NavigationStyle::isSelecting() const
|
SbBool NavigationStyle::isSelecting() const
|
||||||
{
|
{
|
||||||
return (mouseSelection ? TRUE : FALSE);
|
return (mouseSelection ? true : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<SbVec2s>& NavigationStyle::getPolygon(SbBool* clip_inner) const
|
const std::vector<SbVec2s>& NavigationStyle::getPolygon(SbBool* clip_inner) const
|
||||||
|
@ -1332,7 +1332,7 @@ SbBool NavigationStyle::processEvent(const SoEvent * const ev)
|
||||||
int hd=mouseSelection->handleEvent(ev,viewer->getSoRenderManager()->getViewportRegion());
|
int hd=mouseSelection->handleEvent(ev,viewer->getSoRenderManager()->getViewportRegion());
|
||||||
if (hd==AbstractMouseSelection::Continue||
|
if (hd==AbstractMouseSelection::Continue||
|
||||||
hd==AbstractMouseSelection::Restart) {
|
hd==AbstractMouseSelection::Restart) {
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else if (hd==AbstractMouseSelection::Finish) {
|
else if (hd==AbstractMouseSelection::Finish) {
|
||||||
pcPolygon = mouseSelection->getPositions();
|
pcPolygon = mouseSelection->getPositions();
|
||||||
|
@ -1353,7 +1353,7 @@ SbBool NavigationStyle::processEvent(const SoEvent * const ev)
|
||||||
|
|
||||||
const ViewerMode curmode = this->currentmode;
|
const ViewerMode curmode = this->currentmode;
|
||||||
|
|
||||||
SbBool processed = FALSE;
|
SbBool processed = false;
|
||||||
processed = this->processSoEvent(ev);
|
processed = this->processSoEvent(ev);
|
||||||
|
|
||||||
// check for left click without selecting something
|
// check for left click without selecting something
|
||||||
|
@ -1399,7 +1399,7 @@ void NavigationStyle::syncWithEvent(const SoEvent * const ev)
|
||||||
// Keyboard handling
|
// Keyboard handling
|
||||||
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
||||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
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()) {
|
switch (event->getKey()) {
|
||||||
case SoKeyboardEvent::LEFT_CONTROL:
|
case SoKeyboardEvent::LEFT_CONTROL:
|
||||||
case SoKeyboardEvent::RIGHT_CONTROL:
|
case SoKeyboardEvent::RIGHT_CONTROL:
|
||||||
|
@ -1422,7 +1422,7 @@ void NavigationStyle::syncWithEvent(const SoEvent * const ev)
|
||||||
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
const int button = event->getButton();
|
||||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
|
|
||||||
// SoDebugError::postInfo("processSoEvent", "button = %d", button);
|
// SoDebugError::postInfo("processSoEvent", "button = %d", button);
|
||||||
switch (button) {
|
switch (button) {
|
||||||
|
@ -1445,7 +1445,7 @@ SbBool NavigationStyle::processMotionEvent(const SoMotion3Event * const ev)
|
||||||
{
|
{
|
||||||
SoCamera * const camera = viewer->getSoRenderManager()->getCamera();
|
SoCamera * const camera = viewer->getSoRenderManager()->getCamera();
|
||||||
if (!camera)
|
if (!camera)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
SbViewVolume volume(camera->getViewVolume());
|
SbViewVolume volume(camera->getViewVolume());
|
||||||
SbVec3f center(volume.getSightPoint(camera->focalDistance.getValue()));
|
SbVec3f center(volume.getSightPoint(camera->focalDistance.getValue()));
|
||||||
|
@ -1469,7 +1469,7 @@ SbBool NavigationStyle::processMotionEvent(const SoMotion3Event * const ev)
|
||||||
camera->orientation.getValue().multVec(dir,dir);
|
camera->orientation.getValue().multVec(dir,dir);
|
||||||
camera->position = newPosition + (dir * translationFactor);
|
camera->position = newPosition + (dir * translationFactor);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigationStyle::setPopupMenuEnabled(const SbBool on)
|
void NavigationStyle::setPopupMenuEnabled(const SbBool on)
|
||||||
|
|
|
@ -98,11 +98,11 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
|
|
||||||
this->lastmouseposition = posn;
|
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
|
// necessary to restrict ourselves to only do one "action" for an
|
||||||
// event, we only need this flag to see if any processing happened
|
// event, we only need this flag to see if any processing happened
|
||||||
// at all.
|
// at all.
|
||||||
SbBool processed = FALSE;
|
SbBool processed = false;
|
||||||
|
|
||||||
const ViewerMode curmode = this->currentmode;
|
const ViewerMode curmode = this->currentmode;
|
||||||
ViewerMode newmode = curmode;
|
ViewerMode newmode = curmode;
|
||||||
|
@ -123,13 +123,13 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (!processed && !viewer->isEditing()) {
|
if (!processed && !viewer->isEditing()) {
|
||||||
processed = handleEventInForeground(ev);
|
processed = handleEventInForeground(ev);
|
||||||
if (processed)
|
if (processed)
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keyboard handling
|
// Keyboard handling
|
||||||
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
||||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
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()) {
|
switch (event->getKey()) {
|
||||||
case SoKeyboardEvent::LEFT_CONTROL:
|
case SoKeyboardEvent::LEFT_CONTROL:
|
||||||
case SoKeyboardEvent::RIGHT_CONTROL:
|
case SoKeyboardEvent::RIGHT_CONTROL:
|
||||||
|
@ -144,7 +144,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
this->altdown = press;
|
this->altdown = press;
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::H:
|
case SoKeyboardEvent::H:
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
viewer->saveHomePosition();
|
viewer->saveHomePosition();
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::S:
|
case SoKeyboardEvent::S:
|
||||||
|
@ -165,33 +165,33 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
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) {
|
switch (button) {
|
||||||
case SoMouseButtonEvent::BUTTON1:
|
case SoMouseButtonEvent::BUTTON1:
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
this->button1down = press;
|
this->button1down = press;
|
||||||
if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
|
if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
|
||||||
newmode = NavigationStyle::SEEK_MODE;
|
newmode = NavigationStyle::SEEK_MODE;
|
||||||
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (!press && (this->currentmode == NavigationStyle::ZOOMING)) {
|
else if (!press && (this->currentmode == NavigationStyle::ZOOMING)) {
|
||||||
newmode = NavigationStyle::IDLE;
|
newmode = NavigationStyle::IDLE;
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
||||||
this->setViewing(false);
|
this->setViewing(false);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
|
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON2:
|
case SoMouseButtonEvent::BUTTON2:
|
||||||
// If we are in edit mode then simply ignore the RMB events
|
// If we are in edit mode then simply ignore the RMB events
|
||||||
// to pass the event to the base class.
|
// to pass the event to the base class.
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
if (!viewer->isEditing()) {
|
if (!viewer->isEditing()) {
|
||||||
// If we are in zoom or pan mode ignore RMB events otherwise
|
// If we are in zoom or pan mode ignore RMB events otherwise
|
||||||
// the canvas doesn't get any release events
|
// the canvas doesn't get any release events
|
||||||
|
@ -211,11 +211,11 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
newmode = NavigationStyle::DRAGGING;
|
newmode = NavigationStyle::DRAGGING;
|
||||||
saveCursorPosition(ev);
|
saveCursorPosition(ev);
|
||||||
this->centerTime = ev->getTime();
|
this->centerTime = ev->getTime();
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
||||||
newmode = NavigationStyle::IDLE;
|
newmode = NavigationStyle::IDLE;
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
this->button2down = press;
|
this->button2down = press;
|
||||||
break;
|
break;
|
||||||
|
@ -225,18 +225,18 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
float ratio = vp.getViewportAspectRatio();
|
float ratio = vp.getViewportAspectRatio();
|
||||||
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
||||||
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
||||||
this->lockrecenter = FALSE;
|
this->lockrecenter = false;
|
||||||
}
|
}
|
||||||
else if (!press && (this->currentmode == NavigationStyle::PANNING)) {
|
else if (!press && (this->currentmode == NavigationStyle::PANNING)) {
|
||||||
newmode = NavigationStyle::IDLE;
|
newmode = NavigationStyle::IDLE;
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
this->button3down = press;
|
this->button3down = press;
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON4:
|
case SoMouseButtonEvent::BUTTON4:
|
||||||
case SoMouseButtonEvent::BUTTON5:
|
case SoMouseButtonEvent::BUTTON5:
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), button == SoMouseButtonEvent::BUTTON4, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), button == SoMouseButtonEvent::BUTTON4, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -259,7 +259,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
|
|
||||||
// Mouse Movement handling
|
// Mouse Movement handling
|
||||||
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
||||||
if (this->currentmode == NavigationStyle::ZOOMING) {
|
if (this->currentmode == NavigationStyle::ZOOMING) {
|
||||||
// OCCT uses horizontal mouse position, not vertical
|
// OCCT uses horizontal mouse position, not vertical
|
||||||
|
@ -268,18 +268,18 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (this->invertZoom)
|
if (this->invertZoom)
|
||||||
value = -value;
|
value = -value;
|
||||||
zoom(viewer->getSoRenderManager()->getCamera(), value);
|
zoom(viewer->getSoRenderManager()->getCamera(), value);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (this->currentmode == NavigationStyle::PANNING) {
|
else if (this->currentmode == NavigationStyle::PANNING) {
|
||||||
float ratio = vp.getViewportAspectRatio();
|
float ratio = vp.getViewportAspectRatio();
|
||||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (this->currentmode == NavigationStyle::DRAGGING) {
|
else if (this->currentmode == NavigationStyle::DRAGGING) {
|
||||||
this->addToLog(event->getPosition(), event->getTime());
|
this->addToLog(event->getPosition(), event->getTime());
|
||||||
this->spin(posn);
|
this->spin(posn);
|
||||||
moveCursorPosition();
|
moveCursorPosition();
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (combo == (CTRLDOWN|BUTTON1DOWN)) {
|
else if (combo == (CTRLDOWN|BUTTON1DOWN)) {
|
||||||
newmode = NavigationStyle::ZOOMING;
|
newmode = NavigationStyle::ZOOMING;
|
||||||
|
@ -291,7 +291,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
||||||
if (event)
|
if (event)
|
||||||
this->processMotionEvent(event);
|
this->processMotionEvent(event);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (combo) {
|
switch (combo) {
|
||||||
|
@ -327,7 +327,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (/*(curmode == NavigationStyle::SELECTION || viewer->isEditing()) && */!processed)
|
if (/*(curmode == NavigationStyle::SELECTION || viewer->isEditing()) && */!processed)
|
||||||
processed = inherited::processSoEvent(ev);
|
processed = inherited::processSoEvent(ev);
|
||||||
else
|
else
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
return processed;
|
return processed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,9 +66,9 @@ ImageReader::readImage(const SbString & filename, SbImage & sbimage) const
|
||||||
}
|
}
|
||||||
|
|
||||||
QtCoinCompatibility::QImageToSbImage(image,sbimage);
|
QtCoinCompatibility::QImageToSbImage(image,sbimage);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,7 @@ QuarterWidget::constructor(const QGLFormat & format, const QGLWidget * sharewidg
|
||||||
// set up a cache context for the default SoGLRenderAction
|
// set up a cache context for the default SoGLRenderAction
|
||||||
PRIVATE(this)->sorendermanager->getGLRenderAction()->setCacheContext(this->getCacheContextId());
|
PRIVATE(this)->sorendermanager->getGLRenderAction()->setCacheContext(this->getCacheContextId());
|
||||||
|
|
||||||
this->setMouseTracking(TRUE);
|
this->setMouseTracking(true);
|
||||||
|
|
||||||
// Qt::StrongFocus means the widget will accept keyboard focus by
|
// Qt::StrongFocus means the widget will accept keyboard focus by
|
||||||
// both tabbing and clicking
|
// both tabbing and clicking
|
||||||
|
@ -720,7 +720,7 @@ void QuarterWidget::paintEvent(QPaintEvent* event)
|
||||||
// processing the sensors might trigger a redraw in another
|
// processing the sensors might trigger a redraw in another
|
||||||
// context. Release this context temporarily
|
// context. Release this context temporarily
|
||||||
w->doneCurrent();
|
w->doneCurrent();
|
||||||
SoDB::getSensorManager()->processDelayQueue(FALSE);
|
SoDB::getSensorManager()->processDelayQueue(false);
|
||||||
w->makeCurrent();
|
w->makeCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ SensorManager::SensorManager(void)
|
||||||
this->timerEpsilon = 1.0 / 5000.0;
|
this->timerEpsilon = 1.0 / 5000.0;
|
||||||
|
|
||||||
SoDB::setRealTimeInterval(1.0 / 25.0);
|
SoDB::setRealTimeInterval(1.0 / 25.0);
|
||||||
SoRenderManager::enableRealTimeUpdate(FALSE);
|
SoRenderManager::enableRealTimeUpdate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
SensorManager::~SensorManager()
|
SensorManager::~SensorManager()
|
||||||
|
@ -147,7 +147,7 @@ void
|
||||||
SensorManager::idleTimeout(void)
|
SensorManager::idleTimeout(void)
|
||||||
{
|
{
|
||||||
SoDB::getSensorManager()->processTimerQueue();
|
SoDB::getSensorManager()->processTimerQueue();
|
||||||
SoDB::getSensorManager()->processDelayQueue(TRUE);
|
SoDB::getSensorManager()->processDelayQueue(true);
|
||||||
this->sensorQueueChanged();
|
this->sensorQueueChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ void
|
||||||
SensorManager::delayTimeout(void)
|
SensorManager::delayTimeout(void)
|
||||||
{
|
{
|
||||||
SoDB::getSensorManager()->processTimerQueue();
|
SoDB::getSensorManager()->processTimerQueue();
|
||||||
SoDB::getSensorManager()->processDelayQueue(FALSE);
|
SoDB::getSensorManager()->processDelayQueue(false);
|
||||||
this->sensorQueueChanged();
|
this->sensorQueueChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -158,9 +158,9 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::init()
|
||||||
{
|
{
|
||||||
m_interactionnesting = 0;
|
m_interactionnesting = 0;
|
||||||
m_seekdistance = 50.0f;
|
m_seekdistance = 50.0f;
|
||||||
m_seekdistanceabs = FALSE;
|
m_seekdistanceabs = false;
|
||||||
m_seekperiod = 2.0f;
|
m_seekperiod = 2.0f;
|
||||||
m_inseekmode = FALSE;
|
m_inseekmode = false;
|
||||||
m_storedcamera = 0;
|
m_storedcamera = 0;
|
||||||
|
|
||||||
m_seeksensor = new SoTimerSensor(SoQTQuarterAdaptor::seeksensorCB, (void*)this);
|
m_seeksensor = new SoTimerSensor(SoQTQuarterAdaptor::seeksensorCB, (void*)this);
|
||||||
|
@ -363,7 +363,7 @@ SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::isSeekMode(void) const
|
||||||
|
|
||||||
SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::isSeekValuePercentage(void) const
|
SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::isSeekValuePercentage(void) const
|
||||||
{
|
{
|
||||||
return m_seekdistanceabs ? FALSE : TRUE;
|
return m_seekdistanceabs ? false : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::seekToPoint(const SbVec2s screenpos)
|
SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::seekToPoint(const SbVec2s screenpos)
|
||||||
|
@ -377,16 +377,16 @@ SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::seekToPoint(const SbVec2s scree
|
||||||
SoPickedPoint* picked = rpaction.getPickedPoint();
|
SoPickedPoint* picked = rpaction.getPickedPoint();
|
||||||
|
|
||||||
if(!picked) {
|
if(!picked) {
|
||||||
this->interactiveCountInc(); // decremented in setSeekMode(FALSE)
|
this->interactiveCountInc(); // decremented in setSeekMode(false)
|
||||||
this->setSeekMode(FALSE);
|
this->setSeekMode(false);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SbVec3f hitpoint;
|
SbVec3f hitpoint;
|
||||||
hitpoint = picked->getPoint();
|
hitpoint = picked->getPoint();
|
||||||
|
|
||||||
this->seekToPoint(hitpoint);
|
this->seekToPoint(hitpoint);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::seekToPoint(const SbVec3f& scenepos)
|
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::seekToPoint(const SbVec3f& scenepos)
|
||||||
|
@ -455,13 +455,13 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::setSeekTime(const float seconds)
|
||||||
|
|
||||||
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::setSeekValueAsPercentage(const SbBool on)
|
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::setSeekValueAsPercentage(const SbBool on)
|
||||||
{
|
{
|
||||||
m_seekdistanceabs = on ? FALSE : TRUE;
|
m_seekdistanceabs = on ? false : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::getCameraCoordinateSystem(SoCamera* camera, SoNode* root, SbMatrix& matrix, SbMatrix& inverse)
|
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::getCameraCoordinateSystem(SoCamera* camera, SoNode* root, SbMatrix& matrix, SbMatrix& inverse)
|
||||||
{
|
{
|
||||||
searchaction.reset();
|
searchaction.reset();
|
||||||
searchaction.setSearchingAll(TRUE);
|
searchaction.setSearchingAll(true);
|
||||||
searchaction.setInterest(SoSearchAction::FIRST);
|
searchaction.setInterest(SoSearchAction::FIRST);
|
||||||
searchaction.setNode(camera);
|
searchaction.setNode(camera);
|
||||||
searchaction.apply(root);
|
searchaction.apply(root);
|
||||||
|
@ -500,7 +500,7 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::seeksensorCB(void* data, SoSensor
|
||||||
thisp->m_cameraendorient,
|
thisp->m_cameraendorient,
|
||||||
t);
|
t);
|
||||||
|
|
||||||
if(end) thisp->setSeekMode(FALSE);
|
if(end) thisp->setSeekMode(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::saveHomePosition(void)
|
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::saveHomePosition(void)
|
||||||
|
@ -643,19 +643,19 @@ bool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::processSoEvent(const SoEvent* eve
|
||||||
|
|
||||||
case SoKeyboardEvent::LEFT_ARROW:
|
case SoKeyboardEvent::LEFT_ARROW:
|
||||||
moveCameraScreen(SbVec2f(-0.1f, 0.0f));
|
moveCameraScreen(SbVec2f(-0.1f, 0.0f));
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
case SoKeyboardEvent::UP_ARROW:
|
case SoKeyboardEvent::UP_ARROW:
|
||||||
moveCameraScreen(SbVec2f(0.0f, 0.1f));
|
moveCameraScreen(SbVec2f(0.0f, 0.1f));
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
case SoKeyboardEvent::RIGHT_ARROW:
|
case SoKeyboardEvent::RIGHT_ARROW:
|
||||||
moveCameraScreen(SbVec2f(0.1f, 0.0f));
|
moveCameraScreen(SbVec2f(0.1f, 0.0f));
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
case SoKeyboardEvent::DOWN_ARROW:
|
case SoKeyboardEvent::DOWN_ARROW:
|
||||||
moveCameraScreen(SbVec2f(0.0f, -0.1f));
|
moveCameraScreen(SbVec2f(0.0f, -0.1f));
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -67,12 +67,12 @@ SoShapeScale::SoShapeScale(void)
|
||||||
{
|
{
|
||||||
SO_KIT_CONSTRUCTOR(SoShapeScale);
|
SO_KIT_CONSTRUCTOR(SoShapeScale);
|
||||||
|
|
||||||
SO_KIT_ADD_FIELD(active, (TRUE));
|
SO_KIT_ADD_FIELD(active, (true));
|
||||||
SO_KIT_ADD_FIELD(scaleFactor, (1.0f));
|
SO_KIT_ADD_FIELD(scaleFactor, (1.0f));
|
||||||
|
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(topSeparator, SoSeparator, FALSE, this, "", FALSE);
|
SO_KIT_ADD_CATALOG_ENTRY(topSeparator, SoSeparator, false, this, "", false);
|
||||||
SO_KIT_ADD_CATALOG_ABSTRACT_ENTRY(shape, SoNode, SoCube, TRUE, topSeparator, "", TRUE);
|
SO_KIT_ADD_CATALOG_ABSTRACT_ENTRY(shape, SoNode, SoCube, true, topSeparator, "", true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(scale, SoScale, FALSE, topSeparator, shape, FALSE);
|
SO_KIT_ADD_CATALOG_ENTRY(scale, SoScale, false, topSeparator, shape, false);
|
||||||
|
|
||||||
SO_KIT_INIT_INSTANCE();
|
SO_KIT_INIT_INSTANCE();
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ SoShapeScale::GLRender(SoGLRenderAction * action)
|
||||||
{
|
{
|
||||||
SoState * state = action->getState();
|
SoState * state = action->getState();
|
||||||
|
|
||||||
SoScale * scale = static_cast<SoScale*>(this->getAnyPart(SbName("scale"), TRUE));
|
SoScale * scale = static_cast<SoScale*>(this->getAnyPart(SbName("scale"), true));
|
||||||
if (!this->active.getValue()) {
|
if (!this->active.getValue()) {
|
||||||
SbVec3f v(1.0f, 1.0f, 1.0f);
|
SbVec3f v(1.0f, 1.0f, 1.0f);
|
||||||
if (scale->scaleFactor.getValue() != v)
|
if (scale->scaleFactor.getValue() != v)
|
||||||
|
@ -130,17 +130,17 @@ SoAxisCrossKit::SoAxisCrossKit()
|
||||||
|
|
||||||
// Add the parts to the catalog...
|
// Add the parts to the catalog...
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(xAxis, SoShapeKit,
|
SO_KIT_ADD_CATALOG_ENTRY(xAxis, SoShapeKit,
|
||||||
TRUE, this,"", TRUE);
|
true, this,"", true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(xHead, SoShapeKit,
|
SO_KIT_ADD_CATALOG_ENTRY(xHead, SoShapeKit,
|
||||||
TRUE, this,"", TRUE);
|
true, this,"", true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(yAxis, SoShapeKit,
|
SO_KIT_ADD_CATALOG_ENTRY(yAxis, SoShapeKit,
|
||||||
TRUE, this,"", TRUE);
|
true, this,"", true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(yHead, SoShapeKit,
|
SO_KIT_ADD_CATALOG_ENTRY(yHead, SoShapeKit,
|
||||||
TRUE, this,"", TRUE);
|
true, this,"", true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(zAxis, SoShapeKit,
|
SO_KIT_ADD_CATALOG_ENTRY(zAxis, SoShapeKit,
|
||||||
TRUE, this,"", TRUE);
|
true, this,"", true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(zHead, SoShapeKit,
|
SO_KIT_ADD_CATALOG_ENTRY(zHead, SoShapeKit,
|
||||||
TRUE, this,"", TRUE);
|
true, this,"", true);
|
||||||
|
|
||||||
SO_KIT_INIT_INSTANCE();
|
SO_KIT_INIT_INSTANCE();
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ SoAxisCrossKit::~SoAxisCrossKit()
|
||||||
SbBool
|
SbBool
|
||||||
SoAxisCrossKit::affectsState() const
|
SoAxisCrossKit::affectsState() const
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoAxisCrossKit::addWriteReference(SoOutput * out, SbBool isfromfield)
|
void SoAxisCrossKit::addWriteReference(SoOutput * out, SbBool isfromfield)
|
||||||
|
@ -168,7 +168,7 @@ void SoAxisCrossKit::getBoundingBox(SoGetBoundingBoxAction * action)
|
||||||
{
|
{
|
||||||
inherited::getBoundingBox(action);
|
inherited::getBoundingBox(action);
|
||||||
action->resetCenter();
|
action->resetCenter();
|
||||||
action->setCenter(SbVec3f(0,0,0), FALSE);
|
action->setCenter(SbVec3f(0,0,0), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up parts for default configuration of the jumping jack
|
// Set up parts for default configuration of the jumping jack
|
||||||
|
@ -294,7 +294,7 @@ void SoRegPoint::GLRender(SoGLRenderAction *action)
|
||||||
SoState* state = action->getState();
|
SoState* state = action->getState();
|
||||||
state->push();
|
state->push();
|
||||||
SoMaterialBundle mb(action);
|
SoMaterialBundle mb(action);
|
||||||
SoTextureCoordinateBundle tb(action, TRUE, FALSE);
|
SoTextureCoordinateBundle tb(action, true, false);
|
||||||
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
||||||
mb.sendFirst(); // make sure we have the correct material
|
mb.sendFirst(); // make sure we have the correct material
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ public:
|
||||||
// Overrides default method. All the parts are shapeKits,
|
// Overrides default method. All the parts are shapeKits,
|
||||||
// so this node will not affect the state.
|
// so this node will not affect the state.
|
||||||
virtual SbBool affectsState() const;
|
virtual SbBool affectsState() const;
|
||||||
virtual void addWriteReference(SoOutput * out, SbBool isfromfield = FALSE);
|
virtual void addWriteReference(SoOutput * out, SbBool isfromfield = false);
|
||||||
virtual void getBoundingBox(SoGetBoundingBoxAction * action);
|
virtual void getBoundingBox(SoGetBoundingBoxAction * action);
|
||||||
|
|
||||||
static void initClass();
|
static void initClass();
|
||||||
|
|
|
@ -77,8 +77,8 @@ SoFCBoundingBox::SoFCBoundingBox ()
|
||||||
|
|
||||||
SO_NODE_ADD_FIELD(minBounds, (-1.0, -1.0, -1.0));
|
SO_NODE_ADD_FIELD(minBounds, (-1.0, -1.0, -1.0));
|
||||||
SO_NODE_ADD_FIELD(maxBounds, ( 1.0, 1.0, 1.0));
|
SO_NODE_ADD_FIELD(maxBounds, ( 1.0, 1.0, 1.0));
|
||||||
SO_NODE_ADD_FIELD(coordsOn, (TRUE));
|
SO_NODE_ADD_FIELD(coordsOn, (true));
|
||||||
SO_NODE_ADD_FIELD(dimensionsOn, (TRUE));
|
SO_NODE_ADD_FIELD(dimensionsOn, (true));
|
||||||
|
|
||||||
root = new SoSeparator();
|
root = new SoSeparator();
|
||||||
SoSeparator *bboxSep = new SoSeparator();
|
SoSeparator *bboxSep = new SoSeparator();
|
||||||
|
|
|
@ -61,7 +61,7 @@ using namespace Gui;
|
||||||
using namespace Gui::Inventor;
|
using namespace Gui::Inventor;
|
||||||
using namespace Gui::PropertyEditor;
|
using namespace Gui::PropertyEditor;
|
||||||
|
|
||||||
static SbBool init_done = FALSE;
|
static SbBool init_done = false;
|
||||||
|
|
||||||
SbBool Gui::SoFCDB::isInitialized(void)
|
SbBool Gui::SoFCDB::isInitialized(void)
|
||||||
{
|
{
|
||||||
|
@ -155,7 +155,7 @@ void Gui::SoFCDB::init()
|
||||||
qRegisterMetaType<Base::Vector3d>("Base::Vector3d");
|
qRegisterMetaType<Base::Vector3d>("Base::Vector3d");
|
||||||
qRegisterMetaType<Base::Quantity>("Base::Quantity");
|
qRegisterMetaType<Base::Quantity>("Base::Quantity");
|
||||||
qRegisterMetaType<QList<Base::Quantity> >("Base::QuantityList");
|
qRegisterMetaType<QList<Base::Quantity> >("Base::QuantityList");
|
||||||
init_done = TRUE;
|
init_done = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::SoFCDB::finish()
|
void Gui::SoFCDB::finish()
|
||||||
|
@ -230,7 +230,7 @@ bool Gui::SoFCDB::writeToVRML(SoNode* node, const char* filename, bool binary)
|
||||||
// We want to write compressed VRML but Coin 2.4.3 doesn't do it even though
|
// We want to write compressed VRML but Coin 2.4.3 doesn't do it even though
|
||||||
// SoOutput::getAvailableCompressionMethods() delivers a string list that
|
// SoOutput::getAvailableCompressionMethods() delivers a string list that
|
||||||
// contains 'GZIP'. setCompression() was called directly after opening the file,
|
// contains 'GZIP'. setCompression() was called directly after opening the file,
|
||||||
// returned TRUE and no error message appeared but anyway it didn't work.
|
// returned true and no error message appeared but anyway it didn't work.
|
||||||
// Strange is that reading GZIPped VRML files works.
|
// Strange is that reading GZIPped VRML files works.
|
||||||
// So, we do the compression on our own.
|
// So, we do the compression on our own.
|
||||||
Base::ofstream str(fi, std::ios::out | std::ios::binary);
|
Base::ofstream str(fi, std::ios::out | std::ios::binary);
|
||||||
|
|
|
@ -113,7 +113,7 @@ void SoGLWidgetElement::pop(SoState * state, const SoElement * prevTopElement)
|
||||||
|
|
||||||
SbBool SoGLWidgetElement::matches(const SoElement * element) const
|
SbBool SoGLWidgetElement::matches(const SoElement * element) const
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SoElement * SoGLWidgetElement::copyMatchInfo(void) const
|
SoElement * SoGLWidgetElement::copyMatchInfo(void) const
|
||||||
|
@ -168,7 +168,7 @@ void SoGLRenderActionElement::pop(SoState * state, const SoElement * prevTopElem
|
||||||
|
|
||||||
SbBool SoGLRenderActionElement::matches(const SoElement * element) const
|
SbBool SoGLRenderActionElement::matches(const SoElement * element) const
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SoElement * SoGLRenderActionElement::copyMatchInfo(void) const
|
SoElement * SoGLRenderActionElement::copyMatchInfo(void) const
|
||||||
|
|
|
@ -400,7 +400,7 @@ void SoQtOffscreenRenderer::init(const SbViewportRegion & vpr,
|
||||||
this->renderaction->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND);
|
this->renderaction->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->didallocation = glrenderaction ? FALSE : TRUE;
|
this->didallocation = glrenderaction ? false : true;
|
||||||
this->viewport = vpr;
|
this->viewport = vpr;
|
||||||
|
|
||||||
this->pixelbuffer = NULL; // constructed later
|
this->pixelbuffer = NULL; // constructed later
|
||||||
|
@ -492,7 +492,7 @@ SoQtOffscreenRenderer::setGLRenderAction(SoGLRenderAction * action)
|
||||||
|
|
||||||
if (PRIVATE(this)->didallocation) { delete PRIVATE(this)->renderaction; }
|
if (PRIVATE(this)->didallocation) { delete PRIVATE(this)->renderaction; }
|
||||||
PRIVATE(this)->renderaction = action;
|
PRIVATE(this)->renderaction = action;
|
||||||
PRIVATE(this)->didallocation = FALSE;
|
PRIVATE(this)->didallocation = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -534,7 +534,7 @@ void
|
||||||
SoQtOffscreenRenderer::pre_render_cb(void * userdata, SoGLRenderAction * action)
|
SoQtOffscreenRenderer::pre_render_cb(void * userdata, SoGLRenderAction * action)
|
||||||
{
|
{
|
||||||
glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
|
glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
|
||||||
action->setRenderingIsRemote(FALSE);
|
action->setRenderingIsRemote(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -632,7 +632,7 @@ SoQtOffscreenRenderer::renderFromBase(SoBase * base)
|
||||||
else if (base->isOfType(SoPath::getClassTypeId()))
|
else if (base->isOfType(SoPath::getClassTypeId()))
|
||||||
this->renderaction->apply((SoPath *)base);
|
this->renderaction->apply((SoPath *)base);
|
||||||
else {
|
else {
|
||||||
assert(FALSE && "Cannot apply to anything else than an SoNode or an SoPath");
|
assert(false && "Cannot apply to anything else than an SoNode or an SoPath");
|
||||||
}
|
}
|
||||||
|
|
||||||
this->renderaction->removePreRenderCallback(pre_render_cb, NULL);
|
this->renderaction->removePreRenderCallback(pre_render_cb, NULL);
|
||||||
|
@ -646,7 +646,7 @@ SoQtOffscreenRenderer::renderFromBase(SoBase * base)
|
||||||
|
|
||||||
this->renderaction->setCacheContext(oldcontext); // restore old
|
this->renderaction->setCacheContext(oldcontext); // restore old
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -107,9 +107,9 @@ SoFCSelection::SoFCSelection()
|
||||||
SO_NODE_DEFINE_ENUM_VALUE(Selected, SELECTED);
|
SO_NODE_DEFINE_ENUM_VALUE(Selected, SELECTED);
|
||||||
SO_NODE_SET_SF_ENUM_TYPE(selected, Selected);
|
SO_NODE_SET_SF_ENUM_TYPE(selected, Selected);
|
||||||
|
|
||||||
highlighted = FALSE;
|
highlighted = false;
|
||||||
bShift = FALSE;
|
bShift = false;
|
||||||
bCtrl = FALSE;
|
bCtrl = false;
|
||||||
|
|
||||||
selected = NOTSELECTED;
|
selected = NOTSELECTED;
|
||||||
}
|
}
|
||||||
|
@ -332,9 +332,9 @@ SoFCSelection::handleEvent(SoHandleEventAction * action)
|
||||||
SoFCSelection::turnoffcurrent(action);
|
SoFCSelection::turnoffcurrent(action);
|
||||||
SoFCSelection::currenthighlight = (SoFullPath*)action->getCurPath()->copy();
|
SoFCSelection::currenthighlight = (SoFullPath*)action->getCurPath()->copy();
|
||||||
SoFCSelection::currenthighlight->ref();
|
SoFCSelection::currenthighlight->ref();
|
||||||
highlighted = TRUE;
|
highlighted = true;
|
||||||
this->touch(); // force scene redraw
|
this->touch(); // force scene redraw
|
||||||
this->redrawHighlighted(action, TRUE);
|
this->redrawHighlighted(action, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,7 +353,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action)
|
||||||
SoFCSelection::turnoffcurrent(action);
|
SoFCSelection::turnoffcurrent(action);
|
||||||
//FIXME: I think we should set 'highlighted' to false whenever no point is picked
|
//FIXME: I think we should set 'highlighted' to false whenever no point is picked
|
||||||
//else
|
//else
|
||||||
highlighted = FALSE;
|
highlighted = false;
|
||||||
Gui::Selection().rmvPreselect();
|
Gui::Selection().rmvPreselect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -465,17 +465,17 @@ SoFCSelection::handleEvent(SoHandleEventAction * action)
|
||||||
//
|
//
|
||||||
if (event->isOfType(SoLocation2Event::getClassTypeId())) {
|
if (event->isOfType(SoLocation2Event::getClassTypeId())) {
|
||||||
// check to see if the mouse is over our geometry...
|
// check to see if the mouse is over our geometry...
|
||||||
SbBool underTheMouse = FALSE;
|
SbBool underTheMouse = false;
|
||||||
const SoPickedPoint * pp = this->getPickedPoint(action);
|
const SoPickedPoint * pp = this->getPickedPoint(action);
|
||||||
SoFullPath *pPath = (pp != NULL) ? (SoFullPath *) pp->getPath() : NULL;
|
SoFullPath *pPath = (pp != NULL) ? (SoFullPath *) pp->getPath() : NULL;
|
||||||
if (pPath && pPath->containsPath(action->getCurPath())) {
|
if (pPath && pPath->containsPath(action->getCurPath())) {
|
||||||
// Make sure I'm the lowest LocHL in the pick path!
|
// Make sure I'm the lowest LocHL in the pick path!
|
||||||
underTheMouse = TRUE;
|
underTheMouse = true;
|
||||||
for (int i = 0; i < pPath->getLength(); i++) {
|
for (int i = 0; i < pPath->getLength(); i++) {
|
||||||
SoNode *node = pPath->getNodeFromTail(i);
|
SoNode *node = pPath->getNodeFromTail(i);
|
||||||
if (node->isOfType(SoFCSelection::getClassTypeId())) {
|
if (node->isOfType(SoFCSelection::getClassTypeId())) {
|
||||||
if (node != this)
|
if (node != this)
|
||||||
underTheMouse = FALSE;
|
underTheMouse = false;
|
||||||
break; // found the lowest LocHL - look no further
|
break; // found the lowest LocHL - look no further
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action)
|
||||||
if (! underTheMouse) {
|
if (! underTheMouse) {
|
||||||
// re-draw the object with it's normal color
|
// re-draw the object with it's normal color
|
||||||
//if(mymode != OFF)
|
//if(mymode != OFF)
|
||||||
redrawHighlighted(action, FALSE);
|
redrawHighlighted(action, false);
|
||||||
Gui::Selection().rmvPreselect();
|
Gui::Selection().rmvPreselect();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -502,7 +502,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action)
|
||||||
if (underTheMouse) {
|
if (underTheMouse) {
|
||||||
// draw this object highlighted
|
// draw this object highlighted
|
||||||
if (mymode != OFF)
|
if (mymode != OFF)
|
||||||
redrawHighlighted(action, TRUE);
|
redrawHighlighted(action, true);
|
||||||
//const SoPickedPoint * pp = action->getPickedPoint();
|
//const SoPickedPoint * pp = action->getPickedPoint();
|
||||||
Gui::Selection().setPreselect(documentName.getValue().getString()
|
Gui::Selection().setPreselect(documentName.getValue().getString()
|
||||||
,objectName.getValue().getString()
|
,objectName.getValue().getString()
|
||||||
|
@ -513,10 +513,10 @@ SoFCSelection::handleEvent(SoHandleEventAction * action)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if(selected == SELECTED){
|
//if(selected == SELECTED){
|
||||||
// redrawHighlighted(action, TRUE);
|
// redrawHighlighted(action, true);
|
||||||
//}
|
//}
|
||||||
//if(selectionCleared ){
|
//if(selectionCleared ){
|
||||||
// redrawHighlighted(action, FALSE);
|
// redrawHighlighted(action, false);
|
||||||
// selectionCleared = false;
|
// selectionCleared = false;
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
@ -696,7 +696,7 @@ SoFCSelection::preRender(SoGLRenderAction *action, GLint &oldDepthFunc)
|
||||||
{
|
{
|
||||||
// If not performing locate highlighting, just return.
|
// If not performing locate highlighting, just return.
|
||||||
if (highlightMode.getValue() == OFF)
|
if (highlightMode.getValue() == OFF)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
SoState *state = action->getState();
|
SoState *state = action->getState();
|
||||||
|
|
||||||
|
@ -718,12 +718,12 @@ SoFCSelection::preRender(SoGLRenderAction *action, GLint &oldDepthFunc)
|
||||||
|
|
||||||
// Emissive Color
|
// Emissive Color
|
||||||
SoLazyElement::setEmissive(state, &col);
|
SoLazyElement::setEmissive(state, &col);
|
||||||
SoOverrideElement::setEmissiveColorOverride(state, this, TRUE);
|
SoOverrideElement::setEmissiveColorOverride(state, this, true);
|
||||||
|
|
||||||
// Diffuse Color
|
// Diffuse Color
|
||||||
if (style.getValue() == EMISSIVE_DIFFUSE) {
|
if (style.getValue() == EMISSIVE_DIFFUSE) {
|
||||||
SoLazyElement::setDiffuse(state, this, 1, &col, &colorpacker);
|
SoLazyElement::setDiffuse(state, this, 1, &col, &colorpacker);
|
||||||
SoOverrideElement::setDiffuseColorOverride(state, this, TRUE);
|
SoOverrideElement::setDiffuseColorOverride(state, this, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -759,7 +759,7 @@ SoFCSelection::redrawHighlighted(SoAction * action , SbBool doHighlight )
|
||||||
|
|
||||||
SoNode *tail = currenthighlight->getTail();
|
SoNode *tail = currenthighlight->getTail();
|
||||||
if (tail->isOfType( SoFCSelection::getClassTypeId()))
|
if (tail->isOfType( SoFCSelection::getClassTypeId()))
|
||||||
((SoFCSelection *)tail)->redrawHighlighted(action, FALSE);
|
((SoFCSelection *)tail)->redrawHighlighted(action, false);
|
||||||
else {
|
else {
|
||||||
// Just get rid of the path. It's no longer valid for redraw.
|
// Just get rid of the path. It's no longer valid for redraw.
|
||||||
currenthighlight->unref();
|
currenthighlight->unref();
|
||||||
|
@ -823,9 +823,9 @@ SoFCSelection::redrawHighlighted(SoAction * action , SbBool doHighlight )
|
||||||
if (whichBuffer != GL_FRONT)
|
if (whichBuffer != GL_FRONT)
|
||||||
glDrawBuffer(GL_FRONT);
|
glDrawBuffer(GL_FRONT);
|
||||||
|
|
||||||
highlighted = TRUE;
|
highlighted = true;
|
||||||
glAction->apply(pathToRender);
|
glAction->apply(pathToRender);
|
||||||
highlighted = FALSE;
|
highlighted = false;
|
||||||
|
|
||||||
// restore the buffering type
|
// restore the buffering type
|
||||||
if (whichBuffer != GL_FRONT)
|
if (whichBuffer != GL_FRONT)
|
||||||
|
@ -855,7 +855,7 @@ SoFCSelection::setOverride(SoGLRenderAction * action)
|
||||||
SoLazyElement::setEmissive(state, &this->colorSelection.getValue());
|
SoLazyElement::setEmissive(state, &this->colorSelection.getValue());
|
||||||
else
|
else
|
||||||
SoLazyElement::setEmissive(state, &this->colorHighlight.getValue());
|
SoLazyElement::setEmissive(state, &this->colorHighlight.getValue());
|
||||||
SoOverrideElement::setEmissiveColorOverride(state, this, TRUE);
|
SoOverrideElement::setEmissiveColorOverride(state, this, true);
|
||||||
|
|
||||||
Styles mystyle = (Styles) this->style.getValue();
|
Styles mystyle = (Styles) this->style.getValue();
|
||||||
if (mystyle == SoFCSelection::EMISSIVE_DIFFUSE) {
|
if (mystyle == SoFCSelection::EMISSIVE_DIFFUSE) {
|
||||||
|
@ -863,7 +863,7 @@ SoFCSelection::setOverride(SoGLRenderAction * action)
|
||||||
SoLazyElement::setDiffuse(state, this,1, &this->colorSelection.getValue(),&colorpacker);
|
SoLazyElement::setDiffuse(state, this,1, &this->colorSelection.getValue(),&colorpacker);
|
||||||
else
|
else
|
||||||
SoLazyElement::setDiffuse(state, this,1, &this->colorHighlight.getValue(),&colorpacker);
|
SoLazyElement::setDiffuse(state, this,1, &this->colorHighlight.getValue(),&colorpacker);
|
||||||
SoOverrideElement::setDiffuseColorOverride(state, this, TRUE);
|
SoOverrideElement::setDiffuseColorOverride(state, this, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -876,9 +876,9 @@ SoFCSelection::turnoffcurrent(SoAction * action)
|
||||||
SoFCSelection::currenthighlight->getLength()) {
|
SoFCSelection::currenthighlight->getLength()) {
|
||||||
SoNode * tail = SoFCSelection::currenthighlight->getTail();
|
SoNode * tail = SoFCSelection::currenthighlight->getTail();
|
||||||
if (tail->isOfType(SoFCSelection::getClassTypeId())) {
|
if (tail->isOfType(SoFCSelection::getClassTypeId())) {
|
||||||
((SoFCSelection*)tail)->highlighted = FALSE;
|
((SoFCSelection*)tail)->highlighted = false;
|
||||||
((SoFCSelection*)tail)->touch(); // force scene redraw
|
((SoFCSelection*)tail)->touch(); // force scene redraw
|
||||||
if (action) ((SoFCSelection*)tail)->redrawHighlighted(action, FALSE);
|
if (action) ((SoFCSelection*)tail)->redrawHighlighted(action, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (SoFCSelection::currenthighlight) {
|
if (SoFCSelection::currenthighlight) {
|
||||||
|
@ -896,7 +896,7 @@ SoFCSelection::turnoffcurrent(SoAction * action)
|
||||||
// (processing events during render abort might cause this)
|
// (processing events during render abort might cause this)
|
||||||
SoState *state = action->getState();
|
SoState *state = action->getState();
|
||||||
if (state && state->getDepth() == 1)
|
if (state && state->getDepth() == 1)
|
||||||
((SoFCSelection *)tail)->redrawHighlighted(action, FALSE);
|
((SoFCSelection *)tail)->redrawHighlighted(action, false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Just get rid of the path. It's no longer valid for redraw.
|
// Just get rid of the path. It's no longer valid for redraw.
|
||||||
|
|
|
@ -645,7 +645,7 @@ void SoFCDocumentObjectAction::finish()
|
||||||
atexit_cleanup();
|
atexit_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
SoFCDocumentObjectAction::SoFCDocumentObjectAction () : _handled(FALSE)
|
SoFCDocumentObjectAction::SoFCDocumentObjectAction () : _handled(false)
|
||||||
{
|
{
|
||||||
SO_ACTION_CONSTRUCTOR(SoFCDocumentObjectAction);
|
SO_ACTION_CONSTRUCTOR(SoFCDocumentObjectAction);
|
||||||
}
|
}
|
||||||
|
@ -666,7 +666,7 @@ void SoFCDocumentObjectAction::callDoAction(SoAction *action,SoNode *node)
|
||||||
|
|
||||||
void SoFCDocumentObjectAction::setHandled()
|
void SoFCDocumentObjectAction::setHandled()
|
||||||
{
|
{
|
||||||
this->_handled = TRUE;
|
this->_handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SbBool SoFCDocumentObjectAction::isHandled() const
|
SbBool SoFCDocumentObjectAction::isHandled() const
|
||||||
|
@ -715,7 +715,7 @@ void SoGLSelectAction::initClass()
|
||||||
|
|
||||||
SoGLSelectAction::SoGLSelectAction (const SbViewportRegion& region,
|
SoGLSelectAction::SoGLSelectAction (const SbViewportRegion& region,
|
||||||
const SbViewportRegion& select)
|
const SbViewportRegion& select)
|
||||||
: vpregion(region), vpselect(select), _handled(FALSE)
|
: vpregion(region), vpselect(select), _handled(false)
|
||||||
{
|
{
|
||||||
SO_ACTION_CONSTRUCTOR(SoGLSelectAction);
|
SO_ACTION_CONSTRUCTOR(SoGLSelectAction);
|
||||||
}
|
}
|
||||||
|
@ -742,7 +742,7 @@ void SoGLSelectAction::callDoAction(SoAction *action,SoNode *node)
|
||||||
|
|
||||||
void SoGLSelectAction::setHandled()
|
void SoGLSelectAction::setHandled()
|
||||||
{
|
{
|
||||||
this->_handled = TRUE;
|
this->_handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SbBool SoGLSelectAction::isHandled() const
|
SbBool SoGLSelectAction::isHandled() const
|
||||||
|
@ -790,7 +790,7 @@ void SoVisibleFaceAction::initClass()
|
||||||
SO_ACTION_ADD_METHOD(SoFCSelection,callDoAction);
|
SO_ACTION_ADD_METHOD(SoFCSelection,callDoAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
SoVisibleFaceAction::SoVisibleFaceAction () : _handled(FALSE)
|
SoVisibleFaceAction::SoVisibleFaceAction () : _handled(false)
|
||||||
{
|
{
|
||||||
SO_ACTION_CONSTRUCTOR(SoVisibleFaceAction);
|
SO_ACTION_CONSTRUCTOR(SoVisibleFaceAction);
|
||||||
}
|
}
|
||||||
|
@ -811,7 +811,7 @@ void SoVisibleFaceAction::callDoAction(SoAction *action,SoNode *node)
|
||||||
|
|
||||||
void SoVisibleFaceAction::setHandled()
|
void SoVisibleFaceAction::setHandled()
|
||||||
{
|
{
|
||||||
this->_handled = TRUE;
|
this->_handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SbBool SoVisibleFaceAction::isHandled() const
|
SbBool SoVisibleFaceAction::isHandled() const
|
||||||
|
@ -976,7 +976,7 @@ SoBoxSelectionRenderAction::constructorCommon(void)
|
||||||
// Initialize local variables
|
// Initialize local variables
|
||||||
PRIVATE(this)->initBoxGraph();
|
PRIVATE(this)->initBoxGraph();
|
||||||
|
|
||||||
this->hlVisible = TRUE;
|
this->hlVisible = true;
|
||||||
|
|
||||||
PRIVATE(this)->basecolor->rgb.setValue(1.0f, 0.0f, 0.0f);
|
PRIVATE(this)->basecolor->rgb.setValue(1.0f, 0.0f, 0.0f);
|
||||||
PRIVATE(this)->drawstyle->linePattern = 0xffff;
|
PRIVATE(this)->drawstyle->linePattern = 0xffff;
|
||||||
|
|
|
@ -300,7 +300,7 @@ public:
|
||||||
|
|
||||||
virtual void apply(SoNode * node);
|
virtual void apply(SoNode * node);
|
||||||
virtual void apply(SoPath * path);
|
virtual void apply(SoPath * path);
|
||||||
virtual void apply(const SoPathList & pathlist, SbBool obeysrules = FALSE);
|
virtual void apply(const SoPathList & pathlist, SbBool obeysrules = false);
|
||||||
void setVisible(SbBool b) { hlVisible = b; }
|
void setVisible(SbBool b) { hlVisible = b; }
|
||||||
SbBool isVisible() const { return hlVisible; }
|
SbBool isVisible() const { return hlVisible; }
|
||||||
void setColor(const SbColor & color);
|
void setColor(const SbColor & color);
|
||||||
|
|
|
@ -100,14 +100,14 @@ SoFCUnifiedSelection::SoFCUnifiedSelection() : pcDocument(0)
|
||||||
SO_NODE_ADD_FIELD(colorSelection, (SbColor(0.1f, 0.8f, 0.1f)));
|
SO_NODE_ADD_FIELD(colorSelection, (SbColor(0.1f, 0.8f, 0.1f)));
|
||||||
SO_NODE_ADD_FIELD(highlightMode, (AUTO));
|
SO_NODE_ADD_FIELD(highlightMode, (AUTO));
|
||||||
SO_NODE_ADD_FIELD(selectionMode, (ON));
|
SO_NODE_ADD_FIELD(selectionMode, (ON));
|
||||||
SO_NODE_ADD_FIELD(selectionRole, (TRUE));
|
SO_NODE_ADD_FIELD(selectionRole, (true));
|
||||||
|
|
||||||
SO_NODE_DEFINE_ENUM_VALUE(HighlightModes, AUTO);
|
SO_NODE_DEFINE_ENUM_VALUE(HighlightModes, AUTO);
|
||||||
SO_NODE_DEFINE_ENUM_VALUE(HighlightModes, ON);
|
SO_NODE_DEFINE_ENUM_VALUE(HighlightModes, ON);
|
||||||
SO_NODE_DEFINE_ENUM_VALUE(HighlightModes, OFF);
|
SO_NODE_DEFINE_ENUM_VALUE(HighlightModes, OFF);
|
||||||
SO_NODE_SET_SF_ENUM_TYPE (highlightMode, HighlightModes);
|
SO_NODE_SET_SF_ENUM_TYPE (highlightMode, HighlightModes);
|
||||||
|
|
||||||
highlighted = FALSE;
|
highlighted = false;
|
||||||
preSelection = -1;
|
preSelection = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ void SoFCUnifiedSelection::write(SoWriteAction * action)
|
||||||
SoOutput * out = action->getOutput();
|
SoOutput * out = action->getOutput();
|
||||||
if (out->getStage() == SoOutput::WRITE) {
|
if (out->getStage() == SoOutput::WRITE) {
|
||||||
// Do not write out the fields of this class
|
// Do not write out the fields of this class
|
||||||
if (this->writeHeader(out, TRUE, FALSE)) return;
|
if (this->writeHeader(out, true, false)) return;
|
||||||
SoGroup::doAction((SoAction *)action);
|
SoGroup::doAction((SoAction *)action);
|
||||||
this->writeFooter(out);
|
this->writeFooter(out);
|
||||||
}
|
}
|
||||||
|
@ -358,7 +358,7 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action)
|
||||||
vpd = static_cast<ViewProviderDocumentObject*>(vp);
|
vpd = static_cast<ViewProviderDocumentObject*>(vp);
|
||||||
|
|
||||||
//SbBool old_state = highlighted;
|
//SbBool old_state = highlighted;
|
||||||
highlighted = FALSE;
|
highlighted = false;
|
||||||
if (vpd && vpd->useNewSelectionModel() && vpd->isSelectable()) {
|
if (vpd && vpd->useNewSelectionModel() && vpd->isSelectable()) {
|
||||||
std::string documentName = vpd->getObject()->getDocument()->getName();
|
std::string documentName = vpd->getObject()->getDocument()->getName();
|
||||||
std::string objectName = vpd->getObject()->getNameInDocument();
|
std::string objectName = vpd->getObject()->getNameInDocument();
|
||||||
|
@ -386,10 +386,10 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action)
|
||||||
sa.setNode(vp->getRoot());
|
sa.setNode(vp->getRoot());
|
||||||
sa.apply(vp->getRoot());
|
sa.apply(vp->getRoot());
|
||||||
if (sa.getPath()) {
|
if (sa.getPath()) {
|
||||||
highlighted = TRUE;
|
highlighted = true;
|
||||||
if (currenthighlight && currenthighlight->getTail() != sa.getPath()->getTail()) {
|
if (currenthighlight && currenthighlight->getTail() != sa.getPath()->getTail()) {
|
||||||
SoHighlightElementAction action;
|
SoHighlightElementAction action;
|
||||||
action.setHighlighted(FALSE);
|
action.setHighlighted(false);
|
||||||
action.apply(currenthighlight);
|
action.apply(currenthighlight);
|
||||||
currenthighlight->unref();
|
currenthighlight->unref();
|
||||||
currenthighlight = 0;
|
currenthighlight = 0;
|
||||||
|
@ -570,7 +570,7 @@ void SoHighlightElementAction::initClass()
|
||||||
SO_ACTION_ADD_METHOD(SoPointSet,callDoAction);
|
SO_ACTION_ADD_METHOD(SoPointSet,callDoAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
SoHighlightElementAction::SoHighlightElementAction () : _highlight(FALSE), _det(0)
|
SoHighlightElementAction::SoHighlightElementAction () : _highlight(false), _det(0)
|
||||||
{
|
{
|
||||||
SO_ACTION_CONSTRUCTOR(SoHighlightElementAction);
|
SO_ACTION_CONSTRUCTOR(SoHighlightElementAction);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,30 +61,30 @@ RotTransDragger::RotTransDragger()
|
||||||
|
|
||||||
// Don't create "surroundScale" by default. It's only put
|
// Don't create "surroundScale" by default. It's only put
|
||||||
// to use if this dragger is used within a manipulator.
|
// to use if this dragger is used within a manipulator.
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(surroundScale, SoSurroundScale, TRUE,
|
SO_KIT_ADD_CATALOG_ENTRY(surroundScale, SoSurroundScale, true,
|
||||||
topSeparator, geomSeparator, TRUE);
|
topSeparator, geomSeparator, true);
|
||||||
// Create an anti-squish node by default.
|
// Create an anti-squish node by default.
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(antiSquish, SoAntiSquish, FALSE,
|
SO_KIT_ADD_CATALOG_ENTRY(antiSquish, SoAntiSquish, false,
|
||||||
topSeparator, geomSeparator, TRUE);
|
topSeparator, geomSeparator, true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(translator, SoTranslate1Dragger,
|
SO_KIT_ADD_CATALOG_ENTRY(translator, SoTranslate1Dragger,
|
||||||
TRUE, topSeparator, geomSeparator,
|
true, topSeparator, geomSeparator,
|
||||||
TRUE);
|
true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(XRotatorSep, SoSeparator, FALSE,
|
SO_KIT_ADD_CATALOG_ENTRY(XRotatorSep, SoSeparator, false,
|
||||||
topSeparator, geomSeparator, FALSE);
|
topSeparator, geomSeparator, false);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(XRotatorRot, SoRotation, TRUE,
|
SO_KIT_ADD_CATALOG_ENTRY(XRotatorRot, SoRotation, true,
|
||||||
XRotatorSep,0 , FALSE);
|
XRotatorSep,0 , false);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(XRotator,SoRotateCylindricalDragger,
|
SO_KIT_ADD_CATALOG_ENTRY(XRotator,SoRotateCylindricalDragger,
|
||||||
TRUE, XRotatorSep, 0,TRUE);
|
true, XRotatorSep, 0,true);
|
||||||
|
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(YRotator, SoRotateCylindricalDragger,
|
SO_KIT_ADD_CATALOG_ENTRY(YRotator, SoRotateCylindricalDragger,
|
||||||
TRUE, topSeparator, geomSeparator, TRUE);
|
true, topSeparator, geomSeparator, true);
|
||||||
|
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(ZRotatorSep, SoSeparator, FALSE,
|
SO_KIT_ADD_CATALOG_ENTRY(ZRotatorSep, SoSeparator, false,
|
||||||
topSeparator, geomSeparator, FALSE);
|
topSeparator, geomSeparator, false);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(ZRotatorRot, SoRotation, TRUE,
|
SO_KIT_ADD_CATALOG_ENTRY(ZRotatorRot, SoRotation, true,
|
||||||
ZRotatorSep,0 ,FALSE);
|
ZRotatorSep,0 ,false);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(ZRotator, SoRotateCylindricalDragger,
|
SO_KIT_ADD_CATALOG_ENTRY(ZRotator, SoRotateCylindricalDragger,
|
||||||
TRUE, ZRotatorSep, 0,TRUE);
|
true, ZRotatorSep, 0,true);
|
||||||
|
|
||||||
// Read geometry resources. Only do this the first time we
|
// Read geometry resources. Only do this the first time we
|
||||||
// construct one. 'geomBuffer' contains our compiled in
|
// construct one. 'geomBuffer' contains our compiled in
|
||||||
|
@ -165,7 +165,7 @@ RotTransDragger::RotTransDragger()
|
||||||
&RotTransDragger::fieldSensorCB,this);
|
&RotTransDragger::fieldSensorCB,this);
|
||||||
translFieldSensor->setPriority(0);
|
translFieldSensor->setPriority(0);
|
||||||
|
|
||||||
setUpConnections(TRUE, TRUE);
|
setUpConnections(true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
RotTransDragger::~RotTransDragger()
|
RotTransDragger::~RotTransDragger()
|
||||||
|
@ -201,7 +201,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways)
|
||||||
// will be transferred into motion of the entire
|
// will be transferred into motion of the entire
|
||||||
// dragger.
|
// dragger.
|
||||||
SoDragger *tD =
|
SoDragger *tD =
|
||||||
(SoDragger *) getAnyPart("translator", FALSE);
|
(SoDragger *) getAnyPart("translator", false);
|
||||||
// [a] Set up the parts in the child dragger...
|
// [a] Set up the parts in the child dragger...
|
||||||
tD->setPartAsDefault("translator",
|
tD->setPartAsDefault("translator",
|
||||||
"rotTransTranslatorTranslator");
|
"rotTransTranslatorTranslator");
|
||||||
|
@ -219,7 +219,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways)
|
||||||
registerChildDragger(tD);
|
registerChildDragger(tD);
|
||||||
|
|
||||||
SoDragger *XD =
|
SoDragger *XD =
|
||||||
(SoDragger *) getAnyPart("XRotator", FALSE);
|
(SoDragger *) getAnyPart("XRotator", false);
|
||||||
// [a] Set up the parts in the child dragger...
|
// [a] Set up the parts in the child dragger...
|
||||||
XD->setPartAsDefault("rotator",
|
XD->setPartAsDefault("rotator",
|
||||||
"rotTransRotatorRotator");
|
"rotTransRotatorRotator");
|
||||||
|
@ -237,7 +237,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways)
|
||||||
registerChildDragger(XD);
|
registerChildDragger(XD);
|
||||||
|
|
||||||
SoDragger *YD =
|
SoDragger *YD =
|
||||||
(SoDragger *) getAnyPart("YRotator", FALSE);
|
(SoDragger *) getAnyPart("YRotator", false);
|
||||||
// [a] Set up the parts in the child dragger...
|
// [a] Set up the parts in the child dragger...
|
||||||
YD->setPartAsDefault("rotator",
|
YD->setPartAsDefault("rotator",
|
||||||
"rotTransRotatorRotator");
|
"rotTransRotatorRotator");
|
||||||
|
@ -255,7 +255,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways)
|
||||||
registerChildDragger(YD);
|
registerChildDragger(YD);
|
||||||
|
|
||||||
SoDragger *ZD =
|
SoDragger *ZD =
|
||||||
(SoDragger *) getAnyPart("ZRotator", FALSE);
|
(SoDragger *) getAnyPart("ZRotator", false);
|
||||||
// [a] Set up the parts in the child dragger...
|
// [a] Set up the parts in the child dragger...
|
||||||
ZD->setPartAsDefault("rotator",
|
ZD->setPartAsDefault("rotator",
|
||||||
"rotTransRotatorRotator");
|
"rotTransRotatorRotator");
|
||||||
|
@ -288,7 +288,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways)
|
||||||
// Remove the callbacks from the child draggers,
|
// Remove the callbacks from the child draggers,
|
||||||
// and unregister them as children.
|
// and unregister them as children.
|
||||||
SoDragger *tD =
|
SoDragger *tD =
|
||||||
(SoDragger *) getAnyPart("translator", FALSE);
|
(SoDragger *) getAnyPart("translator", false);
|
||||||
tD->removeStartCallback(
|
tD->removeStartCallback(
|
||||||
&RotTransDragger::invalidateSurroundScaleCB, this);
|
&RotTransDragger::invalidateSurroundScaleCB, this);
|
||||||
tD->removeFinishCallback(
|
tD->removeFinishCallback(
|
||||||
|
@ -296,7 +296,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways)
|
||||||
unregisterChildDragger(tD);
|
unregisterChildDragger(tD);
|
||||||
|
|
||||||
SoDragger *XD =
|
SoDragger *XD =
|
||||||
(SoDragger *) getAnyPart("XRotator", FALSE);
|
(SoDragger *) getAnyPart("XRotator", false);
|
||||||
XD->removeStartCallback(
|
XD->removeStartCallback(
|
||||||
&RotTransDragger::invalidateSurroundScaleCB, this);
|
&RotTransDragger::invalidateSurroundScaleCB, this);
|
||||||
XD->removeFinishCallback(
|
XD->removeFinishCallback(
|
||||||
|
@ -304,7 +304,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways)
|
||||||
unregisterChildDragger(XD);
|
unregisterChildDragger(XD);
|
||||||
|
|
||||||
SoDragger *YD =
|
SoDragger *YD =
|
||||||
(SoDragger *) getAnyPart("YRotator", FALSE);
|
(SoDragger *) getAnyPart("YRotator", false);
|
||||||
YD->removeStartCallback(
|
YD->removeStartCallback(
|
||||||
&RotTransDragger::invalidateSurroundScaleCB, this);
|
&RotTransDragger::invalidateSurroundScaleCB, this);
|
||||||
YD->removeFinishCallback(
|
YD->removeFinishCallback(
|
||||||
|
@ -312,7 +312,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways)
|
||||||
unregisterChildDragger(YD);
|
unregisterChildDragger(YD);
|
||||||
|
|
||||||
SoDragger *ZD =
|
SoDragger *ZD =
|
||||||
(SoDragger *) getAnyPart("ZRotator", FALSE);
|
(SoDragger *) getAnyPart("ZRotator", false);
|
||||||
ZD->removeStartCallback(
|
ZD->removeStartCallback(
|
||||||
&RotTransDragger::invalidateSurroundScaleCB, this);
|
&RotTransDragger::invalidateSurroundScaleCB, this);
|
||||||
ZD->removeFinishCallback(
|
ZD->removeFinishCallback(
|
||||||
|
@ -389,8 +389,8 @@ RotTransDragger::setDefaultOnNonWritingFields()
|
||||||
// The nodes pointed to by these part-fields may
|
// The nodes pointed to by these part-fields may
|
||||||
// change after construction, but we
|
// change after construction, but we
|
||||||
// don't want to write them out.
|
// don't want to write them out.
|
||||||
surroundScale.setDefault(TRUE);
|
surroundScale.setDefault(true);
|
||||||
antiSquish.setDefault(TRUE);
|
antiSquish.setDefault(true);
|
||||||
|
|
||||||
SoDragger::setDefaultOnNonWritingFields();
|
SoDragger::setDefaultOnNonWritingFields();
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ class RotTransDragger : public SoDragger
|
||||||
// and on the new copy at the start/end of SoBaseKit::copy()
|
// and on the new copy at the start/end of SoBaseKit::copy()
|
||||||
// Returns the state of the node when this was called.
|
// Returns the state of the node when this was called.
|
||||||
virtual SbBool setUpConnections( SbBool onOff,
|
virtual SbBool setUpConnections( SbBool onOff,
|
||||||
SbBool doItAlways = FALSE);
|
SbBool doItAlways = false);
|
||||||
|
|
||||||
// This allows us to specify that certain parts do not
|
// This allows us to specify that certain parts do not
|
||||||
// write out. We'll use this on the antiSquish and
|
// write out. We'll use this on the antiSquish and
|
||||||
|
|
|
@ -105,7 +105,7 @@ SoTextLabel::SoTextLabel()
|
||||||
{
|
{
|
||||||
SO_NODE_CONSTRUCTOR(SoTextLabel);
|
SO_NODE_CONSTRUCTOR(SoTextLabel);
|
||||||
SO_NODE_ADD_FIELD(backgroundColor, (SbVec3f(1.0f,1.0f,1.0f)));
|
SO_NODE_ADD_FIELD(backgroundColor, (SbVec3f(1.0f,1.0f,1.0f)));
|
||||||
SO_NODE_ADD_FIELD(background, (TRUE));
|
SO_NODE_ADD_FIELD(background, (true));
|
||||||
SO_NODE_ADD_FIELD(frameSize, (10.0f));
|
SO_NODE_ADD_FIELD(frameSize, (10.0f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ void SoTextLabel::GLRender(SoGLRenderAction *action)
|
||||||
SbVec3f center;
|
SbVec3f center;
|
||||||
this->computeBBox(action, box, center);
|
this->computeBBox(action, box, center);
|
||||||
|
|
||||||
if (!SoCullElement::cullTest(state, box, TRUE)) {
|
if (!SoCullElement::cullTest(state, box, true)) {
|
||||||
SoMaterialBundle mb(action);
|
SoMaterialBundle mb(action);
|
||||||
mb.sendFirst();
|
mb.sendFirst();
|
||||||
const SbMatrix & mat = SoModelMatrixElement::get(state);
|
const SbMatrix & mat = SoModelMatrixElement::get(state);
|
||||||
|
@ -254,11 +254,11 @@ void SoTextLabel::GLRender(SoGLRenderAction *action)
|
||||||
state->push();
|
state->push();
|
||||||
|
|
||||||
// disable textures for all units
|
// disable textures for all units
|
||||||
SoGLTextureEnabledElement::set(state, this, FALSE);
|
SoGLTextureEnabledElement::set(state, this, false);
|
||||||
#if COIN_MAJOR_VERSION > 3
|
#if COIN_MAJOR_VERSION > 3
|
||||||
SoMultiTextureEnabledElement::set(state, this, FALSE);
|
SoMultiTextureEnabledElement::set(state, this, false);
|
||||||
#else
|
#else
|
||||||
SoGLTexture3EnabledElement::set(state, this, FALSE);
|
SoGLTexture3EnabledElement::set(state, this, false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
glPushAttrib(GL_ENABLE_BIT | GL_PIXEL_MODE_BIT | GL_COLOR_BUFFER_BIT);
|
glPushAttrib(GL_ENABLE_BIT | GL_PIXEL_MODE_BIT | GL_COLOR_BUFFER_BIT);
|
||||||
|
@ -406,7 +406,7 @@ SoFrameLabel::SoFrameLabel()
|
||||||
SO_NODE_ADD_FIELD(justification, (LEFT));
|
SO_NODE_ADD_FIELD(justification, (LEFT));
|
||||||
SO_NODE_ADD_FIELD(name, ("Helvetica"));
|
SO_NODE_ADD_FIELD(name, ("Helvetica"));
|
||||||
SO_NODE_ADD_FIELD(size, (12));
|
SO_NODE_ADD_FIELD(size, (12));
|
||||||
SO_NODE_ADD_FIELD(frame, (TRUE));
|
SO_NODE_ADD_FIELD(frame, (true));
|
||||||
//SO_NODE_ADD_FIELD(image, (SbVec2s(0,0), 0, NULL));
|
//SO_NODE_ADD_FIELD(image, (SbVec2s(0,0), 0, NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -317,9 +317,9 @@ static int getWordSizeOfOS()
|
||||||
|
|
||||||
// determine if 32-bit process running on 64-bit windows in WOW64 emulation
|
// determine if 32-bit process running on 64-bit windows in WOW64 emulation
|
||||||
// or 32-bit process running on 32-bit windows
|
// or 32-bit process running on 32-bit windows
|
||||||
// default bIsWow64 to FALSE for 32-bit process on 32-bit windows
|
// default bIsWow64 to false for 32-bit process on 32-bit windows
|
||||||
|
|
||||||
BOOL bIsWow64 = FALSE; // must default to FALSE
|
BOOL bIsWow64 = false; // must default to false
|
||||||
typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
|
typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
|
||||||
|
|
||||||
LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress(
|
LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress(
|
||||||
|
|
|
@ -100,7 +100,7 @@ void ToolBox::removeItem ( int index )
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If \a enabled is TRUE then the item at position \a index is enabled; otherwise item \a index is disabled.
|
* If \a enabled is true then the item at position \a index is enabled; otherwise item \a index is disabled.
|
||||||
*/
|
*/
|
||||||
void ToolBox::setItemEnabled ( int index, bool enabled )
|
void ToolBox::setItemEnabled ( int index, bool enabled )
|
||||||
{
|
{
|
||||||
|
@ -108,7 +108,7 @@ void ToolBox::setItemEnabled ( int index, bool enabled )
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns TRUE if the item at position \a index is enabled; otherwise returns FALSE.
|
* Returns true if the item at position \a index is enabled; otherwise returns false.
|
||||||
*/
|
*/
|
||||||
bool ToolBox::isItemEnabled ( int index ) const
|
bool ToolBox::isItemEnabled ( int index ) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -98,11 +98,11 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
|
|
||||||
this->lastmouseposition = posn;
|
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
|
// necessary to restrict ourselves to only do one "action" for an
|
||||||
// event, we only need this flag to see if any processing happened
|
// event, we only need this flag to see if any processing happened
|
||||||
// at all.
|
// at all.
|
||||||
SbBool processed = FALSE;
|
SbBool processed = false;
|
||||||
|
|
||||||
const ViewerMode curmode = this->currentmode;
|
const ViewerMode curmode = this->currentmode;
|
||||||
ViewerMode newmode = curmode;
|
ViewerMode newmode = curmode;
|
||||||
|
@ -123,13 +123,13 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (!processed && !viewer->isEditing()) {
|
if (!processed && !viewer->isEditing()) {
|
||||||
processed = handleEventInForeground(ev);
|
processed = handleEventInForeground(ev);
|
||||||
if (processed)
|
if (processed)
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keyboard handling
|
// Keyboard handling
|
||||||
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
||||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
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()) {
|
switch (event->getKey()) {
|
||||||
case SoKeyboardEvent::LEFT_CONTROL:
|
case SoKeyboardEvent::LEFT_CONTROL:
|
||||||
case SoKeyboardEvent::RIGHT_CONTROL:
|
case SoKeyboardEvent::RIGHT_CONTROL:
|
||||||
|
@ -144,7 +144,7 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
this->altdown = press;
|
this->altdown = press;
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::H:
|
case SoKeyboardEvent::H:
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
viewer->saveHomePosition();
|
viewer->saveHomePosition();
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::S:
|
case SoKeyboardEvent::S:
|
||||||
|
@ -157,12 +157,12 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
this->setViewing(true);
|
this->setViewing(true);
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::PAGE_UP:
|
case SoKeyboardEvent::PAGE_UP:
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
case SoKeyboardEvent::PAGE_DOWN:
|
case SoKeyboardEvent::PAGE_DOWN:
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -173,33 +173,33 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
const int button = event->getButton();
|
||||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
|
|
||||||
// SoDebugError::postInfo("processSoEvent", "button = %d", button);
|
// SoDebugError::postInfo("processSoEvent", "button = %d", button);
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case SoMouseButtonEvent::BUTTON1:
|
case SoMouseButtonEvent::BUTTON1:
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
this->button1down = press;
|
this->button1down = press;
|
||||||
if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
|
if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
|
||||||
newmode = NavigationStyle::SEEK_MODE;
|
newmode = NavigationStyle::SEEK_MODE;
|
||||||
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (press && (this->currentmode == NavigationStyle::PANNING ||
|
else if (press && (this->currentmode == NavigationStyle::PANNING ||
|
||||||
this->currentmode == NavigationStyle::ZOOMING)) {
|
this->currentmode == NavigationStyle::ZOOMING)) {
|
||||||
newmode = NavigationStyle::DRAGGING;
|
newmode = NavigationStyle::DRAGGING;
|
||||||
saveCursorPosition(ev);
|
saveCursorPosition(ev);
|
||||||
this->centerTime = ev->getTime();
|
this->centerTime = ev->getTime();
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
|
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON2:
|
case SoMouseButtonEvent::BUTTON2:
|
||||||
// If we are in edit mode then simply ignore the RMB events
|
// If we are in edit mode then simply ignore the RMB events
|
||||||
// to pass the event to the base class.
|
// to pass the event to the base class.
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
if (!viewer->isEditing()) {
|
if (!viewer->isEditing()) {
|
||||||
// If we are in zoom or pan mode ignore RMB events otherwise
|
// If we are in zoom or pan mode ignore RMB events otherwise
|
||||||
// the canvas doesn't get any release events
|
// the canvas doesn't get any release events
|
||||||
|
@ -219,17 +219,17 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
newmode = NavigationStyle::DRAGGING;
|
newmode = NavigationStyle::DRAGGING;
|
||||||
saveCursorPosition(ev);
|
saveCursorPosition(ev);
|
||||||
this->centerTime = ev->getTime();
|
this->centerTime = ev->getTime();
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
this->button2down = press;
|
this->button2down = press;
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON4:
|
case SoMouseButtonEvent::BUTTON4:
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
case SoMouseButtonEvent::BUTTON5:
|
case SoMouseButtonEvent::BUTTON5:
|
||||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -238,22 +238,22 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
|
|
||||||
// Mouse Movement handling
|
// Mouse Movement handling
|
||||||
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
||||||
this->lockrecenter = TRUE;
|
this->lockrecenter = true;
|
||||||
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
||||||
if (this->currentmode == NavigationStyle::ZOOMING) {
|
if (this->currentmode == NavigationStyle::ZOOMING) {
|
||||||
this->zoomByCursor(posn, prevnormalized);
|
this->zoomByCursor(posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (this->currentmode == NavigationStyle::PANNING) {
|
else if (this->currentmode == NavigationStyle::PANNING) {
|
||||||
float ratio = vp.getViewportAspectRatio();
|
float ratio = vp.getViewportAspectRatio();
|
||||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (this->currentmode == NavigationStyle::DRAGGING) {
|
else if (this->currentmode == NavigationStyle::DRAGGING) {
|
||||||
this->addToLog(event->getPosition(), event->getTime());
|
this->addToLog(event->getPosition(), event->getTime());
|
||||||
this->spin(posn);
|
this->spin(posn);
|
||||||
moveCursorPosition();
|
moveCursorPosition();
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
||||||
if (event)
|
if (event)
|
||||||
this->processMotionEvent(event);
|
this->processMotionEvent(event);
|
||||||
processed = TRUE;
|
processed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -320,7 +320,7 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||||
if (!processed)
|
if (!processed)
|
||||||
processed = inherited::processSoEvent(ev);
|
processed = inherited::processSoEvent(ev);
|
||||||
else
|
else
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
return processed;
|
return processed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,7 +300,7 @@ void LightManip(SoSeparator * root)
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
sa.setName( pointlightnames[i] );
|
sa.setName( pointlightnames[i] );
|
||||||
sa.setInterest( SoSearchAction::FIRST );
|
sa.setInterest( SoSearchAction::FIRST );
|
||||||
sa.setSearchingAll( FALSE );
|
sa.setSearchingAll( false );
|
||||||
sa.apply( root );
|
sa.apply( root );
|
||||||
SoPath * path = sa.getPath();
|
SoPath * path = sa.getPath();
|
||||||
if ( path == NULL) return; // Shouldn't happen.
|
if ( path == NULL) return; // Shouldn't happen.
|
||||||
|
@ -379,7 +379,7 @@ texture()
|
||||||
static void
|
static void
|
||||||
timersensorcallback(void * data, SoSensor *)
|
timersensorcallback(void * data, SoSensor *)
|
||||||
{
|
{
|
||||||
static SbBool direction = FALSE;
|
static SbBool direction = false;
|
||||||
|
|
||||||
SoTexture2 * texnode = (SoTexture2*) data;
|
SoTexture2 * texnode = (SoTexture2*) data;
|
||||||
|
|
||||||
|
|
|
@ -332,16 +332,16 @@ public:
|
||||||
// *************************************************************************
|
// *************************************************************************
|
||||||
View3DInventorViewer::View3DInventorViewer(QWidget* parent, const QGLWidget* sharewidget)
|
View3DInventorViewer::View3DInventorViewer(QWidget* parent, const QGLWidget* sharewidget)
|
||||||
: Quarter::SoQTQuarterAdaptor(parent, sharewidget), editViewProvider(0), navigation(0),
|
: Quarter::SoQTQuarterAdaptor(parent, sharewidget), editViewProvider(0), navigation(0),
|
||||||
renderType(Native), framebuffer(0), axisCross(0), axisGroup(0), editing(FALSE), redirected(FALSE),
|
renderType(Native), framebuffer(0), axisCross(0), axisGroup(0), editing(false), redirected(false),
|
||||||
allowredir(FALSE), overrideMode("As Is"), _viewerPy(0)
|
allowredir(false), overrideMode("As Is"), _viewerPy(0)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
View3DInventorViewer::View3DInventorViewer(const QGLFormat& format, QWidget* parent, const QGLWidget* sharewidget)
|
View3DInventorViewer::View3DInventorViewer(const QGLFormat& format, QWidget* parent, const QGLWidget* sharewidget)
|
||||||
: Quarter::SoQTQuarterAdaptor(format, parent, sharewidget), editViewProvider(0), navigation(0),
|
: Quarter::SoQTQuarterAdaptor(format, parent, sharewidget), editViewProvider(0), navigation(0),
|
||||||
renderType(Native), framebuffer(0), axisCross(0), axisGroup(0), editing(FALSE), redirected(FALSE),
|
renderType(Native), framebuffer(0), axisCross(0), axisGroup(0), editing(false), redirected(false),
|
||||||
allowredir(FALSE), overrideMode("As Is"), _viewerPy(0)
|
allowredir(false), overrideMode("As Is"), _viewerPy(0)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
@ -352,7 +352,7 @@ void View3DInventorViewer::init()
|
||||||
|
|
||||||
// Coin should not clear the pixel-buffer, so the background image
|
// Coin should not clear the pixel-buffer, so the background image
|
||||||
// is not removed.
|
// is not removed.
|
||||||
this->setClearWindow(FALSE);
|
this->setClearWindow(false);
|
||||||
|
|
||||||
// setting up the defaults for the spin rotation
|
// setting up the defaults for the spin rotation
|
||||||
initialize();
|
initialize();
|
||||||
|
@ -369,7 +369,7 @@ void View3DInventorViewer::init()
|
||||||
backlight->ref();
|
backlight->ref();
|
||||||
backlight->setName("backlight");
|
backlight->setName("backlight");
|
||||||
backlight->direction.setValue(-hl->direction.getValue());
|
backlight->direction.setValue(-hl->direction.getValue());
|
||||||
backlight->on.setValue(FALSE); // by default off
|
backlight->on.setValue(false); // by default off
|
||||||
|
|
||||||
// Set up background scenegraph with image in it.
|
// Set up background scenegraph with image in it.
|
||||||
backgroundroot = new SoSeparator;
|
backgroundroot = new SoSeparator;
|
||||||
|
@ -574,7 +574,7 @@ void View3DInventorViewer::initialize()
|
||||||
navigation = new CADNavigationStyle();
|
navigation = new CADNavigationStyle();
|
||||||
navigation->setViewer(this);
|
navigation->setViewer(this);
|
||||||
|
|
||||||
this->axiscrossEnabled = TRUE;
|
this->axiscrossEnabled = true;
|
||||||
this->axiscrossSize = 10;
|
this->axiscrossSize = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2123,7 +2123,7 @@ void View3DInventorViewer::viewSelection()
|
||||||
Decide if it should be possible to start a spin animation of the
|
Decide if it should be possible to start a spin animation of the
|
||||||
model in the viewer by releasing the mouse button while dragging.
|
model in the viewer by releasing the mouse button while dragging.
|
||||||
|
|
||||||
If the \a enable flag is \c FALSE and we're currently animating, the
|
If the \a enable flag is \c false and we're currently animating, the
|
||||||
spin will be stopped.
|
spin will be stopped.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
|
|
|
@ -299,7 +299,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the camera's orientation. If isAnimationEnabled() returns
|
* Set the camera's orientation. If isAnimationEnabled() returns
|
||||||
* \a TRUE the reorientation is animated, otherwise its directly
|
* \a true the reorientation is animated, otherwise its directly
|
||||||
* set.
|
* set.
|
||||||
*/
|
*/
|
||||||
void setCameraOrientation(const SbRotation& rot, SbBool moveTocenter=false);
|
void setCameraOrientation(const SbRotation& rot, SbBool moveTocenter=false);
|
||||||
|
|
|
@ -155,7 +155,7 @@ void ViewProvider::eventCallback(void * ud, SoEventCallback * node)
|
||||||
// Keyboard events
|
// Keyboard events
|
||||||
if (ev->getTypeId().isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
if (ev->getTypeId().isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
||||||
SoKeyboardEvent * ke = (SoKeyboardEvent *)ev;
|
SoKeyboardEvent * ke = (SoKeyboardEvent *)ev;
|
||||||
const SbBool press = ke->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
const SbBool press = ke->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
switch (ke->getKey()) {
|
switch (ke->getKey()) {
|
||||||
case SoKeyboardEvent::ESCAPE:
|
case SoKeyboardEvent::ESCAPE:
|
||||||
if (self->keyPressed (press, ke->getKey()))
|
if (self->keyPressed (press, ke->getKey()))
|
||||||
|
@ -175,7 +175,7 @@ void ViewProvider::eventCallback(void * ud, SoEventCallback * node)
|
||||||
|
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
const int button = event->getButton();
|
||||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
|
|
||||||
// call the virtual method
|
// call the virtual method
|
||||||
if (self->mouseButtonPressed(button,press,ev->getPosition(),viewer))
|
if (self->mouseButtonPressed(button,press,ev->getPosition(),viewer))
|
||||||
|
|
|
@ -414,7 +414,7 @@ bool ViewProviderAnnotationLabel::setEdit(int ModNum)
|
||||||
{
|
{
|
||||||
SoSearchAction sa;
|
SoSearchAction sa;
|
||||||
sa.setInterest(SoSearchAction::FIRST);
|
sa.setInterest(SoSearchAction::FIRST);
|
||||||
sa.setSearchingAll(FALSE);
|
sa.setSearchingAll(false);
|
||||||
sa.setNode(this->pTextTranslation);
|
sa.setNode(this->pTextTranslation);
|
||||||
sa.apply(pcRoot);
|
sa.apply(pcRoot);
|
||||||
SoPath * path = sa.getPath();
|
SoPath * path = sa.getPath();
|
||||||
|
|
|
@ -227,7 +227,7 @@ bool ViewProviderGeometryObject::setEdit(int ModNum)
|
||||||
#if 1
|
#if 1
|
||||||
SoSearchAction sa;
|
SoSearchAction sa;
|
||||||
sa.setInterest(SoSearchAction::FIRST);
|
sa.setInterest(SoSearchAction::FIRST);
|
||||||
sa.setSearchingAll(FALSE);
|
sa.setSearchingAll(false);
|
||||||
sa.setNode(this->pcTransform);
|
sa.setNode(this->pcTransform);
|
||||||
sa.apply(pcRoot);
|
sa.apply(pcRoot);
|
||||||
SoPath * path = sa.getPath();
|
SoPath * path = sa.getPath();
|
||||||
|
@ -336,7 +336,7 @@ void ViewProviderGeometryObject::setEditViewer(Gui::View3DInventorViewer* viewer
|
||||||
{
|
{
|
||||||
if (ModNum == (int)ViewProvider::Transform) {
|
if (ModNum == (int)ViewProvider::Transform) {
|
||||||
SoNode* root = viewer->getSceneGraph();
|
SoNode* root = viewer->getSceneGraph();
|
||||||
static_cast<SoFCUnifiedSelection*>(root)->selectionRole.setValue(FALSE);
|
static_cast<SoFCUnifiedSelection*>(root)->selectionRole.setValue(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ void ViewProviderGeometryObject::unsetEditViewer(Gui::View3DInventorViewer* view
|
||||||
int ModNum = this->getEditingMode();
|
int ModNum = this->getEditingMode();
|
||||||
if (ModNum == (int)ViewProvider::Transform) {
|
if (ModNum == (int)ViewProvider::Transform) {
|
||||||
SoNode* root = viewer->getSceneGraph();
|
SoNode* root = viewer->getSceneGraph();
|
||||||
static_cast<SoFCUnifiedSelection*>(root)->selectionRole.setValue(TRUE);
|
static_cast<SoFCUnifiedSelection*>(root)->selectionRole.setValue(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -601,7 +601,7 @@ void ViewProviderGeometryObject::setSelectable(bool selectable)
|
||||||
{
|
{
|
||||||
SoSearchAction sa;
|
SoSearchAction sa;
|
||||||
sa.setInterest(SoSearchAction::ALL);
|
sa.setInterest(SoSearchAction::ALL);
|
||||||
sa.setSearchingAll(TRUE);
|
sa.setSearchingAll(true);
|
||||||
sa.setType(Gui::SoFCSelection::getClassTypeId());
|
sa.setType(Gui::SoFCSelection::getClassTypeId());
|
||||||
sa.apply(pcRoot);
|
sa.apply(pcRoot);
|
||||||
|
|
||||||
|
|
|
@ -842,14 +842,14 @@ ContainerDialog::ContainerDialog( QWidget* templChild )
|
||||||
setWindowTitle( templChild->objectName() );
|
setWindowTitle( templChild->objectName() );
|
||||||
setObjectName( templChild->objectName() );
|
setObjectName( templChild->objectName() );
|
||||||
|
|
||||||
setSizeGripEnabled( TRUE );
|
setSizeGripEnabled( true );
|
||||||
MyDialogLayout = new QGridLayout(this);
|
MyDialogLayout = new QGridLayout(this);
|
||||||
|
|
||||||
buttonOk = new QPushButton(this);
|
buttonOk = new QPushButton(this);
|
||||||
buttonOk->setObjectName(QLatin1String("buttonOK"));
|
buttonOk->setObjectName(QLatin1String("buttonOK"));
|
||||||
buttonOk->setText( tr( "&OK" ) );
|
buttonOk->setText( tr( "&OK" ) );
|
||||||
buttonOk->setAutoDefault( TRUE );
|
buttonOk->setAutoDefault( true );
|
||||||
buttonOk->setDefault( TRUE );
|
buttonOk->setDefault( true );
|
||||||
|
|
||||||
MyDialogLayout->addWidget( buttonOk, 1, 0 );
|
MyDialogLayout->addWidget( buttonOk, 1, 0 );
|
||||||
QSpacerItem* spacer = new QSpacerItem( 210, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
QSpacerItem* spacer = new QSpacerItem( 210, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
||||||
|
@ -858,7 +858,7 @@ ContainerDialog::ContainerDialog( QWidget* templChild )
|
||||||
buttonCancel = new QPushButton(this);
|
buttonCancel = new QPushButton(this);
|
||||||
buttonCancel->setObjectName(QLatin1String("buttonCancel"));
|
buttonCancel->setObjectName(QLatin1String("buttonCancel"));
|
||||||
buttonCancel->setText( tr( "&Cancel" ) );
|
buttonCancel->setText( tr( "&Cancel" ) );
|
||||||
buttonCancel->setAutoDefault( TRUE );
|
buttonCancel->setAutoDefault( true );
|
||||||
|
|
||||||
MyDialogLayout->addWidget( buttonCancel, 1, 2 );
|
MyDialogLayout->addWidget( buttonCancel, 1, 2 );
|
||||||
|
|
||||||
|
@ -1029,8 +1029,8 @@ void PyResource::load( const char* name )
|
||||||
/**
|
/**
|
||||||
* Makes a connection between the sender widget \a sender and its signal \a signal
|
* Makes a connection between the sender widget \a sender and its signal \a signal
|
||||||
* of the created resource and Python callback function \a cb.
|
* of the created resource and Python callback function \a cb.
|
||||||
* If the sender widget does not exist or no resource has been loaded this method returns FALSE,
|
* If the sender widget does not exist or no resource has been loaded this method returns false,
|
||||||
* otherwise it returns TRUE.
|
* otherwise it returns true.
|
||||||
*/
|
*/
|
||||||
bool PyResource::connect(const char* sender, const char* signal, PyObject* cb)
|
bool PyResource::connect(const char* sender, const char* signal, PyObject* cb)
|
||||||
{
|
{
|
||||||
|
|
|
@ -444,7 +444,7 @@ void AccelLineEdit::keyPressEvent ( QKeyEvent * e)
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
CheckListDialog::CheckListDialog( QWidget* parent, Qt::WindowFlags fl )
|
CheckListDialog::CheckListDialog( QWidget* parent, Qt::WindowFlags fl )
|
||||||
: QDialog( parent, fl )
|
: QDialog( parent, fl )
|
||||||
|
|
|
@ -328,7 +328,7 @@ static LONG __stdcall MyCrashHandlerExceptionFilter(EXCEPTION_POINTERS* pEx)
|
||||||
MINIDUMP_EXCEPTION_INFORMATION stMDEI;
|
MINIDUMP_EXCEPTION_INFORMATION stMDEI;
|
||||||
stMDEI.ThreadId = GetCurrentThreadId();
|
stMDEI.ThreadId = GetCurrentThreadId();
|
||||||
stMDEI.ExceptionPointers = pEx;
|
stMDEI.ExceptionPointers = pEx;
|
||||||
stMDEI.ClientPointers = TRUE;
|
stMDEI.ClientPointers = true;
|
||||||
// try to create an miniDump:
|
// try to create an miniDump:
|
||||||
if (s_pMDWD(
|
if (s_pMDWD(
|
||||||
GetCurrentProcess(),
|
GetCurrentProcess(),
|
||||||
|
|
|
@ -69,7 +69,7 @@ BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
#elif defined(FC_OS_LINUX)
|
#elif defined(FC_OS_LINUX)
|
||||||
# ifndef GNU_SOURCE
|
# ifndef GNU_SOURCE
|
||||||
|
|
|
@ -472,7 +472,7 @@ void ViewProviderInspection::inspectCallback(void * ud, SoEventCallback * n)
|
||||||
else {
|
else {
|
||||||
// the nearest picked point was not part of the view provider
|
// the nearest picked point was not part of the view provider
|
||||||
SoRayPickAction action(view->getSoRenderManager()->getViewportRegion());
|
SoRayPickAction action(view->getSoRenderManager()->getViewportRegion());
|
||||||
action.setPickAll(TRUE);
|
action.setPickAll(true);
|
||||||
action.setPoint(mbe->getPosition());
|
action.setPoint(mbe->getPosition());
|
||||||
action.apply(view->getSoRenderManager()->getSceneGraph());
|
action.apply(view->getSoRenderManager()->getSceneGraph());
|
||||||
|
|
||||||
|
|
|
@ -459,7 +459,7 @@ inline void MeshFacetGrid::AddFacet (const MeshGeomFacet &rclFacet, unsigned lon
|
||||||
{
|
{
|
||||||
for (ulZ = ulZ1; ulZ <= ulZ2; ulZ++)
|
for (ulZ = ulZ1; ulZ <= ulZ2; ulZ++)
|
||||||
{
|
{
|
||||||
if (CMeshFacetFunc::BBoxContainFacet(GetBoundBox(ulX, ulY, ulZ), rclFacet) == TRUE)
|
if (CMeshFacetFunc::BBoxContainFacet(GetBoundBox(ulX, ulY, ulZ), rclFacet) == true)
|
||||||
_aulGrid[ulX][ulY][ulZ].insert(ulFacetIndex);
|
_aulGrid[ulX][ulY][ulZ].insert(ulFacetIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ inline bool MeshHelpPoint::operator < (const MeshHelpPoint &rclObj) const
|
||||||
// if (fabs(_clPt.y - rclObj._clPt.y) < MeshDefinitions::_fMinPointDistanceD1)
|
// if (fabs(_clPt.y - rclObj._clPt.y) < MeshDefinitions::_fMinPointDistanceD1)
|
||||||
// {
|
// {
|
||||||
// if (fabs(_clPt.z - rclObj._clPt.z) < MeshDefinitions::_fMinPointDistanceD1)
|
// if (fabs(_clPt.z - rclObj._clPt.z) < MeshDefinitions::_fMinPointDistanceD1)
|
||||||
// return FALSE;
|
// return false;
|
||||||
// else
|
// else
|
||||||
// return _clPt.z < rclObj._clPt.z;
|
// return _clPt.z < rclObj._clPt.z;
|
||||||
// }
|
// }
|
||||||
|
@ -136,15 +136,15 @@ inline bool MeshHelpPoint::operator == (const MeshHelpPoint &rclObj) const
|
||||||
if (fabs(_clPt.y - rclObj._clPt.y) < (MeshDefinitions::_fMinPointDistanceD1 + 1.0e-2f))
|
if (fabs(_clPt.y - rclObj._clPt.y) < (MeshDefinitions::_fMinPointDistanceD1 + 1.0e-2f))
|
||||||
{
|
{
|
||||||
if (fabs(_clPt.z - rclObj._clPt.z) < (MeshDefinitions::_fMinPointDistanceD1 + 1.0e-2f))
|
if (fabs(_clPt.z - rclObj._clPt.z) < (MeshDefinitions::_fMinPointDistanceD1 + 1.0e-2f))
|
||||||
return TRUE;
|
return true;
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2422,9 +2422,9 @@ bool MeshOutput::SaveVRML (std::ostream &rstrOut) const
|
||||||
|
|
||||||
rstrOut << " ]\n }\n";
|
rstrOut << " ]\n }\n";
|
||||||
if (_material->binding == MeshIO::PER_VERTEX)
|
if (_material->binding == MeshIO::PER_VERTEX)
|
||||||
rstrOut << " colorPerVertex TRUE\n";
|
rstrOut << " colorPerVertex true\n";
|
||||||
else
|
else
|
||||||
rstrOut << " colorPerVertex FALSE\n";
|
rstrOut << " colorPerVertex false\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// write face index
|
// write face index
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
if |dv|<EPSILON then dv=0.0;
|
if |dv|<EPSILON then dv=0.0;
|
||||||
else no check is done (which is less robust)
|
else no check is done (which is less robust)
|
||||||
*/
|
*/
|
||||||
#define USE_EPSILON_TEST TRUE
|
#define USE_EPSILON_TEST 1
|
||||||
#define EPSILON 0.000001
|
#define EPSILON 0.000001
|
||||||
|
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ int tri_tri_intersect(float V0[3],float V1[3],float V2[3],
|
||||||
du2=DOT(N1,U2)+d1;
|
du2=DOT(N1,U2)+d1;
|
||||||
|
|
||||||
/* coplanarity robustness check */
|
/* coplanarity robustness check */
|
||||||
#if USE_EPSILON_TEST==TRUE
|
#if USE_EPSILON_TEST
|
||||||
if(fabs(du0)<EPSILON) du0=0.0;
|
if(fabs(du0)<EPSILON) du0=0.0;
|
||||||
if(fabs(du1)<EPSILON) du1=0.0;
|
if(fabs(du1)<EPSILON) du1=0.0;
|
||||||
if(fabs(du2)<EPSILON) du2=0.0;
|
if(fabs(du2)<EPSILON) du2=0.0;
|
||||||
|
@ -260,7 +260,7 @@ int tri_tri_intersect(float V0[3],float V1[3],float V2[3],
|
||||||
dv1=DOT(N2,V1)+d2;
|
dv1=DOT(N2,V1)+d2;
|
||||||
dv2=DOT(N2,V2)+d2;
|
dv2=DOT(N2,V2)+d2;
|
||||||
|
|
||||||
#if USE_EPSILON_TEST==TRUE
|
#if USE_EPSILON_TEST
|
||||||
if(fabs(dv0)<EPSILON) dv0=0.0;
|
if(fabs(dv0)<EPSILON) dv0=0.0;
|
||||||
if(fabs(dv1)<EPSILON) dv1=0.0;
|
if(fabs(dv1)<EPSILON) dv1=0.0;
|
||||||
if(fabs(dv2)<EPSILON) dv2=0.0;
|
if(fabs(dv2)<EPSILON) dv2=0.0;
|
||||||
|
@ -371,7 +371,7 @@ int NoDivTriTriIsect(float V0[3],float V1[3],float V2[3],
|
||||||
du2=DOT(N1,U2)+d1;
|
du2=DOT(N1,U2)+d1;
|
||||||
|
|
||||||
/* coplanarity robustness check */
|
/* coplanarity robustness check */
|
||||||
#if USE_EPSILON_TEST==TRUE
|
#if USE_EPSILON_TEST
|
||||||
if(FABS(du0)<EPSILON) du0=0.0;
|
if(FABS(du0)<EPSILON) du0=0.0;
|
||||||
if(FABS(du1)<EPSILON) du1=0.0;
|
if(FABS(du1)<EPSILON) du1=0.0;
|
||||||
if(FABS(du2)<EPSILON) du2=0.0;
|
if(FABS(du2)<EPSILON) du2=0.0;
|
||||||
|
@ -394,7 +394,7 @@ int NoDivTriTriIsect(float V0[3],float V1[3],float V2[3],
|
||||||
dv1=DOT(N2,V1)+d2;
|
dv1=DOT(N2,V1)+d2;
|
||||||
dv2=DOT(N2,V2)+d2;
|
dv2=DOT(N2,V2)+d2;
|
||||||
|
|
||||||
#if USE_EPSILON_TEST==TRUE
|
#if USE_EPSILON_TEST
|
||||||
if(FABS(dv0)<EPSILON) dv0=0.0;
|
if(FABS(dv0)<EPSILON) dv0=0.0;
|
||||||
if(FABS(dv1)<EPSILON) dv1=0.0;
|
if(FABS(dv1)<EPSILON) dv1=0.0;
|
||||||
if(FABS(dv2)<EPSILON) dv2=0.0;
|
if(FABS(dv2)<EPSILON) dv2=0.0;
|
||||||
|
@ -597,7 +597,7 @@ int tri_tri_intersect_with_isectline(float V0[3],float V1[3],float V2[3],
|
||||||
du2=DOT(N1,U2)+d1;
|
du2=DOT(N1,U2)+d1;
|
||||||
|
|
||||||
/* coplanarity robustness check */
|
/* coplanarity robustness check */
|
||||||
#if USE_EPSILON_TEST==TRUE
|
#if USE_EPSILON_TEST
|
||||||
if(fabs(du0)<EPSILON) du0=0.0;
|
if(fabs(du0)<EPSILON) du0=0.0;
|
||||||
if(fabs(du1)<EPSILON) du1=0.0;
|
if(fabs(du1)<EPSILON) du1=0.0;
|
||||||
if(fabs(du2)<EPSILON) du2=0.0;
|
if(fabs(du2)<EPSILON) du2=0.0;
|
||||||
|
@ -620,7 +620,7 @@ int tri_tri_intersect_with_isectline(float V0[3],float V1[3],float V2[3],
|
||||||
dv1=DOT(N2,V1)+d2;
|
dv1=DOT(N2,V1)+d2;
|
||||||
dv2=DOT(N2,V2)+d2;
|
dv2=DOT(N2,V2)+d2;
|
||||||
|
|
||||||
#if USE_EPSILON_TEST==TRUE
|
#if USE_EPSILON_TEST
|
||||||
if(fabs(dv0)<EPSILON) dv0=0.0;
|
if(fabs(dv0)<EPSILON) dv0=0.0;
|
||||||
if(fabs(dv1)<EPSILON) dv1=0.0;
|
if(fabs(dv1)<EPSILON) dv1=0.0;
|
||||||
if(fabs(dv2)<EPSILON) dv2=0.0;
|
if(fabs(dv2)<EPSILON) dv2=0.0;
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
// Input:
|
// Input:
|
||||||
// A[iSize][iSize], entries are A[row][col]
|
// A[iSize][iSize], entries are A[row][col]
|
||||||
// Output:
|
// Output:
|
||||||
// return value is TRUE if successful, FALSE if pivoting failed
|
// return value is true if successful, false if pivoting failed
|
||||||
// InvA[iSize][iSize], inverse matrix
|
// InvA[iSize][iSize], inverse matrix
|
||||||
bool Inverse (const GMatrix<Real>& rkA, GMatrix<Real>& rkInvA);
|
bool Inverse (const GMatrix<Real>& rkA, GMatrix<Real>& rkInvA);
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public:
|
||||||
// A[iSize][iSize] coefficient matrix, entries are A[row][col]
|
// A[iSize][iSize] coefficient matrix, entries are A[row][col]
|
||||||
// B[iSize] vector, entries are B[row]
|
// B[iSize] vector, entries are B[row]
|
||||||
// Output:
|
// Output:
|
||||||
// return value is TRUE if successful, FALSE if pivoting failed
|
// return value is true if successful, false if pivoting failed
|
||||||
// X[iSize] is solution X to AX = B
|
// X[iSize] is solution X to AX = B
|
||||||
bool Solve (const GMatrix<Real>& rkA, const Real* afB, Real* afX);
|
bool Solve (const GMatrix<Real>& rkA, const Real* afB, Real* afX);
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ public:
|
||||||
// Upper diagonal C[iSize-1]
|
// Upper diagonal C[iSize-1]
|
||||||
// Right-hand side R[iSize]
|
// Right-hand side R[iSize]
|
||||||
// Output:
|
// Output:
|
||||||
// return value is TRUE if successful, FALSE if pivoting failed
|
// return value is true if successful, false if pivoting failed
|
||||||
// U[iSize] is solution
|
// U[iSize] is solution
|
||||||
bool SolveTri (int iSize, Real* afA, Real* afB, Real* afC, Real* afR,
|
bool SolveTri (int iSize, Real* afA, Real* afB, Real* afC, Real* afR,
|
||||||
Real* afU);
|
Real* afU);
|
||||||
|
@ -69,7 +69,7 @@ public:
|
||||||
// Upper diagonal is constant, C
|
// Upper diagonal is constant, C
|
||||||
// Right-hand side Rr[iSize]
|
// Right-hand side Rr[iSize]
|
||||||
// Output:
|
// Output:
|
||||||
// return value is TRUE if successful, FALSE if pivoting failed
|
// return value is true if successful, false if pivoting failed
|
||||||
// U[iSize] is solution
|
// U[iSize] is solution
|
||||||
bool SolveConstTri (int iSize, Real fA, Real fB, Real fC, Real* afR,
|
bool SolveConstTri (int iSize, Real fA, Real fB, Real fC, Real* afR,
|
||||||
Real* afU);
|
Real* afU);
|
||||||
|
@ -102,7 +102,7 @@ public:
|
||||||
// A, a banded matrix
|
// A, a banded matrix
|
||||||
// B[iSize] vector, entries are B[row]
|
// B[iSize] vector, entries are B[row]
|
||||||
// Output:
|
// Output:
|
||||||
// return value is TRUE if successful, FALSE if pivoting failed
|
// return value is true if successful, false if pivoting failed
|
||||||
// X[iSize] is solution X to AX = B
|
// X[iSize] is solution X to AX = B
|
||||||
bool SolveBanded (const BandedMatrix<Real>& rkA, const Real* afB,
|
bool SolveBanded (const BandedMatrix<Real>& rkA, const Real* afB,
|
||||||
Real* afX);
|
Real* afX);
|
||||||
|
@ -111,7 +111,7 @@ public:
|
||||||
// Input:
|
// Input:
|
||||||
// A, a banded matrix
|
// A, a banded matrix
|
||||||
// Output:
|
// Output:
|
||||||
// return value is TRUE if the inverse exists, FALSE otherwise
|
// return value is true if the inverse exists, false otherwise
|
||||||
// InvA, the inverse of A
|
// InvA, the inverse of A
|
||||||
bool Invert (const BandedMatrix<Real>& rkA, GMatrix<Real>& rkInvA);
|
bool Invert (const BandedMatrix<Real>& rkA, GMatrix<Real>& rkInvA);
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ void DlgEvaluateMeshImp::slotDeletedDocument(const App::Document& Doc)
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgEvaluateMeshImp::DlgEvaluateMeshImp(QWidget* parent, Qt::WindowFlags fl)
|
DlgEvaluateMeshImp::DlgEvaluateMeshImp(QWidget* parent, Qt::WindowFlags fl)
|
||||||
: QDialog(parent, fl), d(new Private())
|
: QDialog(parent, fl), d(new Private())
|
||||||
|
|
|
@ -49,7 +49,7 @@ using namespace MeshGui;
|
||||||
* name 'name' and widget flags set to 'f'.
|
* name 'name' and widget flags set to 'f'.
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
MeshGui::DlgRegularSolidImp::DlgRegularSolidImp(QWidget* parent, Qt::WindowFlags fl)
|
MeshGui::DlgRegularSolidImp::DlgRegularSolidImp(QWidget* parent, Qt::WindowFlags fl)
|
||||||
: QDialog( parent, fl )
|
: QDialog( parent, fl )
|
||||||
|
|
|
@ -95,7 +95,7 @@ void SoFCIndexedFaceSet::GLRender(SoGLRenderAction *action)
|
||||||
|
|
||||||
SoMaterialBundle mb(action);
|
SoMaterialBundle mb(action);
|
||||||
|
|
||||||
SoTextureCoordinateBundle tb(action, TRUE, FALSE);
|
SoTextureCoordinateBundle tb(action, true, false);
|
||||||
SbBool sendNormals = !mb.isColorOnly() || tb.isFunction();
|
SbBool sendNormals = !mb.isColorOnly() || tb.isFunction();
|
||||||
|
|
||||||
this->getVertexData(state, coords, normals, cindices,
|
this->getVertexData(state, coords, normals, cindices,
|
||||||
|
@ -129,14 +129,14 @@ void SoFCIndexedFaceSet::drawCoords(const SoGLCoordinateElement * const vertexli
|
||||||
float size = std::min<float>((float)mod,3.0f);
|
float size = std::min<float>((float)mod,3.0f);
|
||||||
glPointSize(size);
|
glPointSize(size);
|
||||||
|
|
||||||
SbBool per_face = FALSE;
|
SbBool per_face = false;
|
||||||
SbBool per_vert = FALSE;
|
SbBool per_vert = false;
|
||||||
switch (binding) {
|
switch (binding) {
|
||||||
case SoMaterialBindingElement::PER_FACE:
|
case SoMaterialBindingElement::PER_FACE:
|
||||||
per_face = TRUE;
|
per_face = true;
|
||||||
break;
|
break;
|
||||||
case SoMaterialBindingElement::PER_VERTEX:
|
case SoMaterialBindingElement::PER_VERTEX:
|
||||||
per_vert = TRUE;
|
per_vert = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -153,10 +153,10 @@ void SoFCIndexedFaceSet::drawCoords(const SoGLCoordinateElement * const vertexli
|
||||||
for (int index=0; index<numindices; ct++) {
|
for (int index=0; index<numindices; ct++) {
|
||||||
if (ct%mod==0) {
|
if (ct%mod==0) {
|
||||||
if (per_face)
|
if (per_face)
|
||||||
materials->send(ct, TRUE);
|
materials->send(ct, true);
|
||||||
v1 = *viptr++; index++;
|
v1 = *viptr++; index++;
|
||||||
if (per_vert)
|
if (per_vert)
|
||||||
materials->send(v1, TRUE);
|
materials->send(v1, true);
|
||||||
if (normals)
|
if (normals)
|
||||||
currnormal = &normals[*normalindices++];
|
currnormal = &normals[*normalindices++];
|
||||||
glNormal3fv((const GLfloat*)currnormal);
|
glNormal3fv((const GLfloat*)currnormal);
|
||||||
|
@ -164,7 +164,7 @@ void SoFCIndexedFaceSet::drawCoords(const SoGLCoordinateElement * const vertexli
|
||||||
|
|
||||||
v2 = *viptr++; index++;
|
v2 = *viptr++; index++;
|
||||||
if (per_vert)
|
if (per_vert)
|
||||||
materials->send(v2, TRUE);
|
materials->send(v2, true);
|
||||||
if (normals)
|
if (normals)
|
||||||
currnormal = &normals[*normalindices++];
|
currnormal = &normals[*normalindices++];
|
||||||
glNormal3fv((const GLfloat*)currnormal);
|
glNormal3fv((const GLfloat*)currnormal);
|
||||||
|
@ -172,7 +172,7 @@ void SoFCIndexedFaceSet::drawCoords(const SoGLCoordinateElement * const vertexli
|
||||||
|
|
||||||
v3 = *viptr++; index++;
|
v3 = *viptr++; index++;
|
||||||
if (per_vert)
|
if (per_vert)
|
||||||
materials->send(v3, TRUE);
|
materials->send(v3, true);
|
||||||
if (normals)
|
if (normals)
|
||||||
currnormal = &normals[*normalindices++];
|
currnormal = &normals[*normalindices++];
|
||||||
glNormal3fv((const GLfloat*)currnormal);
|
glNormal3fv((const GLfloat*)currnormal);
|
||||||
|
@ -199,7 +199,7 @@ void SoFCIndexedFaceSet::doAction(SoAction * action)
|
||||||
// thus we search there for it.
|
// thus we search there for it.
|
||||||
SoSearchAction sa;
|
SoSearchAction sa;
|
||||||
sa.setInterest(SoSearchAction::FIRST);
|
sa.setInterest(SoSearchAction::FIRST);
|
||||||
sa.setSearchingAll(FALSE);
|
sa.setSearchingAll(false);
|
||||||
sa.setType(SoCoordinate3::getClassTypeId(), 1);
|
sa.setType(SoCoordinate3::getClassTypeId(), 1);
|
||||||
sa.apply(node);
|
sa.apply(node);
|
||||||
SoPath * path = sa.getPath();
|
SoPath * path = sa.getPath();
|
||||||
|
@ -221,7 +221,7 @@ void SoFCIndexedFaceSet::doAction(SoAction * action)
|
||||||
// thus we search there for it.
|
// thus we search there for it.
|
||||||
SoSearchAction sa;
|
SoSearchAction sa;
|
||||||
sa.setInterest(SoSearchAction::FIRST);
|
sa.setInterest(SoSearchAction::FIRST);
|
||||||
sa.setSearchingAll(FALSE);
|
sa.setSearchingAll(false);
|
||||||
sa.setType(SoCoordinate3::getClassTypeId(), 1);
|
sa.setType(SoCoordinate3::getClassTypeId(), 1);
|
||||||
sa.apply(node);
|
sa.apply(node);
|
||||||
SoPath * path = sa.getPath();
|
SoPath * path = sa.getPath();
|
||||||
|
|
|
@ -176,7 +176,7 @@ void SoSFMeshObject::initClass()
|
||||||
SO_SFIELD_INIT_CLASS(SoSFMeshObject, SoSField);
|
SO_SFIELD_INIT_CLASS(SoSFMeshObject, SoSField);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This reads the value of a field from a file. It returns FALSE if the value could not be read
|
// This reads the value of a field from a file. It returns false if the value could not be read
|
||||||
// successfully.
|
// successfully.
|
||||||
SbBool SoSFMeshObject::readValue(SoInput *in)
|
SbBool SoSFMeshObject::readValue(SoInput *in)
|
||||||
{
|
{
|
||||||
|
@ -191,7 +191,7 @@ SbBool SoSFMeshObject::readValue(SoInput *in)
|
||||||
// during initial scene graph import.
|
// during initial scene graph import.
|
||||||
this->valueChanged();
|
this->valueChanged();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t countPt;
|
int32_t countPt;
|
||||||
|
@ -235,7 +235,7 @@ SbBool SoSFMeshObject::readValue(SoInput *in)
|
||||||
// during initial scene graph import.
|
// during initial scene graph import.
|
||||||
this->valueChanged();
|
this->valueChanged();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This writes the value of a field to a file.
|
// This writes the value of a field to a file.
|
||||||
|
@ -626,9 +626,9 @@ void SoFCMeshObjectShape::GLRender(SoGLRenderAction *action)
|
||||||
SbBool needNormals = !mb.isColorOnly()/* || tb.isFunction()*/;
|
SbBool needNormals = !mb.isColorOnly()/* || tb.isFunction()*/;
|
||||||
mb.sendFirst(); // make sure we have the correct material
|
mb.sendFirst(); // make sure we have the correct material
|
||||||
|
|
||||||
SbBool ccw = TRUE;
|
SbBool ccw = true;
|
||||||
if (SoShapeHintsElement::getVertexOrdering(state) == SoShapeHintsElement::CLOCKWISE)
|
if (SoShapeHintsElement::getVertexOrdering(state) == SoShapeHintsElement::CLOCKWISE)
|
||||||
ccw = FALSE;
|
ccw = false;
|
||||||
|
|
||||||
if (mode == false || mesh->countFacets() <= this->renderTriangleLimit) {
|
if (mode == false || mesh->countFacets() <= this->renderTriangleLimit) {
|
||||||
if (mbind != OVERALL)
|
if (mbind != OVERALL)
|
||||||
|
@ -708,16 +708,16 @@ void SoFCMeshObjectShape::drawFaces(const Mesh::MeshObject * mesh, SoMaterialBun
|
||||||
n[2] = (v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x);
|
n[2] = (v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x);
|
||||||
|
|
||||||
if(perFace)
|
if(perFace)
|
||||||
mb->send(it-rFacets.begin(), TRUE);
|
mb->send(it-rFacets.begin(), true);
|
||||||
glNormal(n);
|
glNormal(n);
|
||||||
if(perVertex)
|
if(perVertex)
|
||||||
mb->send(it->_aulPoints[0], TRUE);
|
mb->send(it->_aulPoints[0], true);
|
||||||
glVertex(v0);
|
glVertex(v0);
|
||||||
if(perVertex)
|
if(perVertex)
|
||||||
mb->send(it->_aulPoints[1], TRUE);
|
mb->send(it->_aulPoints[1], true);
|
||||||
glVertex(v1);
|
glVertex(v1);
|
||||||
if(perVertex)
|
if(perVertex)
|
||||||
mb->send(it->_aulPoints[2], TRUE);
|
mb->send(it->_aulPoints[2], true);
|
||||||
glVertex(v2);
|
glVertex(v2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -852,7 +852,7 @@ void SoFCMeshObjectShape::doAction(SoAction * action)
|
||||||
// thus we search there for it.
|
// thus we search there for it.
|
||||||
SoSearchAction sa;
|
SoSearchAction sa;
|
||||||
sa.setInterest(SoSearchAction::FIRST);
|
sa.setInterest(SoSearchAction::FIRST);
|
||||||
sa.setSearchingAll(FALSE);
|
sa.setSearchingAll(false);
|
||||||
sa.setType(SoFCMeshObjectNode::getClassTypeId(), 1);
|
sa.setType(SoFCMeshObjectNode::getClassTypeId(), 1);
|
||||||
sa.apply(node);
|
sa.apply(node);
|
||||||
SoPath * path = sa.getPath();
|
SoPath * path = sa.getPath();
|
||||||
|
@ -961,8 +961,8 @@ void SoFCMeshObjectShape::renderSelectionGeometry(const Mesh::MeshObject* mesh)
|
||||||
//static SbBool
|
//static SbBool
|
||||||
//SoFCMeshObjectShape_ray_intersect(SoRayPickAction * action, const SbBox3f & box)
|
//SoFCMeshObjectShape_ray_intersect(SoRayPickAction * action, const SbBox3f & box)
|
||||||
//{
|
//{
|
||||||
// if (box.isEmpty()) return FALSE;
|
// if (box.isEmpty()) return false;
|
||||||
// return action->intersect(box, TRUE);
|
// return action->intersect(box, true);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1163,9 +1163,9 @@ void SoFCMeshSegmentShape::GLRender(SoGLRenderAction *action)
|
||||||
SbBool needNormals = !mb.isColorOnly()/* || tb.isFunction()*/;
|
SbBool needNormals = !mb.isColorOnly()/* || tb.isFunction()*/;
|
||||||
mb.sendFirst(); // make sure we have the correct material
|
mb.sendFirst(); // make sure we have the correct material
|
||||||
|
|
||||||
SbBool ccw = TRUE;
|
SbBool ccw = true;
|
||||||
if (SoShapeHintsElement::getVertexOrdering(state) == SoShapeHintsElement::CLOCKWISE)
|
if (SoShapeHintsElement::getVertexOrdering(state) == SoShapeHintsElement::CLOCKWISE)
|
||||||
ccw = FALSE;
|
ccw = false;
|
||||||
|
|
||||||
if (mode == false || mesh->countFacets() <= this->renderTriangleLimit) {
|
if (mode == false || mesh->countFacets() <= this->renderTriangleLimit) {
|
||||||
if (mbind != OVERALL)
|
if (mbind != OVERALL)
|
||||||
|
@ -1250,16 +1250,16 @@ void SoFCMeshSegmentShape::drawFaces(const Mesh::MeshObject * mesh, SoMaterialBu
|
||||||
n[2] = (v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x);
|
n[2] = (v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x);
|
||||||
|
|
||||||
if(perFace)
|
if(perFace)
|
||||||
mb->send(*it, TRUE);
|
mb->send(*it, true);
|
||||||
glNormal(n);
|
glNormal(n);
|
||||||
if(perVertex)
|
if(perVertex)
|
||||||
mb->send(f._aulPoints[0], TRUE);
|
mb->send(f._aulPoints[0], true);
|
||||||
glVertex(v0);
|
glVertex(v0);
|
||||||
if(perVertex)
|
if(perVertex)
|
||||||
mb->send(f._aulPoints[1], TRUE);
|
mb->send(f._aulPoints[1], true);
|
||||||
glVertex(v1);
|
glVertex(v1);
|
||||||
if(perVertex)
|
if(perVertex)
|
||||||
mb->send(f._aulPoints[2], TRUE);
|
mb->send(f._aulPoints[2], true);
|
||||||
glVertex(v2);
|
glVertex(v2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1556,7 +1556,7 @@ void SoFCMeshObjectBoundary::GLRender(SoGLRenderAction *action)
|
||||||
if (!mesh) return;
|
if (!mesh) return;
|
||||||
|
|
||||||
SoMaterialBundle mb(action);
|
SoMaterialBundle mb(action);
|
||||||
SoTextureCoordinateBundle tb(action, TRUE, FALSE);
|
SoTextureCoordinateBundle tb(action, true, false);
|
||||||
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
||||||
mb.sendFirst(); // make sure we have the correct material
|
mb.sendFirst(); // make sure we have the correct material
|
||||||
|
|
||||||
|
|
|
@ -68,8 +68,8 @@ SoPolygon::SoPolygon()
|
||||||
|
|
||||||
SO_NODE_ADD_FIELD(startIndex, (0));
|
SO_NODE_ADD_FIELD(startIndex, (0));
|
||||||
SO_NODE_ADD_FIELD(numVertices, (0));
|
SO_NODE_ADD_FIELD(numVertices, (0));
|
||||||
SO_NODE_ADD_FIELD(highlight, (FALSE));
|
SO_NODE_ADD_FIELD(highlight, (false));
|
||||||
SO_NODE_ADD_FIELD(render, (TRUE));
|
SO_NODE_ADD_FIELD(render, (true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -86,7 +86,7 @@ void SoPolygon::GLRender(SoGLRenderAction *action)
|
||||||
if (!points) return;
|
if (!points) return;
|
||||||
|
|
||||||
SoMaterialBundle mb(action);
|
SoMaterialBundle mb(action);
|
||||||
SoTextureCoordinateBundle tb(action, TRUE, FALSE);
|
SoTextureCoordinateBundle tb(action, true, false);
|
||||||
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
||||||
mb.sendFirst(); // make sure we have the correct material
|
mb.sendFirst(); // make sure we have the correct material
|
||||||
|
|
||||||
|
|
|
@ -172,8 +172,8 @@ MeshCore::MeshKernel* MeshAlgos::boolean(MeshCore::MeshKernel* pMesh1, MeshCore:
|
||||||
GtsSurface * s1, * s2, * s3;
|
GtsSurface * s1, * s2, * s3;
|
||||||
GtsSurfaceInter * si;
|
GtsSurfaceInter * si;
|
||||||
GNode * tree1, * tree2;
|
GNode * tree1, * tree2;
|
||||||
gboolean check_self_intersection = FALSE;
|
gboolean check_self_intersection = false;
|
||||||
gboolean closed = TRUE, is_open1, is_open2;
|
gboolean closed = true, is_open1, is_open2;
|
||||||
|
|
||||||
|
|
||||||
// create a GTS surface
|
// create a GTS surface
|
||||||
|
@ -224,11 +224,11 @@ MeshCore::MeshKernel* MeshAlgos::boolean(MeshCore::MeshKernel* pMesh1, MeshCore:
|
||||||
|
|
||||||
/* build bounding box tree for first surface */
|
/* build bounding box tree for first surface */
|
||||||
tree1 = gts_bb_tree_surface (s1);
|
tree1 = gts_bb_tree_surface (s1);
|
||||||
is_open1 = gts_surface_volume (s1) < 0. ? TRUE : FALSE;
|
is_open1 = gts_surface_volume (s1) < 0. ? true : false;
|
||||||
|
|
||||||
/* build bounding box tree for second surface */
|
/* build bounding box tree for second surface */
|
||||||
tree2 = gts_bb_tree_surface (s2);
|
tree2 = gts_bb_tree_surface (s2);
|
||||||
is_open2 = gts_surface_volume (s2) < 0. ? TRUE : FALSE;
|
is_open2 = gts_surface_volume (s2) < 0. ? true : false;
|
||||||
|
|
||||||
si = gts_surface_inter_new (gts_surface_inter_class (),
|
si = gts_surface_inter_new (gts_surface_inter_class (),
|
||||||
s1, s2, tree1, tree2, is_open1, is_open2);
|
s1, s2, tree1, tree2, is_open1, is_open2);
|
||||||
|
@ -236,8 +236,8 @@ MeshCore::MeshKernel* MeshAlgos::boolean(MeshCore::MeshKernel* pMesh1, MeshCore:
|
||||||
if (!closed) {
|
if (!closed) {
|
||||||
gts_object_destroy (GTS_OBJECT (s1));
|
gts_object_destroy (GTS_OBJECT (s1));
|
||||||
gts_object_destroy (GTS_OBJECT (s2));
|
gts_object_destroy (GTS_OBJECT (s2));
|
||||||
gts_bb_tree_destroy (tree1, TRUE);
|
gts_bb_tree_destroy (tree1, true);
|
||||||
gts_bb_tree_destroy (tree2, TRUE);
|
gts_bb_tree_destroy (tree2, true);
|
||||||
throw"the intersection of 1 and 2 is not a closed curve\n";
|
throw"the intersection of 1 and 2 is not a closed curve\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,8 +280,8 @@ MeshCore::MeshKernel* MeshAlgos::boolean(MeshCore::MeshKernel* pMesh1, MeshCore:
|
||||||
gts_object_destroy (GTS_OBJECT (s2));
|
gts_object_destroy (GTS_OBJECT (s2));
|
||||||
gts_object_destroy (GTS_OBJECT (s3));
|
gts_object_destroy (GTS_OBJECT (s3));
|
||||||
gts_object_destroy (GTS_OBJECT (si));
|
gts_object_destroy (GTS_OBJECT (si));
|
||||||
gts_bb_tree_destroy (tree1, TRUE);
|
gts_bb_tree_destroy (tree1, true);
|
||||||
gts_bb_tree_destroy (tree2, TRUE);
|
gts_bb_tree_destroy (tree2, true);
|
||||||
throw "the resulting surface is self-intersecting\n";
|
throw "the resulting surface is self-intersecting\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -301,8 +301,8 @@ MeshCore::MeshKernel* MeshAlgos::boolean(MeshCore::MeshKernel* pMesh1, MeshCore:
|
||||||
// gts_object_destroy (GTS_OBJECT (si));
|
// gts_object_destroy (GTS_OBJECT (si));
|
||||||
|
|
||||||
// destroy bounding box trees (including bounding boxes)
|
// destroy bounding box trees (including bounding boxes)
|
||||||
// gts_bb_tree_destroy (tree1, TRUE);
|
// gts_bb_tree_destroy (tree1, true);
|
||||||
// gts_bb_tree_destroy (tree2, TRUE);
|
// gts_bb_tree_destroy (tree2, true);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
return pMesh1;
|
return pMesh1;
|
||||||
|
|
|
@ -34,7 +34,7 @@ using namespace PartGui;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgPartBoxImp::DlgPartBoxImp(QWidget* parent, Qt::WindowFlags fl)
|
DlgPartBoxImp::DlgPartBoxImp(QWidget* parent, Qt::WindowFlags fl)
|
||||||
: Gui::LocationInterface<Ui_DlgPartBox>(parent, fl)
|
: Gui::LocationInterface<Ui_DlgPartBox>(parent, fl)
|
||||||
|
|
|
@ -34,7 +34,7 @@ using namespace PartGui;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgPartCylinderImp::DlgPartCylinderImp(QWidget* parent, Qt::WindowFlags fl)
|
DlgPartCylinderImp::DlgPartCylinderImp(QWidget* parent, Qt::WindowFlags fl)
|
||||||
: Gui::LocationInterface<Ui_DlgPartCylinder>(parent, fl)
|
: Gui::LocationInterface<Ui_DlgPartCylinder>(parent, fl)
|
||||||
|
|
|
@ -40,7 +40,7 @@ using namespace PartGui;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgPartImportIgesImp::DlgPartImportIgesImp(QWidget* parent, Qt::WindowFlags fl)
|
DlgPartImportIgesImp::DlgPartImportIgesImp(QWidget* parent, Qt::WindowFlags fl)
|
||||||
: QDialog(parent, fl)
|
: QDialog(parent, fl)
|
||||||
|
|
|
@ -39,7 +39,7 @@ using namespace PartGui;
|
||||||
* name 'name' and widget flags set to 'f'
|
* name 'name' and widget flags set to 'f'
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
DlgPartImportStepImp::DlgPartImportStepImp( QWidget* parent, Qt::WindowFlags fl )
|
DlgPartImportStepImp::DlgPartImportStepImp( QWidget* parent, Qt::WindowFlags fl )
|
||||||
: QDialog( parent, fl )
|
: QDialog( parent, fl )
|
||||||
|
|
|
@ -131,9 +131,9 @@ void SoBrepEdgeSet::renderHighlight(SoGLRenderAction *action)
|
||||||
//SoLineWidthElement::set(state, this, 4.0f);
|
//SoLineWidthElement::set(state, this, 4.0f);
|
||||||
|
|
||||||
SoLazyElement::setEmissive(state, &this->highlightColor);
|
SoLazyElement::setEmissive(state, &this->highlightColor);
|
||||||
SoOverrideElement::setEmissiveColorOverride(state, this, TRUE);
|
SoOverrideElement::setEmissiveColorOverride(state, this, true);
|
||||||
SoLazyElement::setDiffuse(state, this,1, &this->highlightColor,&this->colorpacker1);
|
SoLazyElement::setDiffuse(state, this,1, &this->highlightColor,&this->colorpacker1);
|
||||||
SoOverrideElement::setDiffuseColorOverride(state, this, TRUE);
|
SoOverrideElement::setDiffuseColorOverride(state, this, true);
|
||||||
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
||||||
|
|
||||||
const SoCoordinateElement * coords;
|
const SoCoordinateElement * coords;
|
||||||
|
@ -146,7 +146,7 @@ void SoBrepEdgeSet::renderHighlight(SoGLRenderAction *action)
|
||||||
SbBool normalCacheUsed;
|
SbBool normalCacheUsed;
|
||||||
|
|
||||||
this->getVertexData(state, coords, normals, cindices, nindices,
|
this->getVertexData(state, coords, normals, cindices, nindices,
|
||||||
tindices, mindices, numcindices, FALSE, normalCacheUsed);
|
tindices, mindices, numcindices, false, normalCacheUsed);
|
||||||
|
|
||||||
SoMaterialBundle mb(action);
|
SoMaterialBundle mb(action);
|
||||||
mb.sendFirst(); // make sure we have the correct material
|
mb.sendFirst(); // make sure we have the correct material
|
||||||
|
@ -174,9 +174,9 @@ void SoBrepEdgeSet::renderSelection(SoGLRenderAction *action)
|
||||||
//SoLineWidthElement::set(state, this, 4.0f);
|
//SoLineWidthElement::set(state, this, 4.0f);
|
||||||
|
|
||||||
SoLazyElement::setEmissive(state, &this->selectionColor);
|
SoLazyElement::setEmissive(state, &this->selectionColor);
|
||||||
SoOverrideElement::setEmissiveColorOverride(state, this, TRUE);
|
SoOverrideElement::setEmissiveColorOverride(state, this, true);
|
||||||
SoLazyElement::setDiffuse(state, this,1, &this->selectionColor,&this->colorpacker2);
|
SoLazyElement::setDiffuse(state, this,1, &this->selectionColor,&this->colorpacker2);
|
||||||
SoOverrideElement::setDiffuseColorOverride(state, this, TRUE);
|
SoOverrideElement::setDiffuseColorOverride(state, this, true);
|
||||||
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
||||||
|
|
||||||
const SoCoordinateElement * coords;
|
const SoCoordinateElement * coords;
|
||||||
|
@ -189,7 +189,7 @@ void SoBrepEdgeSet::renderSelection(SoGLRenderAction *action)
|
||||||
SbBool normalCacheUsed;
|
SbBool normalCacheUsed;
|
||||||
|
|
||||||
this->getVertexData(state, coords, normals, cindices, nindices,
|
this->getVertexData(state, coords, normals, cindices, nindices,
|
||||||
tindices, mindices, numcindices, FALSE, normalCacheUsed);
|
tindices, mindices, numcindices, false, normalCacheUsed);
|
||||||
|
|
||||||
SoMaterialBundle mb(action);
|
SoMaterialBundle mb(action);
|
||||||
mb.sendFirst(); // make sure we have the correct material
|
mb.sendFirst(); // make sure we have the correct material
|
||||||
|
|
|
@ -194,7 +194,7 @@ void SoBrepFaceSet::GLRender(SoGLRenderAction *action)
|
||||||
SoMaterialBundle mb(action);
|
SoMaterialBundle mb(action);
|
||||||
Binding mbind = this->findMaterialBinding(state);
|
Binding mbind = this->findMaterialBinding(state);
|
||||||
|
|
||||||
SoTextureCoordinateBundle tb(action, TRUE, FALSE);
|
SoTextureCoordinateBundle tb(action, true, false);
|
||||||
SbBool doTextures = tb.needCoordinates();
|
SbBool doTextures = tb.needCoordinates();
|
||||||
|
|
||||||
int32_t hl_idx = this->highlightIndex.getValue();
|
int32_t hl_idx = this->highlightIndex.getValue();
|
||||||
|
@ -320,7 +320,7 @@ void SoBrepFaceSet::renderColoredArray(SoMaterialBundle *const materials)
|
||||||
int tris = partIndex[part_id];
|
int tris = partIndex[part_id];
|
||||||
|
|
||||||
if (tris > 0) {
|
if (tris > 0) {
|
||||||
materials->send(part_id, TRUE);
|
materials->send(part_id, true);
|
||||||
glDrawElements(GL_TRIANGLES, 3 * tris, GL_UNSIGNED_INT, ptr);
|
glDrawElements(GL_TRIANGLES, 3 * tris, GL_UNSIGNED_INT, ptr);
|
||||||
ptr += 3 * tris;
|
ptr += 3 * tris;
|
||||||
}
|
}
|
||||||
|
@ -363,7 +363,7 @@ void SoBrepFaceSet::GLRender(SoGLRenderAction *action)
|
||||||
|
|
||||||
SoMaterialBundle mb(action);
|
SoMaterialBundle mb(action);
|
||||||
|
|
||||||
SoTextureCoordinateBundle tb(action, TRUE, FALSE);
|
SoTextureCoordinateBundle tb(action, true, false);
|
||||||
doTextures = tb.needCoordinates();
|
doTextures = tb.needCoordinates();
|
||||||
SbBool sendNormals = !mb.isColorOnly() || tb.isFunction();
|
SbBool sendNormals = !mb.isColorOnly() || tb.isFunction();
|
||||||
|
|
||||||
|
@ -461,13 +461,13 @@ void SoBrepFaceSet::generatePrimitives(SoAction * action)
|
||||||
SbBool sendNormals;
|
SbBool sendNormals;
|
||||||
SbBool normalCacheUsed;
|
SbBool normalCacheUsed;
|
||||||
|
|
||||||
sendNormals = TRUE; // always generate normals
|
sendNormals = true; // always generate normals
|
||||||
|
|
||||||
this->getVertexData(state, coords, normals, cindices,
|
this->getVertexData(state, coords, normals, cindices,
|
||||||
nindices, tindices, mindices, numindices,
|
nindices, tindices, mindices, numindices,
|
||||||
sendNormals, normalCacheUsed);
|
sendNormals, normalCacheUsed);
|
||||||
|
|
||||||
SoTextureCoordinateBundle tb(action, FALSE, FALSE);
|
SoTextureCoordinateBundle tb(action, false, false);
|
||||||
doTextures = tb.needCoordinates();
|
doTextures = tb.needCoordinates();
|
||||||
|
|
||||||
if (!sendNormals) nbind = OVERALL;
|
if (!sendNormals) nbind = OVERALL;
|
||||||
|
@ -674,11 +674,11 @@ void SoBrepFaceSet::renderHighlight(SoGLRenderAction *action)
|
||||||
state->push();
|
state->push();
|
||||||
|
|
||||||
SoLazyElement::setEmissive(state, &this->highlightColor);
|
SoLazyElement::setEmissive(state, &this->highlightColor);
|
||||||
SoOverrideElement::setEmissiveColorOverride(state, this, TRUE);
|
SoOverrideElement::setEmissiveColorOverride(state, this, true);
|
||||||
#if 0 // disables shading effect
|
#if 0 // disables shading effect
|
||||||
// sendNormals will be FALSE
|
// sendNormals will be false
|
||||||
SoLazyElement::setDiffuse(state, this,1, &this->highlightColor,&this->colorpacker);
|
SoLazyElement::setDiffuse(state, this,1, &this->highlightColor,&this->colorpacker);
|
||||||
SoOverrideElement::setDiffuseColorOverride(state, this, TRUE);
|
SoOverrideElement::setDiffuseColorOverride(state, this, true);
|
||||||
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -697,7 +697,7 @@ void SoBrepFaceSet::renderHighlight(SoGLRenderAction *action)
|
||||||
SbBool normalCacheUsed;
|
SbBool normalCacheUsed;
|
||||||
|
|
||||||
SoMaterialBundle mb(action);
|
SoMaterialBundle mb(action);
|
||||||
SoTextureCoordinateBundle tb(action, TRUE, FALSE);
|
SoTextureCoordinateBundle tb(action, true, false);
|
||||||
doTextures = tb.needCoordinates();
|
doTextures = tb.needCoordinates();
|
||||||
SbBool sendNormals = !mb.isColorOnly() || tb.isFunction();
|
SbBool sendNormals = !mb.isColorOnly() || tb.isFunction();
|
||||||
|
|
||||||
|
@ -734,7 +734,7 @@ void SoBrepFaceSet::renderHighlight(SoGLRenderAction *action)
|
||||||
|
|
||||||
// materials
|
// materials
|
||||||
mbind = OVERALL;
|
mbind = OVERALL;
|
||||||
doTextures = FALSE;
|
doTextures = false;
|
||||||
|
|
||||||
renderShape(static_cast<const SoGLCoordinateElement*>(coords), &(cindices[start]), length,
|
renderShape(static_cast<const SoGLCoordinateElement*>(coords), &(cindices[start]), length,
|
||||||
&(pindices[id]), 1, normals, nindices, &mb, mindices, &tb, tindices, nbind, mbind, doTextures?1:0);
|
&(pindices[id]), 1, normals, nindices, &mb, mindices, &tb, tindices, nbind, mbind, doTextures?1:0);
|
||||||
|
@ -752,10 +752,10 @@ void SoBrepFaceSet::renderSelection(SoGLRenderAction *action)
|
||||||
state->push();
|
state->push();
|
||||||
|
|
||||||
SoLazyElement::setEmissive(state, &this->selectionColor);
|
SoLazyElement::setEmissive(state, &this->selectionColor);
|
||||||
SoOverrideElement::setEmissiveColorOverride(state, this, TRUE);
|
SoOverrideElement::setEmissiveColorOverride(state, this, true);
|
||||||
#if 0 // disables shading effect
|
#if 0 // disables shading effect
|
||||||
SoLazyElement::setDiffuse(state, this,1, &this->selectionColor,&this->colorpacker);
|
SoLazyElement::setDiffuse(state, this,1, &this->selectionColor,&this->colorpacker);
|
||||||
SoOverrideElement::setDiffuseColorOverride(state, this, TRUE);
|
SoOverrideElement::setDiffuseColorOverride(state, this, true);
|
||||||
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -774,7 +774,7 @@ void SoBrepFaceSet::renderSelection(SoGLRenderAction *action)
|
||||||
SbBool normalCacheUsed;
|
SbBool normalCacheUsed;
|
||||||
|
|
||||||
SoMaterialBundle mb(action);
|
SoMaterialBundle mb(action);
|
||||||
SoTextureCoordinateBundle tb(action, TRUE, FALSE);
|
SoTextureCoordinateBundle tb(action, true, false);
|
||||||
doTextures = tb.needCoordinates();
|
doTextures = tb.needCoordinates();
|
||||||
SbBool sendNormals = !mb.isColorOnly() || tb.isFunction();
|
SbBool sendNormals = !mb.isColorOnly() || tb.isFunction();
|
||||||
|
|
||||||
|
@ -791,7 +791,7 @@ void SoBrepFaceSet::renderSelection(SoGLRenderAction *action)
|
||||||
|
|
||||||
// materials
|
// materials
|
||||||
mbind = OVERALL;
|
mbind = OVERALL;
|
||||||
doTextures = FALSE;
|
doTextures = false;
|
||||||
|
|
||||||
for (int i=0; i<numSelected; i++) {
|
for (int i=0; i<numSelected; i++) {
|
||||||
int id = selected[i];
|
int id = selected[i];
|
||||||
|
@ -883,17 +883,17 @@ void SoBrepFaceSet::renderShape(const SoGLCoordinateElement * const vertexlist,
|
||||||
/* vertex 1 *********************************************************/
|
/* vertex 1 *********************************************************/
|
||||||
if (mbind == PER_PART) {
|
if (mbind == PER_PART) {
|
||||||
if (trinr == 0)
|
if (trinr == 0)
|
||||||
materials->send(matnr++, TRUE);
|
materials->send(matnr++, true);
|
||||||
}
|
}
|
||||||
else if (mbind == PER_PART_INDEXED) {
|
else if (mbind == PER_PART_INDEXED) {
|
||||||
if (trinr == 0)
|
if (trinr == 0)
|
||||||
materials->send(*matindices++, TRUE);
|
materials->send(*matindices++, true);
|
||||||
}
|
}
|
||||||
else if (mbind == PER_VERTEX || mbind == PER_FACE) {
|
else if (mbind == PER_VERTEX || mbind == PER_FACE) {
|
||||||
materials->send(matnr++, TRUE);
|
materials->send(matnr++, true);
|
||||||
}
|
}
|
||||||
else if (mbind == PER_VERTEX_INDEXED || mbind == PER_FACE_INDEXED) {
|
else if (mbind == PER_VERTEX_INDEXED || mbind == PER_FACE_INDEXED) {
|
||||||
materials->send(*matindices++, TRUE);
|
materials->send(*matindices++, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (normals) {
|
if (normals) {
|
||||||
|
@ -917,9 +917,9 @@ void SoBrepFaceSet::renderShape(const SoGLCoordinateElement * const vertexlist,
|
||||||
|
|
||||||
/* vertex 2 *********************************************************/
|
/* vertex 2 *********************************************************/
|
||||||
if (mbind == PER_VERTEX)
|
if (mbind == PER_VERTEX)
|
||||||
materials->send(matnr++, TRUE);
|
materials->send(matnr++, true);
|
||||||
else if (mbind == PER_VERTEX_INDEXED)
|
else if (mbind == PER_VERTEX_INDEXED)
|
||||||
materials->send(*matindices++, TRUE);
|
materials->send(*matindices++, true);
|
||||||
|
|
||||||
if (normals) {
|
if (normals) {
|
||||||
if (nbind == PER_VERTEX) {
|
if (nbind == PER_VERTEX) {
|
||||||
|
@ -942,9 +942,9 @@ void SoBrepFaceSet::renderShape(const SoGLCoordinateElement * const vertexlist,
|
||||||
|
|
||||||
/* vertex 3 *********************************************************/
|
/* vertex 3 *********************************************************/
|
||||||
if (mbind == PER_VERTEX)
|
if (mbind == PER_VERTEX)
|
||||||
materials->send(matnr++, TRUE);
|
materials->send(matnr++, true);
|
||||||
else if (mbind == PER_VERTEX_INDEXED)
|
else if (mbind == PER_VERTEX_INDEXED)
|
||||||
materials->send(*matindices++, TRUE);
|
materials->send(*matindices++, true);
|
||||||
|
|
||||||
if (normals) {
|
if (normals) {
|
||||||
if (nbind == PER_VERTEX) {
|
if (nbind == PER_VERTEX) {
|
||||||
|
|
|
@ -131,14 +131,14 @@ void SoBrepPointSet::renderHighlight(SoGLRenderAction *action)
|
||||||
if (ps < 4.0f) SoPointSizeElement::set(state, this, 4.0f);
|
if (ps < 4.0f) SoPointSizeElement::set(state, this, 4.0f);
|
||||||
|
|
||||||
SoLazyElement::setEmissive(state, &this->highlightColor);
|
SoLazyElement::setEmissive(state, &this->highlightColor);
|
||||||
SoOverrideElement::setEmissiveColorOverride(state, this, TRUE);
|
SoOverrideElement::setEmissiveColorOverride(state, this, true);
|
||||||
SoLazyElement::setDiffuse(state, this,1, &this->highlightColor,&this->colorpacker);
|
SoLazyElement::setDiffuse(state, this,1, &this->highlightColor,&this->colorpacker);
|
||||||
SoOverrideElement::setDiffuseColorOverride(state, this, TRUE);
|
SoOverrideElement::setDiffuseColorOverride(state, this, true);
|
||||||
|
|
||||||
const SoCoordinateElement * coords;
|
const SoCoordinateElement * coords;
|
||||||
const SbVec3f * normals;
|
const SbVec3f * normals;
|
||||||
|
|
||||||
this->getVertexData(state, coords, normals, FALSE);
|
this->getVertexData(state, coords, normals, false);
|
||||||
|
|
||||||
SoMaterialBundle mb(action);
|
SoMaterialBundle mb(action);
|
||||||
mb.sendFirst(); // make sure we have the correct material
|
mb.sendFirst(); // make sure we have the correct material
|
||||||
|
@ -161,16 +161,16 @@ void SoBrepPointSet::renderSelection(SoGLRenderAction *action)
|
||||||
if (ps < 4.0f) SoPointSizeElement::set(state, this, 4.0f);
|
if (ps < 4.0f) SoPointSizeElement::set(state, this, 4.0f);
|
||||||
|
|
||||||
SoLazyElement::setEmissive(state, &this->selectionColor);
|
SoLazyElement::setEmissive(state, &this->selectionColor);
|
||||||
SoOverrideElement::setEmissiveColorOverride(state, this, TRUE);
|
SoOverrideElement::setEmissiveColorOverride(state, this, true);
|
||||||
SoLazyElement::setDiffuse(state, this,1, &this->selectionColor,&this->colorpacker);
|
SoLazyElement::setDiffuse(state, this,1, &this->selectionColor,&this->colorpacker);
|
||||||
SoOverrideElement::setDiffuseColorOverride(state, this, TRUE);
|
SoOverrideElement::setDiffuseColorOverride(state, this, true);
|
||||||
|
|
||||||
const SoCoordinateElement * coords;
|
const SoCoordinateElement * coords;
|
||||||
const SbVec3f * normals;
|
const SbVec3f * normals;
|
||||||
const int32_t * cindices;
|
const int32_t * cindices;
|
||||||
int numcindices;
|
int numcindices;
|
||||||
|
|
||||||
this->getVertexData(state, coords, normals, FALSE);
|
this->getVertexData(state, coords, normals, false);
|
||||||
|
|
||||||
SoMaterialBundle mb(action);
|
SoMaterialBundle mb(action);
|
||||||
mb.sendFirst(); // make sure we have the correct material
|
mb.sendFirst(); // make sure we have the correct material
|
||||||
|
|
|
@ -86,7 +86,7 @@ void SoFCControlPoints::GLRender(SoGLRenderAction *action)
|
||||||
if (!points) return;
|
if (!points) return;
|
||||||
|
|
||||||
SoMaterialBundle mb(action);
|
SoMaterialBundle mb(action);
|
||||||
SoTextureCoordinateBundle tb(action, TRUE, FALSE);
|
SoTextureCoordinateBundle tb(action, true, false);
|
||||||
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR);
|
||||||
mb.sendFirst(); // make sure we have the correct material
|
mb.sendFirst(); // make sure we have the correct material
|
||||||
|
|
||||||
|
|
|
@ -322,12 +322,12 @@ PartGui::DimensionLinear::DimensionLinear()
|
||||||
{
|
{
|
||||||
SO_KIT_CONSTRUCTOR(PartGui::DimensionLinear);
|
SO_KIT_CONSTRUCTOR(PartGui::DimensionLinear);
|
||||||
|
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(transformation, SoTransform, TRUE, topSeparator,"" , TRUE);
|
SO_KIT_ADD_CATALOG_ENTRY(transformation, SoTransform, true, topSeparator,"" , true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(annotate, SoAnnotation, TRUE, topSeparator,"" , TRUE);
|
SO_KIT_ADD_CATALOG_ENTRY(annotate, SoAnnotation, true, topSeparator,"" , true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(leftArrow, SoShapeKit, TRUE, topSeparator,"" ,TRUE);
|
SO_KIT_ADD_CATALOG_ENTRY(leftArrow, SoShapeKit, true, topSeparator,"" ,true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(rightArrow, SoShapeKit, TRUE, topSeparator,"" ,TRUE);
|
SO_KIT_ADD_CATALOG_ENTRY(rightArrow, SoShapeKit, true, topSeparator,"" ,true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(line, SoShapeKit, TRUE, annotate,"" ,TRUE);
|
SO_KIT_ADD_CATALOG_ENTRY(line, SoShapeKit, true, annotate,"" ,true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(textSep, SoSeparator, TRUE, annotate,"" ,TRUE);
|
SO_KIT_ADD_CATALOG_ENTRY(textSep, SoSeparator, true, annotate,"" ,true);
|
||||||
|
|
||||||
SO_KIT_INIT_INSTANCE();
|
SO_KIT_INIT_INSTANCE();
|
||||||
|
|
||||||
|
@ -350,13 +350,13 @@ PartGui::DimensionLinear::~DimensionLinear()
|
||||||
|
|
||||||
SbBool PartGui::DimensionLinear::affectsState() const
|
SbBool PartGui::DimensionLinear::affectsState() const
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PartGui::DimensionLinear::setupDimension()
|
void PartGui::DimensionLinear::setupDimension()
|
||||||
{
|
{
|
||||||
//transformation
|
//transformation
|
||||||
SoTransform *trans = static_cast<SoTransform *>(getPart("transformation", TRUE));
|
SoTransform *trans = static_cast<SoTransform *>(getPart("transformation", true));
|
||||||
trans->translation.connectFrom(&point1);
|
trans->translation.connectFrom(&point1);
|
||||||
//build engine for vector subtraction and length.
|
//build engine for vector subtraction and length.
|
||||||
SoCalculator *hyp = new SoCalculator();
|
SoCalculator *hyp = new SoCalculator();
|
||||||
|
@ -389,7 +389,7 @@ void PartGui::DimensionLinear::setupDimension()
|
||||||
//have use local here to do the offset because the main is wired up to length of dimension.
|
//have use local here to do the offset because the main is wired up to length of dimension.
|
||||||
set("rightArrow.localTransform", "translation 0.0 -0.25 0.0"); //half cone height.
|
set("rightArrow.localTransform", "translation 0.0 -0.25 0.0"); //half cone height.
|
||||||
|
|
||||||
SoTransform *transform = static_cast<SoTransform *>(getPart("rightArrow.transform", FALSE));
|
SoTransform *transform = static_cast<SoTransform *>(getPart("rightArrow.transform", false));
|
||||||
if (!transform)
|
if (!transform)
|
||||||
return;//what to do here?
|
return;//what to do here?
|
||||||
SoComposeVec3f *vec = new SoComposeVec3f;
|
SoComposeVec3f *vec = new SoComposeVec3f;
|
||||||
|
@ -420,7 +420,7 @@ void PartGui::DimensionLinear::setupDimension()
|
||||||
setPart("line.material", material);
|
setPart("line.material", material);
|
||||||
|
|
||||||
//text
|
//text
|
||||||
SoSeparator *textSep = static_cast<SoSeparator *>(getPart("textSep", TRUE));
|
SoSeparator *textSep = static_cast<SoSeparator *>(getPart("textSep", true));
|
||||||
if (!textSep)
|
if (!textSep)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1014,12 +1014,12 @@ PartGui::DimensionAngular::DimensionAngular()
|
||||||
{
|
{
|
||||||
SO_KIT_CONSTRUCTOR(PartGui::DimensionAngular);
|
SO_KIT_CONSTRUCTOR(PartGui::DimensionAngular);
|
||||||
|
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(transformation, SoMatrixTransform, TRUE, topSeparator,"" , TRUE);
|
SO_KIT_ADD_CATALOG_ENTRY(transformation, SoMatrixTransform, true, topSeparator,"" , true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(annotate, SoAnnotation, TRUE, topSeparator,"" , TRUE);
|
SO_KIT_ADD_CATALOG_ENTRY(annotate, SoAnnotation, true, topSeparator,"" , true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(arrow1, SoShapeKit, TRUE, topSeparator,"" ,TRUE);
|
SO_KIT_ADD_CATALOG_ENTRY(arrow1, SoShapeKit, true, topSeparator,"" ,true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(arrow2, SoShapeKit, TRUE, topSeparator,"" ,TRUE);
|
SO_KIT_ADD_CATALOG_ENTRY(arrow2, SoShapeKit, true, topSeparator,"" ,true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(arcSep, SoSeparator, TRUE, annotate,"" ,TRUE);
|
SO_KIT_ADD_CATALOG_ENTRY(arcSep, SoSeparator, true, annotate,"" ,true);
|
||||||
SO_KIT_ADD_CATALOG_ENTRY(textSep, SoSeparator, TRUE, annotate,"" ,TRUE);
|
SO_KIT_ADD_CATALOG_ENTRY(textSep, SoSeparator, true, annotate,"" ,true);
|
||||||
|
|
||||||
SO_KIT_INIT_INSTANCE();
|
SO_KIT_INIT_INSTANCE();
|
||||||
|
|
||||||
|
@ -1042,14 +1042,14 @@ PartGui::DimensionAngular::~DimensionAngular()
|
||||||
|
|
||||||
SbBool PartGui::DimensionAngular::affectsState() const
|
SbBool PartGui::DimensionAngular::affectsState() const
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PartGui::DimensionAngular::setupDimension()
|
void PartGui::DimensionAngular::setupDimension()
|
||||||
{
|
{
|
||||||
//transformation
|
//transformation
|
||||||
SoMatrixTransform *trans = static_cast<SoMatrixTransform *>(getPart("transformation", TRUE));
|
SoMatrixTransform *trans = static_cast<SoMatrixTransform *>(getPart("transformation", true));
|
||||||
trans->matrix.connectFrom(&matrix);
|
trans->matrix.connectFrom(&matrix);
|
||||||
|
|
||||||
//color
|
//color
|
||||||
|
@ -1110,14 +1110,14 @@ void PartGui::DimensionAngular::setupDimension()
|
||||||
lineSet->numVertices.connectFrom(&arcEngine->pointCount);
|
lineSet->numVertices.connectFrom(&arcEngine->pointCount);
|
||||||
lineSet->startIndex.setValue(0);
|
lineSet->startIndex.setValue(0);
|
||||||
|
|
||||||
SoSeparator *arcSep = static_cast<SoSeparator *>(getPart("arcSep", TRUE));
|
SoSeparator *arcSep = static_cast<SoSeparator *>(getPart("arcSep", true));
|
||||||
if (!arcSep)
|
if (!arcSep)
|
||||||
return;
|
return;
|
||||||
arcSep->addChild(material);
|
arcSep->addChild(material);
|
||||||
arcSep->addChild(lineSet);
|
arcSep->addChild(lineSet);
|
||||||
|
|
||||||
//text
|
//text
|
||||||
SoSeparator *textSep = static_cast<SoSeparator *>(getPart("textSep", TRUE));
|
SoSeparator *textSep = static_cast<SoSeparator *>(getPart("textSep", true));
|
||||||
if (!textSep)
|
if (!textSep)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -221,7 +221,7 @@ public:
|
||||||
Gui::View3DInventorViewer* view = reinterpret_cast<Gui::View3DInventorViewer*>(cb->getUserData());
|
Gui::View3DInventorViewer* view = reinterpret_cast<Gui::View3DInventorViewer*>(cb->getUserData());
|
||||||
view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), selectionCallback, ud);
|
view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), selectionCallback, ud);
|
||||||
SoNode* root = view->getSceneGraph();
|
SoNode* root = view->getSceneGraph();
|
||||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(TRUE);
|
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(true);
|
||||||
|
|
||||||
std::vector<SbVec2f> picked = view->getGLPolygon();
|
std::vector<SbVec2f> picked = view->getGLPolygon();
|
||||||
SoCamera* cam = view->getSoRenderManager()->getCamera();
|
SoCamera* cam = view->getSoRenderManager()->getCamera();
|
||||||
|
@ -277,7 +277,7 @@ FaceColors::~FaceColors()
|
||||||
d->view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(),
|
d->view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(),
|
||||||
Private::selectionCallback, this);
|
Private::selectionCallback, this);
|
||||||
SoNode* root = d->view->getSceneGraph();
|
SoNode* root = d->view->getSceneGraph();
|
||||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(TRUE);
|
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(true);
|
||||||
}
|
}
|
||||||
Gui::Selection().rmvSelectionGate();
|
Gui::Selection().rmvSelectionGate();
|
||||||
d->connectDelDoc.disconnect();
|
d->connectDelDoc.disconnect();
|
||||||
|
@ -308,7 +308,7 @@ void FaceColors::on_boxSelection_clicked()
|
||||||
// avoid that the selection node handles the event otherwise the callback function won't be
|
// avoid that the selection node handles the event otherwise the callback function won't be
|
||||||
// called immediately
|
// called immediately
|
||||||
SoNode* root = viewer->getSceneGraph();
|
SoNode* root = viewer->getSceneGraph();
|
||||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(FALSE);
|
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(false);
|
||||||
d->view = viewer;
|
d->view = viewer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,7 @@ bool ViewProviderCurveNet::handleEvent(const SoEvent * const ev, Gui::View3DInve
|
||||||
if (ev->getTypeId().isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
if (ev->getTypeId().isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
||||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||||
const int button = event->getButton();
|
const int button = event->getButton();
|
||||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||||
|
|
||||||
// which button pressed?
|
// which button pressed?
|
||||||
switch (button) {
|
switch (button) {
|
||||||
|
|
|
@ -119,7 +119,7 @@ bool ViewProviderMirror::setEdit(int ModNum)
|
||||||
// translation and center fields are overridden.
|
// translation and center fields are overridden.
|
||||||
SoSearchAction sa;
|
SoSearchAction sa;
|
||||||
sa.setInterest(SoSearchAction::FIRST);
|
sa.setInterest(SoSearchAction::FIRST);
|
||||||
sa.setSearchingAll(FALSE);
|
sa.setSearchingAll(false);
|
||||||
sa.setNode(trans);
|
sa.setNode(trans);
|
||||||
sa.apply(pcEditNode);
|
sa.apply(pcEditNode);
|
||||||
SoPath * path = sa.getPath();
|
SoPath * path = sa.getPath();
|
||||||
|
|
|
@ -273,7 +273,7 @@ namespace geoff_geometry {
|
||||||
two lines P1P2 and P3P4. Calculate also the values of mua and mub where
|
two lines P1P2 and P3P4. Calculate also the values of mua and mub where
|
||||||
Pa = P1 + t1 (P2 - P1)
|
Pa = P1 + t1 (P2 - P1)
|
||||||
Pb = P3 + t2 (P4 - P3)
|
Pb = P3 + t2 (P4 - P3)
|
||||||
Return FALSE if no solution exists. P Bourke method.
|
Return false if no solution exists. P Bourke method.
|
||||||
Input this 1st line
|
Input this 1st line
|
||||||
Input l2 2nd line
|
Input l2 2nd line
|
||||||
Output lshort shortest line between lines (if lshort.ok == false, the line intersect at a point lshort.p0)
|
Output lshort shortest line between lines (if lshort.ok == false, the line intersect at a point lshort.p0)
|
||||||
|
|
|
@ -201,7 +201,7 @@ void ViewProviderRobotObject::updateData(const App::Property* prop)
|
||||||
// Axis 1
|
// Axis 1
|
||||||
searchAction.setName("FREECAD_AXIS1");
|
searchAction.setName("FREECAD_AXIS1");
|
||||||
searchAction.setInterest(SoSearchAction::FIRST);
|
searchAction.setInterest(SoSearchAction::FIRST);
|
||||||
searchAction.setSearchingAll(FALSE);
|
searchAction.setSearchingAll(false);
|
||||||
searchAction.apply(pcRobotRoot);
|
searchAction.apply(pcRobotRoot);
|
||||||
path = searchAction.getPath();
|
path = searchAction.getPath();
|
||||||
if(path){
|
if(path){
|
||||||
|
@ -214,7 +214,7 @@ void ViewProviderRobotObject::updateData(const App::Property* prop)
|
||||||
// Axis 2
|
// Axis 2
|
||||||
searchAction.setName("FREECAD_AXIS2");
|
searchAction.setName("FREECAD_AXIS2");
|
||||||
searchAction.setInterest(SoSearchAction::FIRST);
|
searchAction.setInterest(SoSearchAction::FIRST);
|
||||||
searchAction.setSearchingAll(FALSE);
|
searchAction.setSearchingAll(false);
|
||||||
searchAction.apply(pcRobotRoot);
|
searchAction.apply(pcRobotRoot);
|
||||||
path = searchAction.getPath();
|
path = searchAction.getPath();
|
||||||
if(path){
|
if(path){
|
||||||
|
@ -227,7 +227,7 @@ void ViewProviderRobotObject::updateData(const App::Property* prop)
|
||||||
// Axis 3
|
// Axis 3
|
||||||
searchAction.setName("FREECAD_AXIS3");
|
searchAction.setName("FREECAD_AXIS3");
|
||||||
searchAction.setInterest(SoSearchAction::FIRST);
|
searchAction.setInterest(SoSearchAction::FIRST);
|
||||||
searchAction.setSearchingAll(FALSE);
|
searchAction.setSearchingAll(false);
|
||||||
searchAction.apply(pcRobotRoot);
|
searchAction.apply(pcRobotRoot);
|
||||||
path = searchAction.getPath();
|
path = searchAction.getPath();
|
||||||
if(path){
|
if(path){
|
||||||
|
@ -240,7 +240,7 @@ void ViewProviderRobotObject::updateData(const App::Property* prop)
|
||||||
// Axis 4
|
// Axis 4
|
||||||
searchAction.setName("FREECAD_AXIS4");
|
searchAction.setName("FREECAD_AXIS4");
|
||||||
searchAction.setInterest(SoSearchAction::FIRST);
|
searchAction.setInterest(SoSearchAction::FIRST);
|
||||||
searchAction.setSearchingAll(FALSE);
|
searchAction.setSearchingAll(false);
|
||||||
searchAction.apply(pcRobotRoot);
|
searchAction.apply(pcRobotRoot);
|
||||||
path = searchAction.getPath();
|
path = searchAction.getPath();
|
||||||
if(path){
|
if(path){
|
||||||
|
@ -253,7 +253,7 @@ void ViewProviderRobotObject::updateData(const App::Property* prop)
|
||||||
// Axis 5
|
// Axis 5
|
||||||
searchAction.setName("FREECAD_AXIS5");
|
searchAction.setName("FREECAD_AXIS5");
|
||||||
searchAction.setInterest(SoSearchAction::FIRST);
|
searchAction.setInterest(SoSearchAction::FIRST);
|
||||||
searchAction.setSearchingAll(FALSE);
|
searchAction.setSearchingAll(false);
|
||||||
searchAction.apply(pcRobotRoot);
|
searchAction.apply(pcRobotRoot);
|
||||||
path = searchAction.getPath();
|
path = searchAction.getPath();
|
||||||
if(path){
|
if(path){
|
||||||
|
@ -266,7 +266,7 @@ void ViewProviderRobotObject::updateData(const App::Property* prop)
|
||||||
// Axis 6
|
// Axis 6
|
||||||
searchAction.setName("FREECAD_AXIS6");
|
searchAction.setName("FREECAD_AXIS6");
|
||||||
searchAction.setInterest(SoSearchAction::FIRST);
|
searchAction.setInterest(SoSearchAction::FIRST);
|
||||||
searchAction.setSearchingAll(FALSE);
|
searchAction.setSearchingAll(false);
|
||||||
searchAction.apply(pcRobotRoot);
|
searchAction.apply(pcRobotRoot);
|
||||||
path = searchAction.getPath();
|
path = searchAction.getPath();
|
||||||
if(path){
|
if(path){
|
||||||
|
|
|
@ -4545,7 +4545,7 @@ public:
|
||||||
viewer = static_cast<Gui::View3DInventor *>(mdi)->getViewer();
|
viewer = static_cast<Gui::View3DInventor *>(mdi)->getViewer();
|
||||||
|
|
||||||
SoNode* root = viewer->getSceneGraph();
|
SoNode* root = viewer->getSceneGraph();
|
||||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(TRUE);
|
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(true);
|
||||||
|
|
||||||
Gui::Selection().clearSelection();
|
Gui::Selection().clearSelection();
|
||||||
Gui::Selection().rmvSelectionGate();
|
Gui::Selection().rmvSelectionGate();
|
||||||
|
|
|
@ -351,7 +351,7 @@ void ViewProviderSketch::purgeHandler(void)
|
||||||
viewer = static_cast<Gui::View3DInventor *>(mdi)->getViewer();
|
viewer = static_cast<Gui::View3DInventor *>(mdi)->getViewer();
|
||||||
|
|
||||||
SoNode* root = viewer->getSceneGraph();
|
SoNode* root = viewer->getSceneGraph();
|
||||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(FALSE);
|
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewProviderSketch::setAxisPickStyle(bool on)
|
void ViewProviderSketch::setAxisPickStyle(bool on)
|
||||||
|
@ -4612,9 +4612,9 @@ void ViewProviderSketch::setEditViewer(Gui::View3DInventorViewer* viewer, int Mo
|
||||||
|
|
||||||
viewer->setCameraOrientation(rot);
|
viewer->setCameraOrientation(rot);
|
||||||
|
|
||||||
viewer->setEditing(TRUE);
|
viewer->setEditing(true);
|
||||||
SoNode* root = viewer->getSceneGraph();
|
SoNode* root = viewer->getSceneGraph();
|
||||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(FALSE);
|
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(false);
|
||||||
|
|
||||||
viewer->addGraphicsItem(rubberband);
|
viewer->addGraphicsItem(rubberband);
|
||||||
rubberband->setViewer(viewer);
|
rubberband->setViewer(viewer);
|
||||||
|
@ -4623,9 +4623,9 @@ void ViewProviderSketch::setEditViewer(Gui::View3DInventorViewer* viewer, int Mo
|
||||||
void ViewProviderSketch::unsetEditViewer(Gui::View3DInventorViewer* viewer)
|
void ViewProviderSketch::unsetEditViewer(Gui::View3DInventorViewer* viewer)
|
||||||
{
|
{
|
||||||
viewer->removeGraphicsItem(rubberband);
|
viewer->removeGraphicsItem(rubberband);
|
||||||
viewer->setEditing(FALSE);
|
viewer->setEditing(false);
|
||||||
SoNode* root = viewer->getSceneGraph();
|
SoNode* root = viewer->getSceneGraph();
|
||||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(TRUE);
|
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewProviderSketch::setPositionText(const Base::Vector2D &Pos, const SbString &text)
|
void ViewProviderSketch::setPositionText(const Base::Vector2D &Pos, const SbString &text)
|
||||||
|
|
|
@ -480,7 +480,7 @@ void QtColorPicker::insertColor(const QColor &color, const QString &text, int in
|
||||||
/*! \property QtColorPicker::colorDialog
|
/*! \property QtColorPicker::colorDialog
|
||||||
\brief Whether the ellipsis "..." (more) button is available.
|
\brief Whether the ellipsis "..." (more) button is available.
|
||||||
|
|
||||||
If this property is set to TRUE, the color grid popup will include
|
If this property is set to true, the color grid popup will include
|
||||||
a "More" button (signified by an ellipsis, "...") which pops up a
|
a "More" button (signified by an ellipsis, "...") which pops up a
|
||||||
QColorDialog when clicked. The user will then be able to select
|
QColorDialog when clicked. The user will then be able to select
|
||||||
any custom color they like.
|
any custom color they like.
|
||||||
|
|
|
@ -77,7 +77,7 @@ bool UnitTestDialog::hasInstance()
|
||||||
* name 'name' and widget flags set to 'f'.
|
* name 'name' and widget flags set to 'f'.
|
||||||
*
|
*
|
||||||
* The dialog will by default be modeless, unless you set 'modal' to
|
* The dialog will by default be modeless, unless you set 'modal' to
|
||||||
* TRUE to construct a modal dialog.
|
* true to construct a modal dialog.
|
||||||
*/
|
*/
|
||||||
UnitTestDialog::UnitTestDialog(QWidget* parent, Qt::WindowFlags f)
|
UnitTestDialog::UnitTestDialog(QWidget* parent, Qt::WindowFlags f)
|
||||||
: QDialog(parent, f)
|
: QDialog(parent, f)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user