mirror of https://github.com/CGAL/cgal
Polyline simplification demo
This commit is contained in:
parent
46bf663ecd
commit
85e409f413
|
|
@ -41,7 +41,7 @@ class CGAL_QT4_EXPORT GraphicsItem : public QObject, public QGraphicsItem {
|
|||
#if QT_VERSION >= 0x040600
|
||||
Q_INTERFACES(QGraphicsItem)
|
||||
#endif
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
|
||||
virtual void modelChanged() = 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -40,11 +40,11 @@ public:
|
|||
: QObject(parent)
|
||||
{}
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void generate(CGAL::Object o);
|
||||
void modelChanged();
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
|
||||
virtual void processInput(CGAL::Object /*o*/) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class CGAL_QT4_EXPORT GraphicsViewNavigation: public QObject {
|
|||
|
||||
Q_OBJECT
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void mouseCoordinates(QString);
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public:
|
|||
GraphicsViewPolygonWithHolesInput(QObject *parent, QGraphicsScene* s);
|
||||
~GraphicsViewPolygonWithHolesInput();
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void processInput(CGAL::Object o);
|
||||
|
||||
typedef CGAL::Polygon_2<K> Polygon;
|
||||
|
|
@ -141,7 +141,7 @@ GraphicsViewPolygonWithHolesInput<K>::processInput(CGAL::Object o)
|
|||
it++;
|
||||
pwh = Polygon_with_holes(holes.front(), it, holes.end());
|
||||
}
|
||||
emit(modelChanged());
|
||||
Q_EMIT( modelChanged());
|
||||
polygon_input = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -172,11 +172,11 @@ GraphicsViewPolygonWithHolesInput<K>::eventFilter(QObject *obj, QEvent *event)
|
|||
polygon_input = true;
|
||||
return pi->eventFilter(obj, event);
|
||||
} else if(mouseEvent->button() == ::Qt::RightButton) {
|
||||
emit(generate(CGAL::make_object(pwh)));
|
||||
Q_EMIT( generate(CGAL::make_object(pwh)));
|
||||
pwh.clear();
|
||||
holes.clear();
|
||||
polygon_input = false;
|
||||
emit(modelChanged());
|
||||
Q_EMIT( modelChanged());
|
||||
}
|
||||
return true;
|
||||
} else if (event->type() == QEvent::KeyPress) {
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ protected:
|
|||
if(closed_ && points.size()>2){
|
||||
points.push_back(points.front());
|
||||
}
|
||||
emit(generate(CGAL::make_object(points)));
|
||||
Q_EMIT( generate(CGAL::make_object(points)));
|
||||
}
|
||||
}; // end class GraphicsViewPolylineInput
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ include_directories (BEFORE ${CMAKE_CURRENT_BINARY_DIR})
|
|||
|
||||
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
|
||||
|
||||
add_definitions(-DQT_NO_KEYWORDS)
|
||||
|
||||
include(${QT_USE_FILE})
|
||||
|
||||
# UI files (Qt Designer files)
|
||||
|
|
|
|||
|
|
@ -107,10 +107,10 @@ private:
|
|||
void loadPoly(QString);
|
||||
void loadOSM (QString);
|
||||
|
||||
protected slots:
|
||||
protected Q_SLOTS:
|
||||
void open(QString);
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
|
||||
void processInput(CGAL::Object o);
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ public slots:
|
|||
|
||||
double getThreshold() ;
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void changed();
|
||||
};
|
||||
|
||||
|
|
@ -238,10 +238,10 @@ MainWindow::processInput(CGAL::Object o)
|
|||
out << *it << std::endl;
|
||||
}
|
||||
#endif
|
||||
emit(changed());
|
||||
Q_EMIT( changed());
|
||||
}
|
||||
}
|
||||
emit(changed());
|
||||
Q_EMIT( changed());
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -274,7 +274,7 @@ MainWindow::on_actionClear_triggered()
|
|||
{
|
||||
m_pct.clear();
|
||||
mGI->modelChanged();
|
||||
emit(changed());
|
||||
Q_EMIT( changed());
|
||||
}
|
||||
|
||||
Mode MainWindow::getSimplificationMode()
|
||||
|
|
@ -325,7 +325,7 @@ void MainWindow::on_actionSimplify_triggered()
|
|||
// default cursor
|
||||
QApplication::restoreOverrideCursor();
|
||||
mGI->modelChanged();
|
||||
emit(changed());
|
||||
Q_EMIT( changed());
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -447,7 +447,7 @@ void MainWindow::loadPoly(QString fileName)
|
|||
}
|
||||
}
|
||||
|
||||
emit(changed());
|
||||
Q_EMIT( changed());
|
||||
|
||||
actionRecenter->trigger();
|
||||
}
|
||||
|
|
@ -522,7 +522,7 @@ void MainWindow::loadOSM(QString fileName)
|
|||
statusBar()->showMessage(QString("Exception ocurred"));
|
||||
}
|
||||
|
||||
emit(changed());
|
||||
Q_EMIT( changed());
|
||||
|
||||
actionRecenter->trigger();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue