C++11: modernize use nullptr (replaces NULL or 0)
This commit is contained in:
@@ -64,7 +64,7 @@ struct NavigationStyleP {
|
||||
{
|
||||
this->animationsteps = 0;
|
||||
this->animationdelta = 0;
|
||||
this->animsensor = 0;
|
||||
this->animsensor = nullptr;
|
||||
this->sensitivity = 2.0f;
|
||||
this->resetcursorpos = false;
|
||||
this->rotationCenterFound = false;
|
||||
@@ -173,7 +173,7 @@ const Base::Type& NavigationStyleEvent::style() const
|
||||
|
||||
TYPESYSTEM_SOURCE_ABSTRACT(Gui::NavigationStyle,Base::BaseClass)
|
||||
|
||||
NavigationStyle::NavigationStyle() : viewer(0), mouseSelection(0)
|
||||
NavigationStyle::NavigationStyle() : viewer(nullptr), mouseSelection(nullptr)
|
||||
{
|
||||
PRIVATE(this) = new NavigationStyleP();
|
||||
PRIVATE(this)->animsensor = new SoTimerSensor(NavigationStyleP::viewAnimationCB, this);
|
||||
@@ -261,17 +261,17 @@ void NavigationStyle::finalize()
|
||||
delete[] this->log.time;
|
||||
}
|
||||
|
||||
void NavigationStyle::interactiveCountInc(void)
|
||||
void NavigationStyle::interactiveCountInc()
|
||||
{
|
||||
viewer->interactiveCountInc();
|
||||
}
|
||||
|
||||
void NavigationStyle::interactiveCountDec(void)
|
||||
void NavigationStyle::interactiveCountDec()
|
||||
{
|
||||
viewer->interactiveCountDec();
|
||||
}
|
||||
|
||||
int NavigationStyle::getInteractiveCount(void) const
|
||||
int NavigationStyle::getInteractiveCount() const
|
||||
{
|
||||
return viewer->getInteractiveCount();
|
||||
}
|
||||
@@ -288,7 +288,7 @@ NavigationStyle::OrbitStyle NavigationStyle::getOrbitStyle() const
|
||||
return NavigationStyle::OrbitStyle(projector->getOrbitStyle());
|
||||
}
|
||||
|
||||
SbBool NavigationStyle::isViewing(void) const
|
||||
SbBool NavigationStyle::isViewing() const
|
||||
{
|
||||
return viewer->isViewing();
|
||||
}
|
||||
@@ -298,7 +298,7 @@ void NavigationStyle::setViewing(SbBool enable)
|
||||
viewer->setViewing(enable);
|
||||
}
|
||||
|
||||
SbBool NavigationStyle::isSeekMode(void) const
|
||||
SbBool NavigationStyle::isSeekMode() const
|
||||
{
|
||||
return viewer->isSeekMode();
|
||||
}
|
||||
@@ -321,7 +321,7 @@ void NavigationStyle::seekToPoint(const SbVec3f& scenepos)
|
||||
SbBool NavigationStyle::lookAtPoint(const SbVec2s screenpos)
|
||||
{
|
||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||
if (cam == 0) return false;
|
||||
if (cam == nullptr) return false;
|
||||
|
||||
SoRayPickAction rpaction(viewer->getSoRenderManager()->getViewportRegion());
|
||||
rpaction.setPoint(screenpos);
|
||||
@@ -343,7 +343,7 @@ SbBool NavigationStyle::lookAtPoint(const SbVec2s screenpos)
|
||||
void NavigationStyle::lookAtPoint(const SbVec3f& pos)
|
||||
{
|
||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||
if (cam == 0) return;
|
||||
if (cam == nullptr) return;
|
||||
PRIVATE(this)->rotationCenterFound = false;
|
||||
|
||||
// Find global coordinates of focal point.
|
||||
@@ -401,7 +401,7 @@ void NavigationStyle::lookAtPoint(const SbVec3f& pos)
|
||||
void NavigationStyle::setCameraOrientation(const SbRotation& rot, SbBool moveToCenter)
|
||||
{
|
||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||
if (cam == 0) return;
|
||||
if (cam == nullptr) return;
|
||||
|
||||
// Find global coordinates of focal point.
|
||||
SbVec3f direction;
|
||||
@@ -611,7 +611,7 @@ void NavigationStyle::viewAll()
|
||||
*/
|
||||
void NavigationStyle::reorientCamera(SoCamera * cam, const SbRotation & rot)
|
||||
{
|
||||
if (cam == NULL) return;
|
||||
if (cam == nullptr) return;
|
||||
|
||||
// Find global coordinates of focal point.
|
||||
SbVec3f direction;
|
||||
@@ -630,7 +630,7 @@ void NavigationStyle::reorientCamera(SoCamera * cam, const SbRotation & rot)
|
||||
void NavigationStyle::panCamera(SoCamera * cam, float aspectratio, const SbPlane & panplane,
|
||||
const SbVec2f & currpos, const SbVec2f & prevpos)
|
||||
{
|
||||
if (cam == NULL) return; // can happen for empty scenegraph
|
||||
if (cam == nullptr) return; // can happen for empty scenegraph
|
||||
if (currpos == prevpos) return; // useless invocation
|
||||
|
||||
|
||||
@@ -659,7 +659,7 @@ void NavigationStyle::pan(SoCamera* camera)
|
||||
// The plane we're projecting the mouse coordinates to get 3D
|
||||
// coordinates should stay the same during the whole pan
|
||||
// operation, so we should calculate this value here.
|
||||
if (camera == NULL) { // can happen for empty scenegraph
|
||||
if (camera == nullptr) { // can happen for empty scenegraph
|
||||
this->panningplane = SbPlane(SbVec3f(0, 0, 1), 0);
|
||||
}
|
||||
else {
|
||||
@@ -689,7 +689,7 @@ void NavigationStyle::panToCenter(const SbPlane & pplane, const SbVec2f & currpo
|
||||
*/
|
||||
void NavigationStyle::zoom(SoCamera * cam, float diffvalue)
|
||||
{
|
||||
if (cam == NULL) return; // can happen for empty scenegraph
|
||||
if (cam == nullptr) return; // can happen for empty scenegraph
|
||||
SoType t = cam->getTypeId();
|
||||
SbName tname = t.getName();
|
||||
|
||||
@@ -870,7 +870,7 @@ void NavigationStyle::setRotationCenter(const SbVec3f& cnt)
|
||||
SbVec3f NavigationStyle::getFocalPoint() const
|
||||
{
|
||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||
if (cam == 0)
|
||||
if (cam == nullptr)
|
||||
return SbVec3f(0,0,0);
|
||||
|
||||
// Find global coordinates of focal point.
|
||||
@@ -887,7 +887,7 @@ SbVec3f NavigationStyle::getFocalPoint() const
|
||||
void NavigationStyle::spin(const SbVec2f & pointerpos)
|
||||
{
|
||||
if (this->log.historysize < 2) return;
|
||||
assert(this->spinprojector != NULL);
|
||||
assert(this->spinprojector != nullptr);
|
||||
|
||||
const SbViewportRegion & vp = viewer->getSoRenderManager()->getViewportRegion();
|
||||
SbVec2s glsize(vp.getViewportSizePixels());
|
||||
@@ -965,7 +965,7 @@ void NavigationStyle::spin(const SbVec2f & pointerpos)
|
||||
* \param prevpos previous normalized position of mouse pointer
|
||||
*/
|
||||
void NavigationStyle::spin_simplified(SoCamera* cam, SbVec2f curpos, SbVec2f prevpos){
|
||||
assert(this->spinprojector != NULL);
|
||||
assert(this->spinprojector != nullptr);
|
||||
|
||||
// 0000333: Turntable camera rotation
|
||||
SbMatrix mat;
|
||||
@@ -1163,7 +1163,7 @@ NavigationStyle::setAnimationEnabled(const SbBool enable)
|
||||
*/
|
||||
|
||||
SbBool
|
||||
NavigationStyle::isAnimationEnabled(void) const
|
||||
NavigationStyle::isAnimationEnabled() const
|
||||
{
|
||||
return this->spinanimatingallowed;
|
||||
}
|
||||
@@ -1172,7 +1172,7 @@ NavigationStyle::isAnimationEnabled(void) const
|
||||
Query if the model in the viewer is currently in spinning mode after
|
||||
a user drag.
|
||||
*/
|
||||
SbBool NavigationStyle::isAnimating(void) const
|
||||
SbBool NavigationStyle::isAnimating() const
|
||||
{
|
||||
return this->currentmode == NavigationStyle::SPINNING;
|
||||
}
|
||||
@@ -1195,7 +1195,7 @@ void NavigationStyle::startAnimating(const SbVec3f& axis, float velocity)
|
||||
this->spinRotation = rot;
|
||||
}
|
||||
|
||||
void NavigationStyle::stopAnimating(void)
|
||||
void NavigationStyle::stopAnimating()
|
||||
{
|
||||
if (this->currentmode != NavigationStyle::SPINNING) {
|
||||
return;
|
||||
@@ -1321,7 +1321,7 @@ void NavigationStyle::stopSelection()
|
||||
if (mouseSelection) {
|
||||
mouseSelection->releaseMouseModel();
|
||||
delete mouseSelection;
|
||||
mouseSelection = 0;
|
||||
mouseSelection = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1367,7 +1367,7 @@ void NavigationStyle::addToLog(const SbVec2s pos, const SbTime time)
|
||||
|
||||
// This method "clears" the mouse location log, used for spin
|
||||
// animation calculations.
|
||||
void NavigationStyle::clearLog(void)
|
||||
void NavigationStyle::clearLog()
|
||||
{
|
||||
this->log.historysize = 0;
|
||||
}
|
||||
@@ -1461,14 +1461,14 @@ SbBool NavigationStyle::processEvent(const SoEvent * const ev)
|
||||
pcPolygon = mouseSelection->getPositions();
|
||||
selectedRole = mouseSelection->selectedRole();
|
||||
delete mouseSelection;
|
||||
mouseSelection = 0;
|
||||
mouseSelection = nullptr;
|
||||
syncWithEvent(ev);
|
||||
return NavigationStyle::processSoEvent(ev);
|
||||
}
|
||||
else if (hd==AbstractMouseSelection::Cancel) {
|
||||
pcPolygon.clear();
|
||||
delete mouseSelection;
|
||||
mouseSelection = 0;
|
||||
mouseSelection = nullptr;
|
||||
syncWithEvent(ev);
|
||||
return NavigationStyle::processSoEvent(ev);
|
||||
}
|
||||
@@ -1495,11 +1495,8 @@ SbBool NavigationStyle::processEvent(const SoEvent * const ev)
|
||||
|
||||
SbBool NavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
{
|
||||
const SbViewportRegion & vp = viewer->getSoRenderManager()->getViewportRegion();
|
||||
const SbVec2s size(vp.getViewportSizePixels());
|
||||
const SbVec2s pos(ev->getPosition());
|
||||
const SbVec2f posn((float) pos[0] / (float) std::max((int)(size[0] - 1), 1),
|
||||
(float) pos[1] / (float) std::max((int)(size[1] - 1), 1));
|
||||
const SbVec2f posn = normalizePixelPos(pos);
|
||||
bool processed = false;
|
||||
|
||||
//handle mouse wheel zoom
|
||||
@@ -1529,15 +1526,7 @@ void NavigationStyle::syncWithEvent(const SoEvent * const ev)
|
||||
|
||||
// Mismatches in state of the modifier keys happens if the user
|
||||
// presses or releases them outside the viewer window.
|
||||
if (this->ctrldown != ev->wasCtrlDown()) {
|
||||
this->ctrldown = ev->wasCtrlDown();
|
||||
}
|
||||
if (this->shiftdown != ev->wasShiftDown()) {
|
||||
this->shiftdown = ev->wasShiftDown();
|
||||
}
|
||||
if (this->altdown != ev->wasAltDown()) {
|
||||
this->altdown = ev->wasAltDown();
|
||||
}
|
||||
syncModifierKeys(ev);
|
||||
|
||||
// Keyboard handling
|
||||
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
||||
@@ -1708,7 +1697,7 @@ void NavigationStyle::setPopupMenuEnabled(const SbBool on)
|
||||
this->menuenabled = on;
|
||||
}
|
||||
|
||||
SbBool NavigationStyle::isPopupMenuEnabled(void) const
|
||||
SbBool NavigationStyle::isPopupMenuEnabled() const
|
||||
{
|
||||
return this->menuenabled;
|
||||
}
|
||||
|
||||
@@ -116,11 +116,11 @@ public:
|
||||
void setViewer(View3DInventorViewer*);
|
||||
|
||||
void setAnimationEnabled(const SbBool enable);
|
||||
SbBool isAnimationEnabled(void) const;
|
||||
SbBool isAnimationEnabled() const;
|
||||
|
||||
void startAnimating(const SbVec3f& axis, float velocity);
|
||||
void stopAnimating(void);
|
||||
SbBool isAnimating(void) const;
|
||||
void stopAnimating();
|
||||
SbBool isAnimating() const;
|
||||
|
||||
void setSensitivity(float);
|
||||
float getSensitivity() const;
|
||||
@@ -156,14 +156,14 @@ public:
|
||||
virtual SbBool processClickEvent(const SoMouseButtonEvent * const event);
|
||||
|
||||
void setPopupMenuEnabled(const SbBool on);
|
||||
SbBool isPopupMenuEnabled(void) const;
|
||||
SbBool isPopupMenuEnabled() const;
|
||||
|
||||
void startSelection(AbstractMouseSelection*);
|
||||
void startSelection(SelectionMode = Lasso);
|
||||
void abortSelection();
|
||||
void stopSelection();
|
||||
SbBool isSelecting() const;
|
||||
const std::vector<SbVec2s>& getPolygon(SelectionRole* role=0) const;
|
||||
const std::vector<SbVec2s>& getPolygon(SelectionRole* role=nullptr) const;
|
||||
|
||||
void setOrbitStyle(OrbitStyle style);
|
||||
OrbitStyle getOrbitStyle() const;
|
||||
@@ -172,13 +172,13 @@ protected:
|
||||
void initialize();
|
||||
void finalize();
|
||||
|
||||
void interactiveCountInc(void);
|
||||
void interactiveCountDec(void);
|
||||
int getInteractiveCount(void) const;
|
||||
void interactiveCountInc();
|
||||
void interactiveCountDec();
|
||||
int getInteractiveCount() const;
|
||||
|
||||
SbBool isViewing(void) const;
|
||||
SbBool isViewing() const;
|
||||
void setViewing(SbBool);
|
||||
SbBool isSeekMode(void) const;
|
||||
SbBool isSeekMode() const;
|
||||
void setSeekMode(SbBool enable);
|
||||
SbBool seekToPoint(const SbVec2s screenpos);
|
||||
void seekToPoint(const SbVec3f& scenepos);
|
||||
@@ -213,7 +213,7 @@ protected:
|
||||
void syncWithEvent(const SoEvent * const ev);
|
||||
virtual void openPopupMenu(const SbVec2s& position);
|
||||
|
||||
void clearLog(void);
|
||||
void clearLog();
|
||||
void addToLog(const SbVec2s pos, const SbTime time);
|
||||
|
||||
void syncModifierKeys(const SoEvent * const ev);
|
||||
|
||||
@@ -58,9 +58,9 @@ ContextMenu::ContextMenu(QuarterWidget * quarterwidget)
|
||||
|
||||
SoRenderManager * sorendermanager = quarterwidget->getSoRenderManager();
|
||||
|
||||
QActionGroup * rendermodegroup = NULL;
|
||||
QActionGroup * stereomodegroup = NULL;
|
||||
QActionGroup * transparencytypegroup = NULL;
|
||||
QActionGroup * rendermodegroup = nullptr;
|
||||
QActionGroup * stereomodegroup = nullptr;
|
||||
QActionGroup * transparencytypegroup = nullptr;
|
||||
|
||||
foreach (QAction * action, quarterwidget->renderModeActions()) {
|
||||
if (!rendermodegroup) {
|
||||
@@ -138,7 +138,7 @@ ContextMenu::~ContextMenu()
|
||||
}
|
||||
|
||||
QMenu *
|
||||
ContextMenu::getMenu(void) const
|
||||
ContextMenu::getMenu() const
|
||||
{
|
||||
return this->contextmenu;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
ContextMenu(QuarterWidget * quarterwidget);
|
||||
~ContextMenu();
|
||||
|
||||
QMenu * getMenu(void) const;
|
||||
QMenu * getMenu() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void changeRenderMode(QAction * action);
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <Inventor/nodes/SoSeparator.h>
|
||||
|
||||
#include <Quarter/QuarterWidget.h>
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace SIM { namespace Coin3D { namespace Quarter {
|
||||
|
||||
@@ -152,7 +152,7 @@ DragDropHandlerP::dropEvent(QDropEvent * event)
|
||||
|
||||
// attempt to import it
|
||||
root = SoDB::readAll(&in);
|
||||
if (root == NULL) return;
|
||||
if (root == nullptr) return;
|
||||
|
||||
// set new scenegraph
|
||||
this->quarterwidget->setSceneGraph(root);
|
||||
|
||||
@@ -177,7 +177,7 @@ EventFilter::eventFilter(QObject * obj, QEvent * qevent)
|
||||
Returns mouse position in global coordinates
|
||||
*/
|
||||
const QPoint &
|
||||
EventFilter::globalMousePosition(void) const
|
||||
EventFilter::globalMousePosition() const
|
||||
{
|
||||
return PRIVATE(this)->globalmousepos;
|
||||
}
|
||||
|
||||
@@ -39,12 +39,12 @@
|
||||
|
||||
using namespace SIM::Coin3D::Quarter;
|
||||
|
||||
ImageReader::ImageReader(void)
|
||||
ImageReader::ImageReader()
|
||||
{
|
||||
SbImage::addReadImageCB(ImageReader::readImageCB, this);
|
||||
}
|
||||
|
||||
ImageReader::~ImageReader(void)
|
||||
ImageReader::~ImageReader()
|
||||
{
|
||||
SbImage::removeReadImageCB(ImageReader::readImageCB, this);
|
||||
}
|
||||
|
||||
@@ -43,8 +43,8 @@ namespace SIM { namespace Coin3D { namespace Quarter {
|
||||
|
||||
class ImageReader {
|
||||
public:
|
||||
ImageReader(void);
|
||||
~ImageReader(void);
|
||||
ImageReader();
|
||||
~ImageReader();
|
||||
|
||||
SbBool readImage(const SbString & filename, SbImage & image) const;
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ using namespace SIM::Coin3D::Quarter;
|
||||
devices.
|
||||
*/
|
||||
|
||||
InputDevice::InputDevice(void) : quarter(nullptr)
|
||||
InputDevice::InputDevice() : quarter(nullptr)
|
||||
{
|
||||
this->mousepos = SbVec2s(0, 0);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ InteractionMode::setEnabled(bool yes)
|
||||
}
|
||||
|
||||
bool
|
||||
InteractionMode::enabled(void) const
|
||||
InteractionMode::enabled() const
|
||||
{
|
||||
return this->isenabled;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ InteractionMode::setOn(bool on)
|
||||
}
|
||||
|
||||
bool
|
||||
InteractionMode::on(void) const
|
||||
InteractionMode::on() const
|
||||
{
|
||||
return this->altkeydown;
|
||||
}
|
||||
|
||||
@@ -54,10 +54,10 @@ public:
|
||||
virtual ~InteractionMode();
|
||||
|
||||
void setEnabled(bool yes);
|
||||
bool enabled(void) const;
|
||||
bool enabled() const;
|
||||
|
||||
void setOn(bool on);
|
||||
bool on(void) const;
|
||||
bool on() const;
|
||||
|
||||
protected:
|
||||
virtual bool eventFilter(QObject *, QEvent * event);
|
||||
|
||||
@@ -55,7 +55,7 @@ using namespace SIM::Coin3D::Quarter;
|
||||
|
||||
#define PRIVATE(obj) obj->pimpl
|
||||
|
||||
Keyboard::Keyboard(void)
|
||||
Keyboard::Keyboard()
|
||||
{
|
||||
PRIVATE(this) = new KeyboardP(this);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ Keyboard::translateEvent(QEvent * event)
|
||||
case QEvent::KeyRelease:
|
||||
return PRIVATE(this)->keyEvent((QKeyEvent *) event);
|
||||
default:
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ KeyboardP::KeyboardP(Keyboard * publ)
|
||||
PUBLIC(this) = publ;
|
||||
this->keyboard = new SoKeyboardEvent;
|
||||
|
||||
if (keyboardmap == NULL) {
|
||||
if (keyboardmap == nullptr) {
|
||||
keyboardmap = new KeyMap;
|
||||
keypadmap = new KeyMap;
|
||||
this->initKeyMap();
|
||||
@@ -57,7 +57,7 @@ KeyboardP::~KeyboardP()
|
||||
}
|
||||
|
||||
bool
|
||||
KeyboardP::debugKeyEvents(void)
|
||||
KeyboardP::debugKeyEvents()
|
||||
{
|
||||
const char * env = coin_getenv("QUARTER_DEBUG_KEYEVENTS");
|
||||
return env && (atoi(env) > 0);
|
||||
@@ -103,11 +103,11 @@ KeyboardP::keyEvent(QKeyEvent * qevent)
|
||||
return this->keyboard;
|
||||
}
|
||||
|
||||
KeyboardP::KeyMap * KeyboardP::keyboardmap = NULL;
|
||||
KeyboardP::KeyMap * KeyboardP::keypadmap = NULL;
|
||||
KeyboardP::KeyMap * KeyboardP::keyboardmap = nullptr;
|
||||
KeyboardP::KeyMap * KeyboardP::keypadmap = nullptr;
|
||||
|
||||
void
|
||||
KeyboardP::initKeyMap(void)
|
||||
KeyboardP::initKeyMap()
|
||||
{
|
||||
// keyboard
|
||||
keyboardmap->insert(Qt::Key_Shift, SoKeyboardEvent::LEFT_SHIFT);
|
||||
|
||||
@@ -49,8 +49,8 @@ public:
|
||||
~KeyboardP();
|
||||
|
||||
const SoEvent * keyEvent(QKeyEvent * event);
|
||||
void initKeyMap(void);
|
||||
static bool debugKeyEvents(void);
|
||||
void initKeyMap();
|
||||
static bool debugKeyEvents();
|
||||
|
||||
typedef QMap<Qt::Key, SoKeyboardEvent::Key> KeyMap;
|
||||
static KeyMap * keyboardmap;
|
||||
|
||||
@@ -95,7 +95,7 @@ using namespace SIM::Coin3D::Quarter;
|
||||
#define PRIVATE(obj) obj->pimpl
|
||||
#define PUBLIC(obj) obj->publ
|
||||
|
||||
Mouse::Mouse(void)
|
||||
Mouse::Mouse()
|
||||
{
|
||||
PRIVATE(this) = new MouseP(this);
|
||||
}
|
||||
@@ -131,9 +131,9 @@ Mouse::translateEvent(QEvent * event)
|
||||
return PRIVATE(this)->mouseWheelEvent((QWheelEvent *) event);
|
||||
case QEvent::Resize:
|
||||
PRIVATE(this)->resizeEvent((QResizeEvent *) event);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
default:
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ NativeEvent::getEvent() const
|
||||
NativeEvent::NativeEvent()
|
||||
: QEvent(QEvent::User)
|
||||
{
|
||||
this->rawevent = NULL;
|
||||
this->rawevent = nullptr;
|
||||
}
|
||||
|
||||
#endif // !HAVE_SPACENAV_LIB
|
||||
|
||||
@@ -22,7 +22,7 @@ QtCoinCompatibility::QImageToSbImage(const QImage & image, SbImage & sbimage)
|
||||
}
|
||||
|
||||
SbVec2s size((short) w, (short) h);
|
||||
sbimage.setValue(size, c, NULL);
|
||||
sbimage.setValue(size, c, nullptr);
|
||||
unsigned char * buffer = sbimage.getValue(size, c);
|
||||
|
||||
if (c == 1) {
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
|
||||
using namespace SIM::Coin3D::Quarter;
|
||||
|
||||
static QuarterP * self = NULL;
|
||||
static QuarterP * self = nullptr;
|
||||
|
||||
/*!
|
||||
initialize Quarter, and implicitly Coin
|
||||
@@ -182,14 +182,14 @@ Quarter::init(bool initCoin)
|
||||
clean up resources
|
||||
*/
|
||||
void
|
||||
Quarter::clean(void)
|
||||
Quarter::clean()
|
||||
{
|
||||
COMPILE_ONLY_BEFORE(2,0,0,"Should not be encapsulated in double Quarter namespace");
|
||||
assert(self);
|
||||
bool initCoin = self->initCoin;
|
||||
|
||||
delete self;
|
||||
self = NULL;
|
||||
self = nullptr;
|
||||
|
||||
if (initCoin) {
|
||||
// SoDB::finish() will clean up everything that has been
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace SIM { namespace Coin3D { namespace Quarter {
|
||||
|
||||
namespace Quarter {
|
||||
void QUARTER_DLL_API init(bool initCoin = true);
|
||||
void QUARTER_DLL_API clean(void);
|
||||
void QUARTER_DLL_API clean();
|
||||
void QUARTER_DLL_API setTimerEpsilon(double sec);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include "KeyboardP.h"
|
||||
|
||||
using namespace SIM::Coin3D::Quarter;
|
||||
QuarterP::StateCursorMap * QuarterP::statecursormap = NULL;
|
||||
QuarterP::StateCursorMap * QuarterP::statecursormap = nullptr;
|
||||
|
||||
QuarterP::QuarterP(void)
|
||||
QuarterP::QuarterP()
|
||||
{
|
||||
this->sensormanager = new SensorManager;
|
||||
this->imagereader = new ImageReader;
|
||||
assert(QuarterP::statecursormap == NULL);
|
||||
assert(QuarterP::statecursormap == nullptr);
|
||||
QuarterP::statecursormap = new StateCursorMap;
|
||||
|
||||
}
|
||||
@@ -20,17 +20,17 @@ QuarterP::~QuarterP()
|
||||
delete this->imagereader;
|
||||
delete this->sensormanager;
|
||||
|
||||
assert(QuarterP::statecursormap != NULL);
|
||||
assert(QuarterP::statecursormap != nullptr);
|
||||
delete QuarterP::statecursormap;
|
||||
|
||||
// FIXME: Why not use an atexit mechanism for this?
|
||||
if (KeyboardP::keyboardmap != NULL) {
|
||||
if (KeyboardP::keyboardmap != nullptr) {
|
||||
KeyboardP::keyboardmap->clear();
|
||||
KeyboardP::keypadmap->clear();
|
||||
delete KeyboardP::keyboardmap;
|
||||
delete KeyboardP::keypadmap;
|
||||
KeyboardP::keyboardmap = NULL;
|
||||
KeyboardP::keypadmap = NULL;
|
||||
KeyboardP::keyboardmap = nullptr;
|
||||
KeyboardP::keypadmap = nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#pragma warning(disable : 4267)
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
|
||||
#include <Quarter/QuarterWidget.h>
|
||||
#include <Quarter/eventhandlers/EventFilter.h>
|
||||
@@ -152,7 +152,7 @@ class CustomGLWidget : public QOpenGLWidget {
|
||||
public:
|
||||
QSurfaceFormat myFormat;
|
||||
|
||||
CustomGLWidget(const QSurfaceFormat& format, QWidget* parent = 0, const QOpenGLWidget* shareWidget = 0, Qt::WindowFlags f = Qt::WindowFlags())
|
||||
CustomGLWidget(const QSurfaceFormat& format, QWidget* parent = nullptr, const QOpenGLWidget* shareWidget = nullptr, Qt::WindowFlags f = Qt::WindowFlags())
|
||||
: QOpenGLWidget(parent, f), myFormat(format)
|
||||
{
|
||||
Q_UNUSED(shareWidget);
|
||||
@@ -308,7 +308,7 @@ QuarterWidget::constructor(const QtGLFormat & format, const QtGLWidget * sharewi
|
||||
PRIVATE(this)->eventfilter = new EventFilter(this);
|
||||
PRIVATE(this)->interactionmode = new InteractionMode(this);
|
||||
|
||||
PRIVATE(this)->currentStateMachine = NULL;
|
||||
PRIVATE(this)->currentStateMachine = nullptr;
|
||||
|
||||
PRIVATE(this)->headlight = new SoDirectionalLight;
|
||||
PRIVATE(this)->headlight->ref();
|
||||
@@ -364,10 +364,10 @@ QuarterWidget::~QuarterWidget()
|
||||
delete PRIVATE(this)->currentStateMachine;
|
||||
}
|
||||
PRIVATE(this)->headlight->unref();
|
||||
PRIVATE(this)->headlight = NULL;
|
||||
this->setSceneGraph(NULL);
|
||||
this->setSoRenderManager(NULL);
|
||||
this->setSoEventManager(NULL);
|
||||
PRIVATE(this)->headlight = nullptr;
|
||||
this->setSceneGraph(nullptr);
|
||||
this->setSoRenderManager(nullptr);
|
||||
this->setSoEventManager(nullptr);
|
||||
delete PRIVATE(this)->eventfilter;
|
||||
delete PRIVATE(this);
|
||||
}
|
||||
@@ -418,7 +418,7 @@ QuarterWidget::setHeadlightEnabled(bool onoff)
|
||||
Returns true if the headlight is on, false if it is off
|
||||
*/
|
||||
bool
|
||||
QuarterWidget::headlightEnabled(void) const
|
||||
QuarterWidget::headlightEnabled() const
|
||||
{
|
||||
return PRIVATE(this)->headlight->on.getValue();
|
||||
}
|
||||
@@ -427,7 +427,7 @@ QuarterWidget::headlightEnabled(void) const
|
||||
Returns the light used for the headlight.
|
||||
*/
|
||||
SoDirectionalLight *
|
||||
QuarterWidget::getHeadlight(void) const
|
||||
QuarterWidget::getHeadlight() const
|
||||
{
|
||||
return PRIVATE(this)->headlight;
|
||||
}
|
||||
@@ -452,7 +452,7 @@ QuarterWidget::setClearZBuffer(bool onoff)
|
||||
Returns true if the z buffer is cleared before rendering.
|
||||
*/
|
||||
bool
|
||||
QuarterWidget::clearZBuffer(void) const
|
||||
QuarterWidget::clearZBuffer() const
|
||||
{
|
||||
return PRIVATE(this)->clearzbuffer;
|
||||
}
|
||||
@@ -477,7 +477,7 @@ QuarterWidget::setClearWindow(bool onoff)
|
||||
Returns true if the rendering buffer is cleared before rendering.
|
||||
*/
|
||||
bool
|
||||
QuarterWidget::clearWindow(void) const
|
||||
QuarterWidget::clearWindow() const
|
||||
{
|
||||
return PRIVATE(this)->clearwindow;
|
||||
}
|
||||
@@ -503,7 +503,7 @@ QuarterWidget::setInteractionModeEnabled(bool onoff)
|
||||
Returns true if interaction mode is enabled, false otherwise.
|
||||
*/
|
||||
bool
|
||||
QuarterWidget::interactionModeEnabled(void) const
|
||||
QuarterWidget::interactionModeEnabled() const
|
||||
{
|
||||
return PRIVATE(this)->interactionmode->enabled();
|
||||
}
|
||||
@@ -527,7 +527,7 @@ QuarterWidget::setInteractionModeOn(bool onoff)
|
||||
Returns true if interaction mode is on.
|
||||
*/
|
||||
bool
|
||||
QuarterWidget::interactionModeOn(void) const
|
||||
QuarterWidget::interactionModeOn() const
|
||||
{
|
||||
return PRIVATE(this)->interactionmode->on();
|
||||
}
|
||||
@@ -536,7 +536,7 @@ QuarterWidget::interactionModeOn(void) const
|
||||
Returns the Coin cache context id for this widget.
|
||||
*/
|
||||
uint32_t
|
||||
QuarterWidget::getCacheContextId(void) const
|
||||
QuarterWidget::getCacheContextId() const
|
||||
{
|
||||
return PRIVATE(this)->getCacheContextId();
|
||||
}
|
||||
@@ -562,7 +562,7 @@ QuarterWidget::setTransparencyType(TransparencyType type)
|
||||
\retval The current \ref TransparencyType
|
||||
*/
|
||||
QuarterWidget::TransparencyType
|
||||
QuarterWidget::transparencyType(void) const
|
||||
QuarterWidget::transparencyType() const
|
||||
{
|
||||
assert(PRIVATE(this)->sorendermanager);
|
||||
SoGLRenderAction * action = PRIVATE(this)->sorendermanager->getGLRenderAction();
|
||||
@@ -590,7 +590,7 @@ QuarterWidget::setRenderMode(RenderMode mode)
|
||||
\retval The current \ref RenderMode
|
||||
*/
|
||||
QuarterWidget::RenderMode
|
||||
QuarterWidget::renderMode(void) const
|
||||
QuarterWidget::renderMode() const
|
||||
{
|
||||
assert(PRIVATE(this)->sorendermanager);
|
||||
return static_cast<RenderMode>(PRIVATE(this)->sorendermanager->getRenderMode());
|
||||
@@ -618,7 +618,7 @@ QuarterWidget::setStereoMode(StereoMode mode)
|
||||
\retval The current \ref StereoMode
|
||||
*/
|
||||
QuarterWidget::StereoMode
|
||||
QuarterWidget::stereoMode(void) const
|
||||
QuarterWidget::stereoMode() const
|
||||
{
|
||||
assert(PRIVATE(this)->sorendermanager);
|
||||
return static_cast<StereoMode>(PRIVATE(this)->sorendermanager->getStereoMode());
|
||||
@@ -636,7 +636,7 @@ the widget is located within, and updated whenever any change occurs, emitting a
|
||||
*/
|
||||
|
||||
qreal
|
||||
QuarterWidget::devicePixelRatio(void) const
|
||||
QuarterWidget::devicePixelRatio() const
|
||||
{
|
||||
return PRIVATE(this)->device_pixel_ratio;
|
||||
}
|
||||
@@ -653,11 +653,11 @@ QuarterWidget::setSceneGraph(SoNode * node)
|
||||
|
||||
if (PRIVATE(this)->scene) {
|
||||
PRIVATE(this)->scene->unref();
|
||||
PRIVATE(this)->scene = NULL;
|
||||
PRIVATE(this)->scene = nullptr;
|
||||
}
|
||||
|
||||
SoCamera * camera = NULL;
|
||||
SoSeparator * superscene = NULL;
|
||||
SoCamera * camera = nullptr;
|
||||
SoSeparator * superscene = nullptr;
|
||||
bool viewall = false;
|
||||
|
||||
if (node) {
|
||||
@@ -690,7 +690,7 @@ QuarterWidget::setSceneGraph(SoNode * node)
|
||||
Returns pointer to root of scene graph
|
||||
*/
|
||||
SoNode *
|
||||
QuarterWidget::getSceneGraph(void) const
|
||||
QuarterWidget::getSceneGraph() const
|
||||
{
|
||||
return PRIVATE(this)->scene;
|
||||
}
|
||||
@@ -702,10 +702,10 @@ void
|
||||
QuarterWidget::setSoRenderManager(SoRenderManager * manager)
|
||||
{
|
||||
bool carrydata = false;
|
||||
SoNode * scene = NULL;
|
||||
SoCamera * camera = NULL;
|
||||
SoNode * scene = nullptr;
|
||||
SoCamera * camera = nullptr;
|
||||
SbViewportRegion vp;
|
||||
if (PRIVATE(this)->sorendermanager && (manager != NULL)) {
|
||||
if (PRIVATE(this)->sorendermanager && (manager != nullptr)) {
|
||||
scene = PRIVATE(this)->sorendermanager->getSceneGraph();
|
||||
camera = PRIVATE(this)->sorendermanager->getCamera();
|
||||
vp = PRIVATE(this)->sorendermanager->getViewportRegion();
|
||||
@@ -735,7 +735,7 @@ QuarterWidget::setSoRenderManager(SoRenderManager * manager)
|
||||
Returns a pointer to the render manager.
|
||||
*/
|
||||
SoRenderManager *
|
||||
QuarterWidget::getSoRenderManager(void) const
|
||||
QuarterWidget::getSoRenderManager() const
|
||||
{
|
||||
return PRIVATE(this)->sorendermanager;
|
||||
}
|
||||
@@ -747,10 +747,10 @@ void
|
||||
QuarterWidget::setSoEventManager(SoEventManager * manager)
|
||||
{
|
||||
bool carrydata = false;
|
||||
SoNode * scene = NULL;
|
||||
SoCamera * camera = NULL;
|
||||
SoNode * scene = nullptr;
|
||||
SoCamera * camera = nullptr;
|
||||
SbViewportRegion vp;
|
||||
if (PRIVATE(this)->soeventmanager && (manager != NULL)) {
|
||||
if (PRIVATE(this)->soeventmanager && (manager != nullptr)) {
|
||||
scene = PRIVATE(this)->soeventmanager->getSceneGraph();
|
||||
camera = PRIVATE(this)->soeventmanager->getCamera();
|
||||
vp = PRIVATE(this)->soeventmanager->getViewportRegion();
|
||||
@@ -780,7 +780,7 @@ QuarterWidget::setSoEventManager(SoEventManager * manager)
|
||||
Returns a pointer to the event manager
|
||||
*/
|
||||
SoEventManager *
|
||||
QuarterWidget::getSoEventManager(void) const
|
||||
QuarterWidget::getSoEventManager() const
|
||||
{
|
||||
return PRIVATE(this)->soeventmanager;
|
||||
}
|
||||
@@ -789,7 +789,7 @@ QuarterWidget::getSoEventManager(void) const
|
||||
Returns a pointer to the event filter
|
||||
*/
|
||||
EventFilter *
|
||||
QuarterWidget::getEventFilter(void) const
|
||||
QuarterWidget::getEventFilter() const
|
||||
{
|
||||
return PRIVATE(this)->eventfilter;
|
||||
}
|
||||
@@ -798,7 +798,7 @@ QuarterWidget::getEventFilter(void) const
|
||||
Reposition the current camera to display the entire scene
|
||||
*/
|
||||
void
|
||||
QuarterWidget::viewAll(void)
|
||||
QuarterWidget::viewAll()
|
||||
{
|
||||
const SbName viewallevent("sim.coin3d.coin.navigation.ViewAll");
|
||||
for (int c = 0; c < PRIVATE(this)->soeventmanager->getNumSoScXMLStateMachines(); ++c) {
|
||||
@@ -816,7 +816,7 @@ QuarterWidget::viewAll(void)
|
||||
Camera typically seeks towards what the mouse is pointing at.
|
||||
*/
|
||||
void
|
||||
QuarterWidget::seek(void)
|
||||
QuarterWidget::seek()
|
||||
{
|
||||
const SbName seekevent("sim.coin3d.coin.navigation.Seek");
|
||||
for (int c = 0; c < PRIVATE(this)->soeventmanager->getNumSoScXMLStateMachines(); ++c) {
|
||||
@@ -830,10 +830,10 @@ QuarterWidget::seek(void)
|
||||
}
|
||||
|
||||
bool
|
||||
QuarterWidget::updateDevicePixelRatio(void) {
|
||||
QuarterWidget::updateDevicePixelRatio() {
|
||||
qreal dev_pix_ratio = 1.0;
|
||||
QWidget* winwidg = window();
|
||||
QWindow* win = NULL;
|
||||
QWindow* win = nullptr;
|
||||
if(winwidg) {
|
||||
win = winwidg->windowHandle();
|
||||
}
|
||||
@@ -1023,7 +1023,7 @@ bool QuarterWidget::viewportEvent(QEvent* event)
|
||||
render manager and render the scene by calling this method.
|
||||
*/
|
||||
void
|
||||
QuarterWidget::redraw(void)
|
||||
QuarterWidget::redraw()
|
||||
{
|
||||
// we're triggering the next paintGL(). Set a flag to remember this
|
||||
// to avoid that we process the delay queue in paintGL()
|
||||
@@ -1050,7 +1050,7 @@ QuarterWidget::redraw(void)
|
||||
Overridden from QGLWidget to render the scenegraph
|
||||
*/
|
||||
void
|
||||
QuarterWidget::actualRedraw(void)
|
||||
QuarterWidget::actualRedraw()
|
||||
{
|
||||
PRIVATE(this)->sorendermanager->render(PRIVATE(this)->clearwindow,
|
||||
PRIVATE(this)->clearzbuffer);
|
||||
@@ -1102,7 +1102,7 @@ QuarterWidget::setBackgroundColor(const QColor & color)
|
||||
rendering the scene.
|
||||
*/
|
||||
QColor
|
||||
QuarterWidget::backgroundColor(void) const
|
||||
QuarterWidget::backgroundColor() const
|
||||
{
|
||||
SbColor4f bg = PRIVATE(this)->sorendermanager->getBackgroundColor();
|
||||
|
||||
@@ -1116,7 +1116,7 @@ QuarterWidget::backgroundColor(void) const
|
||||
Returns the context menu used by the widget.
|
||||
*/
|
||||
QMenu *
|
||||
QuarterWidget::getContextMenu(void) const
|
||||
QuarterWidget::getContextMenu() const
|
||||
{
|
||||
return PRIVATE(this)->contextMenu();
|
||||
}
|
||||
@@ -1125,7 +1125,7 @@ QuarterWidget::getContextMenu(void) const
|
||||
\retval Is context menu enabled?
|
||||
*/
|
||||
bool
|
||||
QuarterWidget::contextMenuEnabled(void) const
|
||||
QuarterWidget::contextMenuEnabled() const
|
||||
{
|
||||
return PRIVATE(this)->contextmenuenabled;
|
||||
}
|
||||
@@ -1175,8 +1175,8 @@ void
|
||||
QuarterWidget::removeStateMachine(SoScXMLStateMachine * statemachine)
|
||||
{
|
||||
SoEventManager * em = this->getSoEventManager();
|
||||
statemachine->setSceneGraphRoot(NULL);
|
||||
statemachine->setActiveCamera(NULL);
|
||||
statemachine->setSceneGraphRoot(nullptr);
|
||||
statemachine->setActiveCamera(nullptr);
|
||||
em->removeSoScXMLStateMachine(statemachine);
|
||||
}
|
||||
|
||||
@@ -1184,7 +1184,7 @@ QuarterWidget::removeStateMachine(SoScXMLStateMachine * statemachine)
|
||||
See \ref QWidget::minimumSizeHint
|
||||
*/
|
||||
QSize
|
||||
QuarterWidget::minimumSizeHint(void) const
|
||||
QuarterWidget::minimumSizeHint() const
|
||||
{
|
||||
return QSize(50, 50);
|
||||
}
|
||||
@@ -1195,7 +1195,7 @@ QuarterWidget::minimumSizeHint(void) const
|
||||
QuarterWidget, add these actions to the menu.
|
||||
*/
|
||||
QList<QAction *>
|
||||
QuarterWidget::transparencyTypeActions(void) const
|
||||
QuarterWidget::transparencyTypeActions() const
|
||||
{
|
||||
return PRIVATE(this)->transparencyTypeActions();
|
||||
}
|
||||
@@ -1206,7 +1206,7 @@ QuarterWidget::transparencyTypeActions(void) const
|
||||
QuarterWidget, add these actions to the menu.
|
||||
*/
|
||||
QList<QAction *>
|
||||
QuarterWidget::stereoModeActions(void) const
|
||||
QuarterWidget::stereoModeActions() const
|
||||
{
|
||||
return PRIVATE(this)->stereoModeActions();
|
||||
}
|
||||
@@ -1217,7 +1217,7 @@ QuarterWidget::stereoModeActions(void) const
|
||||
QuarterWidget, add these actions to the menu.
|
||||
*/
|
||||
QList<QAction *>
|
||||
QuarterWidget::renderModeActions(void) const
|
||||
QuarterWidget::renderModeActions() const
|
||||
{
|
||||
return PRIVATE(this)->renderModeActions();
|
||||
}
|
||||
@@ -1239,7 +1239,7 @@ QuarterWidget::renderModeActions(void) const
|
||||
Removes any navigationModeFile set.
|
||||
*/
|
||||
void
|
||||
QuarterWidget::resetNavigationModeFile(void) {
|
||||
QuarterWidget::resetNavigationModeFile() {
|
||||
this->setNavigationModeFile(QUrl());
|
||||
}
|
||||
|
||||
@@ -1276,7 +1276,7 @@ QuarterWidget::setNavigationModeFile(const QUrl & url)
|
||||
if (PRIVATE(this)->currentStateMachine) {
|
||||
this->removeStateMachine(PRIVATE(this)->currentStateMachine);
|
||||
delete PRIVATE(this)->currentStateMachine;
|
||||
PRIVATE(this)->currentStateMachine = NULL;
|
||||
PRIVATE(this)->currentStateMachine = nullptr;
|
||||
PRIVATE(this)->navigationModeFile = url;
|
||||
}
|
||||
return;
|
||||
@@ -1287,7 +1287,7 @@ QuarterWidget::setNavigationModeFile(const QUrl & url)
|
||||
}
|
||||
|
||||
QByteArray filenametmp = filename.toLocal8Bit();
|
||||
ScXMLStateMachine * stateMachine = NULL;
|
||||
ScXMLStateMachine * stateMachine = nullptr;
|
||||
|
||||
if (filenametmp.startsWith("coin:")){
|
||||
stateMachine = ScXML::readFile(filenametmp.data());
|
||||
@@ -1350,7 +1350,7 @@ QuarterWidget::setNavigationModeFile(const QUrl & url)
|
||||
\retval The current navigationModeFile
|
||||
*/
|
||||
const QUrl &
|
||||
QuarterWidget::navigationModeFile(void) const
|
||||
QuarterWidget::navigationModeFile() const
|
||||
{
|
||||
return PRIVATE(this)->navigationModeFile;
|
||||
}
|
||||
|
||||
@@ -81,9 +81,9 @@ class QUARTER_DLL_API QuarterWidget : public QGraphicsView {
|
||||
|
||||
|
||||
public:
|
||||
explicit QuarterWidget(QWidget * parent = 0, const QtGLWidget * sharewidget = 0, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
explicit QuarterWidget(QtGLContext * context, QWidget * parent = 0, const QtGLWidget * sharewidget = 0, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
explicit QuarterWidget(const QtGLFormat & format, QWidget * parent = 0, const QtGLWidget * shareWidget = 0, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
explicit QuarterWidget(QWidget * parent = nullptr, const QtGLWidget * sharewidget = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
explicit QuarterWidget(QtGLContext * context, QWidget * parent = nullptr, const QtGLWidget * sharewidget = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
explicit QuarterWidget(const QtGLFormat & format, QWidget * parent = nullptr, const QtGLWidget * shareWidget = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
virtual ~QuarterWidget();
|
||||
|
||||
enum TransparencyType {
|
||||
@@ -117,70 +117,70 @@ public:
|
||||
INTERLEAVED_COLUMNS = SoRenderManager::INTERLEAVED_COLUMNS
|
||||
};
|
||||
|
||||
TransparencyType transparencyType(void) const;
|
||||
RenderMode renderMode(void) const;
|
||||
StereoMode stereoMode(void) const;
|
||||
TransparencyType transparencyType() const;
|
||||
RenderMode renderMode() const;
|
||||
StereoMode stereoMode() const;
|
||||
|
||||
void setBackgroundColor(const QColor & color);
|
||||
QColor backgroundColor(void) const;
|
||||
QColor backgroundColor() const;
|
||||
|
||||
qreal devicePixelRatio(void) const;
|
||||
qreal devicePixelRatio() const;
|
||||
|
||||
void resetNavigationModeFile(void);
|
||||
void resetNavigationModeFile();
|
||||
void setNavigationModeFile(const QUrl & url = QUrl(QString::fromLatin1(DEFAULT_NAVIGATIONFILE)));
|
||||
const QUrl & navigationModeFile(void) const;
|
||||
const QUrl & navigationModeFile() const;
|
||||
|
||||
void setContextMenuEnabled(bool yes);
|
||||
bool contextMenuEnabled(void) const;
|
||||
QMenu * getContextMenu(void) const;
|
||||
bool contextMenuEnabled() const;
|
||||
QMenu * getContextMenu() const;
|
||||
|
||||
bool headlightEnabled(void) const;
|
||||
bool headlightEnabled() const;
|
||||
void setHeadlightEnabled(bool onoff);
|
||||
SoDirectionalLight * getHeadlight(void) const;
|
||||
SoDirectionalLight * getHeadlight() const;
|
||||
|
||||
bool clearZBuffer(void) const;
|
||||
bool clearZBuffer() const;
|
||||
void setClearZBuffer(bool onoff);
|
||||
|
||||
bool clearWindow(void) const;
|
||||
bool clearWindow() const;
|
||||
void setClearWindow(bool onoff);
|
||||
|
||||
bool interactionModeEnabled(void) const;
|
||||
bool interactionModeEnabled() const;
|
||||
void setInteractionModeEnabled(bool onoff);
|
||||
|
||||
bool interactionModeOn(void) const;
|
||||
bool interactionModeOn() const;
|
||||
void setInteractionModeOn(bool onoff);
|
||||
|
||||
void setStateCursor(const SbName & state, const QCursor & cursor);
|
||||
QCursor stateCursor(const SbName & state);
|
||||
|
||||
uint32_t getCacheContextId(void) const;
|
||||
uint32_t getCacheContextId() const;
|
||||
|
||||
virtual void setSceneGraph(SoNode * root);
|
||||
virtual SoNode * getSceneGraph(void) const;
|
||||
virtual SoNode * getSceneGraph() const;
|
||||
|
||||
void setSoEventManager(SoEventManager * manager);
|
||||
SoEventManager * getSoEventManager(void) const;
|
||||
SoEventManager * getSoEventManager() const;
|
||||
|
||||
void setSoRenderManager(SoRenderManager * manager);
|
||||
SoRenderManager * getSoRenderManager(void) const;
|
||||
SoRenderManager * getSoRenderManager() const;
|
||||
|
||||
EventFilter * getEventFilter(void) const;
|
||||
EventFilter * getEventFilter() const;
|
||||
|
||||
void addStateMachine(SoScXMLStateMachine * statemachine);
|
||||
void removeStateMachine(SoScXMLStateMachine * statemachine);
|
||||
|
||||
virtual bool processSoEvent(const SoEvent * event);
|
||||
virtual QSize minimumSizeHint(void) const;
|
||||
virtual QSize minimumSizeHint() const;
|
||||
|
||||
QList<QAction *> transparencyTypeActions(void) const;
|
||||
QList<QAction *> stereoModeActions(void) const;
|
||||
QList<QAction *> renderModeActions(void) const;
|
||||
QList<QAction *> transparencyTypeActions() const;
|
||||
QList<QAction *> stereoModeActions() const;
|
||||
QList<QAction *> renderModeActions() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
virtual void viewAll(void);
|
||||
virtual void seek(void);
|
||||
virtual void viewAll();
|
||||
virtual void seek();
|
||||
|
||||
void redraw(void);
|
||||
void redraw();
|
||||
|
||||
void setRenderMode(RenderMode mode);
|
||||
void setStereoMode(StereoMode mode);
|
||||
@@ -197,8 +197,8 @@ protected:
|
||||
virtual void paintEvent(QPaintEvent*);
|
||||
virtual void resizeEvent(QResizeEvent*);
|
||||
virtual bool viewportEvent(QEvent* event);
|
||||
virtual void actualRedraw(void);
|
||||
virtual bool updateDevicePixelRatio(void);
|
||||
virtual void actualRedraw();
|
||||
virtual bool updateDevicePixelRatio();
|
||||
|
||||
private:
|
||||
void constructor(const QtGLFormat& format, const QtGLWidget* sharewidget);
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
#include "ContextMenu.h"
|
||||
#include "QuarterP.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
|
||||
using namespace SIM::Coin3D::Quarter;
|
||||
|
||||
@@ -67,19 +67,19 @@ public:
|
||||
SbList <const QtGLWidget *> widgetlist;
|
||||
};
|
||||
|
||||
static SbList <QuarterWidgetP_cachecontext *> * cachecontext_list = NULL;
|
||||
static SbList <QuarterWidgetP_cachecontext *> * cachecontext_list = nullptr;
|
||||
|
||||
QuarterWidgetP::QuarterWidgetP(QuarterWidget * masterptr, const QtGLWidget * sharewidget)
|
||||
: master(masterptr),
|
||||
scene(NULL),
|
||||
eventfilter(NULL),
|
||||
interactionmode(NULL),
|
||||
sorendermanager(NULL),
|
||||
soeventmanager(NULL),
|
||||
scene(nullptr),
|
||||
eventfilter(nullptr),
|
||||
interactionmode(nullptr),
|
||||
sorendermanager(nullptr),
|
||||
soeventmanager(nullptr),
|
||||
initialsorendermanager(false),
|
||||
initialsoeventmanager(false),
|
||||
headlight(NULL),
|
||||
cachecontext(NULL),
|
||||
headlight(nullptr),
|
||||
cachecontext(nullptr),
|
||||
contextmenuenabled(true),
|
||||
autoredrawenabled(true),
|
||||
interactionmodeenabled(false),
|
||||
@@ -87,7 +87,7 @@ QuarterWidgetP::QuarterWidgetP(QuarterWidget * masterptr, const QtGLWidget * sha
|
||||
clearwindow(true),
|
||||
addactions(true),
|
||||
device_pixel_ratio(1.0),
|
||||
contextmenu(NULL)
|
||||
contextmenu(nullptr)
|
||||
{
|
||||
this->cachecontext = findCacheContext(masterptr, sharewidget);
|
||||
|
||||
@@ -121,11 +121,11 @@ QuarterWidgetP::searchForCamera(SoNode * root)
|
||||
return (SoCamera *) node;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
QuarterWidgetP::getCacheContextId(void) const
|
||||
QuarterWidgetP::getCacheContextId() const
|
||||
{
|
||||
return this->cachecontext->id;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ QuarterWidgetP::getCacheContextId(void) const
|
||||
QuarterWidgetP_cachecontext *
|
||||
QuarterWidgetP::findCacheContext(QuarterWidget * widget, const QtGLWidget * sharewidget)
|
||||
{
|
||||
if (cachecontext_list == NULL) {
|
||||
if (cachecontext_list == nullptr) {
|
||||
// FIXME: static memory leak
|
||||
cachecontext_list = new SbList <QuarterWidgetP_cachecontext*>;
|
||||
}
|
||||
@@ -257,7 +257,7 @@ QuarterWidgetP::statechangecb(void * userdata, ScXMLStateMachine * statemachine,
|
||||
|
||||
|
||||
QList<QAction *>
|
||||
QuarterWidgetP::transparencyTypeActions(void) const
|
||||
QuarterWidgetP::transparencyTypeActions() const
|
||||
{
|
||||
if (this->transparencytypeactions.isEmpty()) {
|
||||
this->transparencytypegroup = new QActionGroup(this->master);
|
||||
@@ -277,7 +277,7 @@ QuarterWidgetP::transparencyTypeActions(void) const
|
||||
}
|
||||
|
||||
QList<QAction *>
|
||||
QuarterWidgetP::stereoModeActions(void) const
|
||||
QuarterWidgetP::stereoModeActions() const
|
||||
{
|
||||
if (this->stereomodeactions.isEmpty()) {
|
||||
this->stereomodegroup = new QActionGroup(this->master);
|
||||
@@ -291,7 +291,7 @@ QuarterWidgetP::stereoModeActions(void) const
|
||||
}
|
||||
|
||||
QList<QAction *>
|
||||
QuarterWidgetP::renderModeActions(void) const
|
||||
QuarterWidgetP::renderModeActions() const
|
||||
{
|
||||
if (this->rendermodeactions.isEmpty()) {
|
||||
this->rendermodegroup = new QActionGroup(this->master);
|
||||
@@ -308,7 +308,7 @@ QuarterWidgetP::renderModeActions(void) const
|
||||
#undef ADD_ACTION
|
||||
|
||||
QMenu *
|
||||
QuarterWidgetP::contextMenu(void)
|
||||
QuarterWidgetP::contextMenu()
|
||||
{
|
||||
if (!this->contextmenu) {
|
||||
this->contextmenu = new ContextMenu(this->master);
|
||||
|
||||
@@ -66,12 +66,12 @@ public:
|
||||
~QuarterWidgetP();
|
||||
|
||||
SoCamera * searchForCamera(SoNode * root);
|
||||
uint32_t getCacheContextId(void) const;
|
||||
QMenu * contextMenu(void);
|
||||
uint32_t getCacheContextId() const;
|
||||
QMenu * contextMenu();
|
||||
|
||||
QList<QAction *> transparencyTypeActions(void) const;
|
||||
QList<QAction *> renderModeActions(void) const;
|
||||
QList<QAction *> stereoModeActions(void) const;
|
||||
QList<QAction *> transparencyTypeActions() const;
|
||||
QList<QAction *> renderModeActions() const;
|
||||
QList<QAction *> stereoModeActions() const;
|
||||
|
||||
QuarterWidget * const master;
|
||||
SoNode * scene;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
using namespace SIM::Coin3D::Quarter;
|
||||
|
||||
SensorManager::SensorManager(void)
|
||||
SensorManager::SensorManager()
|
||||
: inherited()
|
||||
{
|
||||
this->mainthreadid = cc_thread_id();
|
||||
@@ -74,7 +74,7 @@ SensorManager::SensorManager(void)
|
||||
SensorManager::~SensorManager()
|
||||
{
|
||||
// remove the Coin callback before shutting down
|
||||
SoDB::getSensorManager()->setChangedCallback(NULL, NULL);
|
||||
SoDB::getSensorManager()->setChangedCallback(nullptr, nullptr);
|
||||
|
||||
if (this->signalthread->isRunning()) {
|
||||
this->signalthread->stopThread();
|
||||
@@ -104,7 +104,7 @@ SensorManager::sensorQueueChangedCB(void * closure)
|
||||
}
|
||||
|
||||
void
|
||||
SensorManager::sensorQueueChanged(void)
|
||||
SensorManager::sensorQueueChanged()
|
||||
{
|
||||
SoSensorManager * sensormanager = SoDB::getSensorManager();
|
||||
assert(sensormanager);
|
||||
@@ -144,7 +144,7 @@ SensorManager::sensorQueueChanged(void)
|
||||
}
|
||||
|
||||
void
|
||||
SensorManager::idleTimeout(void)
|
||||
SensorManager::idleTimeout()
|
||||
{
|
||||
SoDB::getSensorManager()->processTimerQueue();
|
||||
SoDB::getSensorManager()->processDelayQueue(true);
|
||||
@@ -152,14 +152,14 @@ SensorManager::idleTimeout(void)
|
||||
}
|
||||
|
||||
void
|
||||
SensorManager::timerQueueTimeout(void)
|
||||
SensorManager::timerQueueTimeout()
|
||||
{
|
||||
SoDB::getSensorManager()->processTimerQueue();
|
||||
this->sensorQueueChanged();
|
||||
}
|
||||
|
||||
void
|
||||
SensorManager::delayTimeout(void)
|
||||
SensorManager::delayTimeout()
|
||||
{
|
||||
SoDB::getSensorManager()->processTimerQueue();
|
||||
SoDB::getSensorManager()->processDelayQueue(false);
|
||||
|
||||
@@ -45,14 +45,14 @@ class SensorManager : public QObject {
|
||||
Q_OBJECT
|
||||
typedef QObject inherited;
|
||||
public:
|
||||
SensorManager(void);
|
||||
SensorManager();
|
||||
~SensorManager();
|
||||
|
||||
public Q_SLOTS:
|
||||
void idleTimeout(void);
|
||||
void delayTimeout(void);
|
||||
void timerQueueTimeout(void);
|
||||
void sensorQueueChanged(void);
|
||||
void idleTimeout();
|
||||
void delayTimeout();
|
||||
void timerQueueTimeout();
|
||||
void sensorQueueChanged();
|
||||
void setTimerEpsilon(double sec);
|
||||
|
||||
private:
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
using namespace SIM::Coin3D::Quarter;
|
||||
|
||||
SignalThread::SignalThread(void)
|
||||
SignalThread::SignalThread()
|
||||
: isstopped(false)
|
||||
{
|
||||
}
|
||||
@@ -46,7 +46,7 @@ SignalThread::~SignalThread()
|
||||
}
|
||||
|
||||
void
|
||||
SignalThread::trigger(void)
|
||||
SignalThread::trigger()
|
||||
{
|
||||
// lock first to make sure the QThread is actually waiting for a signal
|
||||
QMutexLocker ml(&this->mutex);
|
||||
@@ -54,7 +54,7 @@ SignalThread::trigger(void)
|
||||
}
|
||||
|
||||
void
|
||||
SignalThread::stopThread(void)
|
||||
SignalThread::stopThread()
|
||||
{
|
||||
QMutexLocker ml(&this->mutex);
|
||||
this->isstopped = true;
|
||||
@@ -63,7 +63,7 @@ SignalThread::stopThread(void)
|
||||
|
||||
|
||||
void
|
||||
SignalThread::run(void)
|
||||
SignalThread::run()
|
||||
{
|
||||
QMutexLocker ml(&this->mutex);
|
||||
while (!this->isstopped) {
|
||||
|
||||
@@ -44,16 +44,16 @@ namespace SIM { namespace Coin3D { namespace Quarter {
|
||||
class SignalThread : public QThread {
|
||||
Q_OBJECT
|
||||
public:
|
||||
SignalThread(void);
|
||||
SignalThread();
|
||||
virtual ~SignalThread();
|
||||
|
||||
virtual void run(void);
|
||||
void trigger(void);
|
||||
void stopThread(void);
|
||||
virtual void run();
|
||||
void trigger();
|
||||
void stopThread();
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
void triggerSignal(void);
|
||||
void triggerSignal();
|
||||
|
||||
private:
|
||||
QWaitCondition waitcond;
|
||||
|
||||
@@ -168,7 +168,7 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::init()
|
||||
m_seekdistanceabs = false;
|
||||
m_seekperiod = 2.0f;
|
||||
m_inseekmode = false;
|
||||
m_storedcamera = 0;
|
||||
m_storedcamera = nullptr;
|
||||
m_viewingflag = false;
|
||||
pickRadius = 5.0;
|
||||
|
||||
@@ -298,12 +298,12 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::convertPerspective2Ortho(const So
|
||||
out->height = 2.0f * focaldist * (float)tan(in->heightAngle.getValue() / 2.0);
|
||||
}
|
||||
|
||||
SoCamera* SIM::Coin3D::Quarter::SoQTQuarterAdaptor::getCamera(void) const
|
||||
SoCamera* SIM::Coin3D::Quarter::SoQTQuarterAdaptor::getCamera() const
|
||||
{
|
||||
return getSoRenderManager()->getCamera();
|
||||
}
|
||||
|
||||
const SbViewportRegion & SIM::Coin3D::Quarter::SoQTQuarterAdaptor::getViewportRegion(void) const
|
||||
const SbViewportRegion & SIM::Coin3D::Quarter::SoQTQuarterAdaptor::getViewportRegion() const
|
||||
{
|
||||
return getSoRenderManager()->getViewportRegion();
|
||||
}
|
||||
@@ -318,17 +318,17 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::setViewing(SbBool enable)
|
||||
if(m_viewingflag) {
|
||||
SoGLRenderAction* action = getSoRenderManager()->getGLRenderAction();
|
||||
|
||||
if(action != NULL)
|
||||
if(action != nullptr)
|
||||
SoLocateHighlight::turnOffCurrentHighlight(action);
|
||||
}
|
||||
}
|
||||
|
||||
SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::isViewing(void) const
|
||||
SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::isViewing() const
|
||||
{
|
||||
return m_viewingflag;
|
||||
}
|
||||
|
||||
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::interactiveCountInc(void)
|
||||
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::interactiveCountInc()
|
||||
{
|
||||
// Catch problems with missing interactiveCountDec() calls.
|
||||
assert(m_interactionnesting < 100);
|
||||
@@ -338,7 +338,7 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::interactiveCountInc(void)
|
||||
}
|
||||
}
|
||||
|
||||
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::interactiveCountDec(void)
|
||||
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::interactiveCountDec()
|
||||
{
|
||||
if(--m_interactionnesting <= 0) {
|
||||
m_interactionEndCallback.invokeCallbacks(this);
|
||||
@@ -346,7 +346,7 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::interactiveCountDec(void)
|
||||
}
|
||||
}
|
||||
|
||||
int SIM::Coin3D::Quarter::SoQTQuarterAdaptor::getInteractiveCount(void) const
|
||||
int SIM::Coin3D::Quarter::SoQTQuarterAdaptor::getInteractiveCount() const
|
||||
{
|
||||
return m_interactionnesting;
|
||||
}
|
||||
@@ -372,22 +372,22 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::removeFinishCallback(SIM::Coin3D:
|
||||
}
|
||||
|
||||
|
||||
float SIM::Coin3D::Quarter::SoQTQuarterAdaptor::getSeekDistance(void) const
|
||||
float SIM::Coin3D::Quarter::SoQTQuarterAdaptor::getSeekDistance() const
|
||||
{
|
||||
return m_seekdistance;
|
||||
}
|
||||
|
||||
float SIM::Coin3D::Quarter::SoQTQuarterAdaptor::getSeekTime(void) const
|
||||
float SIM::Coin3D::Quarter::SoQTQuarterAdaptor::getSeekTime() const
|
||||
{
|
||||
return m_seekperiod;
|
||||
}
|
||||
|
||||
SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::isSeekMode(void) const
|
||||
SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::isSeekMode() const
|
||||
{
|
||||
return m_inseekmode;
|
||||
}
|
||||
|
||||
SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::isSeekValuePercentage(void) const
|
||||
SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::isSeekValuePercentage() const
|
||||
{
|
||||
return m_seekdistanceabs ? false : true;
|
||||
}
|
||||
@@ -541,7 +541,7 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::seeksensorCB(void* data, SoSensor
|
||||
if(end) thisp->setSeekMode(false);
|
||||
}
|
||||
|
||||
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::saveHomePosition(void)
|
||||
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::saveHomePosition()
|
||||
{
|
||||
SoCamera* cam = getSoRenderManager()->getCamera();
|
||||
if (!cam) {
|
||||
@@ -562,7 +562,7 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::saveHomePosition(void)
|
||||
m_storedcamera->copyFieldValues(getSoRenderManager()->getCamera());
|
||||
}
|
||||
|
||||
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::resetToHomePosition(void)
|
||||
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::resetToHomePosition()
|
||||
{
|
||||
SoCamera* cam = getSoRenderManager()->getCamera();
|
||||
if (!cam) {
|
||||
@@ -724,7 +724,7 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::paintEvent(QPaintEvent* event)
|
||||
this->framesPerSecond = addFrametime(start);
|
||||
}
|
||||
|
||||
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::resetFrameCounter(void)
|
||||
void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::resetFrameCounter()
|
||||
{
|
||||
this->framecount = 0;
|
||||
this->frametime = 0.0f;
|
||||
|
||||
@@ -47,9 +47,9 @@ typedef void SoQTQuarterAdaptorCB(void* data, SoQTQuarterAdaptor* viewer);
|
||||
class QUARTER_DLL_API SoQTQuarterAdaptor : public QuarterWidget {
|
||||
|
||||
public:
|
||||
explicit SoQTQuarterAdaptor(QWidget* parent = 0, const QtGLWidget* sharewidget = 0, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
explicit SoQTQuarterAdaptor(const QtGLFormat& format, QWidget* parent = 0, const QtGLWidget* shareWidget = 0, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
explicit SoQTQuarterAdaptor(QtGLContext* context, QWidget* parent = 0, const QtGLWidget* sharewidget = 0, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
explicit SoQTQuarterAdaptor(QWidget* parent = nullptr, const QtGLWidget* sharewidget = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
explicit SoQTQuarterAdaptor(const QtGLFormat& format, QWidget* parent = nullptr, const QtGLWidget* shareWidget = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
explicit SoQTQuarterAdaptor(QtGLContext* context, QWidget* parent = nullptr, const QtGLWidget* sharewidget = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
virtual ~SoQTQuarterAdaptor();
|
||||
|
||||
//the functions available in soqtviewer but missing in quarter
|
||||
@@ -59,38 +59,38 @@ public:
|
||||
QWidget* getGLWidget() const;
|
||||
|
||||
virtual void setCameraType(SoType type);
|
||||
SoCamera * getCamera(void) const;
|
||||
SoCamera * getCamera() const;
|
||||
|
||||
const SbViewportRegion & getViewportRegion(void) const;
|
||||
const SbViewportRegion & getViewportRegion() const;
|
||||
|
||||
virtual void setViewing(SbBool enable);
|
||||
SbBool isViewing(void) const;
|
||||
SbBool isViewing() const;
|
||||
|
||||
void interactiveCountInc(void);
|
||||
void interactiveCountDec(void);
|
||||
int getInteractiveCount(void) const;
|
||||
void interactiveCountInc();
|
||||
void interactiveCountDec();
|
||||
int getInteractiveCount() const;
|
||||
|
||||
void addStartCallback(SoQTQuarterAdaptorCB* func, void* data = NULL);
|
||||
void addFinishCallback(SoQTQuarterAdaptorCB* func, void* data = NULL);
|
||||
void removeStartCallback(SoQTQuarterAdaptorCB* func, void* data = NULL);
|
||||
void removeFinishCallback(SoQTQuarterAdaptorCB* func, void* data = NULL);
|
||||
void addStartCallback(SoQTQuarterAdaptorCB* func, void* data = nullptr);
|
||||
void addFinishCallback(SoQTQuarterAdaptorCB* func, void* data = nullptr);
|
||||
void removeStartCallback(SoQTQuarterAdaptorCB* func, void* data = nullptr);
|
||||
void removeFinishCallback(SoQTQuarterAdaptorCB* func, void* data = nullptr);
|
||||
|
||||
virtual void setSeekMode(SbBool enable);
|
||||
SbBool isSeekMode(void) const;
|
||||
SbBool isSeekMode() const;
|
||||
SbBool seekToPoint(const SbVec2s screenpos);
|
||||
void seekToPoint(const SbVec3f& scenepos);
|
||||
void setSeekTime(const float seconds);
|
||||
float getSeekTime(void) const;
|
||||
float getSeekTime() const;
|
||||
void setSeekDistance(const float distance);
|
||||
float getSeekDistance(void) const;
|
||||
float getSeekDistance() const;
|
||||
void setSeekValueAsPercentage(const SbBool on);
|
||||
SbBool isSeekValuePercentage(void) const;
|
||||
SbBool isSeekValuePercentage() const;
|
||||
|
||||
virtual float getPickRadius(void) const {return this->pickRadius;}
|
||||
virtual float getPickRadius() const {return this->pickRadius;}
|
||||
virtual void setPickRadius(float pickRadius);
|
||||
|
||||
virtual void saveHomePosition(void);
|
||||
virtual void resetToHomePosition(void);
|
||||
virtual void saveHomePosition();
|
||||
virtual void resetToHomePosition();
|
||||
|
||||
virtual void setSceneGraph(SoNode* root) {
|
||||
QuarterWidget::setSceneGraph(root);
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
virtual void paintEvent(QPaintEvent*);
|
||||
|
||||
//this functions still need to be ported
|
||||
virtual void afterRealizeHook(void) {} //enables spacenav and joystick in soqt, dunno if this is needed
|
||||
virtual void afterRealizeHook() {} //enables spacenav and joystick in soqt, dunno if this is needed
|
||||
|
||||
private:
|
||||
void init();
|
||||
@@ -109,7 +109,7 @@ private:
|
||||
void getCameraCoordinateSystem(SoCamera * camera, SoNode * root, SbMatrix & matrix, SbMatrix & inverse);
|
||||
static void seeksensorCB(void * data, SoSensor * s);
|
||||
void moveCameraScreen(const SbVec2f & screenpos);
|
||||
void resetFrameCounter(void);
|
||||
void resetFrameCounter();
|
||||
SbVec2f addFrametime(double ft);
|
||||
|
||||
bool m_viewingflag;
|
||||
|
||||
@@ -128,7 +128,7 @@ const SoEvent *
|
||||
SpaceNavigatorDevice::translateEvent(QEvent * event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
SoEvent * ret = NULL;
|
||||
SoEvent * ret = nullptr;
|
||||
|
||||
#ifdef HAVE_SPACENAV_LIB
|
||||
NativeEvent * ce = dynamic_cast<NativeEvent *>(event);
|
||||
|
||||
@@ -47,7 +47,7 @@ class QuarterWidget;
|
||||
class QUARTER_DLL_API InputDevice {
|
||||
public:
|
||||
InputDevice(QuarterWidget * quarter);
|
||||
InputDevice(void);
|
||||
InputDevice();
|
||||
virtual ~InputDevice() {}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace SIM { namespace Coin3D { namespace Quarter {
|
||||
class QUARTER_DLL_API Keyboard : public InputDevice {
|
||||
public:
|
||||
Keyboard(QuarterWidget* quarter);
|
||||
Keyboard(void);
|
||||
Keyboard();
|
||||
virtual ~Keyboard();
|
||||
|
||||
virtual const SoEvent * translateEvent(QEvent * event);
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace SIM { namespace Coin3D { namespace Quarter {
|
||||
class QUARTER_DLL_API Mouse : public InputDevice {
|
||||
public:
|
||||
Mouse(QuarterWidget* quarter);
|
||||
Mouse(void);
|
||||
Mouse();
|
||||
virtual ~Mouse();
|
||||
|
||||
virtual const SoEvent * translateEvent(QEvent * event);
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace SIM { namespace Coin3D { namespace Quarter {
|
||||
class QUARTER_DLL_API SpaceNavigatorDevice : public InputDevice {
|
||||
public:
|
||||
SpaceNavigatorDevice(QuarterWidget* quarter);
|
||||
SpaceNavigatorDevice(void);
|
||||
SpaceNavigatorDevice();
|
||||
virtual ~SpaceNavigatorDevice();
|
||||
virtual const SoEvent * translateEvent(QEvent * event);
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
void registerInputDevice(InputDevice * device);
|
||||
void unregisterInputDevice(InputDevice * device);
|
||||
|
||||
const QPoint & globalMousePosition(void) const;
|
||||
const QPoint & globalMousePosition() const;
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject * obj, QEvent * event);
|
||||
|
||||
Reference in New Issue
Block a user