Replace Q_FOREACH

This commit is contained in:
Andreas Fabri 2023-11-15 08:59:17 +00:00
parent dc0cd7f1e6
commit 652f7b26c0
69 changed files with 296 additions and 303 deletions

View File

@ -317,7 +317,7 @@ MainWindow::MainWindow(const QStringList &keywords, bool verbose, QWidget* paren
accepted_keywords.clear();
// Setup the submenu of the View menu that can toggle the dockwidgets
Q_FOREACH(QDockWidget* widget, findChildren<QDockWidget*>()) {
for(QDockWidget* widget : findChildren<QDockWidget*>()) {
widget->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetFloatable);
ui->menuDockWindows->addAction(widget->toggleViewAction());
}
@ -342,7 +342,7 @@ MainWindow::MainWindow(const QStringList &keywords, bool verbose, QWidget* paren
actionResetDefaultLoaders = new QAction("Reset Default Loaders",this);
// evaluate_script("print(plugins);");
Q_FOREACH(QAction* action, findChildren<QAction*>()) {
for(QAction* action : findChildren<QAction*>()) {
if(action->objectName() != "") {
QJSValue objectValue = script_engine->newQObject(action);
script_engine->globalObject().setProperty(action->objectName(),
@ -372,11 +372,11 @@ void addActionToMenu(QAction* action, QMenu* menu)
void filterMenuOperations(QMenu* menu, QString filter, bool keep_from_here)
{
QList<QAction*> buffer;
Q_FOREACH(QAction* action, menu->actions())
for(QAction* action : menu->actions())
buffer.append(action);
while(!buffer.isEmpty()){
Q_FOREACH(QAction* action, buffer) {
for(QAction* action : buffer) {
if(QMenu* submenu = action->menu())
{
bool keep = true;
@ -384,7 +384,7 @@ void filterMenuOperations(QMenu* menu, QString filter, bool keep_from_here)
keep = submenu->menuAction()->text().contains(filter, Qt::CaseInsensitive);
if(!keep)
{
Q_FOREACH(QAction* subaction, submenu->actions())
for(QAction* subaction : submenu->actions())
{
submenu->removeAction(subaction);
buffer.append(subaction);
@ -421,23 +421,23 @@ void MainWindow::filterOperations(bool)
ui->menuOperations->hide();
#endif
//return actions to their true menu
Q_FOREACH(QMenu* menu, action_menu_map.values())
for(QMenu* menu : action_menu_map.values())
{
Q_FOREACH(QAction* action, menu->actions())
for(QAction* action : menu->actions())
{
if(action != searchAction)
menu->removeAction(action);
}
}
Q_FOREACH(QAction* action, action_menu_map.keys())
for(QAction* action : action_menu_map.keys())
{
QMenu* menu = action_menu_map[action];
addActionToMenu(action, menu);
}
QString filter=operationSearchBar.text();
Q_FOREACH(const PluginNamePair& p, plugins) {
Q_FOREACH(QAction* action, p.first->actions()) {
for(const PluginNamePair& p : plugins) {
for(QAction* action : p.first->actions()) {
action->setVisible( p.first->applicable(action)
&& (action->text().remove("&").contains(filter, Qt::CaseInsensitive)
|| action->property("subMenuName")
@ -579,7 +579,7 @@ bool MainWindow::load_plugin(QString fileName, bool blacklisted)
bool do_load = accepted_keywords.empty();
if(!do_load)
{
Q_FOREACH(QString k, s_keywords)
for(QString k : s_keywords)
{
if(accepted_keywords.contains(k))
{
@ -621,7 +621,7 @@ bool MainWindow::load_plugin(QString fileName, bool blacklisted)
void MainWindow::loadPlugins()
{
Q_FOREACH(QObject *obj, QPluginLoader::staticInstances())
for(QObject *obj : QPluginLoader::staticInstances())
{
initPlugin(obj);
initIOPlugin(obj);
@ -637,7 +637,7 @@ void MainWindow::loadPlugins()
QFileInfoList filist = QDir(dirPath).entryInfoList();
filist << msvc_dir.entryInfoList();
Q_FOREACH(QFileInfo fileinfo, filist)
for(QFileInfo fileinfo : filist)
{
//checks if the path leads to a directory
if(fileinfo.baseName().contains("Plugins"))
@ -645,7 +645,7 @@ void MainWindow::loadPlugins()
QString plugins_dir = fileinfo.absolutePath();
plugins_dir.append("/").append(fileinfo.baseName());
Q_FOREACH(QString package_dir,
for(QString package_dir :
QDir(plugins_dir).entryList(QDir::Dirs))
{
QString package_dir_path(plugins_dir);
@ -677,7 +677,7 @@ void MainWindow::loadPlugins()
QByteArray new_path = path.append(env_path.prepend(separator)).toUtf8();
qputenv("PATH", new_path);
#endif
Q_FOREACH (QString pluginsDir,
for (QString pluginsDir :
env_path.split(separator, CGAL_QT_SKIP_EMPTY_PARTS)) {
QDir dir(pluginsDir);
if(dir.isReadable())
@ -686,11 +686,11 @@ void MainWindow::loadPlugins()
}
QSet<QString> loaded;
Q_FOREACH (QDir pluginsDir, plugins_directories) {
for (QDir pluginsDir : plugins_directories) {
if(verbose)
qDebug("# Looking for plugins in directory \"%s\"...",
qPrintable(pluginsDir.absolutePath()));
Q_FOREACH(QString fileName, pluginsDir.entryList(QDir::Files))
for(QString fileName : pluginsDir.entryList(QDir::Files))
{
QString abs_name = pluginsDir.absoluteFilePath(fileName);
if(loaded.find(abs_name) == loaded.end())
@ -708,7 +708,7 @@ void MainWindow::loadPlugins()
void MainWindow::updateMenus()
{
QList<QAction*> as = ui->menuOperations->actions();
Q_FOREACH(QAction* a, as)
for(QAction* a : as)
{
QString menuPath = a->property("subMenuName").toString();
setMenus(menuPath, ui->menuOperations->title(), a);
@ -724,7 +724,7 @@ void MainWindow::updateMenus()
bool MainWindow::hasPlugin(const QString& pluginName) const
{
Q_FOREACH(const PluginNamePair& p, plugins) {
for(const PluginNamePair& p : plugins) {
if(p.second == pluginName) return true;
}
return false;
@ -741,7 +741,7 @@ bool MainWindow::initPlugin(QObject* obj)
plugin->init(this, this->scene, this);
plugins << qMakePair(plugin, obj->objectName());
Q_FOREACH(QAction* action, plugin->actions()) {
for(QAction* action : plugin->actions()) {
// If action does not belong to the menus, add it to "Operations" menu
if(!childs.contains(action)) {
ui->menuOperations->addAction(action);
@ -771,7 +771,7 @@ bool MainWindow::initIOPlugin(QObject* obj)
void MainWindow::clearMenu(QMenu* menu)
{
Q_FOREACH(QAction* action, menu->actions())
for(QAction* action : menu->actions())
{
QMenu* menu = action->menu();
if(menu) {
@ -805,7 +805,7 @@ void MainWindow::addAction(QString actionName,
QString actionText,
QString menuName) {
QMenu* menu = nullptr;
Q_FOREACH(QAction* action, findChildren<QAction*>()) {
for(QAction* action : findChildren<QAction*>()) {
if(!action->menu()) continue;
QString menuText = action->menu()->title();
if(menuText != menuName) continue;
@ -894,7 +894,7 @@ void MainWindow::updateViewersBboxes(bool recenter)
{
CGAL::qglviewer::Vec min, max;
computeViewerBBox(min, max);
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
if(v == nullptr)
continue;
@ -939,7 +939,7 @@ void MainWindow::computeViewerBBox(CGAL::qglviewer::Vec& vmin, CGAL::qglviewer::
}
if(offset != viewer->offset())
{
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
if(v == nullptr)
continue;
@ -959,7 +959,7 @@ void MainWindow::reloadItem() {
Scene_item* item = nullptr;
Q_FOREACH(Scene::Item_id id, scene->selectionIndices())
for(Scene::Item_id id : scene->selectionIndices())
{
item = scene->item(id);
if(!item)//secure items like selection items that get deleted when their "parent" item is reloaded.
@ -1017,7 +1017,7 @@ void MainWindow::reloadItem() {
}
CGAL::Three::Polyhedron_demo_io_plugin_interface* MainWindow::findLoader(const QString& loader_name) const {
Q_FOREACH(CGAL::Three::Polyhedron_demo_io_plugin_interface* io_plugin,
for(CGAL::Three::Polyhedron_demo_io_plugin_interface* io_plugin :
io_plugins) {
if(io_plugin->name() == loader_name) {
return io_plugin;
@ -1037,7 +1037,7 @@ bool MainWindow::file_matches_filter(const QString& filters,
QRegularExpression all_filters_rx("\\((.*)\\)");
QStringList split_filters = filters.split(";;");
Q_FOREACH(const QString& filter, split_filters) {
for(const QString& filter : split_filters) {
QRegularExpressionMatch match = all_filters_rx.match(filter);
if(match.hasMatch()){
for (const QString& pattern : match.captured(1).split(' ')) {
@ -1322,7 +1322,7 @@ QList<int> MainWindow::getSelectedSceneItemIndices() const
{
QModelIndexList selectedIndices = sceneView->selectionModel()->selectedIndexes();
QList<int> result;
Q_FOREACH(QModelIndex index, selectedIndices) {
for(QModelIndex index : selectedIndices) {
int temp = scene->getIdFromModelIndex(proxyModel->mapToSource(index));
if(!result.contains(temp))
result<<temp;
@ -1335,7 +1335,7 @@ void MainWindow::selectionChanged()
scene->setSelectedItemIndex(getSelectedSceneItemIndex());
scene->setSelectedItemIndices(getSelectedSceneItemIndices());
CGAL::Three::Scene_item* item = scene->item(getSelectedSceneItemIndex());
Q_FOREACH(CGAL::QGLViewer* vi, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* vi : CGAL::QGLViewer::QGLViewerPool())
{
if(vi == nullptr)
continue;
@ -1346,7 +1346,7 @@ void MainWindow::selectionChanged()
vi->setManipulatedFrame(nullptr);
}
if(vi->manipulatedFrame() == nullptr) {
Q_FOREACH(CGAL::Three::Scene_item* item, scene->entries()) {
for(CGAL::Three::Scene_item* item : scene->entries()) {
if(item->manipulatable() && item->manipulatedFrame() != nullptr) {
if(vi->manipulatedFrame() != nullptr) {
// there are at least two possible frames
@ -1444,7 +1444,7 @@ void MainWindow::showSceneContextMenu(const QPoint& p) {
QVector<QMenu*> slider_menus;
bool has_stats = false;
bool has_reload = false;
Q_FOREACH(Scene::Item_id id, scene->selectionIndices())
for(Scene::Item_id id : scene->selectionIndices())
{
if(!scene->item(id)->property("source filename").toString().isEmpty())
{
@ -1452,7 +1452,7 @@ void MainWindow::showSceneContextMenu(const QPoint& p) {
break;
}
}
Q_FOREACH(QAction* action, scene->item(main_index)->contextMenu()->actions())
for(QAction* action : scene->item(main_index)->contextMenu()->actions())
{
if(action->property("is_groupable").toBool())
{
@ -1476,7 +1476,7 @@ void MainWindow::showSceneContextMenu(const QPoint& p) {
}
}
Q_FOREACH(Scene::Item_id index, scene->selectionIndices())
for(Scene::Item_id index : scene->selectionIndices())
{
if(index == main_index)
continue;
@ -1490,7 +1490,7 @@ void MainWindow::showSceneContextMenu(const QPoint& p) {
QMenu menu;
menu.addAction(actionAddToGroup);
menu.insertSeparator(nullptr);
Q_FOREACH(QString name, menu_actions.keys())
for(QString name : menu_actions.keys())
{
if(name == QString("alpha slider")
|| name == QString("points slider")
@ -1512,10 +1512,10 @@ void MainWindow::showSceneContextMenu(const QPoint& p) {
connect(slider, &QSlider::valueChanged, [this, slider]()
{
Q_FOREACH(Scene::Item_id id, scene->selectionIndices())
for(Scene::Item_id id : scene->selectionIndices())
{
Scene_item* item = scene->item(id);
Q_FOREACH(QAction* action, item->contextMenu()->actions())
for(QAction* action : item->contextMenu()->actions())
{
if(action->text() == "Alpha value")
{
@ -1547,10 +1547,10 @@ void MainWindow::showSceneContextMenu(const QPoint& p) {
connect(slider, &QSlider::valueChanged, [this, slider]()
{
Q_FOREACH(Scene::Item_id id, scene->selectionIndices())
for(Scene::Item_id id : scene->selectionIndices())
{
Scene_item* item = scene->item(id);
Q_FOREACH(QAction* action, item->contextMenu()->actions())
for(QAction* action : item->contextMenu()->actions())
{
if(action->text() == "Points Size")
{
@ -1582,10 +1582,10 @@ void MainWindow::showSceneContextMenu(const QPoint& p) {
connect(slider, &QSlider::valueChanged, [this, slider]()
{
Q_FOREACH(Scene::Item_id id, scene->selectionIndices())
for(Scene::Item_id id : scene->selectionIndices())
{
Scene_item* item = scene->item(id);
Q_FOREACH(QAction* action, item->contextMenu()->actions())
for(QAction* action : item->contextMenu()->actions())
{
if(action->text() == "Normals Length")
{
@ -1625,10 +1625,10 @@ void MainWindow::showSceneContextMenu(const QPoint& p) {
connect(slider, &QSlider::valueChanged, [this, slider]()
{
Q_FOREACH(Scene::Item_id id, scene->selectionIndices())
for(Scene::Item_id id : scene->selectionIndices())
{
Scene_item* item = scene->item(id);
Q_FOREACH(QAction* action, item->contextMenu()->actions())
for(QAction* action : item->contextMenu()->actions())
{
if(action->text() == "Line Width")
{
@ -1652,7 +1652,7 @@ void MainWindow::showSceneContextMenu(const QPoint& p) {
}
if(!slider_menus.empty())
{
Q_FOREACH(QMenu* m, slider_menus){
for(QMenu* m : slider_menus){
menu.addMenu(m);
}
menu.insertSeparator(nullptr);
@ -1744,7 +1744,7 @@ void MainWindow::readSettings()
settings.value("default_ps_rm", "points").toString());
// read plugin blacklist
QStringList blacklist=settings.value("plugin_blacklist",QStringList()).toStringList();
Q_FOREACH(QString name,blacklist){ plugin_blacklist.insert(name); }
for(QString name :blacklist){ plugin_blacklist.insert(name); }
def_save_dir = settings.value("default_saveas_dir", QDir::homePath()).toString();
this->default_point_size = settings.value("points_size").toInt();
this->default_normal_length = settings.value("normals_length").toInt();
@ -1758,7 +1758,7 @@ void MainWindow::writeSettings()
{
//setting plugin blacklist
QStringList blacklist;
Q_FOREACH(QString name,plugin_blacklist){ blacklist << name; }
for(QString name :plugin_blacklist){ blacklist << name; }
if ( !blacklist.isEmpty() ) settings.setValue("plugin_blacklist",blacklist);
else settings.remove("plugin_blacklist");
}
@ -1838,7 +1838,7 @@ void MainWindow::on_actionLoad_triggered()
for(CGAL::Three::Polyhedron_demo_io_plugin_interface* plugin : io_plugins) {
QStringList split_filters = plugin->loadNameFilters().split(";;");
Q_FOREACH(const QString& filter, split_filters) {
for(const QString& filter : split_filters) {
FilterPluginMap::iterator it = filterPluginMap.find(filter);
if(it != filterPluginMap.end()) {
if(verbose)
@ -1881,7 +1881,7 @@ void MainWindow::on_actionLoad_triggered()
std::back_inserter(colors_));
std::size_t nb_item = -1;
Q_FOREACH(const QString& filename, dialog.selectedFiles()) {
for(const QString& filename : dialog.selectedFiles()) {
CGAL::Three::Scene_item* item = nullptr;
if(selectedPlugin) {
@ -2002,9 +2002,9 @@ void MainWindow::on_actionSaveAs_triggered()
filename_ext.push_front(".");
QStringList final_extensions;
Q_FOREACH(QString string, filter_exts)
for(QString string : filter_exts)
{
Q_FOREACH(QString s, string.split(" ")){// in case of syntax like (*.a *.b)
for(QString s : string.split(" ")){// in case of syntax like (*.a *.b)
s.remove(")");
s.remove("(");
//remove *
@ -2099,7 +2099,7 @@ void MainWindow::on_actionDuplicate_triggered()
void MainWindow::on_actionShowHide_triggered()
{
scene->setUpdatesEnabled(false);
Q_FOREACH(QModelIndex index, sceneView->selectionModel()->selectedRows())
for(QModelIndex index : sceneView->selectionModel()->selectedRows())
{
int i = scene->getIdFromModelIndex(proxyModel->mapToSource(index));
CGAL::Three::Scene_item* item = scene->item(i);
@ -2216,7 +2216,7 @@ void MainWindow::on_actionPreferences_triggered()
ignoredBrush(Qt::lightGray);
//add blacklisted plugins
Q_FOREACH (QString name, PathNames_map.keys())
for (QString name : PathNames_map.keys())
{
QTreeWidgetItem *item = new QTreeWidgetItem(prefdiag.treeWidget);
item->setText(1, name);
@ -2245,7 +2245,7 @@ void MainWindow::on_actionPreferences_triggered()
detdiag.setupUi(&dialog);
QTreeWidgetItem *header = new QTreeWidgetItem(titles);
detdiag.treeWidget->setHeaderItem(header);
Q_FOREACH(QTreeWidgetItem* plugin_item, prefdiag.treeWidget->selectedItems())
for(QTreeWidgetItem* plugin_item : prefdiag.treeWidget->selectedItems())
{
QString name = plugin_item->text(1);
QString keywords = plugin_metadata_map[name].first.join(", ");
@ -2379,7 +2379,7 @@ void MainWindow::setBackgroundColor()
{
QColor c = QColorDialog::getColor();
if(c.isValid()) {
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
if(v == nullptr)
continue;
@ -2456,7 +2456,7 @@ void MainWindow::on_actionLoadPlugin_triggered()
this,
tr("Select the directory containing your plugins:"),
".",filters);
Q_FOREACH(QString name, paths)
for(QString name : paths)
load_plugin(name, false);
updateMenus();
@ -2549,7 +2549,7 @@ QString MainWindow::get_item_stats()
{
//1st step : get all classnames of the selected items
QList<QString> classnames;
Q_FOREACH(int id, scene->selectionIndices())
for(int id : scene->selectionIndices())
{
Scene_item* item = scene->item(id);
QString classname = item->property("classname").toString();
@ -2561,7 +2561,7 @@ QString MainWindow::get_item_stats()
//2nd step : separate the selection in lists corresponding to their classname
QVector< QList<Scene_item*> > items;
items.resize(classnames.size());
Q_FOREACH(int id, scene->selectionIndices())
for(int id : scene->selectionIndices())
{
Scene_item* s_item = scene->item(id);
for(int i=0; i<items.size(); i++)
@ -2588,7 +2588,7 @@ QString MainWindow::get_item_stats()
{
//1st row : item names
str.append("<html> <table border=1>""<tr><td colspan = 2></td>");
Q_FOREACH(Scene_item* sit, items[i])
for(Scene_item* sit : items[i])
{
str.append(QString("<td>%1</td>").arg(sit->name()));
}
@ -2602,7 +2602,7 @@ QString MainWindow::get_item_stats()
.arg(data.categories[j].first));
titles_limit+=data.categories[j].second;
str.append(QString("<td> %1 </td>").arg(data.titles.at(title)));
Q_FOREACH(Scene_item* sit, items[i])
for(Scene_item* sit : items[i])
{
str.append(QString("<td>%1</td>").arg(sit->computeStats(title)));
}
@ -2610,7 +2610,7 @@ QString MainWindow::get_item_stats()
for(;title<titles_limit; title++)
{
str.append(QString("</tr><tr><td> %1 </td>").arg(data.titles.at(title)));
Q_FOREACH(Scene_item* sit, items[i])
for(Scene_item* sit : items[i])
{
str.append(QString("<td>%1</td>").arg(sit->computeStats(title)));
}
@ -2703,7 +2703,7 @@ void MainWindow::colorItems()
std::back_inserter(colors_));
std::size_t nb_item = -1;
Q_FOREACH(int id, scene->selectionIndices())
for(int id : scene->selectionIndices())
{
scene->item(id)->setColor(colors_[++nb_item]);
}
@ -2715,7 +2715,7 @@ void MainWindow::colorItems()
void MainWindow::exportStatistics()
{
std::vector<Scene_item*> items;
Q_FOREACH(int id, getSelectedSceneItemIndices())
for(int id : getSelectedSceneItemIndices())
{
Scene_item* s_item = scene->item(id);
items.push_back(s_item);
@ -2767,10 +2767,10 @@ void MainWindow::propagate_action()
QAction* sender = qobject_cast<QAction*>(this->sender());
if(!sender) return;
QString name = sender->text();
Q_FOREACH(Scene::Item_id id, scene->selectionIndices())
for(Scene::Item_id id : scene->selectionIndices())
{
Scene_item* item = scene->item(id);
Q_FOREACH(QAction* action, item->contextMenu()->actions())
for(QAction* action : item->contextMenu()->actions())
{
if(action->text() == name)
{
@ -3163,7 +3163,7 @@ void MainWindow::toggleFullScreen()
QList<QDockWidget *> dockWidgets = findChildren<QDockWidget *>();
if(visibleDockWidgets.isEmpty())
{
Q_FOREACH(QDockWidget * dock, dockWidgets)
for(QDockWidget * dock : dockWidgets)
{
if(dock->isVisible())
{
@ -3174,7 +3174,7 @@ void MainWindow::toggleFullScreen()
}
else
{
Q_FOREACH(QDockWidget * dock, visibleDockWidgets){
for(QDockWidget * dock : visibleDockWidgets){
dock->show();
}
visibleDockWidgets.clear();
@ -3538,7 +3538,7 @@ void SubViewer::changeEvent(QEvent *event)
if(isMaximized())
{
QMenu* menu = mw->findChild<QMenu*>("menuView");
Q_FOREACH(QAction* action, viewMenu->actions())
for(QAction* action : viewMenu->actions())
{
menu->addAction(action);
}
@ -3556,7 +3556,7 @@ void SubViewer::changeEvent(QEvent *event)
else
{
QMenu* menu = mw->findChild<QMenu*>("menuView");
Q_FOREACH(QAction* action, viewMenu->actions())
for(QAction* action : viewMenu->actions())
{
menu->removeAction(action);
}
@ -3605,10 +3605,10 @@ void MainWindow::test_all_actions()
{
int nb_items = scene->numberOfEntries();
selectSceneItem(0);
Q_FOREACH(PluginNamePair pnp, plugins)
for(PluginNamePair pnp : plugins)
{
Polyhedron_demo_plugin_interface* plugin = pnp.first;
Q_FOREACH(QAction* action, plugin->actions()){
for(QAction* action : plugin->actions()){
if(plugin->applicable(action)){
qDebug()<<"Testing "<<pnp.second<<"and "<<action->text()<<" on";
qDebug()<<scene->item(scene->mainSelectionIndex())->name()<<"...";

View File

@ -398,7 +398,7 @@ private:
FT diag = scene_diag();
std::vector<SM_Tree*> closed_sm_trees;
Q_FOREACH(SM_Tree *sm_tree, sm_trees->values())
for(SM_Tree *sm_tree : sm_trees->values())
if(!(is_signed && !CGAL::is_closed(*qobject_cast<Scene_surface_mesh_item*>(sm_trees->key(sm_tree))->polyhedron())))
closed_sm_trees.push_back(sm_tree);
#ifndef CGAL_LINKED_WITH_TBB
@ -1063,7 +1063,7 @@ public Q_SLOTS:
}
void uncheckActions()
{
Q_FOREACH(QAction* action, _actions)
for(QAction* action : _actions)
if(action->isChecked())
{
action->setChecked(false);
@ -1129,11 +1129,11 @@ private:
Polyhedron_demo_cut_plugin::~Polyhedron_demo_cut_plugin()
{
Q_FOREACH(Facet_sm_tree *tree, facet_sm_trees.values())
for(Facet_sm_tree *tree : facet_sm_trees.values())
{
delete tree;
}
Q_FOREACH(Edge_sm_tree *tree, edge_sm_trees.values())
for(Edge_sm_tree *tree : edge_sm_trees.values())
{
delete tree;
}
@ -1182,7 +1182,7 @@ void Polyhedron_demo_cut_plugin::init(QMainWindow* mainWindow,
QActionGroup *group = new QActionGroup(mainWindow);
group->setExclusive(true);
Q_FOREACH(QAction *action, _actions)
for(QAction *action : _actions)
{
action->setActionGroup(group);
action->setCheckable(true);

View File

@ -42,7 +42,7 @@ public:
{
if(scene->selectionIndices().size() <2)
return false;
Q_FOREACH(Scene::Item_id i, scene->selectionIndices())
for(Scene::Item_id i : scene->selectionIndices())
{
if(! qobject_cast<Scene_surface_mesh_item*>(scene->item(i)))
return false;
@ -76,7 +76,7 @@ private Q_SLOTS:
void start()
{
QApplication::setOverrideCursor(Qt::WaitCursor);
Q_FOREACH(Scene::Item_id i, scene->selectionIndices())
for(Scene::Item_id i : scene->selectionIndices())
{
Scene_surface_mesh_item* item=qobject_cast<Scene_surface_mesh_item*>(scene->item(i));
if (!CGAL::is_triangle_mesh(*item->face_graph()))
@ -96,7 +96,7 @@ private Q_SLOTS:
group_item = nullptr;});
scene->addItem(group_item);
Q_FOREACH(Scene::Item_id i, scene->selectionIndices())
for(Scene::Item_id i : scene->selectionIndices())
{
Scene_surface_mesh_item* item=qobject_cast<Scene_surface_mesh_item*>(scene->item(i));
connect(item, &Scene_surface_mesh_item::aboutToBeDestroyed,
@ -147,7 +147,7 @@ public Q_SLOTS:
{
if(items.empty())
return;
Q_FOREACH(Scene_movable_sm_item* item, items)
for(Scene_movable_sm_item* item : items)
item->setColor(QColor(Qt::green));
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(
@ -158,7 +158,7 @@ public Q_SLOTS:
std::size_t mesh_id = 0;
std::size_t sel_id = 0;
Q_FOREACH(Scene_movable_sm_item* item, items)
for(Scene_movable_sm_item* item : items)
{
if(item == sel_item)
{
@ -168,7 +168,7 @@ public Q_SLOTS:
++mesh_id;
}
mesh_id = 0;
Q_FOREACH(Scene_movable_sm_item* item, items)
for(Scene_movable_sm_item* item : items)
{
if(mesh_id == sel_id)
{
@ -251,7 +251,7 @@ public Q_SLOTS:
std::size_t mesh_id = 0;
std::size_t sel_id = 0;
Q_FOREACH(Scene_movable_sm_item* item, items)
for(Scene_movable_sm_item* item : items)
{
if(item == sel_item)
{

View File

@ -359,7 +359,7 @@ public:
if(scene->selectionIndices().empty())
return false;
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
if(!qobject_cast<Scene_polygon_soup_item*>(scene->item(index)) &&
!qobject_cast<Scene_surface_mesh_item*>(scene->item(index)) &&
@ -540,7 +540,7 @@ public Q_SLOTS:
Segments segments;
Points points;
Q_FOREACH(int index, this->scene->selectionIndices())
for(int index : this->scene->selectionIndices())
{
// ---
Scene_surface_mesh_item* sm_item = qobject_cast<Scene_surface_mesh_item*>(this->scene->item(index));
@ -765,7 +765,7 @@ public Q_SLOTS:
QApplication::restoreOverrideCursor();
QApplication::setOverrideCursor(Qt::BusyCursor);
Q_FOREACH(int index, this->scene->selectionIndices())
for(int index : this->scene->selectionIndices())
{
Scene_surface_mesh_item* sm_item = qobject_cast<Scene_surface_mesh_item*>(this->scene->item(index));
if(sm_item != nullptr)

View File

@ -64,7 +64,7 @@ void Camera_positions_list::on_downButton_pressed()
void Camera_positions_list::on_minusButton_pressed()
{
Q_FOREACH(QModelIndex index,
for(QModelIndex index :
m_listView->selectionModel()->selectedIndexes()) {
m_model->removeRows(index.row(), 1);
}

View File

@ -52,7 +52,7 @@ void init(QMainWindow* mw,
<< actionIntersection
<< actionDifference
<< actionMinkowskiSum;
Q_FOREACH(QAction * action, _actions)
for(QAction * action : _actions)
action->setProperty("subMenuName",
"Boolean Operations");
_actions<< actionConvexDecomposition;

View File

@ -118,7 +118,7 @@ load_function() const
// Add loaded functions to the dialog
int i=0;
Q_FOREACH( Implicit_function_interface* f, functions_ )
for( Implicit_function_interface* f : functions_ )
{
ui.functionList->insertItem(i++,f->name());
}
@ -159,7 +159,7 @@ load_function_plugins()
if( !pluginsDir.cd(newDir) ) return;
}
Q_FOREACH (QString fileName, pluginsDir.entryList(QDir::Files))
for (QString fileName : pluginsDir.entryList(QDir::Files))
{
if ( fileName.contains("plugin") && QLibrary::isLibrary(fileName) )
{

View File

@ -73,7 +73,7 @@ public:
return qobject_cast<Scene_polylines_item*>(scene->item(
scene->mainSelectionIndex()));
bool all_polylines_selected = true;
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
if (!qobject_cast<Scene_polylines_item*>(scene->item(index)))
{

View File

@ -169,7 +169,7 @@ public:
bool applicable(QAction*) const
{
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
//if one polyhedron is found in the selection, it's fine
if (qobject_cast<Scene_polylines_item*>(scene->item(index)))
@ -229,8 +229,8 @@ private:
{
// extract seeds
std::vector<Kernel::Point_3> seeds;
Q_FOREACH(Scene_points_with_normal_item* points_item, points_items)
Q_FOREACH(Point_set_3<Kernel>::Index it, *points_item->point_set())
for(Scene_points_with_normal_item* points_item : points_items)
for(Point_set_3<Kernel>::Index it : *points_item->point_set())
seeds.push_back(points_item->point_set()->point(it));
// Create dialog box
@ -275,8 +275,8 @@ private:
double constant_coordinate =
polylines_items.back()->polylines.back().back()[constant_coordinate_index];
try{
Q_FOREACH(Scene_polylines_item* polylines_item, polylines_items)
Q_FOREACH(const std::vector<Kernel::Point_3>& points,
for(Scene_polylines_item* polylines_item : polylines_items)
for(const std::vector<Kernel::Point_3>& points :
polylines_item->polylines)
cdt.insert_constraint(points.begin(),points.end());
}catch(std::runtime_error&)
@ -357,10 +357,10 @@ private:
{
int res=-1;
Kernel::Point_3 ref = polylines_items.front()->polylines.front().front();
Q_FOREACH(Scene_polylines_item* polylines_item, polylines_items)
Q_FOREACH(const std::vector<Kernel::Point_3>& points,
for(Scene_polylines_item* polylines_item : polylines_items)
for(const std::vector<Kernel::Point_3>& points :
polylines_item->polylines)
Q_FOREACH(const Kernel::Point_3& pt, points)
for(const Kernel::Point_3& pt : points)
{
int nbe=0, candidate=-1;
for (int i=0; i<3; ++i)
@ -377,8 +377,8 @@ private:
}
}
if (res==-1) return res;
Q_FOREACH(Scene_points_with_normal_item* points_item, points_items)
Q_FOREACH(Point_set_3<Kernel>::Index pt, *points_item->point_set())
for(Scene_points_with_normal_item* points_item : points_items)
for(Point_set_3<Kernel>::Index pt : *points_item->point_set())
if (points_item->point_set()->point(pt)[res]!=ref[res])
return -1;
return res;
@ -394,7 +394,7 @@ public Q_SLOTS:
std::vector<Scene_points_with_normal_item*> points_items;
double inf = std::numeric_limits<double>::infinity();
CGAL::Three::Scene_interface::Bbox bbox(inf,inf,inf,-inf,-inf,-inf);
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
Scene_polylines_item* polylines_item =
qobject_cast<Scene_polylines_item*>(scene->item(index));

View File

@ -313,7 +313,7 @@ public:
// Look for action just after "Load..." action
QAction* actionAfterLoad = nullptr;
for(QList<QAction*>::iterator it_action = menuFileActions.begin(),
end = menuFileActions.end() ; it_action != end ; ++ it_action ) //Q_FOREACH( QAction* action, menuFileActions)
end = menuFileActions.end() ; it_action != end ; ++ it_action ) //for( QAction* action : menuFileActions)
{
if(NULL != *it_action && (*it_action)->text().contains("Load..."))
{
@ -594,7 +594,7 @@ public Q_SLOTS:
void connectNewViewer(QObject* o)
{
Q_FOREACH(Controls c, group_map.values())
for(Controls c : group_map.values())
{
o->installEventFilter(c.x_item);
o->installEventFilter(c.y_item);
@ -827,7 +827,7 @@ private:
x_item->setColor(QColor("red"));
y_item->setColor(QColor("green"));
z_item->setColor(QColor("blue"));
Q_FOREACH(CGAL::QGLViewer* viewer, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* viewer : CGAL::QGLViewer::QGLViewerPool())
{
viewer->installEventFilter(x_item);
viewer->installEventFilter(y_item);
@ -927,7 +927,7 @@ private Q_SLOTS:
CGAL::Three::Scene_group_item* group_item = qobject_cast<CGAL::Three::Scene_group_item*>(sender());
if(group_item)
{
Q_FOREACH(CGAL::Three::Scene_item* key, group_map.keys())
for(CGAL::Three::Scene_item* key : group_map.keys())
{
if(group_map[key].group == group_item)
{
@ -966,7 +966,7 @@ private Q_SLOTS:
group_map.remove(img_item);
QList<int> deletion;
Q_FOREACH(Scene_interface::Item_id id, group->getChildren())
for(Scene_interface::Item_id id : group->getChildren())
{
Scene_item* child = group->getChild(id);
group->unlockChild(child);

View File

@ -104,7 +104,7 @@ init(QMainWindow* mainWindow, CGAL::Three::Scene_interface* scene_interface, Mes
// Look for action just after "Load..." action
QAction* actionAfterLoad = NULL;
for ( QList<QAction*>::iterator it_action = menuFileActions.begin(),
end = menuFileActions.end() ; it_action != end ; ++ it_action ) //Q_FOREACH( QAction* action, menuFileActions)
end = menuFileActions.end() ; it_action != end ; ++ it_action ) //for( QAction* action : menuFileActions)
{
if ( NULL != *it_action && (*it_action)->text().contains("Load") )
{
@ -139,7 +139,7 @@ load_function() const
// Add loaded functions to the dialog
int i=0;
Q_FOREACH( Implicit_function_interface* f, functions_ )
for( Implicit_function_interface* f : functions_ )
{
ui.functionList->insertItem(i++,f->name());
}
@ -180,7 +180,7 @@ load_function_plugins()
if( !pluginsDir.cd(newDir) ) return;
}
Q_FOREACH (QString fileName, pluginsDir.entryList(QDir::Files))
for (QString fileName : pluginsDir.entryList(QDir::Files))
{
if ( fileName.contains("plugin") && QLibrary::isLibrary(fileName) )
{

View File

@ -992,7 +992,7 @@ meshing_done(Meshing_thread* thread)
.arg(source_item_name_)
.arg(thread->time());
Q_FOREACH( QString param, thread->parameters_log() )
for( QString param : thread->parameters_log() )
{
str.append(QString("( %1 )<br>").arg(param));
}
@ -1042,7 +1042,7 @@ treat_result(Scene_item& source_item,
result_item->setRenderingMode(source_item.renderingMode());
result_item->set_data_item(&source_item);
Q_FOREACH(int ind, scene->selectionIndices()) {
for(int ind : scene->selectionIndices()) {
scene->item(ind)->setVisible(false);
}
const Scene_interface::Item_id index = scene->mainSelectionIndex();
@ -1056,7 +1056,7 @@ treat_result(Scene_item& source_item,
Scene_surface_mesh_item* new_item = new Scene_surface_mesh_item;
CGAL::facets_in_complex_3_to_triangle_mesh(result_item->c3t3(), *new_item->face_graph());
new_item->setName(tr("%1 [Remeshed]").arg(source_item_name_));
Q_FOREACH(int ind, scene->selectionIndices()) {
for(int ind : scene->selectionIndices()) {
scene->item(ind)->setVisible(false);
}
const Scene_interface::Item_id index = scene->mainSelectionIndex();

View File

@ -512,7 +512,7 @@ offset_meshing()
Scene_polylines_item* polylines_item = nullptr;
bool mesh_or_soup_item_found = false;
Q_FOREACH(Scene_interface::Item_id index, scene->selectionIndices())
for(Scene_interface::Item_id index : scene->selectionIndices())
{
if(!mesh_or_soup_item_found)
{

View File

@ -561,7 +561,7 @@ optimization_done(Optimizer_thread* thread)
.arg(thread->time())
.arg(translate(return_code));
Q_FOREACH( QString param, thread->parameters_log() )
for( QString param : thread->parameters_log() )
{
str.append(QString("( %1 )<br>").arg(param));
}

View File

@ -515,7 +515,7 @@ void Volume_plane<T>::draw(Viewer_interface *viewer) const {
updateCurrentCube();
if(cur_cube != currentCube)
{
Q_FOREACH(CGAL::QGLViewer*v, CGAL::QGLViewer::QGLViewerPool()){
for(CGAL::QGLViewer*v : CGAL::QGLViewer::QGLViewerPool()){
v->setProperty("need_update", true);
}
}

View File

@ -157,7 +157,7 @@ if it has a closed contour on the clipping polyhedron. Otherwise, it will be lef
}
bool applicable(QAction*) const
{
Q_FOREACH(int id, scene->selectionIndices())
for(int id : scene->selectionIndices())
{
if(qobject_cast<Scene_surface_mesh_item*>(scene->item(id)))
return true;
@ -396,7 +396,7 @@ public Q_SLOTS:
}
}
//apply the clipping function
Q_FOREACH(Scene_item* item, polyhedra)
for(Scene_item* item : polyhedra)
{
Scene_surface_mesh_item *sm_item = qobject_cast<Scene_surface_mesh_item*>(item);
if(!ui_widget.do_not_modify_CheckBox->isChecked() && CGAL::Polygon_mesh_processing::does_self_intersect(*sm_item->face_graph()))

View File

@ -126,7 +126,7 @@ public:
QList<QLineEdit*> lineEdits;
lineEdits << ui.lineEditA << ui.lineEditX << ui.lineEditY << ui.lineEditZ;
Q_FOREACH(QLineEdit* widget, lineEdits)
for(QLineEdit* widget : lineEdits)
{
QSizePolicy sp_retain = widget->sizePolicy();
sp_retain.setRetainSizeWhenHidden(true);

View File

@ -128,7 +128,7 @@ public :
this, SLOT(on_actionPolyline_triggered()));
_actions << actionPolyline;
Q_FOREACH(QAction* action, _actions)
for(QAction* action : _actions)
{
menu->addAction(action);
}
@ -689,7 +689,7 @@ void Basic_generator_plugin::generatePoints()
return;
}
Q_FOREACH(QString s, list)
for(QString s : list)
{
if(!s.isEmpty())
{
@ -754,7 +754,7 @@ void Basic_generator_plugin::generateLines()
msgBox->exec();
return;
}
Q_FOREACH(QString s, list)
for(QString s : list)
{
if(!s.isEmpty())
{

View File

@ -144,7 +144,7 @@ void Clipping_box_plugin::clipbox()
item->setName("Clipping box");
item->setRenderingMode(FlatPlusEdges);
Q_FOREACH(CGAL::QGLViewer* viewer, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* viewer : CGAL::QGLViewer::QGLViewerPool())
viewer->installEventFilter(item);
scene->addItem(item);
@ -182,7 +182,7 @@ void Clipping_box_plugin::do_clip(bool b)
typedef CGAL::Epick Kernel;
typedef CGAL::Polyhedron_3<Kernel> Mesh;
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer =
qobject_cast<CGAL::Three::Viewer_interface*>(v);

View File

@ -29,7 +29,7 @@ public:
bool applicable(QAction*) const
{
bool at_least_one_non_empty = false;
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
Scene_item* item = scene->item(index);
if(!item->isFinite())
@ -108,7 +108,7 @@ bbox(bool extended)
int item_count = 0;
QString name;
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
Scene_item* item = scene->item(index);
if(item->isFinite() && !item->isEmpty())

View File

@ -37,7 +37,7 @@ public:
bool applicable(QAction*) const
{
bool at_least_one_non_empty = false;
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
Scene_item* item = scene->item(index);
if(!item->isFinite())
@ -144,7 +144,7 @@ void
Create_obb_mesh_plugin::
gather_mesh_points(std::vector<Point_3>& points)
{
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
Scene_item* item = scene->item(index);
@ -247,7 +247,7 @@ obb()
<< std::endl;
QString name;
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
Scene_item* item = scene->item(index);
if(!item->isEmpty())

View File

@ -98,7 +98,7 @@ void Edit_box_plugin::bbox()
this, SLOT(enableAction()));
item->setName("Edit box");
item->setRenderingMode(FlatPlusEdges);
Q_FOREACH(CGAL::QGLViewer* viewer, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* viewer : CGAL::QGLViewer::QGLViewerPool())
viewer->installEventFilter(item);
scene->addItem(item);

View File

@ -71,7 +71,7 @@ public:
this, SLOT(on_actionFitLine_triggered()));
_actions << actionFitPlane
<< actionFitLine;
Q_FOREACH(QAction* action, _actions)
for(QAction* action : _actions)
action->setProperty("subMenuName", "Principal Component Analysis");

View File

@ -289,7 +289,7 @@ Scene_edit_box_item::Scene_edit_box_item(const Scene_interface *scene_interface)
are_buffers_filled = false;
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
v->setMouseTracking(true);
}
@ -652,7 +652,7 @@ void Scene_edit_box_item::highlight(Viewer_interface *viewer)
tc->setCenterSize(d->hl_vertex.size());
//draw
d->hl_type = Scene_edit_box_item_priv::VERTEX;
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer =
static_cast<CGAL::Three::Viewer_interface*>(v);
@ -681,7 +681,7 @@ void Scene_edit_box_item::highlight(Viewer_interface *viewer)
ec->setFlatDataSize(d->hl_vertex.size());
//draw
d->hl_type = Scene_edit_box_item_priv::EDGE;
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer =
static_cast<CGAL::Three::Viewer_interface*>(v);
@ -719,7 +719,7 @@ void Scene_edit_box_item::highlight(Viewer_interface *viewer)
tc->setFlatDataSize(d->hl_vertex.size());
//draw
d->hl_type = Scene_edit_box_item_priv::FACE;
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer =
static_cast<CGAL::Three::Viewer_interface*>(v);

View File

@ -112,7 +112,7 @@ void Degenerated_faces_plugin::on_actionDegenFaces_triggered()
QApplication::setOverrideCursor(Qt::WaitCursor);
bool found = false;
std::vector<Scene_facegraph_item*> selected_polys;
Q_FOREACH(Scene_interface::Item_id index, scene->selectionIndices())
for(Scene_interface::Item_id index : scene->selectionIndices())
{
Scene_facegraph_item* poly_item =
qobject_cast<Scene_facegraph_item*>(scene->item(index));
@ -121,7 +121,7 @@ void Degenerated_faces_plugin::on_actionDegenFaces_triggered()
selected_polys.push_back(poly_item);
}
}
Q_FOREACH(Scene_facegraph_item* poly_item, selected_polys)
for(Scene_facegraph_item* poly_item : selected_polys)
{
Face_graph* pMesh = poly_item->polyhedron();
std::vector<Face_descriptor> facets;
@ -174,7 +174,7 @@ void Degenerated_faces_plugin::on_actionDegenEdges_triggered()
QApplication::setOverrideCursor(Qt::WaitCursor);
bool found = false;
std::vector<Scene_facegraph_item*> selected_polys;
Q_FOREACH(Scene_interface::Item_id index, scene->selectionIndices())
for(Scene_interface::Item_id index : scene->selectionIndices())
{
Scene_facegraph_item* poly_item =
qobject_cast<Scene_facegraph_item*>(scene->item(index));
@ -183,7 +183,7 @@ void Degenerated_faces_plugin::on_actionDegenEdges_triggered()
selected_polys.push_back(poly_item);
}
}
Q_FOREACH(Scene_facegraph_item* poly_item, selected_polys)
for(Scene_facegraph_item* poly_item : selected_polys)
{
Face_graph* pMesh = poly_item->polyhedron();
std::vector<edge_descriptor> edges;

View File

@ -41,7 +41,7 @@ public:
}
bool applicable(QAction*) const {
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
Scene_facegraph_item* item =
qobject_cast<Scene_facegraph_item*>(scene->item(index));
@ -82,7 +82,7 @@ void Polyhedron_demo_detect_sharp_edges_plugin::detectSharpEdges(bool input_dial
// Get selected items
QList<Poly_tuple> polyhedrons;
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
Scene_facegraph_item* item =
qobject_cast<Scene_facegraph_item*>(scene->item(index));
@ -113,7 +113,7 @@ void Polyhedron_demo_detect_sharp_edges_plugin::detectSharpEdges(bool input_dial
QApplication::setOverrideCursor(Qt::WaitCursor);
QApplication::processEvents();
std::size_t first_patch = 1;
Q_FOREACH(Poly_tuple tuple, polyhedrons)
for(Poly_tuple tuple : polyhedrons)
{
Scene_facegraph_item* item =
qobject_cast<Scene_facegraph_item*>(scene->item(tuple.first));

View File

@ -556,8 +556,8 @@ public Q_SLOTS:
float pxmin(8000),pxmax(-8000),
pymin(8000), pymax(-8000);
Q_FOREACH(QPolygonF poly, polys){
Q_FOREACH(QPointF pf, poly)
for(QPolygonF poly : polys){
for(QPointF pf : poly)
{
EPICK::Point_2 v = EPICK::Point_2(pf.x(),-pf.y());
if(v.x() < pxmin)
@ -570,9 +570,9 @@ public Q_SLOTS:
pymax = v.y();
}
}
Q_FOREACH(QPolygonF poly, polys){
for(QPolygonF poly : polys){
polylines.push_back(std::vector<EPICK::Point_2>());
Q_FOREACH(QPointF pf, poly)
for(QPointF pf : poly)
{
EPICK::Point_2 v = EPICK::Point_2(pf.x(),-pf.y());
polylines.back().push_back(EPICK::Point_2(v.x()*(xmax-xmin)/(pxmax-pxmin) +xmin ,
@ -705,7 +705,7 @@ public Q_SLOTS:
CGAL::Bbox_2 bbox= CGAL::bbox_2(local_polylines.front().begin(),
local_polylines.front().end(),
EPICK());
Q_FOREACH(const std::vector<EPICK::Point_2>& points,
for(const std::vector<EPICK::Point_2>& points :
local_polylines)
{
bbox += CGAL::bbox_2(points.begin(), points.end(), EPICK());
@ -965,4 +965,3 @@ private:
Navigation* navigation = nullptr;
};
#include "Engrave_text_plugin.moc"

View File

@ -91,7 +91,7 @@ public :
}
void invalidateOpenGLBuffers() Q_DECL_OVERRIDE
{
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer =
static_cast<CGAL::Three::Viewer_interface*>(v);
@ -419,7 +419,7 @@ private Q_SLOTS:
oliver_queen->manipulatedFrame()->setConstraint(&constraint);
oliver_queen->setColor(QColor(Qt::green));
oliver_queen->setName("Extrude item");
Q_FOREACH(CGAL::QGLViewer* viewer, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* viewer : CGAL::QGLViewer::QGLViewerPool())
viewer->installEventFilter(oliver_queen);
mw->installEventFilter(oliver_queen);
scene->addItem(oliver_queen);

View File

@ -109,7 +109,7 @@ public:
get_holes();
active_hole = polyline_data_list.end();
Q_FOREACH(CGAL::QGLViewer* viewer, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* viewer : CGAL::QGLViewer::QGLViewerPool())
{
viewer->installEventFilter(this);
}
@ -435,7 +435,7 @@ private:
ui_widget.Accept_button->setVisible(true);
ui_widget.Reject_button->setVisible(true);
Q_FOREACH( QWidget* w, ui_widget.dockWidgetContents->findChildren<QWidget*>() )
for( QWidget* w : ui_widget.dockWidgetContents->findChildren<QWidget*>() )
{ w->setEnabled(false); }
ui_widget.Accept_button->setEnabled(true);
@ -445,7 +445,7 @@ private:
ui_widget.Accept_button->setVisible(false);
ui_widget.Reject_button->setVisible(false);
Q_FOREACH( QWidget* w, ui_widget.dockWidgetContents->findChildren<QWidget*>() )
for( QWidget* w : ui_widget.dockWidgetContents->findChildren<QWidget*>() )
{ w->setEnabled(true); }
}
}
@ -882,7 +882,7 @@ void Polyhedron_demo_hole_filling_plugin::on_Fill_from_selection_button() {
vertices.push_back(target(opposite(b_edges.back(),*poly), *poly));
boost::property_map<Face_graph,CGAL::vertex_point_t>::type vpm = get(CGAL::vertex_point,*poly);
Q_FOREACH(fg_vertex_descriptor vh, vertices)
for(fg_vertex_descriptor vh : vertices)
{
points.push_back(get(vpm,vh));
}

View File

@ -228,7 +228,7 @@ public:
bool ok(true), found_poly(false);
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
if (!qobject_cast<Scene_facegraph_item*>(scene->item(index)))
ok = false;

View File

@ -62,7 +62,7 @@ public:
bool applicable(QAction* a) const
{
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
if (qobject_cast<Scene_facegraph_item*>(scene->item(index)))
return true;
@ -94,7 +94,7 @@ void Polyhedron_demo_join_and_split_polyhedra_plugin::on_actionJoinPolyhedra_tri
return;
}
std::vector<int> indices_to_remove;
Q_FOREACH(int index, scene->selectionIndices()) {
for(int index : scene->selectionIndices()) {
if (index == mainSelectionIndex)
continue;
@ -113,7 +113,7 @@ void Polyhedron_demo_join_and_split_polyhedra_plugin::on_actionJoinPolyhedra_tri
//remove the other items
std::sort(indices_to_remove.begin(), indices_to_remove.end(), std::greater<int>());
Q_FOREACH(int index, indices_to_remove)
for(int index : indices_to_remove)
{
scene->erase(index);
}
@ -137,7 +137,7 @@ bool operator()(const FaceGraph& mesh1, const FaceGraph& mesh2)
void Polyhedron_demo_join_and_split_polyhedra_plugin::on_actionSplitPolyhedra_triggered()
{
Q_FOREACH(int index, scene->selectionIndices()) {
for(int index : scene->selectionIndices()) {
Scene_facegraph_item* item =
qobject_cast<Scene_facegraph_item*>(scene->item(index));
if(item)
@ -203,7 +203,7 @@ void Polyhedron_demo_join_and_split_polyhedra_plugin::on_actionColorConnectedCom
std::set<Scene_facegraph_item*> to_skip;
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
Scene_facegraph_item* item =
qobject_cast<Scene_facegraph_item*>(scene->item(index));

View File

@ -891,7 +891,7 @@ Polyhedron_demo_mean_curvature_flow_skeleton_plugin::createContractedItem(Scene_
Scene_mcf_item*
Polyhedron_demo_mean_curvature_flow_skeleton_plugin::getMCFItem()
{
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
Scene_mcf_item* mcf = qobject_cast<Scene_mcf_item*>(scene->item(index));
if(mcf)

View File

@ -34,7 +34,7 @@ public:
CGAL::Three::Scene_interface* scene_interface,
Messages_interface* m);
bool applicable(QAction* action) const {
Q_FOREACH(CGAL::Three::Scene_interface::Item_id index, scene->selectionIndices()) {
for(CGAL::Three::Scene_interface::Item_id index : scene->selectionIndices()) {
if(qobject_cast<Scene_polygon_soup_item*>(scene->item(index)))
return true;
else
@ -139,7 +139,7 @@ void set_fcolors(SMesh* smesh, std::vector<CGAL::IO::Color> colors)
void Polyhedron_demo_orient_soup_plugin::orientSM()
{
Q_FOREACH(CGAL::Three::Scene_interface::Item_id index, scene->selectionIndices())
for(CGAL::Three::Scene_interface::Item_id index : scene->selectionIndices())
{
Scene_polygon_soup_item* item =
qobject_cast<Scene_polygon_soup_item*>(scene->item(index));
@ -335,4 +335,3 @@ void Polyhedron_demo_orient_soup_plugin::cleanSoup()
item->itemChanged();
}
#include "Orient_soup_plugin.moc"

View File

@ -108,7 +108,7 @@ public Q_SLOTS:
std::vector<Point_inside_smesh*>inside_smesh_testers;
std::vector<Point_set*> point_sets;
Q_FOREACH(CGAL::Three::Scene_interface::Item_id id, scene->selectionIndices()) {
for(CGAL::Three::Scene_interface::Item_id id : scene->selectionIndices()) {
Scene_surface_mesh_item* sm_item = qobject_cast<Scene_surface_mesh_item*>(scene->item(id));
if (sm_item){
inside_smesh_testers.push_back(new Point_inside_smesh(*(sm_item->polyhedron())));
@ -171,7 +171,7 @@ public Q_SLOTS:
bool found = false;
// for repaint
Q_FOREACH(CGAL::Three::Scene_interface::Item_id id, scene->selectionIndices()) {
for(CGAL::Three::Scene_interface::Item_id id : scene->selectionIndices()) {
Scene_points_with_normal_item* point_item = qobject_cast<Scene_points_with_normal_item*>(scene->item(id));
if(point_item) {
found = true;
@ -196,7 +196,7 @@ public Q_SLOTS:
// warning about '*bbox' not being initialized.
// -- Laurent Rineau, 2014/10/30
Q_FOREACH(CGAL::Three::Scene_interface::Item_id id, scene->selectionIndices()) {
for(CGAL::Three::Scene_interface::Item_id id : scene->selectionIndices()) {
Scene_surface_mesh_item* sm_item = qobject_cast<Scene_surface_mesh_item*>(scene->item(id));
if(sm_item) {
if(!bbox) {
@ -254,7 +254,7 @@ public Q_SLOTS:
private Q_SLOTS:
void resetGeneratedPoints(QObject* o)
{
Q_FOREACH(Scene_points_with_normal_item* item , generated_points)
for(Scene_points_with_normal_item* item : generated_points)
if(item == o)
{
generated_points.removeAll(item);

View File

@ -52,7 +52,7 @@ public:
}
bool applicable(QAction*) const {
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
if ( qobject_cast<Scene_surface_mesh_item*>(scene->item(index)) )
return true;
@ -120,7 +120,7 @@ void Polyhedron_demo_polyhedron_stitching_plugin::on_actionDetectBorders_trigger
void Polyhedron_demo_polyhedron_stitching_plugin::on_actionDetectBorders_triggered()
{
Q_FOREACH(int index, scene->selectionIndices()){
for(int index : scene->selectionIndices()){
on_actionDetectBorders_triggered<Scene_surface_mesh_item>(index);
}
}
@ -142,7 +142,7 @@ void Polyhedron_demo_polyhedron_stitching_plugin::on_actionStitchBorders_trigger
void Polyhedron_demo_polyhedron_stitching_plugin::on_actionStitchBorders_triggered()
{
Q_FOREACH(int index, scene->selectionIndices()){
for(int index : scene->selectionIndices()){
on_actionStitchBorders_triggered<Scene_surface_mesh_item>(index);
}
}
@ -177,14 +177,14 @@ void Polyhedron_demo_polyhedron_stitching_plugin::on_actionMergeReversibleCCs_tr
void Polyhedron_demo_polyhedron_stitching_plugin::on_actionStitchByCC_triggered()
{
Q_FOREACH(int index, scene->selectionIndices()){
for(int index : scene->selectionIndices()){
on_actionStitchByCC_triggered<Scene_surface_mesh_item>(index);
}
}
void Polyhedron_demo_polyhedron_stitching_plugin::on_actionMergeReversibleCCs_triggered()
{
Q_FOREACH(int index, scene->selectionIndices()){
for(int index : scene->selectionIndices()){
on_actionMergeReversibleCCs_triggered<Scene_surface_mesh_item>(index);
}
}

View File

@ -88,7 +88,7 @@ public:
if (scene->selectionIndices().size() == 1)
return qobject_cast<Scene_surface_mesh_item*>(scene->item(scene->mainSelectionIndex()));
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
if (qobject_cast<Scene_surface_mesh_item*>(scene->item(index)))
return true;

View File

@ -273,7 +273,7 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionSnapBorders_triggered()
{
std::vector<double> tolerances/* = 0.005, 0.0125, 0.025, 0.05, 0.07 */;
bool ok;
Q_FOREACH(QString tol_text, ui.tolerances->text().split(","))
for(QString tol_text : ui.tolerances->text().split(","))
{
double d = tol_text.toDouble(&ok);
if (ok)

View File

@ -112,7 +112,7 @@ public:
void setEditMode(bool b)
{
is_edit_mode = b;
Q_FOREACH(CGAL::QGLViewer* viewer,CGAL::QGLViewer::QGLViewerPool()){
for(CGAL::QGLViewer* viewer :CGAL::QGLViewer::QGLViewerPool()){
//for highlighting
viewer->setMouseTracking(true);
}
@ -132,7 +132,7 @@ public:
is_ready_to_paint_select = true;
is_lasso_active = false;
Q_FOREACH(CGAL::QGLViewer* viewer,CGAL::QGLViewer::QGLViewerPool()){
for(CGAL::QGLViewer* viewer :CGAL::QGLViewer::QGLViewerPool()){
viewer->installEventFilter(this);
viewer->setMouseBindingDescription(Qt::Key_D, Qt::ShiftModifier, Qt::LeftButton, "(When in selection plugin) Removes the clicked primitive from the selection. ");
}

View File

@ -1201,7 +1201,7 @@ void Polyhedron_demo_selection_plugin::on_actionSelfIntersection_triggered()
CGAL::Three::Three::CursorScopeGuard guard(tmp_cursor);
bool found = false;
std::vector<Scene_face_graph_item*> selected_polys;
Q_FOREACH(Scene_interface::Item_id index, scene->selectionIndices())
for(Scene_interface::Item_id index : scene->selectionIndices())
{
Scene_face_graph_item* poly_item =
qobject_cast<Scene_face_graph_item*>(scene->item(index));
@ -1210,7 +1210,7 @@ void Polyhedron_demo_selection_plugin::on_actionSelfIntersection_triggered()
selected_polys.push_back(poly_item);
}
}
Q_FOREACH(Scene_face_graph_item* poly_item, selected_polys)
for(Scene_face_graph_item* poly_item : selected_polys)
{
Face_graph* mesh = poly_item->face_graph();
std::vector<std::pair<Face_descriptor, Face_descriptor> > faces;

View File

@ -109,7 +109,7 @@ public Q_SLOTS:
void Polyhedron_demo_intersection_plugin::intersectionSurfaces()
{
Scene_face_graph_item* itemA = nullptr;
Q_FOREACH(CGAL::Three::Scene_interface::Item_id index, scene->selectionIndices())
for(CGAL::Three::Scene_interface::Item_id index : scene->selectionIndices())
{
Scene_face_graph_item* itemB =
qobject_cast<Scene_face_graph_item*>(scene->item(index));
@ -175,7 +175,7 @@ void Polyhedron_demo_intersection_plugin::intersectionPolylines()
std::pair<std::size_t, std::size_t> > Poly_intersection;
Scene_polylines_item* itemA = nullptr;
Q_FOREACH(CGAL::Three::Scene_interface::Item_id index, scene->selectionIndices())
for(CGAL::Three::Scene_interface::Item_id index : scene->selectionIndices())
{
Scene_polylines_item* itemB =
qobject_cast<Scene_polylines_item*>(scene->item(index));
@ -196,11 +196,11 @@ void Polyhedron_demo_intersection_plugin::intersectionPolylines()
QElapsedTimer time;
time.start();
std::vector<Polyline_3> polyA, polyB;
Q_FOREACH(const Polyline_3& poly, itemA->polylines)
for(const Polyline_3& poly : itemA->polylines)
{
polyA.push_back(poly);
}
Q_FOREACH(const Polyline_3& poly, itemB->polylines)
for(const Polyline_3& poly : itemB->polylines)
{
polyB.push_back(poly);
}
@ -208,7 +208,7 @@ void Polyhedron_demo_intersection_plugin::intersectionPolylines()
std::vector<Poly_intersection> poly_intersections;
PMP::internal::compute_polylines_polylines_intersection(polyA, polyB,std::back_inserter(poly_intersections) , Kernel());
Q_FOREACH(const Poly_intersection& inter, poly_intersections)
for(const Poly_intersection& inter : poly_intersections)
{
Kernel::Segment_3 segA(polyA[inter.first.first][inter.first.second], polyA[inter.first.first][inter.first.second +1]);
Kernel::Segment_3 segB(polyB[inter.second.first][inter.second.second], polyB[inter.second.first][inter.second.second+1]);
@ -293,7 +293,7 @@ void Polyhedron_demo_intersection_plugin::intersectionSurfacePolyline()
time.start();
Scene_face_graph_item::Face_graph tm = *itemA->face_graph();
std::vector<face_descriptor> Afaces;
Q_FOREACH(face_descriptor f, faces(tm))
for(face_descriptor f : faces(tm))
{
Afaces.push_back(f);
}
@ -302,7 +302,7 @@ void Polyhedron_demo_intersection_plugin::intersectionSurfacePolyline()
std::vector<Polyline_3> polylines;
//Polyline_3 polyline;
Q_FOREACH(const Polyline_3 &pol, itemB->polylines)
for(const Polyline_3 &pol : itemB->polylines)
{
polylines.push_back(pol);
}
@ -313,7 +313,7 @@ void Polyhedron_demo_intersection_plugin::intersectionSurfacePolyline()
std::back_inserter(poly_intersections),
CGAL::parameters::default_values());
Q_FOREACH(const Poly_intersection& inter, poly_intersections)
for(const Poly_intersection& inter : poly_intersections)
{
Kernel::Segment_3 segment(polylines[inter.second.first][inter.second.second], polylines[inter.second.first][inter.second.second+1]);

View File

@ -65,7 +65,7 @@ public:
}
bool applicable(QAction*) const {
Q_FOREACH(CGAL::Three::Scene_interface::Item_id index, scene->selectionIndices()){
for(CGAL::Three::Scene_interface::Item_id index : scene->selectionIndices()){
if ( qobject_cast<Scene_surface_mesh_item*>(scene->item(index)) )
return true;
if ( qobject_cast<Scene_polyhedron_selection_item*>(scene->item(index)))
@ -80,7 +80,7 @@ public Q_SLOTS:
void triangulate()
{
QApplication::setOverrideCursor(Qt::WaitCursor);
Q_FOREACH(CGAL::Three::Scene_interface::Item_id index, scene->selectionIndices())
for(CGAL::Three::Scene_interface::Item_id index : scene->selectionIndices())
{
Scene_surface_mesh_item* sm_item =
qobject_cast<Scene_surface_mesh_item*>(scene->item(index));

View File

@ -363,7 +363,7 @@ void Scene_alpha_shape_item::invalidateOpenGLBuffers()
{
getTriangleContainer(0)->reset_vbos(ALL);
setBuffersFilled(false);
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
Viewer_interface* viewer = static_cast<Viewer_interface*>(v);
if(viewer == NULL)

View File

@ -39,7 +39,7 @@ public:
if (scene->selectionIndices().size() < 2)
return false;
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
if ( qobject_cast<Scene_points_with_normal_item*>(scene->item(index)) )
return true;
@ -62,7 +62,7 @@ void Polyhedron_demo_merge_point_sets_plugin::on_actionMergePointSets_triggered(
= qobject_cast<Scene_points_with_normal_item*>(scene->item(mainSelectionIndex));
QList<int> indices_to_remove;
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
if (index == mainSelectionIndex)
continue;
@ -82,7 +82,7 @@ void Polyhedron_demo_merge_point_sets_plugin::on_actionMergePointSets_triggered(
scene->itemChanged(mainSelectionIndex);
//remove the other items
Q_FOREACH(int index, indices_to_remove)
for(int index : indices_to_remove)
{
scene->erase(index);
}

View File

@ -54,7 +54,7 @@ using namespace CGAL::Three;
Viewer_interface* getActiveViewer()
{
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
if(v->hasFocus())
{
@ -606,7 +606,7 @@ public:
shift_pressing = false;
ctrl_pressing = false;
Q_FOREACH(CGAL::QGLViewer* viewer, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* viewer : CGAL::QGLViewer::QGLViewerPool())
{
viewer->installEventFilter(this);
}
@ -952,7 +952,7 @@ public Q_SLOTS:
connect(edit_box, &Scene_edit_box_item::aboutToBeDestroyed,
this, &Polyhedron_demo_point_set_selection_plugin::reset_editbox);
scene->addItem(edit_box);
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()){
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool()){
v->installEventFilter(edit_box);
}
connect(mw, SIGNAL(newViewerCreated(QObject*)),

View File

@ -481,7 +481,7 @@ private:
++index;
}
Q_FOREACH(Scene_group_item* group, groups)
for(Scene_group_item* group : groups)
if(group && group->getChildren().empty())
delete group;
@ -841,7 +841,7 @@ private:
++index;
}
Q_FOREACH(Scene_group_item* group, groups)
for(Scene_group_item* group : groups)
if(group && group->getChildren().empty())
delete group;

View File

@ -133,7 +133,7 @@ public:
return false;
Scene_surface_mesh_item* sm = nullptr;
Scene_points_with_normal_item* pn = nullptr;
Q_FOREACH(Scene_interface::Item_id i,scene->selectionIndices())
for(Scene_interface::Item_id i :scene->selectionIndices())
{
if(!sm)
sm = qobject_cast<Scene_surface_mesh_item*>(scene->item(i));
@ -203,7 +203,7 @@ private Q_SLOTS:
{
Scene_surface_mesh_item* sm = nullptr;
Scene_points_with_normal_item* pn = nullptr;
Q_FOREACH(Scene_interface::Item_id i,scene->selectionIndices())
for(Scene_interface::Item_id i :scene->selectionIndices())
{
if(!sm)
sm = qobject_cast<Scene_surface_mesh_item*>(scene->item(i));

View File

@ -125,7 +125,7 @@ public:
{
std::vector<Scene_points_with_normal_item*> items;
Q_FOREACH(int index, scene->selectionIndices())
for(int index : scene->selectionIndices())
{
Scene_points_with_normal_item* item =
qobject_cast<Scene_points_with_normal_item*>(scene->item(index));

View File

@ -48,7 +48,7 @@ public:
<< actionCatmullClark
<< actionSqrt3
<< actionDooSabin;
Q_FOREACH(QAction* action, _actions)
for(QAction* action : _actions)
action->setProperty("subMenuName", "3D Surface Subdivision Methods");
autoConnectActions();

View File

@ -437,7 +437,7 @@ public:
return false;
}
Q_FOREACH(CGAL::Three::Scene_interface::Item_id index, scene->selectionIndices())
for(CGAL::Three::Scene_interface::Item_id index : scene->selectionIndices())
{
if ( qobject_cast<Scene_surface_mesh_item*>(scene->item(index)) ||
qobject_cast<Scene_polygon_soup_item*>(scene->item(index)) )
@ -513,7 +513,7 @@ void Polyhedron_demo_offset_meshing_plugin::offset_meshing()
bool mesh_or_soup_item_found = false;
Q_FOREACH(CGAL::Three::Scene_interface::Item_id index, scene->selectionIndices())
for(CGAL::Three::Scene_interface::Item_id index : scene->selectionIndices())
{
if (!mesh_or_soup_item_found)
{

View File

@ -363,7 +363,7 @@ public:
<< actionMVC
<< actionOTE;
autoConnectActions();
Q_FOREACH(QAction *action, _actions)
for(QAction *action : _actions)
action->setProperty("subMenuName",
"Triangulated Surface Mesh Parameterization"
);
@ -396,7 +396,7 @@ public:
|| qobject_cast<Scene_polyhedron_selection_item*>(scene->item(scene->mainSelectionIndex()));
}
Q_FOREACH(CGAL::Three::Scene_interface::Item_id id, scene->selectionIndices())
for(CGAL::Three::Scene_interface::Item_id id : scene->selectionIndices())
{
//if one facegraph is found in the selection, it's fine
if (qobject_cast<Scene_facegraph_item*>(scene->item(id)))
@ -432,7 +432,7 @@ public Q_SLOTS:
int id = scene->mainSelectionIndex();
Q_FOREACH(UVItem* pl, projections)
for(UVItem* pl : projections)
{
if(pl==nullptr || pl != projections[scene->item(id)])
continue;
@ -467,7 +467,7 @@ public Q_SLOTS:
void destroyPolyline(CGAL::Three::Scene_item* item)
{
Q_FOREACH(UVItem* pli, projections)
for(UVItem* pli : projections)
{
if(projections.key(pli) != item)
continue;
@ -506,7 +506,7 @@ private:
void Polyhedron_demo_parameterization_plugin::on_prevButton_pressed()
{
int id = scene->mainSelectionIndex();
Q_FOREACH(UVItem* pl, projections)
for(UVItem* pl : projections)
{
if(pl==nullptr
|| pl != projections[scene->item(id)])
@ -524,7 +524,7 @@ void Polyhedron_demo_parameterization_plugin::on_prevButton_pressed()
void Polyhedron_demo_parameterization_plugin::on_nextButton_pressed()
{
int id = scene->mainSelectionIndex();
Q_FOREACH(UVItem* pl, projections)
for(UVItem* pl : projections)
{
if(pl==nullptr
|| pl != projections[scene->item(id)])
@ -545,7 +545,7 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio
// get active polyhedron
Scene_facegraph_item* poly_item = nullptr;
CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex();
Q_FOREACH(CGAL::Three::Scene_interface::Item_id id, scene->selectionIndices())
for(CGAL::Three::Scene_interface::Item_id id : scene->selectionIndices())
{
poly_item = qobject_cast<Scene_facegraph_item*>(scene->item(id));
if(!poly_item)
@ -573,7 +573,7 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio
}
Scene_polyhedron_selection_item* sel_item = nullptr;
bool is_seamed = false;
Q_FOREACH(CGAL::Three::Scene_interface::Item_id id, scene->selectionIndices())
for(CGAL::Three::Scene_interface::Item_id id : scene->selectionIndices())
{
sel_item = qobject_cast<Scene_polyhedron_selection_item*>(scene->item(id));
if(!sel_item)

View File

@ -269,7 +269,7 @@ void Scene_polyhedron_shortest_path_item::invalidateOpenGLBuffers()
compute_bbox();
setBuffersFilled(false);
getPointContainer(0)->reset_vbos(ALL);
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(v);
if(viewer == nullptr)
@ -621,7 +621,7 @@ void Scene_polyhedron_shortest_path_item::initialize(
d->m_sceneInterface = sceneInterface;
connect(polyhedronItem, SIGNAL(item_is_about_to_be_changed()), this,
SLOT(poly_item_changed()));
Q_FOREACH(CGAL::QGLViewer* viewer, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* viewer : CGAL::QGLViewer::QGLViewerPool())
viewer->installEventFilter(this);
connect(d->m_mainWindow, SIGNAL(newViewerCreated(QObject*)),
this, SLOT(connectNewViewer(QObject*)));

View File

@ -47,7 +47,7 @@ protected:
painter.drawRect(QRect(QPoint(0,0), QPoint(this->width(),this->height())));
painter.setPen(QPen(Qt::black));
Q_FOREACH(QPointF p, points)
for(QPointF p : points)
{
/*Translation(-w/2, -h/2) to recenter the scene, then
* Scaling then Rotation and finally the Translation

View File

@ -90,7 +90,7 @@ QList<QAction*> Polyhedron_demo_edit_polyhedron_plugin::actions() const {
return QList<QAction*>() << actionDeformation;
}
bool Polyhedron_demo_edit_polyhedron_plugin::applicable(QAction*) const {
Q_FOREACH(CGAL::Three::Scene_interface::Item_id i, scene->selectionIndices())
for(CGAL::Three::Scene_interface::Item_id i : scene->selectionIndices())
{
if(qobject_cast<Scene_facegraph_item*>(scene->item(i)))
return true;
@ -385,7 +385,7 @@ void Polyhedron_demo_edit_polyhedron_plugin::dock_widget_visibility_changed(bool
else
selection_item = nullptr;
}
Q_FOREACH(CGAL::Three::Scene_interface::Item_id i , scene->selectionIndices())
for(CGAL::Three::Scene_interface::Item_id i : scene->selectionIndices())
{
Scene_facegraph_item* poly_item = qobject_cast<Scene_facegraph_item*>(scene->item(i));
if (poly_item &&
@ -499,7 +499,7 @@ Scene_edit_polyhedron_item* edit_item = nullptr;
bool need_sel(true), need_edit(true);
// find selection_item and edit_item in selection
Q_FOREACH(Item_id id, scene->selectionIndices())
for(Item_id id : scene->selectionIndices())
{
if(need_sel)
{
@ -536,9 +536,9 @@ void Polyhedron_demo_edit_polyhedron_plugin::importSelection(Scene_polyhedron_se
//converts the selection in selected points
QVector<Scene_polyhedron_selection_item::fg_vertex_descriptor> sel_to_import;
Q_FOREACH(Scene_polyhedron_selection_item::fg_vertex_descriptor vh, selection_item->selected_vertices)
for(Scene_polyhedron_selection_item::fg_vertex_descriptor vh : selection_item->selected_vertices)
sel_to_import.push_back(vh);
Q_FOREACH(Scene_polyhedron_selection_item::fg_edge_descriptor ed, selection_item->selected_edges)
for(Scene_polyhedron_selection_item::fg_edge_descriptor ed : selection_item->selected_edges)
{
Scene_polyhedron_selection_item::fg_vertex_descriptor vh = source(halfedge(ed, *selection_item->polyhedron()),*selection_item->polyhedron());
if(!sel_to_import.contains(vh))
@ -549,7 +549,7 @@ void Polyhedron_demo_edit_polyhedron_plugin::importSelection(Scene_polyhedron_se
sel_to_import.push_back(vh);
}
Q_FOREACH(Scene_polyhedron_selection_item::fg_face_descriptor fh, selection_item->selected_facets)
for(Scene_polyhedron_selection_item::fg_face_descriptor fh : selection_item->selected_facets)
{
CGAL::Halfedge_around_face_circulator<Scene_facegraph_item::Face_graph> hafc(halfedge(fh, *selection_item->polyhedron()), *selection_item->polyhedron());
CGAL::Halfedge_around_face_circulator<Scene_facegraph_item::Face_graph> end = hafc;
@ -561,7 +561,7 @@ void Polyhedron_demo_edit_polyhedron_plugin::importSelection(Scene_polyhedron_se
}
//makes the selected points ROI
Q_FOREACH(Scene_polyhedron_selection_item::fg_vertex_descriptor vh, sel_to_import)
for(Scene_polyhedron_selection_item::fg_vertex_descriptor vh : sel_to_import)
{
edit_item->insert_roi_vertex(vh);
}
@ -571,7 +571,7 @@ void Polyhedron_demo_edit_polyhedron_plugin::importSelection(Scene_polyhedron_se
selection_item->set_highlighting(false);
}
selection_item->setVisible(false);
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
v->update();
}

View File

@ -1137,7 +1137,7 @@ void Scene_edit_polyhedron_item::invalidateOpenGLBuffers()
}
getEdgeContainer(2)->reset_vbos(ALL);
setBuffersFilled(false);
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(v);
if(viewer == nullptr)

View File

@ -134,7 +134,7 @@ Polyhedron_demo::Polyhedron_demo(int& argc, char **argv,
if(!parser.isSet(no_autostart) && autostart_js.exists()) {
mainWindow.loadScript(autostart_js);
}
Q_FOREACH(QString filename, parser.positionalArguments()) {
for(QString filename : parser.positionalArguments()) {
mainWindow.open(filename);
}
@ -155,7 +155,7 @@ bool Polyhedron_demo::notify(QObject* receiver, QEvent* event)
return QApplication::notify(receiver, event);
} catch (std::exception &e) {
// find the mainwindow to spawn an error message
Q_FOREACH (QWidget *widget, QApplication::topLevelWidgets()) {
for (QWidget *widget : QApplication::topLevelWidgets()) {
if(MainWindow* mw = qobject_cast<MainWindow*>(widget)) {
QMessageBox::critical(mw,
tr("Unhandled exception"),

View File

@ -12,7 +12,7 @@ void CGAL::Three::Polyhedron_demo_plugin_helper::addDockWidget(QDockWidget* dock
dock_widget->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetFloatable);
QList<QDockWidget*> dockWidgets = mw->findChildren<QDockWidget*>();
int counter = 0;
Q_FOREACH(QDockWidget* dock, dockWidgets) {
for(QDockWidget* dock : dockWidgets) {
if( mw->dockWidgetArea(dock) != ::Qt::LeftDockWidgetArea ||
dock == dock_widget )
{ continue; }
@ -45,7 +45,7 @@ void CGAL::Three::Polyhedron_demo_plugin_helper::autoConnectActions()
methods << metaObject->method(i);
}
Q_FOREACH(QAction* action, actions())
for(QAction* action : actions())
{
bool success = false;
// qDebug("Autoconnecting action \"%s\"...",

View File

@ -113,7 +113,7 @@ Scene::replaceItem(Scene::Item_id index, CGAL::Three::Scene_item* item, bool emi
if(group)
{
m_groups.removeAll(index);
Q_FOREACH(Item_id id, group->getChildren())
for(Item_id id : group->getChildren())
{
CGAL::Three::Scene_item* child = group->getChild(id);
group->unlockChild(child);
@ -161,7 +161,7 @@ Scene::replaceItem(Scene::Item_id index, CGAL::Three::Scene_item* item, bool emi
Q_EMIT restoreCollapsedState();
redraw_model();
Q_EMIT selectionChanged(index);
Q_FOREACH(Scene_item* child, group_children)
for(Scene_item* child : group_children)
{
erase(item_id(child));
}
@ -202,7 +202,7 @@ Scene::erase(Scene::Item_id index)
item->deleteLater();
selected_item = -1;
//re-creates the Scene_view
Q_FOREACH(Item_id id, children)
for(Item_id id : children)
{
organize_items(this->item(id), invisibleRootItem(), 0);
}
@ -224,7 +224,7 @@ Scene::erase(QList<int> indices)
return -1;
std::unordered_set<CGAL::Three::Scene_item*> to_be_removed;
int max_index = -1;
Q_FOREACH(int index, indices) {
for(int index : indices) {
if(index < 0 || index >= m_entries.size())
continue;
@ -237,7 +237,7 @@ Scene::erase(QList<int> indices)
Scene_group_item* group = qobject_cast<Scene_group_item*>(item);
if(group)
{
Q_FOREACH(Item_id id, group->getChildren())
for(Item_id id : group->getChildren())
{
CGAL::Three::Scene_item* child = group->getChild(id);
to_be_removed.insert(child);
@ -264,7 +264,7 @@ Scene::erase(QList<int> indices)
clear();
index_map.clear();
selected_item = -1;
Q_FOREACH(Item_id id, children)
for(Item_id id : children)
{
organize_items(item(id), invisibleRootItem(), 0);
}
@ -296,17 +296,17 @@ void Scene::remove_item_from_groups(Scene_item* item)
}
Scene::~Scene()
{
Q_FOREACH(CGAL::QGLViewer* viewer, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* viewer : CGAL::QGLViewer::QGLViewerPool())
{
removeViewer(static_cast<CGAL::Three::Viewer_interface*>(viewer));
viewer->setProperty("is_destroyed", true);
}
Q_FOREACH(QOpenGLVertexArrayObject* vao, vaos.values())
for(QOpenGLVertexArrayObject* vao : vaos.values())
{
vao->destroy();
delete vao;
}
Q_FOREACH(CGAL::Three::Scene_item* item_ptr, m_entries)
for(CGAL::Three::Scene_item* item_ptr : m_entries)
{
item_ptr->deleteLater();
}
@ -490,7 +490,7 @@ void Scene::initializeGL(CGAL::Three::Viewer_interface* viewer)
void Scene::s_itemAboutToBeDestroyed(CGAL::Three::Scene_item *rmv_itm)
{
Q_FOREACH(CGAL::Three::Scene_item* item, m_entries)
for(CGAL::Three::Scene_item* item : m_entries)
{
if(item == rmv_itm)
item->itemAboutToBeDestroyed(item);
@ -500,7 +500,7 @@ bool
Scene::keyPressEvent(QKeyEvent* e)
{
bool res = false;
Q_FOREACH(int i, selected_items_list)
for(int i : selected_items_list)
{
CGAL::Three::Scene_item* item = m_entries[i];
res |= item->keyPressEvent(e);
@ -542,7 +542,7 @@ void Scene::renderScene(const QList<Scene_interface::Item_id> &items,
viewer->setCurrentPass(pass);
viewer->setDepthWriting(writing_depth);
viewer->setDepthPeelingFbo(fbo);
Q_FOREACH(Scene_interface::Item_id index, items)
for(Scene_interface::Item_id index : items)
{
CGAL::Three::Scene_item& item = *m_entries[index];
CGAL::Three::Scene_group_item* group =
@ -586,7 +586,7 @@ void Scene::renderWireScene(const QList<Scene_interface::Item_id> &items,
QMap<float, int>& picked_item_IDs,
bool with_names)
{
Q_FOREACH(Scene_interface::Item_id index, items)
for(Scene_interface::Item_id index : items)
{
CGAL::Three::Scene_item& item = *m_entries[index];
CGAL::Three::Scene_group_item* group =
@ -651,7 +651,7 @@ void Scene::renderPointScene(const QList<Scene_interface::Item_id> &items,
QMap<float, int>& picked_item_IDs,
bool with_names)
{
Q_FOREACH(Scene_interface::Item_id index, items)
for(Scene_interface::Item_id index : items)
{
CGAL::Three::Scene_item& item = *m_entries[index];
CGAL::Three::Scene_group_item* group =
@ -691,7 +691,7 @@ void Scene::renderPointScene(const QList<Scene_interface::Item_id> &items,
bool Scene::has_alpha()
{
Q_FOREACH(Scene_item* item, m_entries)
for(Scene_item* item : m_entries)
if(item->alpha() != 1.0f)
return true;
return false;
@ -708,7 +708,7 @@ Scene::draw_aux(bool with_names, CGAL::Three::Viewer_interface* viewer)
//the item stays opaque
QList<Item_id> opaque_items;
QList<Item_id> transparent_items;
Q_FOREACH(Item_id id, children)
for(Item_id id : children)
{
Scene_item* item = m_entries[id];
Scene_group_item* group = qobject_cast<Scene_group_item*>(item);
@ -1049,7 +1049,7 @@ Scene::setData(const QModelIndex &index,
break;
case ColorColumn:
if(selectionIndices().contains(item_id(item)))
Q_FOREACH(Item_id item_index, selectionIndices())
for(Item_id item_index : selectionIndices())
this->item(item_index)->setColor(value.value<QColor>());
else
item->setColor(value.value<QColor>());
@ -1095,13 +1095,13 @@ bool Scene::dropMimeData(const QMimeData * /*data*/,
QList<int> groups_children;
//get IDs of all children of selected groups
Q_FOREACH(int i, selected_items_list)
for(int i : selected_items_list)
{
CGAL::Three::Scene_group_item* group =
qobject_cast<CGAL::Three::Scene_group_item*>(item(i));
if(group)
{
Q_FOREACH(Item_id id, group->getChildren())
for(Item_id id : group->getChildren())
{
CGAL::Three::Scene_item* child = item(id);
groups_children << item_id(child);
@ -1109,7 +1109,7 @@ bool Scene::dropMimeData(const QMimeData * /*data*/,
}
}
// Insure that children of selected groups will not be added twice
Q_FOREACH(int i, selected_items_list)
for(int i : selected_items_list)
{
if(!groups_children.contains(i))
{
@ -1123,7 +1123,7 @@ bool Scene::dropMimeData(const QMimeData * /*data*/,
bool one_contained = false;
if(group)
{
Q_FOREACH(int id, selected_items_list)
for(int id : selected_items_list)
{
if(group->getChildren().contains(id))
{
@ -1139,7 +1139,7 @@ bool Scene::dropMimeData(const QMimeData * /*data*/,
//unless the drop zone is empty, which means the item should be removed from all groups.
if(!parent.isValid())
{
Q_FOREACH(Scene_item* item, items)
for(Scene_item* item : items)
{
if(item->parentGroup())
{
@ -1152,7 +1152,7 @@ bool Scene::dropMimeData(const QMimeData * /*data*/,
}
return false;
}
Q_FOREACH(Scene_item* item, items)
for(Scene_item* item : items)
changeGroup(item, group);
redraw_model();
return true;
@ -1162,7 +1162,7 @@ bool Scene::dropMimeData(const QMimeData * /*data*/,
bool Scene::sort_lists(QVector<QList<int> >&sorted_lists, bool up)
{
QVector<int> group_found;
Q_FOREACH(int i, selectionIndices())
for(int i : selectionIndices())
{
Scene_item* item = this->item(i);
if(item->has_group == 0)
@ -1359,7 +1359,7 @@ QItemSelection Scene::createSelection(int i)
QItemSelection Scene::createSelection(QList<int> is)
{
QItemSelection sel;
Q_FOREACH(int i, is)
for(int i : is)
sel.select(index_map.keys(i).at(0),
index_map.keys(i).at(4));
return sel;
@ -1610,7 +1610,7 @@ Scene::Bbox Scene::bbox() const
bool bbox_initialized = false;
Bbox bbox = Bbox(0,0,0,0,0,0);
Q_FOREACH(CGAL::Three::Scene_item* item, m_entries)
for(CGAL::Three::Scene_item* item : m_entries)
{
if(item->isFinite() && !item->isEmpty() && item->visible()) {
if(bbox_initialized) {
@ -1639,7 +1639,7 @@ void Scene::redraw_model()
clear();
index_map.clear();
//fills the model
Q_FOREACH(Item_id id, children)
for(Item_id id : children)
{
organize_items(m_entries[id], invisibleRootItem(), 0);
}
@ -1778,7 +1778,7 @@ void Scene::organize_items(Scene_item* item, QStandardItem* root, int loop)
qobject_cast<CGAL::Three::Scene_group_item*>(item);
if(group)
{
Q_FOREACH(Item_id id, group->getChildren())
for(Item_id id : group->getChildren())
{
CGAL::Three::Scene_item* child = group->getChild(id);
organize_items(child, list.first(), loop+1);
@ -1832,7 +1832,7 @@ findItem(const CGAL::Three::Scene_interface* scene_interface,
QString name, Scene_item_name_fn_ptr fn) {
const Scene* scene = dynamic_cast<const Scene*>(scene_interface);
if(!scene) return nullptr;
Q_FOREACH(CGAL::Three::Scene_item* item, scene->entries()) {
for(CGAL::Three::Scene_item* item : scene->entries()) {
CGAL::Three::Scene_item* ptr = qobject_cast<CGAL::Three::Scene_item*>(metaobj.cast(item));
if(ptr && ((ptr->*fn)() == name)) return ptr;
}
@ -1850,7 +1850,7 @@ findItems(const CGAL::Three::Scene_interface* scene_interface,
QList<CGAL::Three::Scene_item*> list;
if(!scene) return list;
Q_FOREACH(CGAL::Three::Scene_item* item, scene->entries()) {
for(CGAL::Three::Scene_item* item : scene->entries()) {
CGAL::Three::Scene_item* ptr = qobject_cast<CGAL::Three::Scene_item*>(item);
if(ptr && ((ptr->*fn)() == name)) {
list << ptr;
@ -1899,7 +1899,7 @@ void Scene::computeBbox()
bool bbox_initialized = false;
Bbox bbox = Bbox(0,0,0,0,0,0);
Q_FOREACH(CGAL::Three::Scene_item* item, m_entries)
for(CGAL::Three::Scene_item* item : m_entries)
{
if(item->isFinite() && !item->isEmpty() ) {
if(bbox_initialized) {
@ -1920,7 +1920,7 @@ void Scene::computeBbox()
void Scene::newViewer(Viewer_interface *viewer)
{
initGL(viewer);
Q_FOREACH(Scene_item* item, m_entries)
for(Scene_item* item : m_entries)
{
item->newViewer(viewer);
}
@ -1936,7 +1936,7 @@ void Scene::removeViewer(Viewer_interface *viewer)
vaos[viewer]->destroy();
vaos[viewer]->deleteLater();
vaos.remove(viewer);
Q_FOREACH(Scene_item* item, m_entries)
for(Scene_item* item : m_entries)
{
item->removeViewer(viewer);
}
@ -1965,7 +1965,7 @@ void Scene::initGL(Viewer_interface *viewer)
}
void Scene::callDraw(){
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
qobject_cast<Viewer_interface*>(v)->update();
}

View File

@ -185,7 +185,7 @@ public Q_SLOTS:
void setSelectedItem(CGAL::Three::Scene_item* item_to_select)
{
int i=0;
Q_FOREACH(CGAL::Three::Scene_item* item, m_entries)
for(CGAL::Three::Scene_item* item : m_entries)
{
if (item==item_to_select)
{
@ -200,14 +200,14 @@ public Q_SLOTS:
const QList<int>& setSelectedItemIndices(QList<int> l,
const bool do_emit = true)
{
Q_FOREACH(int i,l)
for(int i :l)
{
CGAL::Three::Scene_group_item* group =
qobject_cast<CGAL::Three::Scene_group_item*>(item(i));
if(group)
{
QList<int> list;
Q_FOREACH(Item_id id, group->getChildrenForSelection())
for(Item_id id : group->getChildrenForSelection())
list << id;
l << setSelectedItemIndices(list, false /*do not emit*/);
}
@ -223,14 +223,14 @@ public Q_SLOTS:
const QList<int>& setSelectedItemList(QList<int> l,
const bool do_emit = true)
{
Q_FOREACH(int i,l)
for(int i :l)
{
CGAL::Three::Scene_group_item* group =
qobject_cast<CGAL::Three::Scene_group_item*>(item(i));
if(group)
{
QList<int> list;
Q_FOREACH(Item_id id, group->getChildrenForSelection())
for(Item_id id : group->getChildrenForSelection())
list << id;
l << setSelectedItemList(list, false /*do not emit*/);
}
@ -373,5 +373,3 @@ private:
}; // end class SceneDelegate
#endif // SCENE_H

View File

@ -45,7 +45,7 @@ QList<T> findItems(const CGAL::Three::Scene_interface* scene, QString name,
findItems(scene, reinterpret_cast<T>(0)->staticMetaObject,
name, fn);
QList<T> list;
Q_FOREACH(CGAL::Three::Scene_item* ptr, void_list) {
for(CGAL::Three::Scene_item* ptr : void_list) {
list << qobject_cast<T>(ptr);
}
return list;
@ -106,7 +106,7 @@ QList<T> findItemsByObjectName(const CGAL::Three::Scene_interface* scene,
// scene_findItems(scene, name, fn,
// reinterpret_cast<T>(0)->staticMetaObject());
// QList<T> list;
// Q_FOREACH(void* ptr, void_list) {
// for(void* ptr : void_list) {
// list << static_cast<T>(ptr);
// }
// return list;

View File

@ -91,7 +91,7 @@ void Scene_group_item::update_group_number(Scene_item * new_item, int n)
qobject_cast<Scene_group_item*>(new_item);
if(group)
{
Q_FOREACH(Scene_interface::Item_id id, group->getChildren()){
for(Scene_interface::Item_id id : group->getChildren()){
update_group_number(getChild(id),n+1);
}

View File

@ -905,7 +905,7 @@ void Scene_points_with_normal_item::invalidateOpenGLBuffers()
getPointContainer(Priv::Shaded_points)->reset_vbos(Scene_item_rendering_helper::ALL);
getEdgeContainer(0)->reset_vbos(Scene_item_rendering_helper::ALL);
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(v);
if(viewer == nullptr)

View File

@ -1636,7 +1636,7 @@ void Scene_polyhedron_selection_item::selectPath(fg_vertex_descriptor vh)
return;
}
bool found = false;
Q_FOREACH(Scene_polyhedron_selection_item_priv::vertex_on_path vop, d->path)
for(Scene_polyhedron_selection_item_priv::vertex_on_path vop : d->path)
{
if(vop.vertex == vh)
{
@ -1843,7 +1843,7 @@ Scene_polyhedron_selection_item::Scene_polyhedron_selection_item(Scene_face_grap
Scene_polyhedron_selection_item::~Scene_polyhedron_selection_item()
{
delete d;
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()){
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool()){
CGAL::Three::Viewer_interface* viewer = dynamic_cast<CGAL::Three::Viewer_interface*>(v);
viewer->setBindingSelect();
}
@ -1887,7 +1887,7 @@ void Scene_polyhedron_selection_item::invalidateOpenGLBuffers() {
getPointContainer(Priv::Temp_points)->reset_vbos(ALL);
getPointContainer(Priv::Fixed_points)->reset_vbos(ALL);
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer =
static_cast<CGAL::Three::Viewer_interface*>(v);
@ -1907,14 +1907,14 @@ void Scene_polyhedron_selection_item::invalidateOpenGLBuffers() {
void Scene_polyhedron_selection_item::add_to_selection()
{
Q_FOREACH(fg_edge_descriptor ed, temp_selected_edges)
for(fg_edge_descriptor ed : temp_selected_edges)
{
selected_edges.insert(ed);
temp_selected_edges.erase(ed);
}
on_Ctrlz_pressed();
invalidateOpenGLBuffers();
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
v->update();
d->tempInstructions("Path added to selection.",
"Select two vertices to create the path between them. (1/2)");
@ -2217,7 +2217,7 @@ void Scene_polyhedron_selection_item::init(Scene_face_graph_item* poly_item, QMa
redraw();
});
d->manipulated_frame = new ManipulatedFrame();
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
v->installEventFilter(this);
mw->installEventFilter(this);
connect(mw, SIGNAL(newViewerCreated(QObject*)),
@ -2241,12 +2241,12 @@ void Scene_polyhedron_selection_item::selection_changed(bool)
Three::scene()->item(Three::scene()->mainSelectionIndex())))
do_bind_select = false;
if(do_bind_select)
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()){
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool()){
CGAL::Three::Viewer_interface* viewer = dynamic_cast<CGAL::Three::Viewer_interface*>(v);
viewer->setBindingSelect();
}
else
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()){
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool()){
CGAL::Three::Viewer_interface* viewer = dynamic_cast<CGAL::Three::Viewer_interface*>(v);
viewer->setNoBinding();
}

View File

@ -568,7 +568,7 @@ void Scene_polylines_item::change_corner_radii(double r) {
scene->addItem(d->spheres);
scene->changeGroup(d->spheres, this);
lockChild(d->spheres);
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
d->spheres->gl_initialization(qobject_cast<Viewer_interface*>(v));
}

View File

@ -1146,7 +1146,7 @@ void* Scene_surface_mesh_item_priv::get_aabb_tree()
if(!CGAL::is_triangle(halfedge(f, *sm), *sm))
{
EPICK::Vector_3 normal = CGAL::Polygon_mesh_processing::compute_face_normal(f, *sm);
Q_FOREACH(EPICK::Triangle_3 triangle, triangulate_primitive(f,normal))
for(EPICK::Triangle_3 triangle : triangulate_primitive(f,normal))
{
Primitive primitive(triangle, f);
tree->insert(primitive);
@ -1306,7 +1306,7 @@ void Scene_surface_mesh_item::invalidate(Gl_data_names name)
d->flat_vertex_map_ready = false;
}
setBuffersFilled(false);
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(v);
if(viewer == nullptr)
@ -2183,7 +2183,7 @@ void Scene_surface_mesh_item::printAllIds()
s3(printFaceIds());
if((s1 && s2 && s3))
{
Q_FOREACH(CGAL::QGLViewer* viewer, CGAL::QGLViewer::QGLViewerPool()){
for(CGAL::QGLViewer* viewer : CGAL::QGLViewer::QGLViewerPool()){
viewer->update();
}
return;
@ -2230,7 +2230,7 @@ void Scene_surface_mesh_item::showVertices(bool b)
}
else
{
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()){
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool()){
CGAL::Three::Viewer_interface* viewer = dynamic_cast<CGAL::Three::Viewer_interface*>(v);
TextRenderer *renderer = viewer->textRenderer();
renderer->addTextList(d->textVItems);
@ -2239,7 +2239,7 @@ void Scene_surface_mesh_item::showVertices(bool b)
}
else
{
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()){
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool()){
CGAL::Three::Viewer_interface* viewer = dynamic_cast<CGAL::Three::Viewer_interface*>(v);
TextRenderer *renderer = viewer->textRenderer();
renderer->removeTextList(d->textVItems);
@ -2260,7 +2260,7 @@ void Scene_surface_mesh_item::showEdges(bool b)
}
else
{
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()){
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool()){
CGAL::Three::Viewer_interface* viewer = dynamic_cast<CGAL::Three::Viewer_interface*>(v);
TextRenderer *renderer = viewer->textRenderer();
renderer->addTextList(d->textEItems);
@ -2270,7 +2270,7 @@ void Scene_surface_mesh_item::showEdges(bool b)
}
else
{
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()){
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool()){
CGAL::Three::Viewer_interface* viewer = dynamic_cast<CGAL::Three::Viewer_interface*>(v);
TextRenderer *renderer = viewer->textRenderer();
renderer->removeTextList(d->textEItems);
@ -2291,7 +2291,7 @@ void Scene_surface_mesh_item::showFaces(bool b)
}
else
{
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()){
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool()){
CGAL::Three::Viewer_interface* viewer = dynamic_cast<CGAL::Three::Viewer_interface*>(v);
TextRenderer *renderer = viewer->textRenderer();
renderer->addTextList(d->textFItems);
@ -2301,7 +2301,7 @@ void Scene_surface_mesh_item::showFaces(bool b)
}
else
{
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()){
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool()){
CGAL::Three::Viewer_interface* viewer = dynamic_cast<CGAL::Three::Viewer_interface*>(v);
TextRenderer *renderer = viewer->textRenderer();
renderer->removeTextList(d->textFItems);

View File

@ -326,7 +326,7 @@ Scene_textured_surface_mesh_item::selection_changed(bool p_is_selected)
if(p_is_selected != is_selected)
{
is_selected = p_is_selected;
Q_FOREACH(CGAL::QGLViewer*v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer*v : CGAL::QGLViewer::QGLViewerPool())
{
setBuffersInit(qobject_cast<Vi*>(v), false);
}
@ -421,4 +421,3 @@ void Scene_textured_surface_mesh_item::computeElements() const
setBuffersFilled(true);
QApplication::restoreOverrideCursor();
}

View File

@ -1957,7 +1957,7 @@ void Scene_triangulation_3_item::invalidateOpenGLBuffers()
getEdgeContainer(T3_edges)->reset_vbos(ALL);
getEdgeContainer(Grid_edges)->reset_vbos(ALL);
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(v);
if(viewer == NULL)
@ -2192,4 +2192,3 @@ void Scene_triangulation_3_item::set_cut_edge(bool b)
}
#include "Scene_triangulation_3_item.moc"

View File

@ -10,14 +10,14 @@ void TextRenderer::draw(CGAL::Three::Viewer_interface *viewer, const QVector3D&
QRect rect;
CGAL::qglviewer::Camera* camera = viewer->camera();
//Display the items textItems
Q_FOREACH(TextListItem* list, textItems)
for(TextListItem* list : textItems)
{
CGAL::Three::Scene_print_item_interface* item =
qobject_cast<CGAL::Three::Scene_print_item_interface*>(scene->item(scene->mainSelectionIndex()));
if( item &&
item->shouldDisplayIds(list->item())
){
Q_FOREACH(TextItem* item, list->textList())
for(TextItem* item : list->textList())
{
CGAL::qglviewer::Vec src(item->position().x(), item->position().y(),item->position().z());
if(viewer->testDisplayId(src.x, src.y, src.z))
@ -52,7 +52,7 @@ void TextRenderer::draw(CGAL::Three::Viewer_interface *viewer, const QVector3D&
}
//Display the local TextItems
Q_FOREACH(TextItem* item, local_textItems)
for(TextItem* item : local_textItems)
{
CGAL::qglviewer::Vec src(item->position().x(), item->position().y(),item->position().z());
if(item->is_3D())
@ -110,7 +110,7 @@ void TextRenderer::draw(CGAL::Three::Viewer_interface *viewer, const QVector3D&
void TextRenderer::removeTextList(TextListItem *p_list)
{
Q_FOREACH(TextListItem *list, textItems)
for(TextListItem *list : textItems)
if(list == p_list)
textItems.removeAll(list);
}

View File

@ -83,7 +83,7 @@ Three::Three()
template<class SceneType>
SceneType* Three::getSelectedItem(){
Q_FOREACH(int item_id , scene()->selectionIndices())
for(int item_id : scene()->selectionIndices())
{
SceneType* scene_item = qobject_cast<SceneType*>(scene()->item(item_id));
if(scene_item)
@ -99,7 +99,7 @@ void Three::addDockWidget(QDockWidget* dock_widget)
QList<QDockWidget*> dockWidgets = mainWindow()->findChildren<QDockWidget*>();
int counter = 0;
Q_FOREACH(QDockWidget* dock, dockWidgets) {
for(QDockWidget* dock : dockWidgets) {
if( mainWindow()->dockWidgetArea(dock) != ::Qt::LeftDockWidgetArea ||
dock == dock_widget )
{ continue; }
@ -132,7 +132,7 @@ void Three::autoConnectActions(Polyhedron_demo_plugin_interface *plugin)
methods << metaObject->method(i);
}
Q_FOREACH(QAction* action, plugin->actions())
for(QAction* action : plugin->actions())
{
bool success = false;
const QMetaObject* action_metaObject = action->metaObject();
@ -273,4 +273,3 @@ bool& Three::isLocked()
{
return s_is_locked;
}

View File

@ -1631,7 +1631,7 @@ void Viewer_impl::showDistance(QPoint pixel)
QString(" distance: %1").arg(dist), true, font, Qt::red, true);
distance_text.append(centerCoord);
Q_FOREACH(TextItem* ti, distance_text)
for(TextItem* ti : distance_text)
textRenderer->addText(ti);
Q_EMIT(viewer->sendMessage(QString("First point : A(%1,%2,%3), second point : B(%4,%5,%6), distance between them : %7")
.arg(APoint.x/scaler.x()-viewer->offset().x)
@ -1648,7 +1648,7 @@ void Viewer_impl::showDistance(QPoint pixel)
void Viewer_impl::clearDistancedisplay()
{
distance_is_displayed = false;
Q_FOREACH(TextItem* ti, distance_text)
for(TextItem* ti : distance_text)
{
textRenderer->removeText(ti);
delete ti;