fix warnings about arithmetic operations on enum

This commit is contained in:
Sébastien Loriot 2021-09-28 15:36:51 +02:00
parent de64da240d
commit 3640099261
11 changed files with 47 additions and 29 deletions

View File

@ -263,7 +263,7 @@ public:
Comparison_result res =
ker.compare_x_2_object()(this->_source, this->_target);
this->_info = (Conic_arc_2::IS_VALID | DEGREE_1);
this->_info = (static_cast<int>(Conic_arc_2::IS_VALID) | static_cast<int>(DEGREE_1));
if (res == EQUAL) {
// Mark that the segment is vertical.
this->_info = (this->_info | IS_VERTICAL_SEGMENT);

View File

@ -160,11 +160,11 @@ public:
&arrays[SMOOTH_NORMAL_COLORED_FACES])
{
// Define 'Control+Q' as the new exit shortcut (default was 'Escape')
setShortcut(qglviewer::EXIT_VIEWER, ::Qt::CTRL+::Qt::Key_Q);
setShortcut(qglviewer::EXIT_VIEWER, ::Qt::CTRL, ::Qt::Key_Q);
// Add custom key description (see keyPressEvent).
setKeyDescription(::Qt::Key_C, "Switch clipping plane display mode");
setKeyDescription(::Qt::Key_C+::Qt::AltModifier, "Toggle clipping plane rendering on/off");
setKeyDescription(::Qt::AltModifier, ::Qt::Key_C, "Toggle clipping plane rendering on/off");
setKeyDescription(::Qt::Key_E, "Toggles edges display");
setKeyDescription(::Qt::Key_M, "Toggles mono color");
setKeyDescription(::Qt::Key_N, "Inverse direction of normals");
@ -175,8 +175,8 @@ public:
setKeyDescription(::Qt::Key_W, "Toggles faces display");
setKeyDescription(::Qt::Key_Plus, "Increase size of edges");
setKeyDescription(::Qt::Key_Minus, "Decrease size of edges");
setKeyDescription(::Qt::Key_Plus+::Qt::ControlModifier, "Increase size of vertices");
setKeyDescription(::Qt::Key_Minus+::Qt::ControlModifier, "Decrease size of vertices");
setKeyDescription(::Qt::ControlModifier, ::Qt::Key_Plus, "Increase size of vertices");
setKeyDescription(::Qt::ControlModifier, ::Qt::Key_Minus, "Decrease size of vertices");
setKeyDescription(::Qt::Key_PageDown, "Increase light (all colors, use shift/alt/ctrl for one rgb component)");
setKeyDescription(::Qt::Key_PageUp, "Decrease light (all colors, use shift/alt/ctrl for one rgb component)");
setKeyDescription(::Qt::Key_O, "Toggles 2D mode only");

View File

@ -833,8 +833,26 @@ public:
public Q_SLOTS:
void setShortcut(qglviewer::KeyboardAction action, unsigned int key);
void setShortcut(qglviewer::KeyboardAction action, ::Qt::Modifier modifier, ::Qt::Key key)
{
setShortcut(action,
static_cast<unsigned int>(modifier)+
static_cast<unsigned int>(key));
}
void setKeyDescription(unsigned int key, QString description);
void setKeyDescription(::Qt::KeyboardModifier modifier, ::Qt::Key key, QString description)
{
setKeyDescription(static_cast<unsigned int>(modifier) +
static_cast<unsigned int>(key),
description);
}
void setKeyDescription(::Qt::Modifier modifier, ::Qt::Key key, QString description)
{
setKeyDescription(static_cast<unsigned int>(modifier) +
static_cast<unsigned int>(key),
description);
}
void clearShortcuts();
// Key Frames shortcut keys

View File

@ -657,10 +657,10 @@ void CGAL::QGLViewer::setDefaultShortcuts() {
setShortcut(qglviewer::DRAW_AXIS, ::Qt::Key_A);
setShortcut(qglviewer::DRAW_GRID, ::Qt::Key_G);
setShortcut(qglviewer::DISPLAY_FPS, ::Qt::Key_F);
setShortcut(qglviewer::ENABLE_TEXT, ::Qt::SHIFT + ::Qt::Key_Question);
setShortcut(qglviewer::ENABLE_TEXT, ::Qt::SHIFT, ::Qt::Key_Question);
setShortcut(qglviewer::EXIT_VIEWER, ::Qt::Key_Escape);
setShortcut(qglviewer::CAMERA_MODE, ::Qt::Key_Space);
setShortcut(qglviewer::FULL_SCREEN, ::Qt::ALT + ::Qt::Key_Return);
setShortcut(qglviewer::FULL_SCREEN, ::Qt::ALT, ::Qt::Key_Return);
setShortcut(qglviewer::ANIMATION, ::Qt::Key_Return);
setShortcut(qglviewer::HELP, ::Qt::Key_H);
setShortcut(qglviewer::MOVE_CAMERA_LEFT, ::Qt::Key_Left);

View File

@ -198,7 +198,7 @@ template <class R>
CGAL_KERNEL_MEDIUM_INLINE
Oriented_side
SphereH3<R>::oriented_side(const typename SphereH3<R>::Point_3& p) const
{ return Oriented_side(bounded_side(p) * orientation()); }
{ return Oriented_side(static_cast<int>(bounded_side(p)) * static_cast<int>(orientation())); }
template <class R>
CGAL_KERNEL_INLINE

View File

@ -4675,7 +4675,7 @@ namespace HomogeneousKernelFunctors {
result_type
operator()( const Circle_2& c, const Point_2& p) const
{ return Oriented_side(c.bounded_side(p) * c.orientation()); }
{ return Oriented_side(static_cast<int>(c.bounded_side(p)) * static_cast<int>(c.orientation())); }
result_type
operator()( const Line_2& l, const Point_2& p) const

View File

@ -185,7 +185,7 @@ MainWindow::MainWindow(const QStringList &keywords, bool verbose, QWidget* paren
CGAL::Three::Three::s_scene = scene;
CGAL::Three::Three::s_connectable_scene = scene;
{
QShortcut* shortcut = new QShortcut(QKeySequence(Qt::ALT+Qt::Key_Q), this);
QShortcut* shortcut = new QShortcut(QKeySequence(Qt::ALT,Qt::Key_Q), this);
connect(shortcut, SIGNAL(activated()),
this, SLOT(setFocusToQuickSearch()));
shortcut = new QShortcut(QKeySequence(Qt::Key_F5), this);
@ -194,10 +194,10 @@ MainWindow::MainWindow(const QStringList &keywords, bool verbose, QWidget* paren
shortcut = new QShortcut(QKeySequence(Qt::Key_F11), this);
connect(shortcut, SIGNAL(activated()),
this, SLOT(toggleFullScreen()));
shortcut = new QShortcut(QKeySequence(Qt::CTRL+Qt::Key_R), this);
shortcut = new QShortcut(QKeySequence(Qt::CTRL,Qt::Key_R), this);
connect(shortcut, &QShortcut::activated,
this, &MainWindow::recenterScene);
shortcut = new QShortcut(QKeySequence(Qt::CTRL+Qt::Key_T), this);
shortcut = new QShortcut(QKeySequence(Qt::CTRL,Qt::Key_T), this);
connect(shortcut, &QShortcut::activated,
this,
[](){

View File

@ -309,7 +309,7 @@ void Viewer::doBindings()
setKeyDescription(Qt::Key_M,
tr("Toggle macro mode: useful to view details very near from the camera, "
"but decrease the z-buffer precision"));
setKeyDescription(Qt::Key_I + Qt::CTRL,
setKeyDescription(Qt::CTRL, Qt::Key_I,
tr("Toggle the primitive IDs visibility of the selected Item, for the types selected in the context menu of the said item."));
setKeyDescription(Qt::Key_D,
tr("Disable the distance between two points visibility."));

View File

@ -262,14 +262,14 @@ protected:
{
Base::init();
setKeyDescription(::Qt::Key_D, "Increase current dart drawing");
setKeyDescription(::Qt::Key_D+::Qt::ControlModifier, "Decrease current dart drawing");
setKeyDescription(::Qt::Key_D+::Qt::ShiftModifier, "Draw all darts");
setKeyDescription(::Qt::ControlModifier, ::Qt::Key_D, "Decrease current dart drawing");
setKeyDescription(::Qt::ShiftModifier, ::Qt::Key_D, "Draw all darts");
setKeyDescription(::Qt::Key_X, "Toggles marked darts display");
setKeyDescription(::Qt::Key_P, "Increase current path drawing");
setKeyDescription(::Qt::Key_P+::Qt::ControlModifier, "Decrease current path drawing");
setKeyDescription(::Qt::Key_P+::Qt::ShiftModifier, "Draw all paths");
setKeyDescription(::Qt::ControlModifier, ::Qt::Key_P, "Decrease current path drawing");
setKeyDescription(::Qt::ShiftModifier, ::Qt::Key_P, "Draw all paths");
}
virtual void keyPressEvent(QKeyEvent *e)

View File

@ -12,7 +12,7 @@ PreferenceDlg::PreferenceDlg(QWidget *parent) : QDialog(parent)
QPushButton *btnVertex = new QPushButton( tr("Set Color") );
// create color label
m_labelVertex = new QLabel;
m_labelVertex->setFrameStyle(QFrame::Sunken | QFrame::Panel);
m_labelVertex->setFrameStyle(static_cast<int>(QFrame::Sunken) | static_cast<int>(QFrame::Panel));
// create size label
QLabel *labelSizeV = new QLabel( tr("Set Size") );
// create lineedit
@ -38,7 +38,7 @@ PreferenceDlg::PreferenceDlg(QWidget *parent) : QDialog(parent)
QPushButton *btnDEdge = new QPushButton( tr("Set Color") );
// create color label
m_labelDEdge = new QLabel;
m_labelDEdge->setFrameStyle(QFrame::Sunken | QFrame::Panel);
m_labelDEdge->setFrameStyle(static_cast<int>(QFrame::Sunken) | static_cast<int>(QFrame::Panel));
// create size label
QLabel *labelSizeDE = new QLabel( tr("Set Size") );
// create lineedit
@ -64,7 +64,7 @@ PreferenceDlg::PreferenceDlg(QWidget *parent) : QDialog(parent)
QPushButton *btnVEdge = new QPushButton( tr("Set Color") );
// create color label
m_labelVEdge = new QLabel;
m_labelVEdge->setFrameStyle(QFrame::Sunken | QFrame::Panel);
m_labelVEdge->setFrameStyle(static_cast<int>(QFrame::Sunken) | static_cast<int>(QFrame::Panel));
// create size label
QLabel *labelSizeVE = new QLabel( tr("Set Size") );
// create lineedit
@ -90,7 +90,7 @@ PreferenceDlg::PreferenceDlg(QWidget *parent) : QDialog(parent)
QPushButton *btnFacet = new QPushButton( tr("Set Color") );
// create color label
m_labelFacet = new QLabel;
m_labelFacet->setFrameStyle(QFrame::Sunken | QFrame::Panel);
m_labelFacet->setFrameStyle(static_cast<int>(QFrame::Sunken) | static_cast<int>(QFrame::Panel));
// create label and spinbox
QLabel *labelFacetA = new QLabel( tr("Transparency") );
m_spinAlphaF = new QSpinBox;
@ -116,7 +116,7 @@ PreferenceDlg::PreferenceDlg(QWidget *parent) : QDialog(parent)
QPushButton *btnBall = new QPushButton( tr("Set Color") );
// create color label
m_labelBall = new QLabel;
m_labelBall->setFrameStyle(QFrame::Sunken | QFrame::Panel);
m_labelBall->setFrameStyle(static_cast<int>(QFrame::Sunken) | static_cast<int>(QFrame::Panel));
// create label and spinbox
QLabel *labelBallA = new QLabel( tr("Transparency") );
m_spinAlphaB = new QSpinBox;
@ -147,7 +147,7 @@ PreferenceDlg::PreferenceDlg(QWidget *parent) : QDialog(parent)
QGroupBox *groupS = new QGroupBox( tr("Empty Sphere") );
// create color label
m_labelSphere = new QLabel;
m_labelSphere->setFrameStyle(QFrame::Sunken | QFrame::Panel);
m_labelSphere->setFrameStyle(static_cast<int>(QFrame::Sunken) | static_cast<int>(QFrame::Panel));
// create button
QPushButton *btnSphere = new QPushButton( tr("Set Color") );
// create label and spinbox

View File

@ -69,12 +69,12 @@ void Viewer::init()
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
/* Add mouse and key description */
setKeyDescription( Qt::CTRL + Qt::Key_G, tr("Generate points") );
setKeyDescription( Qt::CTRL + Qt::Key_O, tr("Load points") );
setKeyDescription( Qt::CTRL + Qt::Key_S, tr("Save points") );
setKeyDescription( Qt::CTRL + Qt::Key_Comma, tr("Preference") );
setKeyDescription( Qt::CTRL + Qt::Key_H, tr("Hide Kernel Demo") );
setKeyDescription( Qt::CTRL + Qt::Key_Q, tr("Quit Kernel Demo") );
setKeyDescription( Qt::CTRL, Qt::Key_G, tr("Generate points") );
setKeyDescription( Qt::CTRL, Qt::Key_O, tr("Load points") );
setKeyDescription( Qt::CTRL, Qt::Key_S, tr("Save points") );
setKeyDescription( Qt::CTRL, Qt::Key_Comma, tr("Preference") );
setKeyDescription( Qt::CTRL, Qt::Key_H, tr("Hide Kernel Demo") );
setKeyDescription( Qt::CTRL, Qt::Key_Q, tr("Quit Kernel Demo") );
setKeyDescription( Qt::Key_Return,
tr("Insert new point to triangulation in <u>Input-Point</u> mode") );
setKeyDescription( Qt::Key_Escape,