From 9cd0d450f9df991172ef4b0499730846a54f085b Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 9 Feb 2021 11:31:34 +0100 Subject: [PATCH] Remove QDomElements and need for QtXml --- AABB_tree/demo/AABB_tree/CMakeLists.txt | 4 +- .../demo/Alpha_shapes_3/CMakeLists.txt | 2 +- .../demo/Circular_kernel_3/CMakeLists.txt | 2 +- .../demo/Alpha_shapes_2/CMakeLists.txt | 2 +- .../demo/Apollonius_graph_2/CMakeLists.txt | 2 +- .../demo/Bounding_volumes/CMakeLists.txt | 2 +- .../demo/Circular_kernel_2/CMakeLists.txt | 2 +- GraphicsView/demo/Generator/CMakeLists.txt | 2 +- GraphicsView/demo/GraphicsView/CMakeLists.txt | 2 +- .../demo/L1_Voronoi_diagram_2/CMakeLists.txt | 2 +- .../demo/Largest_empty_rect_2/CMakeLists.txt | 2 +- .../Periodic_2_triangulation_2/CMakeLists.txt | 2 +- GraphicsView/demo/Polygon/CMakeLists.txt | 2 +- .../Segment_Delaunay_graph_2/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../demo/Snap_rounding_2/CMakeLists.txt | 2 +- .../demo/Spatial_searching_2/CMakeLists.txt | 2 +- .../demo/Stream_lines_2/CMakeLists.txt | 2 +- GraphicsView/include/CGAL/Qt/camera.h | 10 - GraphicsView/include/CGAL/Qt/camera_impl.h | 149 -------- GraphicsView/include/CGAL/Qt/domUtils.h | 183 --------- GraphicsView/include/CGAL/Qt/frame.h | 8 - GraphicsView/include/CGAL/Qt/frame_impl.h | 62 ---- .../include/CGAL/Qt/keyFrameInterpolator.h | 8 - .../CGAL/Qt/keyFrameInterpolator_impl.h | 80 ---- .../include/CGAL/Qt/manipulatedCameraFrame.h | 9 - .../CGAL/Qt/manipulatedCameraFrame_impl.h | 63 ---- .../include/CGAL/Qt/manipulatedFrame.h | 9 - .../include/CGAL/Qt/manipulatedFrame_impl.h | 65 ---- GraphicsView/include/CGAL/Qt/qglviewer.h | 3 - GraphicsView/include/CGAL/Qt/qglviewer_impl.h | 346 +----------------- GraphicsView/include/CGAL/Qt/quaternion.h | 6 - .../include/CGAL/Qt/quaternion_impl.h | 65 ---- GraphicsView/include/CGAL/Qt/vec.h | 8 - GraphicsView/include/CGAL/Qt/vec_impl.h | 94 ----- Installation/CMakeLists.txt | 6 +- .../demo/Linear_cell_complex/CMakeLists.txt | 2 +- .../Periodic_3_triangulation_3/CMakeLists.txt | 2 +- .../demo/Periodic_Lloyd_3/CMakeLists.txt | 2 +- Polyhedron/demo/Polyhedron/CMakeLists.txt | 2 +- .../Plugins/Three_examples/CMakeLists.txt | 2 +- .../Polyline_simplification_2/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../demo/Surface_mesher/CMakeLists.txt | 4 +- .../demo/Triangulation_3/CMakeLists.txt | 4 +- 45 files changed, 33 insertions(+), 1201 deletions(-) delete mode 100644 GraphicsView/include/CGAL/Qt/domUtils.h diff --git a/AABB_tree/demo/AABB_tree/CMakeLists.txt b/AABB_tree/demo/AABB_tree/CMakeLists.txt index 7c006dec292..4ee33e3e45f 100644 --- a/AABB_tree/demo/AABB_tree/CMakeLists.txt +++ b/AABB_tree/demo/AABB_tree/CMakeLists.txt @@ -23,7 +23,7 @@ include_directories(BEFORE ./ ./include) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) # Find Qt5 itself -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Gui Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Gui Svg) if(CGAL_Qt5_FOUND AND Qt5_FOUND) @@ -54,7 +54,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) #${CGAL_Qt5_MOC_FILES} ) # Link with Qt libraries - target_link_libraries(AABB_demo PRIVATE Qt5::OpenGL Qt5::Gui Qt5::Xml + target_link_libraries(AABB_demo PRIVATE Qt5::OpenGL Qt5::Gui CGAL::CGAL CGAL::CGAL_Qt5) add_to_cached_list(CGAL_EXECUTABLE_TARGETS AABB_demo) diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt index ede9b5e1367..4c7ecd50b4e 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt @@ -18,7 +18,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt index 78bf951d49a..3df4da89e33 100644 --- a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt +++ b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt @@ -12,7 +12,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL) +find_package(Qt5 QUIET COMPONENTS Script OpenGL) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt b/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt index d4cf857a00e..c1f805372c6 100644 --- a/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt +++ b/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt @@ -15,7 +15,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) include_directories(BEFORE ./include) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt b/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt index 908428488e8..9898f7c0a7a 100644 --- a/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt +++ b/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt @@ -15,7 +15,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) diff --git a/GraphicsView/demo/Bounding_volumes/CMakeLists.txt b/GraphicsView/demo/Bounding_volumes/CMakeLists.txt index c0a12b255fc..af8b531f4b8 100644 --- a/GraphicsView/demo/Bounding_volumes/CMakeLists.txt +++ b/GraphicsView/demo/Bounding_volumes/CMakeLists.txt @@ -15,7 +15,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) include_directories(BEFORE ./include) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt b/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt index 99ddd23a398..279535431fa 100644 --- a/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt +++ b/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt @@ -15,7 +15,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) diff --git a/GraphicsView/demo/Generator/CMakeLists.txt b/GraphicsView/demo/Generator/CMakeLists.txt index e7e4e3afc16..8b1cce296ed 100644 --- a/GraphicsView/demo/Generator/CMakeLists.txt +++ b/GraphicsView/demo/Generator/CMakeLists.txt @@ -14,7 +14,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/GraphicsView/demo/GraphicsView/CMakeLists.txt b/GraphicsView/demo/GraphicsView/CMakeLists.txt index 6fec9bd067b..8b4f82c65df 100644 --- a/GraphicsView/demo/GraphicsView/CMakeLists.txt +++ b/GraphicsView/demo/GraphicsView/CMakeLists.txt @@ -14,7 +14,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt b/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt index dd3ecf5491a..4fc20a4c8da 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt @@ -15,7 +15,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) include_directories(BEFORE ./include) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt b/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt index c7cda2cb1b6..cb8f1dea52c 100644 --- a/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt +++ b/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt @@ -15,7 +15,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt b/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt index 4d75fc2dcbc..d52af8a768d 100644 --- a/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt @@ -12,7 +12,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) include_directories(BEFORE ./include) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/GraphicsView/demo/Polygon/CMakeLists.txt b/GraphicsView/demo/Polygon/CMakeLists.txt index 4ea9ebf497c..67d2b2ed983 100644 --- a/GraphicsView/demo/Polygon/CMakeLists.txt +++ b/GraphicsView/demo/Polygon/CMakeLists.txt @@ -25,7 +25,7 @@ if(NOT TARGET CGAL::Eigen3_support) return() endif() -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_USE_FILE}) diff --git a/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt b/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt index 5a22d88a978..033b647dc34 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt @@ -20,7 +20,7 @@ set(QT_USE_QTMAIN TRUE) set(QT_USE_QTSCRIPT TRUE) set(QT_USE_QTOPENGL TRUE) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) include_directories(BEFORE ./include) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index 46723a27011..45bedf14c38 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -20,7 +20,7 @@ set(QT_USE_QTMAIN TRUE) set(QT_USE_QTSCRIPT TRUE) set(QT_USE_QTOPENGL TRUE) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) include_directories(BEFORE ./include) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt b/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt index c4092df8007..34069835976 100644 --- a/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt +++ b/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt @@ -15,7 +15,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) if(CGAL_Qt5_FOUND AND Qt5_FOUND) set(CMAKE_AUTOMOC ON) diff --git a/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt b/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt index 6ff2a9bacae..dd4ac996e12 100644 --- a/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt +++ b/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt @@ -15,7 +15,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/GraphicsView/demo/Stream_lines_2/CMakeLists.txt b/GraphicsView/demo/Stream_lines_2/CMakeLists.txt index 2c5c3c33005..5ae748db9d1 100644 --- a/GraphicsView/demo/Stream_lines_2/CMakeLists.txt +++ b/GraphicsView/demo/Stream_lines_2/CMakeLists.txt @@ -15,7 +15,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/GraphicsView/include/CGAL/Qt/camera.h b/GraphicsView/include/CGAL/Qt/camera.h index 96a88574e51..bda76bafb05 100644 --- a/GraphicsView/include/CGAL/Qt/camera.h +++ b/GraphicsView/include/CGAL/Qt/camera.h @@ -14,7 +14,6 @@ #ifndef QGLVIEWER_CAMERA_H #define QGLVIEWER_CAMERA_H #include -#include #include #include #include @@ -435,15 +434,6 @@ public Q_SLOTS: void setFlySpeed(qreal speed); //@} - /*! @name XML representation */ - //@{ -public: - virtual QDomElement domElement(const QString &name, - QDomDocument &document) const; -public Q_SLOTS: - virtual void initFromDOMElement(const QDomElement &element); - //@} - private Q_SLOTS: void onFrameModified(); diff --git a/GraphicsView/include/CGAL/Qt/camera_impl.h b/GraphicsView/include/CGAL/Qt/camera_impl.h index d79ce8af56d..7321b58a0c7 100644 --- a/GraphicsView/include/CGAL/Qt/camera_impl.h +++ b/GraphicsView/include/CGAL/Qt/camera_impl.h @@ -45,7 +45,6 @@ Camera::Camera(QObject *parent) // Requires the interpolationKfi_ setFrame(new ManipulatedCameraFrame()); - // #CONNECTION# All these default values identical in initFromDOMElement. // Requires fieldOfView() to define focusDistance() setSceneRadius(1.0); @@ -61,7 +60,6 @@ Camera::Camera(QObject *parent) // projectionMatrix_ below. setType(PERSPECTIVE); - // #CONNECTION# initFromDOMElement default values setZNearCoefficient(0.005); setZClippingCoefficient(sqrt(3.0)); @@ -2016,153 +2014,6 @@ void Camera::deletePath(unsigned int i) { //////////////////////////////////////////////////////////////////////////////// -/*! Returns an XML \c QDomElement that represents the Camera. - - \p name is the name of the QDomElement tag. \p doc is the \c QDomDocument - factory used to create QDomElement. - - Concatenates the Camera parameters, the ManipulatedCameraFrame::domElement() - and the paths' KeyFrameInterpolator::domElement(). - - Use initFromDOMElement() to restore the Camera state from the resulting \c - QDomElement. - - If you want to save the Camera state in a file, use: - \code - QDomDocument document("myCamera"); - doc.appendChild( myCamera->domElement("Camera", document) ); - - QFile f("myCamera.xml"); - if (f.open(IO_WriteOnly)) - { - QTextStream out(&f); - document.save(out, 2); - } - \endcode - - Note that the CGAL::QGLViewer::camera() is automatically saved by - CGAL::QGLViewer::saveStateToFile() when a CGAL::QGLViewer is closed. Use - CGAL::QGLViewer::restoreStateFromFile() to restore it back. */ -CGAL_INLINE_FUNCTION -QDomElement Camera::domElement(const QString &name, - QDomDocument &document) const { - QDomElement de = document.createElement(name); - QDomElement paramNode = document.createElement("Parameters"); - paramNode.setAttribute("fieldOfView", QString::number(fieldOfView())); - paramNode.setAttribute("zNearCoefficient", - QString::number(zNearCoefficient())); - paramNode.setAttribute("zClippingCoefficient", - QString::number(zClippingCoefficient())); - paramNode.setAttribute("orthoCoef", QString::number(orthoCoef_)); - paramNode.setAttribute("sceneRadius", QString::number(sceneRadius())); - paramNode.appendChild(sceneCenter().domElement("SceneCenter", document)); - - switch (type()) { - case Camera::PERSPECTIVE: - paramNode.setAttribute("Type", "PERSPECTIVE"); - break; - case Camera::ORTHOGRAPHIC: - paramNode.setAttribute("Type", "ORTHOGRAPHIC"); - break; - } - de.appendChild(paramNode); - - de.appendChild(frame()->domElement("ManipulatedCameraFrame", document)); - - // KeyFrame paths - for (QMap::ConstIterator - it = kfi_.begin(), - end = kfi_.end(); - it != end; ++it) { - QDomElement kfNode = - (it.value())->domElement("KeyFrameInterpolator", document); - kfNode.setAttribute("index", QString::number(it.key())); - de.appendChild(kfNode); - } - - return de; -} - -/*! Restores the Camera state from a \c QDomElement created by domElement(). - - Use the following code to retrieve a Camera state from a file created using - domElement(): \code - // Load DOM from file - QDomDocument document; - QFile f("myCamera.xml"); - if (f.open(IO_ReadOnly)) - { - document.setContent(&f); - f.close(); - } - - // Parse the DOM tree - QDomElement main = document.documentElement(); - myCamera->initFromDOMElement(main); - \endcode - - The frame() pointer is not modified by this method. The frame() state is - however modified. - - \attention The original keyFrameInterpolator() are deleted and should be copied - first if they are shared. */ -CGAL_INLINE_FUNCTION -void Camera::initFromDOMElement(const QDomElement &element) { - QDomElement child = element.firstChild().toElement(); - - QMutableMapIterator it(kfi_); - while (it.hasNext()) { - it.next(); - deletePath(it.key()); - } - - while (!child.isNull()) { - if (child.tagName() == "Parameters") { - // #CONNECTION# Default values set in constructor - //setFieldOfView(DomUtils::qrealFromDom(child, "fieldOfView", CGAL_PI / 4.0)); - setZNearCoefficient( - DomUtils::qrealFromDom(child, "zNearCoefficient", 0.005)); - setZClippingCoefficient( - DomUtils::qrealFromDom(child, "zClippingCoefficient", sqrt(3.0))); - orthoCoef_ = - DomUtils::qrealFromDom(child, "orthoCoef", tan(fieldOfView() / 2.0)); - setSceneRadius( - DomUtils::qrealFromDom(child, "sceneRadius", sceneRadius())); - - setType(PERSPECTIVE); - QString type = child.attribute("Type", "PERSPECTIVE"); - if (type == "PERSPECTIVE") - setType(Camera::PERSPECTIVE); - if (type == "ORTHOGRAPHIC") - setType(Camera::ORTHOGRAPHIC); - - QDomElement child2 = child.firstChild().toElement(); - while (!child2.isNull()) { - /* Although the scene does not change when a camera is loaded, restore - the saved center and radius values. Mainly useful when a the viewer is - restored on startup, with possible additional cameras. */ - if (child2.tagName() == "SceneCenter") - setSceneCenter(Vec(child2)); - - child2 = child2.nextSibling().toElement(); - } - } - - if (child.tagName() == "ManipulatedCameraFrame") - frame()->initFromDOMElement(child); - - - if (child.tagName() == "KeyFrameInterpolator") { - unsigned int index = DomUtils::uintFromDom(child, "index", 0); - setKeyFrameInterpolator(index, new KeyFrameInterpolator(frame())); - if (keyFrameInterpolator(index)) - keyFrameInterpolator(index)->initFromDOMElement(child); - } - - child = child.nextSibling().toElement(); - } -} - /*! Gives the coefficients of a 3D half-line passing through the Camera eye and pixel (x,y). diff --git a/GraphicsView/include/CGAL/Qt/domUtils.h b/GraphicsView/include/CGAL/Qt/domUtils.h deleted file mode 100644 index 36e2e69b803..00000000000 --- a/GraphicsView/include/CGAL/Qt/domUtils.h +++ /dev/null @@ -1,183 +0,0 @@ -/**************************************************************************** - - Copyright (c) 2018 GeometryFactory Sarl (France). - Copyright (C) 2002-2014 Gilles Debunne. All rights reserved. - - This file is part of a fork of the QGLViewer library version 2.7.0. - -*****************************************************************************/ -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0-only -#ifndef QGLVIEWER_DOMUTILS_H -#define QGLVIEWER_DOMUTILS_H -#include -#include -#include -#include -#include - -#include - -#ifndef DOXYGEN - -// QDomElement loading with syntax checking. -class DomUtils { -private: - static void warning(const QString &message) { - qWarning("%s", message.toLatin1().constData()); - } - -public: - static qreal qrealFromDom(const QDomElement &e, const QString &attribute, - qreal defValue) { - qreal value = defValue; - if (e.hasAttribute(attribute)) { - const QString s = e.attribute(attribute); - bool ok; - value = s.toDouble(&ok); - if (!ok) { - warning(QString("'%1' is not a valid qreal syntax for attribute \"%2\" " - "in initialization of \"%3\". Setting value to %4.") - .arg(s) - .arg(attribute) - .arg(e.tagName()) - .arg(QString::number(defValue))); - value = defValue; - } - } else { - warning(QString("\"%1\" attribute missing in initialization of \"%2\". " - "Setting value to %3.") - .arg(attribute) - .arg(e.tagName()) - .arg(QString::number(value))); - } - -#if defined(isnan) - // The "isnan" method may not be available on all platforms. - // Find its equivalent or simply remove these two lines - if (isnan(value)) - warning( - QString( - "Warning, attribute \"%1\" initialized to Not a Number in \"%2\"") - .arg(attribute) - .arg(e.tagName())); -#endif - - return value; - } - - static int intFromDom(const QDomElement &e, const QString &attribute, - int defValue) { - int value = defValue; - if (e.hasAttribute(attribute)) { - const QString s = e.attribute(attribute); - bool ok; - value = s.toInt(&ok); - if (!ok) { - warning( - QString("'%1' is not a valid integer syntax for attribute \"%2\" " - "in initialization of \"%3\". Setting value to %4.") - .arg(s) - .arg(attribute) - .arg(e.tagName()) - .arg(QString::number(defValue))); - value = defValue; - } - } else { - warning(QString("\"%1\" attribute missing in initialization of \"%2\". " - "Setting value to %3.") - .arg(attribute) - .arg(e.tagName()) - .arg(QString::number(value))); - } - - return value; - } - - static unsigned int uintFromDom(const QDomElement &e, - const QString &attribute, - unsigned int defValue) { - unsigned int value = defValue; - if (e.hasAttribute(attribute)) { - const QString s = e.attribute(attribute); - bool ok; - value = s.toUInt(&ok); - if (!ok) { - warning( - QString("'%1' is not a valid unsigned integer syntax for attribute " - "\"%2\" in initialization of \"%3\". Setting value to %4.") - .arg(s) - .arg(attribute) - .arg(e.tagName()) - .arg(QString::number(defValue))); - value = defValue; - } - } else { - warning(QString("\"%1\" attribute missing in initialization of \"%2\". " - "Setting value to %3.") - .arg(attribute) - .arg(e.tagName()) - .arg(QString::number(value))); - } - - return value; - } - - static bool boolFromDom(const QDomElement &e, const QString &attribute, - bool defValue) { - bool value = defValue; - if (e.hasAttribute(attribute)) { - const QString s = e.attribute(attribute); - if (s.toLower() == QString("true")) - value = true; - else if (s.toLower() == QString("false")) - value = false; - else { - warning( - QString("'%1' is not a valid boolean syntax for attribute \"%2\" " - "in initialization of \"%3\". Setting value to %4.") - .arg(s) - .arg(attribute) - .arg(e.tagName()) - .arg(defValue ? "true" : "false")); - } - } else { - warning(QString("\"%1\" attribute missing in initialization of \"%2\". " - "Setting value to %3.") - .arg(attribute) - .arg(e.tagName()) - .arg(value ? "true" : "false")); - } - - return value; - } - - static void setBoolAttribute(QDomElement &element, const QString &attribute, - bool value) { - element.setAttribute(attribute, (value ? "true" : "false")); - } - - static QDomElement QColorDomElement(const QColor &color, const QString &name, - QDomDocument &doc) { - QDomElement de = doc.createElement(name); - de.setAttribute("red", QString::number(color.red())); - de.setAttribute("green", QString::number(color.green())); - de.setAttribute("blue", QString::number(color.blue())); - return de; - } - - static QColor QColorFromDom(const QDomElement &e) { - int color[3]; - QStringList attribute; - attribute << "red" - << "green" - << "blue"; - for (int i = 0; i < attribute.count(); ++i) - color[i] = DomUtils::intFromDom(e, attribute[i], 0); - return QColor(color[0], color[1], color[2]); - } -}; - -#endif // DOXYGEN -#endif //QGLVIEWER_DOMUTILS_H diff --git a/GraphicsView/include/CGAL/Qt/frame.h b/GraphicsView/include/CGAL/Qt/frame.h index 7bf7a31eda8..23110350fce 100644 --- a/GraphicsView/include/CGAL/Qt/frame.h +++ b/GraphicsView/include/CGAL/Qt/frame.h @@ -425,14 +425,6 @@ public: } //@} - /*! @name XML representation */ - //@{ -public: - virtual QDomElement domElement(const QString &name, - QDomDocument &document) const; -public Q_SLOTS: - virtual void initFromDOMElement(const QDomElement &element); - //@} private: // P o s i t i o n a n d o r i e n t a t i o n diff --git a/GraphicsView/include/CGAL/Qt/frame_impl.h b/GraphicsView/include/CGAL/Qt/frame_impl.h index 2f5e925fa72..9ba5bfc5941 100644 --- a/GraphicsView/include/CGAL/Qt/frame_impl.h +++ b/GraphicsView/include/CGAL/Qt/frame_impl.h @@ -999,68 +999,6 @@ void Frame::getTransformOfFrom(const qreal src[3], qreal res[3], res[i] = r[i]; } -//////////////////////////// STATE ////////////////////////////// - -/*! Returns an XML \c QDomElement that represents the Frame. - - \p name is the name of the QDomElement tag. \p doc is the \c QDomDocument - factory used to create QDomElement. - - The resulting QDomElement looks like: - \code - - - - - \endcode - - Use initFromDOMElement() to restore the Frame state from the resulting \c - QDomElement. - - - See Vec::domElement() for a complete example. See also - - Quaternion::domElement(), Camera::domElement()... - - \attention The constraint() and referenceFrame() are not saved in the - QDomElement. */ -CGAL_INLINE_FUNCTION -QDomElement Frame::domElement(const QString &name, - QDomDocument &document) const { - // TODO: use translation and rotation instead when referenceFrame is coded... - QDomElement e = document.createElement(name); - e.appendChild(position().domElement("position", document)); - e.appendChild(orientation().domElement("orientation", document)); - return e; -} - -/*! Restores the Frame state from a \c QDomElement created by domElement(). - - See domElement() for the \c QDomElement syntax. See the - Vec::initFromDOMElement() and Quaternion::initFromDOMElement() documentations - for details on default values if an argument is missing. - - \attention The constraint() and referenceFrame() are not restored by this - method and are left unchanged. */ -CGAL_INLINE_FUNCTION -void Frame::initFromDOMElement(const QDomElement &element) { - // TODO: use translation and rotation instead when referenceFrame is coded... - - // Reset default values. Attention: destroys constraint. - // *this = Frame(); - // This instead ? Better : what is not set is not changed. - // setPositionAndOrientation(Vec(), Quaternion()); - - QDomElement child = element.firstChild().toElement(); - while (!child.isNull()) { - if (child.tagName() == "position") - setPosition(Vec(child)); - if (child.tagName() == "orientation") - setOrientation(Quaternion(child).normalized()); - - child = child.nextSibling().toElement(); - } -} ///////////////////////////////// ALIGN ///////////////////////////////// diff --git a/GraphicsView/include/CGAL/Qt/keyFrameInterpolator.h b/GraphicsView/include/CGAL/Qt/keyFrameInterpolator.h index 381ac37bad6..30b87fe0507 100644 --- a/GraphicsView/include/CGAL/Qt/keyFrameInterpolator.h +++ b/GraphicsView/include/CGAL/Qt/keyFrameInterpolator.h @@ -281,14 +281,6 @@ public Q_SLOTS: virtual void interpolateAtTime(qreal time); //@} - /*! @name XML representation */ - //@{ -public: - virtual QDomElement domElement(const QString &name, - QDomDocument &document) const; - virtual void initFromDOMElement(const QDomElement &element); - //@} - private Q_SLOTS: virtual void update(); virtual void invalidateValues() { diff --git a/GraphicsView/include/CGAL/Qt/keyFrameInterpolator_impl.h b/GraphicsView/include/CGAL/Qt/keyFrameInterpolator_impl.h index 143a1b2175f..067aba57041 100644 --- a/GraphicsView/include/CGAL/Qt/keyFrameInterpolator_impl.h +++ b/GraphicsView/include/CGAL/Qt/keyFrameInterpolator_impl.h @@ -37,7 +37,6 @@ KeyFrameInterpolator::KeyFrameInterpolator(Frame *frame) interpolationSpeed_(1.0), interpolationStarted_(false), closedPath_(false), loopInterpolation_(false), pathIsValid_(false), valuesAreValid_(true), currentFrameValid_(false) -// #CONNECTION# Values cut pasted initFromDOMElement() { setFrame(frame); for (int i = 0; i < 4; ++i) @@ -458,85 +457,6 @@ void KeyFrameInterpolator::interpolateAtTime(qreal time) { Q_EMIT interpolated(); } -/*! Returns an XML \c QDomElement that represents the KeyFrameInterpolator. - - The resulting QDomElement holds the KeyFrameInterpolator parameters as well as - the path keyFrames (if the keyFrame is defined by a pointer to a Frame, use its - current value). - - \p name is the name of the QDomElement tag. \p doc is the \c QDomDocument - factory used to create QDomElement. - - Use initFromDOMElement() to restore the ManipulatedFrame state from the - resulting QDomElement. - - - See Vec::domElement() for a complete example. See also - Quaternion::domElement(), Camera::domElement()... - - Note that the Camera::keyFrameInterpolator() are automatically saved by - CGAL::QGLViewer::saveStateToFile() when a CGAL::QGLViewer is closed. */ -CGAL_INLINE_FUNCTION -QDomElement KeyFrameInterpolator::domElement(const QString &name, - QDomDocument &document) const { - QDomElement de = document.createElement(name); - int count = 0; - Q_FOREACH (KeyFrame *kf, keyFrame_) { - Frame fr(kf->position(), kf->orientation()); - QDomElement kfNode = fr.domElement("KeyFrame", document); - kfNode.setAttribute("index", QString::number(count)); - kfNode.setAttribute("time", QString::number(kf->time())); - de.appendChild(kfNode); - ++count; - } - de.setAttribute("nbKF", QString::number(keyFrame_.count())); - de.setAttribute("time", QString::number(interpolationTime())); - de.setAttribute("speed", QString::number(interpolationSpeed())); - de.setAttribute("period", QString::number(interpolationPeriod())); - DomUtils::setBoolAttribute(de, "closedPath", closedPath()); - DomUtils::setBoolAttribute(de, "loop", loopInterpolation()); - return de; -} - -/*! Restores the KeyFrameInterpolator state from a \c QDomElement created by - domElement(). - - Note that the frame() pointer is not included in the domElement(): you need to - setFrame() after this method to attach a Frame to the KeyFrameInterpolator. - - See Vec::initFromDOMElement() for a complete code example. - - See also Camera::initFromDOMElement() and Frame::initFromDOMElement(). */ -CGAL_INLINE_FUNCTION -void KeyFrameInterpolator::initFromDOMElement(const QDomElement &element) { - qDeleteAll(keyFrame_); - keyFrame_.clear(); - QDomElement child = element.firstChild().toElement(); - while (!child.isNull()) { - if (child.tagName() == "KeyFrame") { - Frame fr; - fr.initFromDOMElement(child); - qreal time = DomUtils::qrealFromDom(child, "time", 0.0); - addKeyFrame(fr, time); - } - - child = child.nextSibling().toElement(); - } - - // #CONNECTION# Values cut pasted from constructor - setInterpolationTime(DomUtils::qrealFromDom(element, "time", 0.0)); - setInterpolationSpeed(DomUtils::qrealFromDom(element, "speed", 1.0)); - setInterpolationPeriod(DomUtils::intFromDom(element, "period", 40)); - setClosedPath(DomUtils::boolFromDom(element, "closedPath", false)); - setLoopInterpolation(DomUtils::boolFromDom(element, "loop", false)); - - // setFrame(nullptr); - pathIsValid_ = false; - valuesAreValid_ = false; - currentFrameValid_ = false; - - stopInterpolation(); -} #ifndef DOXYGEN diff --git a/GraphicsView/include/CGAL/Qt/manipulatedCameraFrame.h b/GraphicsView/include/CGAL/Qt/manipulatedCameraFrame.h index a481686f55c..4b9a7b6c563 100644 --- a/GraphicsView/include/CGAL/Qt/manipulatedCameraFrame.h +++ b/GraphicsView/include/CGAL/Qt/manipulatedCameraFrame.h @@ -199,15 +199,6 @@ protected Q_SLOTS: virtual void spin(); //@} - /*! @name XML representation */ - //@{ -public: - virtual QDomElement domElement(const QString &name, - QDomDocument &document) const; -public Q_SLOTS: - virtual void initFromDOMElement(const QDomElement &element); -//@} - #ifndef DOXYGEN protected: virtual void startAction( diff --git a/GraphicsView/include/CGAL/Qt/manipulatedCameraFrame_impl.h b/GraphicsView/include/CGAL/Qt/manipulatedCameraFrame_impl.h index c3cae0c5b71..ec959a4a986 100644 --- a/GraphicsView/include/CGAL/Qt/manipulatedCameraFrame_impl.h +++ b/GraphicsView/include/CGAL/Qt/manipulatedCameraFrame_impl.h @@ -117,69 +117,6 @@ void ManipulatedCameraFrame::updateSceneUpVector() { sceneUpVector_ = inverseTransformOf(Vec(0.0, 1.0, 0.0)); } -//////////////////////////////////////////////////////////////////////////////// -// S t a t e s a v i n g a n d r e s t o r i n g // -//////////////////////////////////////////////////////////////////////////////// - -/*! Returns an XML \c QDomElement that represents the ManipulatedCameraFrame. - - Adds to the ManipulatedFrame::domElement() the ManipulatedCameraFrame specific - informations in a \c ManipulatedCameraParameters child QDomElement. - - \p name is the name of the QDomElement tag. \p doc is the \c QDomDocument - factory used to create QDomElement. - - Use initFromDOMElement() to restore the ManipulatedCameraFrame state from the - resulting \c QDomElement. - - See Vec::domElement() for a complete example. See also - Quaternion::domElement(), Frame::domElement(), Camera::domElement()... */ -CGAL_INLINE_FUNCTION -QDomElement ManipulatedCameraFrame::domElement(const QString &name, - QDomDocument &document) const { - QDomElement e = ManipulatedFrame::domElement(name, document); - QDomElement mcp = document.createElement("ManipulatedCameraParameters"); - mcp.setAttribute("flySpeed", QString::number(flySpeed())); - DomUtils::setBoolAttribute(mcp, "rotatesAroundUpVector", - rotatesAroundUpVector()); - DomUtils::setBoolAttribute(mcp, "zoomsOnPivotPoint", zoomsOnPivotPoint()); - mcp.appendChild(sceneUpVector().domElement("sceneUpVector", document)); - e.appendChild(mcp); - return e; -} - -/*! Restores the ManipulatedCameraFrame state from a \c QDomElement created by -domElement(). - -First calls ManipulatedFrame::initFromDOMElement() and then initializes -ManipulatedCameraFrame specific parameters. */ -CGAL_INLINE_FUNCTION -void ManipulatedCameraFrame::initFromDOMElement(const QDomElement &element) { - // No need to initialize, since default sceneUpVector and flySpeed are not - // meaningful. It's better to keep current ones. And it would destroy - // constraint() and referenceFrame(). *this = ManipulatedCameraFrame(); - ManipulatedFrame::initFromDOMElement(element); - - QDomElement child = element.firstChild().toElement(); - while (!child.isNull()) { - if (child.tagName() == "ManipulatedCameraParameters") { - setFlySpeed(DomUtils::qrealFromDom(child, "flySpeed", flySpeed())); - setRotatesAroundUpVector( - DomUtils::boolFromDom(child, "rotatesAroundUpVector", false)); - setZoomsOnPivotPoint( - DomUtils::boolFromDom(child, "zoomsOnPivotPoint", false)); - - QDomElement schild = child.firstChild().toElement(); - while (!schild.isNull()) { - if (schild.tagName() == "sceneUpVector") - setSceneUpVector(Vec(schild)); - - schild = schild.nextSibling().toElement(); - } - } - child = child.nextSibling().toElement(); - } -} //////////////////////////////////////////////////////////////////////////////// // M o u s e h a n d l i n g // diff --git a/GraphicsView/include/CGAL/Qt/manipulatedFrame.h b/GraphicsView/include/CGAL/Qt/manipulatedFrame.h index bbef82923c0..88566c14097 100644 --- a/GraphicsView/include/CGAL/Qt/manipulatedFrame.h +++ b/GraphicsView/include/CGAL/Qt/manipulatedFrame.h @@ -302,15 +302,6 @@ public: virtual void checkIfGrabsMouse(int x, int y, const Camera *const camera); //@} - /*! @name XML representation */ - //@{ -public: - virtual QDomElement domElement(const QString &name, - QDomDocument &document) const; -public Q_SLOTS: - virtual void initFromDOMElement(const QDomElement &element); -//@} - #ifndef DOXYGEN protected: Quaternion deformedBallQuaternion(int x, int y, qreal cx, qreal cy, diff --git a/GraphicsView/include/CGAL/Qt/manipulatedFrame_impl.h b/GraphicsView/include/CGAL/Qt/manipulatedFrame_impl.h index e99c1acb99e..954c49c3553 100644 --- a/GraphicsView/include/CGAL/Qt/manipulatedFrame_impl.h +++ b/GraphicsView/include/CGAL/Qt/manipulatedFrame_impl.h @@ -43,7 +43,6 @@ namespace qglviewer{ CGAL_INLINE_FUNCTION ManipulatedFrame::ManipulatedFrame() : action_(NO_MOUSE_ACTION), keepsGrabbingMouse_(false) { - // #CONNECTION# initFromDOMElement and accessor docs setRotationSensitivity(1.0); setTranslationSensitivity(1.0); setSpinningSensitivity(0.3); @@ -101,71 +100,7 @@ void ManipulatedFrame::checkIfGrabsMouse(int x, int y, (fabs(y - proj.y) < thresold))); } -//////////////////////////////////////////////////////////////////////////////// -// S t a t e s a v i n g a n d r e s t o r i n g // -//////////////////////////////////////////////////////////////////////////////// -/*! Returns an XML \c QDomElement that represents the ManipulatedFrame. - - Adds to the Frame::domElement() the ManipulatedFrame specific informations in a - \c ManipulatedParameters child QDomElement. - - \p name is the name of the QDomElement tag. \p doc is the \c QDomDocument - factory used to create QDomElement. - - Use initFromDOMElement() to restore the ManipulatedFrame state from the - resulting \c QDomElement. - - See Vec::domElement() for a complete example. See also - Quaternion::domElement(), Camera::domElement()... */ -CGAL_INLINE_FUNCTION -QDomElement ManipulatedFrame::domElement(const QString &name, - QDomDocument &document) const { - QDomElement e = Frame::domElement(name, document); - QDomElement mp = document.createElement("ManipulatedParameters"); - mp.setAttribute("rotSens", QString::number(rotationSensitivity())); - mp.setAttribute("transSens", QString::number(translationSensitivity())); - mp.setAttribute("spinSens", QString::number(spinningSensitivity())); - mp.setAttribute("wheelSens", QString::number(wheelSensitivity())); - mp.setAttribute("zoomSens", QString::number(zoomSensitivity())); - e.appendChild(mp); - return e; -} - -/*! Restores the ManipulatedFrame state from a \c QDomElement created by -domElement(). - -Fields that are not described in \p element are set to their default values (see -ManipulatedFrame()). - -First calls Frame::initFromDOMElement() and then initializes ManipulatedFrame -specific parameters. Note that constraint() and referenceFrame() are not -restored and are left unchanged. - - -See Vec::initFromDOMElement() for a complete code example. */ -CGAL_INLINE_FUNCTION -void ManipulatedFrame::initFromDOMElement(const QDomElement &element) { - // Not called since it would set constraint() and referenceFrame() to nullptr. - // *this = ManipulatedFrame(); - Frame::initFromDOMElement(element); - - stopSpinning(); - - QDomElement child = element.firstChild().toElement(); - while (!child.isNull()) { - if (child.tagName() == "ManipulatedParameters") { - // #CONNECTION# constructor default values and accessor docs - setRotationSensitivity(DomUtils::qrealFromDom(child, "rotSens", 1.0)); - setTranslationSensitivity( - DomUtils::qrealFromDom(child, "transSens", 1.0)); - setSpinningSensitivity(DomUtils::qrealFromDom(child, "spinSens", 0.3)); - setWheelSensitivity(DomUtils::qrealFromDom(child, "wheelSens", 1.0)); - setZoomSensitivity(DomUtils::qrealFromDom(child, "zoomSens", 1.0)); - } - child = child.nextSibling().toElement(); - } -} //////////////////////////////////////////////////////////////////////////////// // M o u s e h a n d l i n g // diff --git a/GraphicsView/include/CGAL/Qt/qglviewer.h b/GraphicsView/include/CGAL/Qt/qglviewer.h index 8b3ff179e9c..aed3e95103d 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer.h @@ -921,13 +921,10 @@ protected: //@{ public: QString stateFileName() const; - virtual QDomElement domElement(const QString &name, - QDomDocument &document) const; Q_SIGNALS: void needNewContext(); public Q_SLOTS: - virtual void initFromDOMElement(const QDomElement &element); virtual void saveStateToFile(); // cannot be const because of QMessageBox virtual bool restoreStateFromFile(); diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index a4f378e84da..0f263a6c0cf 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -103,7 +103,6 @@ void CGAL::QGLViewer::defaultConstructor() { // It will be set when setFullScreen(false) is called after // setFullScreen(true) - // #CONNECTION# default values in initFromDOMElement() manipulatedFrame_ = nullptr; manipulatedFrameIsACamera_ = false; mouseGrabberIsAManipulatedFrame_ = false; @@ -118,7 +117,6 @@ void CGAL::QGLViewer::defaultConstructor() { showEntireScene(); setStateFileName(".qglviewer.xml"); - // #CONNECTION# default values in initFromDOMElement() setAxisIsDrawn(false); setGridIsDrawn(false); setFPSIsDisplayed(false); @@ -179,11 +177,6 @@ other viewer's indexes) and allocated memory is released. The camera() is deleted and should be copied before if it is shared by an other viewer. */ CGAL_INLINE_FUNCTION CGAL::QGLViewer::~QGLViewer() { - // See closeEvent comment. Destructor is called (and not closeEvent) only when - // the widget is embedded. Hence we saveToFile here. It is however a bad idea - // if virtual domElement() has been overloaded ! if (parent()) - // saveStateToFileForAllViewers(); - CGAL::QGLViewer::QGLViewerPool().removeAll(this); camera()->deleteLater(); @@ -656,7 +649,7 @@ void CGAL::QGLViewer::setCameraIsEdited(bool edit) { cameraIsEdited_ = edit; if (edit) { previousCameraZClippingCoefficient_ = camera()->zClippingCoefficient(); - // #CONNECTION# 5.0 also used in domElement() and in initFromDOMElement(). + camera()->setZClippingCoefficient(5.0); } else camera()->setZClippingCoefficient(previousCameraZClippingCoefficient_); @@ -3569,343 +3562,6 @@ void CGAL::QGLViewer::saveStateToFileForAllViewers() { } } -////////////////////////////////////////////////////////////////////////// -// S a v e s t a t e b e t w e e n s e s s i o n s // -////////////////////////////////////////////////////////////////////////// - -/*! Returns the state file name. Default value is \c .qglviewer.xml. - -This is the name of the XML file where saveStateToFile() saves the viewer state -(camera state, widget geometry, display flags... see domElement()) on exit. Use -restoreStateFromFile() to restore this state later (usually in your init() -method). - -Setting this value to \c QString() will disable the automatic state file -saving that normally occurs on exit. - -If more than one viewer are created by the application, this function will -return a numbered file name (as in ".qglviewer1.xml", ".qglviewer2.xml"... using -QGLViewer::QGLViewerIndex()) for extra viewers. Each viewer will then read back -its own information in restoreStateFromFile(), provided that the viewers are -created in the same order, which is usually the case. */ -CGAL_INLINE_FUNCTION -QString CGAL::QGLViewer::stateFileName() const { - QString name = stateFileName_; - - if (!name.isEmpty() && QGLViewer::QGLViewerIndex(this) > 0) { - QFileInfo fi(name); - if (fi.suffix().isEmpty()) - name += QString::number(QGLViewer::QGLViewerIndex(this)); - else - name = fi.absolutePath() + '/' + fi.completeBaseName() + - QString::number(QGLViewer::QGLViewerIndex(this)) + "." + - fi.suffix(); - } - - return name; -} - -/*! Saves in stateFileName() an XML representation of the CGAL::QGLViewer state, -obtained from domElement(). - -Use restoreStateFromFile() to restore this viewer state. - -This method is automatically called when a viewer is closed (using Escape or -using the window's upper right \c x close button). setStateFileName() to \c -QString() to prevent this. */ -CGAL_INLINE_FUNCTION -void CGAL::QGLViewer::saveStateToFile() { - QString name = stateFileName(); - - if (name.isEmpty()) - return; - - QFileInfo fileInfo(name); - - if (fileInfo.isDir()) { - QMessageBox::warning( - this, tr("Save to file error", "Message box window title"), - tr("State file name (%1) references a directory instead of a file.") - .arg(name)); - return; - } - - const QString dirName = fileInfo.absolutePath(); - if (!QFileInfo(dirName).exists()) { - QDir dir; - if (!(dir.mkdir(dirName))) { - QMessageBox::warning(this, - tr("Save to file error", "Message box window title"), - tr("Unable to create directory %1").arg(dirName)); - return; - } - } - - // Write the DOM tree to file - QFile f(name); - if (f.open(QIODevice::WriteOnly)) { - QTextStream out(&f); - QDomDocument doc("QGLVIEWER"); - doc.appendChild(domElement("CGAL::QGLViewer", doc)); - doc.save(out, 2); - f.flush(); - f.close(); - } else - QMessageBox::warning( - this, tr("Save to file error", "Message box window title"), - tr("Unable to save to file %1").arg(name) + ":\n" + f.errorString()); -} - -/*! Restores the CGAL::QGLViewer state from the stateFileName() file using -initFromDOMElement(). - -States are saved using saveStateToFile(), which is automatically called on -viewer exit. - -Returns \c true when the restoration is successful. Possible problems are an non -existing or unreadable stateFileName() file, an empty stateFileName() or an XML -syntax error. - -A manipulatedFrame() should be defined \e before calling this method, so that -its state can be restored. Initialization code put \e after this function will -override saved values: \code void Viewer::init() -{ -// Default initialization goes here (including the declaration of a possible -manipulatedFrame). - -if (!restoreStateFromFile()) -showEntireScene(); // Previous state cannot be restored: fit camera to scene. - -// Specific initialization that overrides file savings goes here. -} -\endcode */ -CGAL_INLINE_FUNCTION -bool CGAL::QGLViewer::restoreStateFromFile() { - QString name = stateFileName(); - - if (name.isEmpty()) - return false; - - QFileInfo fileInfo(name); - - if (!fileInfo.isFile()) - // No warning since it would be displayed at first start. - return false; - - if (!fileInfo.isReadable()) { - QMessageBox::warning( - this, tr("Problem in state restoration", "Message box window title"), - tr("File %1 is not readable.").arg(name)); - return false; - } - - // Read the DOM tree form file - QFile f(name); - if (f.open(QIODevice::ReadOnly)) { - QDomDocument doc; - doc.setContent(&f); - f.close(); - QDomElement main = doc.documentElement(); - initFromDOMElement(main); - } else { - QMessageBox::warning( - this, tr("Open file error", "Message box window title"), - tr("Unable to open file %1").arg(name) + ":\n" + f.errorString()); - return false; - } - - return true; -} - -/*! Returns an XML \c QDomElement that represents the CGAL::QGLViewer. - -Used by saveStateToFile(). restoreStateFromFile() uses initFromDOMElement() to -restore the CGAL::QGLViewer state from the resulting \c QDomElement. - -\p name is the name of the QDomElement tag. \p doc is the \c QDomDocument -factory used to create QDomElement. - -The created QDomElement contains state values (axisIsDrawn(), FPSIsDisplayed(), -isFullScreen()...), viewer geometry, as well as camera() (see -CGAL::qglviewer::Camera::domElement()) and manipulatedFrame() (if defined, see -CGAL::qglviewer::ManipulatedFrame::domElement()) states. - -Overload this method to add your own attributes to the state file: -\code -CGAL_INLINE_FUNCTION -QDomElement Viewer::domElement(const QString& name, QDomDocument& document) -const -{ -// Creates a custom node for a light -QDomElement de = document.createElement("Light"); -de.setAttribute("state", (lightIsOn()?"on":"off")); -// Note the include of the ManipulatedFrame domElement method. -de.appendChild(lightManipulatedFrame()->domElement("LightFrame", document)); - -// Get default state domElement and append custom node -CGAL_INLINE_FUNCTION -QDomElement res = CGAL::QGLViewer::domElement(name, document); -res.appendChild(de); -return res; -} -\endcode -See initFromDOMElement() for the associated restoration code. - -\attention For the manipulatedFrame(), CGAL::qglviewer::Frame::constraint() and -CGAL::qglviewer::Frame::referenceFrame() are not saved. See -CGAL::qglviewer::Frame::domElement(). */ -CGAL_INLINE_FUNCTION -QDomElement CGAL::QGLViewer::domElement(const QString &name, - QDomDocument &document) const { - QDomElement de = document.createElement(name); - - QDomElement stateNode = document.createElement("State"); - // hasMouseTracking() is not saved - stateNode.appendChild(DomUtils::QColorDomElement( - foregroundColor(), "foregroundColor", document)); - stateNode.appendChild(DomUtils::QColorDomElement( - backgroundColor(), "backgroundColor", document)); - // Revolve or fly camera mode is not saved - de.appendChild(stateNode); - - QDomElement displayNode = document.createElement("Display"); - DomUtils::setBoolAttribute(displayNode, "axisIsDrawn", axisIsDrawn()); - DomUtils::setBoolAttribute(displayNode, "gridIsDrawn", gridIsDrawn()); - DomUtils::setBoolAttribute(displayNode, "FPSIsDisplayed", FPSIsDisplayed()); - DomUtils::setBoolAttribute(displayNode, "cameraIsEdited", cameraIsEdited()); - // textIsEnabled() is not saved - de.appendChild(displayNode); - - QDomElement geometryNode = document.createElement("Geometry"); - DomUtils::setBoolAttribute(geometryNode, "fullScreen", isFullScreen()); - if (isFullScreen()) { - geometryNode.setAttribute("prevPosX", QString::number(prevPos_.x())); - geometryNode.setAttribute("prevPosY", QString::number(prevPos_.y())); - } else { - QWidget *tlw = topLevelWidget(); - geometryNode.setAttribute("width", QString::number(tlw->width())); - geometryNode.setAttribute("height", QString::number(tlw->height())); - geometryNode.setAttribute("posX", QString::number(tlw->pos().x())); - geometryNode.setAttribute("posY", QString::number(tlw->pos().y())); - } - de.appendChild(geometryNode); - - // Restore original Camera zClippingCoefficient before saving. - if (cameraIsEdited()) - camera()->setZClippingCoefficient(previousCameraZClippingCoefficient_); - de.appendChild(camera()->domElement("Camera", document)); - if (cameraIsEdited()) - // #CONNECTION# 5.0 from setCameraIsEdited() - camera()->setZClippingCoefficient(5.0); - - if (manipulatedFrame()) - de.appendChild( - manipulatedFrame()->domElement("ManipulatedFrame", document)); - - return de; -} - -/*! Restores the CGAL::QGLViewer state from a \c QDomElement created by domElement(). - -Used by restoreStateFromFile() to restore the CGAL::QGLViewer state from a file. - -Overload this method to retrieve custom attributes from the CGAL::QGLViewer state -file. This code corresponds to the one given in the domElement() documentation: -\code -CGAL_INLINE_FUNCTION -void Viewer::initFromDOMElement(const QDomElement& element) -{ -// Restore standard state -CGAL_INLINE_FUNCTION -CGAL::QGLViewer::initFromDOMElement(element); - -QDomElement child=element.firstChild().toElement(); -while (!child.isNull()) -{ -if (child.tagName() == "Light") -{ -if (child.hasAttribute("state")) -setLightOn(child.attribute("state").toLower() == "on"); - -// Assumes there is only one child. Otherwise you need to parse child's children -recursively. QDomElement lf = child.firstChild().toElement(); if (!lf.isNull() -&& lf.tagName() == "LightFrame") -lightManipulatedFrame()->initFromDomElement(lf); -} -child = child.nextSibling().toElement(); -} -} -\endcode - -CGAL_INLINE_FUNCTION -See also CGAL::qglviewer::Camera::initFromDOMElement(), -CGAL::qglviewer::ManipulatedFrame::initFromDOMElement(). - -\note The manipulatedFrame() \e pointer is not modified by this method. If -defined, its state is simply set from the \p element values. */ -CGAL_INLINE_FUNCTION -void CGAL::QGLViewer::initFromDOMElement(const QDomElement &element) { - QDomElement child = element.firstChild().toElement(); - bool tmpCameraIsEdited = cameraIsEdited(); - while (!child.isNull()) { - if (child.tagName() == "State") { - // #CONNECTION# default values from defaultConstructor() - // setMouseTracking(DomUtils::boolFromDom(child, "mouseTracking", false)); - // if ((child.attribute("cameraMode", "revolve") == "fly") && - // (cameraIsInRevolveMode())) toggleCameraMode(); - - QDomElement ch = child.firstChild().toElement(); - while (!ch.isNull()) { - if (ch.tagName() == "foregroundColor") - setForegroundColor(DomUtils::QColorFromDom(ch)); - if (ch.tagName() == "backgroundColor") - setBackgroundColor(DomUtils::QColorFromDom(ch)); - ch = ch.nextSibling().toElement(); - } - } - - if (child.tagName() == "Display") { - // #CONNECTION# default values from defaultConstructor() - setAxisIsDrawn(DomUtils::boolFromDom(child, "axisIsDrawn", false)); - setGridIsDrawn(DomUtils::boolFromDom(child, "gridIsDrawn", false)); - setFPSIsDisplayed(DomUtils::boolFromDom(child, "FPSIsDisplayed", false)); - } - - if (child.tagName() == "Geometry") { - setFullScreen(DomUtils::boolFromDom(child, "fullScreen", false)); - - if (!isFullScreen()) - { - int width = DomUtils::intFromDom(child, "width", 600); - int height = DomUtils::intFromDom(child, "height", 400); - topLevelWidget()->resize(width, height); - camera()->setScreenWidthAndHeight(this->width(), this->height()); - - QPoint pos; - pos.setX(DomUtils::intFromDom(child, "posX", 0)); - pos.setY(DomUtils::intFromDom(child, "posY", 0)); - topLevelWidget()->move(pos); - } - } - - child = child.nextSibling().toElement(); - } - - // The Camera always stores its "real" zClippingCoef in domElement(). If it is - // edited, its "real" coef must be saved and the coef set to 5.0, as is done - // in setCameraIsEdited(). BUT : Camera and Display are read in an arbitrary - // order. We must initialize Camera's "real" coef BEFORE calling - // setCameraIsEdited. Hence this temp cameraIsEdited and delayed call - cameraIsEdited_ = tmpCameraIsEdited; - if (cameraIsEdited_) { - previousCameraZClippingCoefficient_ = camera()->zClippingCoefficient(); - // #CONNECTION# 5.0 from setCameraIsEdited. - camera()->setZClippingCoefficient(5.0); - } -} - - - CGAL_INLINE_FUNCTION void CGAL::QGLViewer::copyBufferToTexture(GLint , GLenum ) { } diff --git a/GraphicsView/include/CGAL/Qt/quaternion.h b/GraphicsView/include/CGAL/Qt/quaternion.h index ae9fc6365d6..5322db4bea9 100644 --- a/GraphicsView/include/CGAL/Qt/quaternion.h +++ b/GraphicsView/include/CGAL/Qt/quaternion.h @@ -300,12 +300,6 @@ public: static Quaternion randomQuaternion(); //@} - /*! @name XML representation */ - //@{ - explicit Quaternion(const QDomElement &element); - QDomElement domElement(const QString &name, QDomDocument &document) const; - void initFromDOMElement(const QDomElement &element); -//@} #ifdef DOXYGEN /*! @name Output stream */ diff --git a/GraphicsView/include/CGAL/Qt/quaternion_impl.h b/GraphicsView/include/CGAL/Qt/quaternion_impl.h index 6f5f8fff5fa..cf520688276 100644 --- a/GraphicsView/include/CGAL/Qt/quaternion_impl.h +++ b/GraphicsView/include/CGAL/Qt/quaternion_impl.h @@ -211,71 +211,6 @@ qreal Quaternion::angle() const { return (angle <= CGAL_PI) ? angle : 2.0 * CGAL_PI - angle; } -/*! Returns an XML \c QDomElement that represents the Quaternion. - - \p name is the name of the QDomElement tag. \p doc is the \c QDomDocument - factory used to create QDomElement. - - When output to a file, the resulting QDomElement will look like: - \code - - \endcode - - Use initFromDOMElement() to restore the Quaternion state from the resulting \c - QDomElement. See also the Quaternion(const QDomElement&) constructor. - -CGAL_INLINE_FUNCTION - See the Vec::domElement() documentation for a complete QDomDocument creation - and saving example. - -CGAL_INLINE_FUNCTION - See also Frame::domElement(), Camera::domElement(), -CGAL_INLINE_FUNCTION - KeyFrameInterpolator::domElement()... */ -CGAL_INLINE_FUNCTION -QDomElement Quaternion::domElement(const QString &name, - QDomDocument &document) const { - QDomElement de = document.createElement(name); - de.setAttribute("q0", QString::number(q[0])); - de.setAttribute("q1", QString::number(q[1])); - de.setAttribute("q2", QString::number(q[2])); - de.setAttribute("q3", QString::number(q[3])); - return de; -} - -/*! Restores the Quaternion state from a \c QDomElement created by domElement(). - - The \c QDomElement should contain the \c q0, \c q1 , \c q2 and \c q3 - attributes. If one of these attributes is missing or is not a number, a warning - is displayed and these fields are respectively set to 0.0, 0.0, 0.0 and 1.0 - (identity Quaternion). - - See also the Quaternion(const QDomElement&) constructor. */ -CGAL_INLINE_FUNCTION -void Quaternion::initFromDOMElement(const QDomElement &element) { - Quaternion q(element); - *this = q; -} - -/*! Constructs a Quaternion from a \c QDomElement representing an XML code of - the form \code< anyTagName q0=".." q1=".." q2=".." q3=".." />\endcode - - If one of these attributes is missing or is not a number, a warning is - displayed and the associated value is respectively set to 0, 0, 0 and 1 - (identity Quaternion). - - See also domElement() and initFromDOMElement(). */ -CGAL_INLINE_FUNCTION -Quaternion::Quaternion(const QDomElement &element) { - QStringList attribute; - attribute << "q0" - << "q1" - << "q2" - << "q3"; - for (int i = 0; i < attribute.size(); ++i) - q[i] = DomUtils::qrealFromDom(element, attribute[i], ((i < 3) ? 0.0 : 1.0)); -} - /*! Returns the Quaternion associated 4x4 OpenGL rotation matrix. Use \c glMultMatrixd(q.matrix()) to apply the rotation represented by diff --git a/GraphicsView/include/CGAL/Qt/vec.h b/GraphicsView/include/CGAL/Qt/vec.h index 615df43987e..903db34f0f9 100644 --- a/GraphicsView/include/CGAL/Qt/vec.h +++ b/GraphicsView/include/CGAL/Qt/vec.h @@ -16,8 +16,6 @@ #include #include -#include - // Included by all files as vec.h is at the end of the include hierarchy #include @@ -334,12 +332,6 @@ Normalizing a null vector will result in \c NaN values. */ void projectOnPlane(const Vec &normal); //@} - /*! @name XML representation */ - //@{ - explicit Vec(const QDomElement &element); - QDomElement domElement(const QString &name, QDomDocument &document) const; - void initFromDOMElement(const QDomElement &element); -//@} #ifdef DOXYGEN /*! @name Output stream */ diff --git a/GraphicsView/include/CGAL/Qt/vec_impl.h b/GraphicsView/include/CGAL/Qt/vec_impl.h index 84f8296159f..ed7911d0f19 100644 --- a/GraphicsView/include/CGAL/Qt/vec_impl.h +++ b/GraphicsView/include/CGAL/Qt/vec_impl.h @@ -72,100 +72,6 @@ Vec Vec::orthogonalVec() const { return Vec(-y, x, 0.0); } -/*! Constructs a Vec from a \c QDomElement representing an XML code of the form - \code< anyTagName x=".." y=".." z=".." />\endcode - -If one of these attributes is missing or is not a number, a warning is displayed -and the associated value is set to 0.0. - -See also domElement() and initFromDOMElement(). */ -CGAL_INLINE_FUNCTION -Vec::Vec(const QDomElement &element) { - QStringList attribute; - attribute << "x" - << "y" - << "z"; - for (int i = 0; i < attribute.size(); ++i) -#ifdef QGLVIEWER_UNION_NOT_SUPPORTED - this->operator[](i) = DomUtils::qrealFromDom(element, attribute[i], 0.0); -#else - v_[i] = DomUtils::qrealFromDom(element, attribute[i], 0.0); -#endif -} - -/*! Returns an XML \c QDomElement that represents the Vec. - - \p name is the name of the QDomElement tag. \p doc is the \c QDomDocument - factory used to create QDomElement. - - When output to a file, the resulting QDomElement will look like: - \code - - \endcode - - Use initFromDOMElement() to restore the Vec state from the resulting \c - QDomElement. See also the Vec(const QDomElement&) constructor. - - Here is complete example that creates a QDomDocument and saves it into a file: - \code - Vec sunPos; - QDomDocument document("myDocument"); - QDomElement sunElement = document.createElement("Sun"); - document.appendChild(sunElement); - sunElement.setAttribute("brightness", sunBrightness()); - sunElement.appendChild(sunPos.domElement("sunPosition", document)); - // Other additions to the document hierarchy... - - // Save doc document - QFile f("myFile.xml"); - if (f.open(IO_WriteOnly)) - { - QTextStream out(&f); - document.save(out, 2); - f.close(); - } - \endcode - -CGAL_INLINE_FUNCTION - See also Quaternion::domElement(), Frame::domElement(), Camera::domElement()... - */ -CGAL_INLINE_FUNCTION -QDomElement Vec::domElement(const QString &name, QDomDocument &document) const { - QDomElement de = document.createElement(name); - de.setAttribute("x", QString::number(x)); - de.setAttribute("y", QString::number(y)); - de.setAttribute("z", QString::number(z)); - return de; -} - -/*! Restores the Vec state from a \c QDomElement created by domElement(). - - The \c QDomElement should contain \c x, \c y and \c z attributes. If one of - these attributes is missing or is not a number, a warning is displayed and the - associated value is set to 0.0. - - To restore the Vec state from an xml file, use: - \code - // Load DOM from file - QDomDocument doc; - QFile f("myFile.xml"); - if (f.open(IO_ReadOnly)) - { - doc.setContent(&f); - f.close(); - } - // Parse the DOM tree and initialize - QDomElement main=doc.documentElement(); - myVec.initFromDOMElement(main); - \endcode - - See also the Vec(const QDomElement&) constructor. */ -CGAL_INLINE_FUNCTION -void Vec::initFromDOMElement(const QDomElement &element) { - const Vec v(element); - *this = v; -} - CGAL_INLINE_FUNCTION std::ostream &operator<<(std::ostream &o, const Vec &v) { return o << v.x << '\t' << v.y << '\t' << v.z; diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 99281d11635..5890f968422 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -1157,7 +1157,7 @@ if(CGAL_BRANCH_BUILD) find_package(GMP REQUIRED) find_package(Doxygen REQUIRED) find_package(Eigen3 REQUIRED) - find_package(Qt5 COMPONENTS Core Widgets Xml OpenGL Gui REQUIRED) + find_package(Qt5 COMPONENTS Core Widgets OpenGL Gui REQUIRED) find_package(VTK COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE) find_package(IPE) find_package(RS3) @@ -1168,10 +1168,9 @@ if(CGAL_BRANCH_BUILD) set(compile_options "\ ${CMAKE_CXX_FLAGS} -DCGAL_EIGEN3_ENABLED -DCGAL_PROFILE \ -${Qt5Widgets_DEFINITIONS} ${Qt5Xml_DEFINITIONS} ${Qt5OpenGL_DEFINITIONS} ${Qt5Gui_DEFINITIONS} \ +${Qt5Widgets_DEFINITIONS} ${Qt5OpenGL_DEFINITIONS} ${Qt5Gui_DEFINITIONS} \ ${Qt5OpenGL_EXECUTABLE_COMPILE_FLAGS} -fPIC \ ${Qt5Gui_EXECUTABLE_COMPILE_FLAGS} \ -${Qt5Xml_EXECUTABLE_COMPILE_FLAGS} \ ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt5_3RD_PARTY_DEFINITIONS} \ ${CGAL_DEFINITIONS}") message("COMPILATION OPTIONS ARE : ${compile_options}") @@ -1267,7 +1266,6 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.") ${GMP_INCLUDE_DIR} ${Qt5OpenGL_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} - ${Qt5Xml_INCLUDE_DIRS} ${Qt5Gui_DEFINITIONS} ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_Qt5_3RD_PARTY_INCLUDE_DIRS}) diff --git a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt index 1d49f69cf2f..76b250600d2 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt @@ -37,7 +37,7 @@ add_definitions(-DCGAL_PROFILE_LCC_DEMO) ################## find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg) if(NOT (CGAL_Qt5_FOUND diff --git a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt index bbbeecc0371..811619b9522 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt @@ -17,7 +17,7 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) # Find Qt5 itself -find_package(Qt5 QUIET COMPONENTS Xml OpenGL Help Core) +find_package(Qt5 QUIET COMPONENTS OpenGL Help Core) if(Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) diff --git a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt index ee10c5ac9ca..4f73377504b 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt @@ -19,7 +19,7 @@ set(CMAKE_AUTOMOC ON) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS Xml Script Help OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS Script Help OpenGL Svg) if(Qt5Help_VERSION VERSION_LESS 5.12) set(CGAL_QCOLLECTIONGENERATOR_TARGET Qt5::qcollectiongenerator) diff --git a/Polyhedron/demo/Polyhedron/CMakeLists.txt b/Polyhedron/demo/Polyhedron/CMakeLists.txt index a057727c87b..8c84a62592a 100644 --- a/Polyhedron/demo/Polyhedron/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/CMakeLists.txt @@ -69,7 +69,7 @@ include(${CGAL_USE_FILE}) find_package( Qt5 QUIET - COMPONENTS OpenGL Script Xml + COMPONENTS OpenGL Script OPTIONAL_COMPONENTS ScriptTools WebSockets) set_package_properties( diff --git a/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt index 6cde165b88d..9457b7bdc5d 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt @@ -14,7 +14,7 @@ find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5 ImageIO) # Find Qt5 itself find_package( Qt5 QUIET - COMPONENTS OpenGL Script Svg Xml + COMPONENTS OpenGL Script Svg OPTIONAL_COMPONENTS ScriptTools WebSockets) if(RUNNING_CGAL_AUTO_TEST) diff --git a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt index 65c33cb6436..19f85245921 100644 --- a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt @@ -17,7 +17,7 @@ find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) set(CMAKE_INCLUDE_CURRENT_DIR ON) -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Widgets Svg) +find_package(Qt5 QUIET COMPONENTS Script OpenGL Widgets Svg) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt index df54844c7b7..67a8e78c844 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt @@ -28,7 +28,7 @@ if(NOT TARGET CGAL::Eigen3_support) endif() # Find Qt5 itself -find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL) +find_package(Qt5 QUIET COMPONENTS Script OpenGL) if(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/Surface_mesher/demo/Surface_mesher/CMakeLists.txt b/Surface_mesher/demo/Surface_mesher/CMakeLists.txt index 3402ae6a380..96e3edb9472 100644 --- a/Surface_mesher/demo/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/demo/Surface_mesher/CMakeLists.txt @@ -39,14 +39,14 @@ endforeach() include_directories(./) -# QGLViwer needs Qt5 configured with QtOpenGL and QtXml support +# QGLViewer needs Qt5 configured with QtOpenGL find_package(CGAL REQUIRED COMPONENTS ImageIO Qt5) if(CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND) add_definitions(-DQT_NO_KEYWORDS) - find_package(Qt5 QUIET COMPONENTS OpenGL Xml Svg) + find_package(Qt5 QUIET COMPONENTS OpenGL Svg) find_package(OpenGL) if(Qt5_FOUND diff --git a/Triangulation_3/demo/Triangulation_3/CMakeLists.txt b/Triangulation_3/demo/Triangulation_3/CMakeLists.txt index ddd0963b4a9..1c4f8aade5d 100644 --- a/Triangulation_3/demo/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/demo/Triangulation_3/CMakeLists.txt @@ -20,7 +20,7 @@ set(CMAKE_AUTOMOC ON) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Qt5 QUIET COMPONENTS OpenGL Xml) +find_package(Qt5 QUIET COMPONENTS OpenGL) if(Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) @@ -70,7 +70,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_to_cached_list(CGAL_EXECUTABLE_TARGETS T3_demo) target_link_libraries(T3_demo PRIVATE CGAL::CGAL CGAL::CGAL_Qt5) - target_link_libraries(T3_demo PRIVATE Qt5::OpenGL Qt5::Xml) + target_link_libraries(T3_demo PRIVATE Qt5::OpenGL) if(TARGET CGAL::TBB_support) target_link_libraries(T3_demo PUBLIC CGAL::TBB_support) endif()