diff --git a/Mesh_2/demo/Mesh_2/CMakeLists.txt b/Mesh_2/demo/Mesh_2/CMakeLists.txt index 9442d774347..c756de64c64 100644 --- a/Mesh_2/demo/Mesh_2/CMakeLists.txt +++ b/Mesh_2/demo/Mesh_2/CMakeLists.txt @@ -1,41 +1,26 @@ # Created by the script cgal_create_cmake_script (and then adapted manually). # This is the CMake script for compiling a CGAL application. - project( mesh_2_demo ) CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5) set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) + +add_subdirectory(Qt3) if ( COMMAND cmake_policy ) cmake_policy( SET CMP0003 NEW ) endif() -find_package(CGAL COMPONENTS Core Qt3 ) +find_package(CGAL COMPONENTS Core ) include( ${CGAL_USE_FILE} ) -find_package(Qt3-patched ) -# FindQt3-patched.cmake is FindQt3.cmake patched by CGAL developers, so -# that it can be used together with FindQt4: all its variables are prefixed -# by "QT3_" instead of "QT_". +include_directories(BEFORE ../../include) +include_directories(BEFORE ../../../Triangulation_2/include) -if ( CGAL_FOUND AND QT3_FOUND AND CGAL_Qt3_FOUND) - include( Qt3Macros-patched ) - QT3_AUTOMOC( conform.cpp icons.cpp mesh.cpp mesh_2_demo.cpp Qt_widget_styled_layer.cpp Qt_widget_style_editor.cpp Show_points.cpp Show_segments_base.cpp ) - - # Make sure the compiler can find generated .moc files - include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) - - include_directories( ${QT3_INCLUDE_DIR} ) - - add_executable (mesh_2_demo icons.cpp mesh_2_demo.cpp Qt_widget_styled_layer.cpp Qt_widget_style_editor.cpp Show_points.cpp Show_segments_base.cpp) - - add_to_cached_list( CGAL_EXECUTABLE_TARGETS mesh_2_demo ) - - # Link the main executable to CGAL and third-party libraries - target_link_libraries(mesh_2_demo ${QT3_LIBRARIES} ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) +if ( CGAL_FOUND ) # conform target add_executable (conform conform.cpp) @@ -49,6 +34,6 @@ if ( CGAL_FOUND AND QT3_FOUND AND CGAL_Qt3_FOUND) else() - message(STATUS "NOTICE: This demo requires CGAL and Qt3, and will not be compiled.") + message(STATUS "NOTICE: This demo requires CGAL and will not be compiled.") endif() diff --git a/Mesh_2/demo/Mesh_2/Debug_layer.h b/Mesh_2/demo/Mesh_2/Debug_layer.h deleted file mode 100644 index af9bb5d53f1..00000000000 --- a/Mesh_2/demo/Mesh_2/Debug_layer.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2005 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent RINEAU - -#ifndef CGAL_DEBUG_LAYER_H -#define CGAL_DEBUG_LAYER_H - -#include -#include - -namespace CGAL { - -class Debug_layer : public Qt_widget_layer -{ - std::ostream& stream; - -public: - - Debug_layer(std::ostream& s = std::cerr) : stream(s) - { - } - - void draw() - { - stream << "redraw()" << std::endl; - } -}; // end class Debug_layer - -} // end namespace CGAL - -#endif // CGAL_DEBUG_LAYER_H diff --git a/Mesh_2/demo/Mesh_2/Qt3/CMakeLists.txt b/Mesh_2/demo/Mesh_2/Qt3/CMakeLists.txt index 8eae807c03d..8c7d32e0e71 100644 --- a/Mesh_2/demo/Mesh_2/Qt3/CMakeLists.txt +++ b/Mesh_2/demo/Mesh_2/Qt3/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. -project( mesh_2_demo ) +project( mesh_2_qt3_demo ) CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5) @@ -23,7 +23,7 @@ find_package(Qt3-patched ) if ( CGAL_FOUND AND QT3_FOUND AND CGAL_Qt3_FOUND) include( Qt3Macros-patched ) - QT3_AUTOMOC( conform.cpp icons.cpp mesh.cpp mesh_2_demo.cpp Qt_widget_styled_layer.cpp Qt_widget_style_editor.cpp Show_points.cpp Show_segments_base.cpp ) + QT3_AUTOMOC( icons.cpp mesh_2_demo.cpp Qt_widget_styled_layer.cpp Qt_widget_style_editor.cpp Show_points.cpp Show_segments_base.cpp ) # Make sure the compiler can find generated .moc files include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/Mesh_2/demo/Mesh_2/Qt_layer_show_circles.h b/Mesh_2/demo/Mesh_2/Qt_layer_show_circles.h deleted file mode 100644 index 49b9db00165..00000000000 --- a/Mesh_2/demo/Mesh_2/Qt_layer_show_circles.h +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#ifndef CGAL_QT_LAYER_SHOW_CIRCLES_H -#define CGAL_QT_LAYER_SHOW_CIRCLES_H - -#include -#include -#include -#include -#include -#include - - -namespace CGAL { - -// T::Geom_traits has to be a CGAL kernel! -template -class Qt_layer_show_circles : public Qt_widget_layer { -public: - typedef typename T::Point Point; - typedef typename T::Segment Segment; - typedef typename T::Finite_faces_iterator Finite_faces_iterator; - typedef typename T::Locate_type Locate_type; - typedef typename T::Face_handle Face_handle; - typedef typename T::Geom_traits GT; - typedef typename GT::Circle_2 Circle; - typedef typename GT::FT FT; - - Qt_layer_show_circles(T* t, - CGAL::Color c = CGAL::GRAY, - int linewidth = 1, - CGAL::Color fill_color = CGAL::WHITE, - bool filled = false, - QObject* parent = 0, const char* name = 0) : - Qt_widget_layer(parent, name), - tr(t), do_erase(false), color(c), width(linewidth), - fillcolor(fill_color), fill(filled) {}; - - void draw() - { - Qt_widget_layer::draw(); - do_erase = false; - }; - - void mousePressEvent(QMouseEvent* e) - { - if (tr->dimension()<1) return; - FT - x=static_cast(widget->x_real(e->x())), - y=static_cast(widget->y_real(e->y())); - - Point p(x,y); - - int li; - Locate_type lt; - Face_handle fh = tr->locate(p,lt,li); - if(lt == T::FACE) - draw_circle(fh); - }; - - void mouseMoveEvent(QMouseEvent *e) - { - if (tr->dimension()<1) return; - FT - x=static_cast(widget->x_real(e->x())), - y=static_cast(widget->y_real(e->y())); - - Point p(x,y); - - int li; - Locate_type lt; - Face_handle fh = tr->locate(p,lt,li); - if(lt == T::FACE) - { - if(fh!=old_face) - { - widget->lock(); - - if(do_erase) draw_circle(old_face); - draw_circle(fh); - old_face=fh; - - widget->unlock(); - do_erase=true; - } - } - else - { - if(do_erase) - draw_circle(old_face); - do_erase=false; - } - }; - - void leaveEvent(QEvent* e) - { - Qt_widget_layer::leaveEvent(e); - if (tr->dimension()<1) return; - if(do_erase) - draw_circle(old_face); - }; - -private: - void draw_circle(const Face_handle& fh) const - { - RasterOp oldRaster = widget->rasterOp(); - QColor oldcolor = widget->color(); - QColor oldFillColor = widget->fillColor(); - int oldwidth = widget->lineWidth(); - bool oldFilled = widget->isFilled(); - - *widget << color; - *widget << LineWidth(width) << FillColor(fillcolor); - widget->setFilled(fill); - widget->get_painter().setRasterOp(NotROP); - - Point v=((*fh).vertex(0))->point(); - Point c=tr->circumcenter(fh); - - *widget << Circle(c,squared_distance(v,c)); - widget->setColor(oldcolor); - widget->setLineWidth(oldwidth); - widget->setFillColor(oldFillColor); - widget->setFilled(oldFilled); - widget->setRasterOp(oldRaster); - widget->do_paint(); - } - - T* tr; - Face_handle old_face; - bool do_erase; - - CGAL::Color color; - int width; - CGAL::Color fillcolor; - bool fill; -};//end class - -} // namespace CGAL - -#endif // CGAL_QT_LAYER_SHOW_CIRCLES_H diff --git a/Mesh_2/demo/Mesh_2/Qt_layer_show_triangulation.h b/Mesh_2/demo/Mesh_2/Qt_layer_show_triangulation.h deleted file mode 100644 index 736a567eaef..00000000000 --- a/Mesh_2/demo/Mesh_2/Qt_layer_show_triangulation.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#ifndef CGAL_QT_LAYER_SHOW_TRIANGULATION_H -#define CGAL_QT_LAYER_SHOW_TRIANGULATION_H - -#include "Qt_widget_styled_layer.h" -#include - -namespace CGAL { - -template -class Qt_layer_show_triangulation : public Qt_widget_styled_layer -{ -public: - - Qt_layer_show_triangulation(T *t, - CGAL::Color lc = CGAL::BLUE, - int linewidth = 1, - QObject* parent = 0, const char* name = 0) - : Qt_widget_styled_layer(0, parent, name), - tr(t) - { - color="Color"; - width="Line width"; - - setColor(QColor(lc.red(), lc.green(), lc.blue())); - setLineWidth(linewidth); - }; - - void setColor(QColor c) - { style()->setColor(color, c); } - - void setLineWidth(int line_width) - { style()->setInt(width, line_width); } - - void draw() - { - QColor old_color = widget->color(); - int old_width = widget->lineWidth(); - - widget->setColor(style()->getColor(color)); - widget->setLineWidth(style()->getInt(width)); - - *widget << *tr; - - widget->setLineWidth(old_width); - widget->setColor(old_color); - }; - -private: - T *tr; - QString color; - QString width; -};//end class - -} // namespace CGAL - -#endif // CGAL_QT_LAYER_SHOW_TRIANGULATION_H diff --git a/Mesh_2/demo/Mesh_2/Qt_layer_show_triangulation_constraints.h b/Mesh_2/demo/Mesh_2/Qt_layer_show_triangulation_constraints.h deleted file mode 100644 index f45e131d979..00000000000 --- a/Mesh_2/demo/Mesh_2/Qt_layer_show_triangulation_constraints.h +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#ifndef CGAL_QT_LAYER_SHOW_TRIANGULATION_CONSTRAINTS_H -#define CGAL_QT_LAYER_SHOW_TRIANGULATION_CONSTRAINTS_H - -#include "Qt_widget_styled_layer.h" - -namespace CGAL { - -template -class Qt_layer_show_triangulation_constraints - : public Qt_widget_styled_layer -{ -public: - - Qt_layer_show_triangulation_constraints(T *t, - CGAL::Color lc = CGAL::RED, - int linewidth = 1, - QObject* parent = 0, - const char* name = 0) - : Qt_widget_styled_layer(0, parent, name), tr(t) - { - color="Color"; - width="Line width"; - - setColor(QColor(lc.red(), lc.green(), lc.blue())); - setLineWidth(linewidth); - }; - - void setColor(QColor c) - { style()->setColor(color, c); } - - void setLineWidth(int line_width) - { style()->setInt(width, line_width); } - - void draw() - { - widget->lock(); - - QColor old_color = widget->color(); - int old_width = widget->lineWidth(); - - widget->setColor(style()->getColor(color)); - widget->setLineWidth(style()->getInt(width)); - - for(typename T::Edge_iterator it=tr->edges_begin(); - it!=tr->edges_end(); - it++) - if(tr->is_constrained(*it)) - *widget << tr->segment(*it); - - widget->setLineWidth(old_width); - widget->setColor(old_color); - widget->unlock(); - }; - -private: - T *tr; - QString color; - QString width; -};//end class - -} // namespace CGAL - -#endif // CGAL_QT_LAYER_SHOW_TRIANGULATION_CONSTRAINTS_H diff --git a/Mesh_2/demo/Mesh_2/Qt_widget_style_editor-aux.h b/Mesh_2/demo/Mesh_2/Qt_widget_style_editor-aux.h deleted file mode 100644 index 74651fa73be..00000000000 --- a/Mesh_2/demo/Mesh_2/Qt_widget_style_editor-aux.h +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#ifndef CGAL_QT_WIDGET_STYLE_EDITOR_AUX_H -#define CGAL_QT_WIDGET_STYLE_EDITOR_AUX_H - -#include -#include -#include -#include -#include -#include -#include - -class Color_selector : public QPushButton -{ - Q_OBJECT -public: - Color_selector(QColor c = Qt::black, - QWidget* parent = 0, const char* name = 0) - : QPushButton(parent, name) - { - setColor(c); - connect(this, SIGNAL(clicked()), - this, SLOT(color_dialog()) ); - } - - virtual ~Color_selector() {}; - - QColor value() const - { - return color; - } - -public slots: - void setColor(QColor c) - { - color = c; - - QPixmap pix(24,20); - pix.fill(c); - setPixmap(pix); - - emit newColor(c); - } - -signals: - void newColor(QColor); - -private slots: - void color_dialog() - { - QColor c = QColorDialog::getColor(value()); - if( c.isValid() ) - setColor(c); - } - -private: - QColor color; -}; - -class Int_selector : public QSpinBox -{ - Q_OBJECT -public: - Int_selector(int i, QWidget *parent = 0, const char *name = 0) - : QSpinBox(-INT_MAX, INT_MAX, 1, parent, name) - { - setValue(i); - } - - virtual ~Int_selector() {}; -}; - -class Bool_selector : public QComboBox -{ - Q_OBJECT -public: - Bool_selector(bool b_, QWidget *parent = 0, const char *name = 0) - : QComboBox(false, parent, name) - { - insertItem("False"); - insertItem("True"); - - if(b_) - setCurrentItem(1); - else - setCurrentItem(0); - } - - virtual ~Bool_selector() {}; - - bool value() const - { - return currentItem() == 1; - } -}; - -class Point_style_selector : public QComboBox -{ - Q_OBJECT -public: - typedef ::CGAL::PointStyle PointStyle; - Point_style_selector(PointStyle s, - QWidget *parent = 0, const char *name = 0) - : QComboBox(false, parent, name) - { - insertItem("Pixel"); - insertItem("Cross"); - insertItem("Plus"); - insertItem("Circle"); - insertItem("Disc"); - insertItem("Rect"); - insertItem("Box"); - - setCurrentItem(static_cast(s)); - } - - virtual ~Point_style_selector() {}; - - PointStyle value() const - { - return PointStyle(currentItem()); - } -}; - -#endif // CGAL_QT_WIDGET_STYLE_EDITOR_AUX_H diff --git a/Mesh_2/demo/Mesh_2/Qt_widget_style_editor.cpp b/Mesh_2/demo/Mesh_2/Qt_widget_style_editor.cpp deleted file mode 100644 index f05edcd47d1..00000000000 --- a/Mesh_2/demo/Mesh_2/Qt_widget_style_editor.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#include - - -#include "Qt_widget_style_editor.h" -#include "Qt_widget_style_editor-aux.h" - -#include -#include -#include -#include -#include -#include -#include - -namespace CGAL { - -Qt_widget_style_editor::Qt_widget_style_editor(Style* style, - QWidget *parent, - const char *name) - : QFrame(parent, name), style(style) -{ - typedef Style::const_iterator iterator; - - QGridLayout* layout = new QGridLayout(this); - layout->addColSpacing(1,5); - - const int labels_col = 0; // column number of labels - const int selectors_col = 2; // column number of selectors - - int row = 0; - for(iterator it=style->begin(); - it != style->end(); - ++it) - { - QLabel* label = new QLabel( it.key(), this); - layout->addWidget(label, row, labels_col); - - QWidget* selector = 0; - switch( it.data().type() ) { - case QVariant::Color: - selector = new Color_selector(it.data().toColor(), this); - connect(selector, SIGNAL(newColor(QColor)), - this, SLOT(map(QColor))); - break; - case QVariant::Int: - selector = new Int_selector(it.data().toInt(), this); - connect(selector, SIGNAL(valueChanged(int)), - this, SLOT(map(int))); - break; - case QVariant::Bool: - selector = new Bool_selector(it.data().toBool(), - this); - connect(selector, SIGNAL(toggled(bool)), - this, SLOT(map(bool))); - break; - case QVariant::UInt: - selector = - new Point_style_selector(PointStyle(it.data().toUInt()), - this); - connect(selector, SIGNAL(activated(int)), - this, SLOT(pointstyle(int))); - break; - default: - CGAL_error(); - break; - } - - mapper[selector]=it.key(); - - layout->addWidget(selector, row, selectors_col); - - ++row; - } -} - -void Qt_widget_style_editor::map(QColor c) -{ - const QObject* s = sender(); - if( mapper.contains(s) ) - style->setColor(mapper[s], c); - emit styleChanged(); -} - -void Qt_widget_style_editor::map(int i) -{ - const QObject* s = sender(); - if( mapper.contains(s) ) - style->setInt(mapper[s], i); - emit styleChanged(); -} - -void Qt_widget_style_editor::map(bool b) -{ - const QObject* s = sender(); - if( mapper.contains(s) ) - style->setBool(mapper[s], b); - emit styleChanged(); -} - -} // end namespace CGAL - -// moc_source_file: Qt_widget_style_editor.h -#include "Qt_widget_style_editor.moc" - -// moc_source_file: Qt_widget_style_editor-aux.h -#include "Qt_widget_style_editor-aux.moc" - diff --git a/Mesh_2/demo/Mesh_2/Qt_widget_style_editor.h b/Mesh_2/demo/Mesh_2/Qt_widget_style_editor.h deleted file mode 100644 index 9c4222493f4..00000000000 --- a/Mesh_2/demo/Mesh_2/Qt_widget_style_editor.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#ifndef QT_WIDGET_STYLE_EDITOR_H -#define QT_WIDGET_STYLE_EDITOR_H - -#include -#include "Qt_widget_styled_layer.h" - -namespace CGAL { - -class Qt_widget_style_editor : public QFrame { - Q_OBJECT -public: - - typedef Qt_widget_styled_layer::Style Style; - - Qt_widget_style_editor(Style* style, - QWidget *parent = 0 , const char *name = 0); - - virtual ~Qt_widget_style_editor() {} - -signals: - void styleChanged(); - -private slots: - void map(QColor); - void map(int); - void map(bool); - -private: - Style* style; - QMap mapper; -}; // end of class Qt_widget_style_editor - -} // end namespace CGAL - -#endif // QT_WIDGET_STYLE_EDITOR_H diff --git a/Mesh_2/demo/Mesh_2/Qt_widget_styled_layer.cpp b/Mesh_2/demo/Mesh_2/Qt_widget_styled_layer.cpp deleted file mode 100644 index 63da75160e0..00000000000 --- a/Mesh_2/demo/Mesh_2/Qt_widget_styled_layer.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#include - - -#include "Qt_widget_styled_layer.h" - -namespace CGAL { - - Qt_widget_styled_layer::Qt_widget_styled_layer( - Qt_widget_styled_layer::Style* style, - QObject * parent, - const char * name) - : Qt_widget_layer(parent, name), - style_(style), private_style(false) - { - if( style == 0 ) - { - this->style_ = new Style(); - private_style = true; - } - } - - Qt_widget_styled_layer::~Qt_widget_styled_layer() - { - if( private_style ) - delete style_; - } - - void Qt_widget_styled_layer::setStyle(Qt_widget_styled_layer::Style* s) - { - if( private_style ) - delete style_; - private_style = false; - style_ = s; - } - - void Qt_widget_style::setBool(QString name, bool b) - { - map[name] = b; - } - - void Qt_widget_style::setInt(QString name, int i) - { - map[name] = i; - } - - void Qt_widget_style::setColor(QString name, QColor c) - { - map[name] = c; - } - - void Qt_widget_style::setPointStyle(QString name, PointStyle s) - { - map[name] = static_cast(s); - map[name].cast(QVariant::UInt); - } - - bool Qt_widget_style::getBool(QString name) - { - if( ! map.contains(name) ) - return false; - else - { - CGAL_assertion( map[name].type() == QVariant::Bool ); - return map[name].asBool(); - } - } - - int Qt_widget_style::getInt(QString name) - { - if( ! map.contains(name) ) - return 0; - else - { - CGAL_assertion( map[name].type() == QVariant::Int ); - return map[name].asInt(); - } - } - - QColor Qt_widget_style::getColor(QString name) - { - if( ! map.contains(name) ) - return QColor(); - else - { - CGAL_assertion( map[name].type() == QVariant::Color ); - return map[name].asColor(); - } - } - - ::CGAL::PointStyle Qt_widget_style::getPointStyle(QString name) - { - if( ! map.contains(name) ) - return PointStyle(); - else - { - CGAL_assertion( map[name].type() == QVariant::UInt ); - return PointStyle(map[name].asUInt()); - } - } - -} // namespace CGAL - -// moc_source_file: Qt_widget_styled_layer.h -#include "Qt_widget_styled_layer.moc" - diff --git a/Mesh_2/demo/Mesh_2/Qt_widget_styled_layer.h b/Mesh_2/demo/Mesh_2/Qt_widget_styled_layer.h deleted file mode 100644 index 5f4959d7901..00000000000 --- a/Mesh_2/demo/Mesh_2/Qt_widget_styled_layer.h +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#ifndef QT_WIDGET_STYLED_LAYER_H -#define QT_WIDGET_STYLED_LAYER_H - -#include -#include -#include - -#include -#include - -namespace CGAL { - -class Qt_widget_style : public QObject { - Q_OBJECT - - typedef QMap Map; -public: - - typedef Map::const_iterator const_iterator; - typedef Map::size_type size_type; - - Qt_widget_style() - : map() {}; - -public slots: - void setBool(QString name, bool b); - void setInt(QString name, int i); - void setColor(QString name, QColor c); - void setPointStyle(QString name, PointStyle s); - -public: - bool getBool(QString name); - int getInt(QString name); - QColor getColor(QString name); - PointStyle getPointStyle(QString name); - - const_iterator begin() const - { - return map.begin(); - } - - const_iterator end() const - { - return map.end(); - } - - size_type size() const - { - return map.size(); - } - -private: - Map map; -}; - -class Qt_widget_styled_layer : public Qt_widget_layer { - Q_OBJECT -public: - typedef Qt_widget_style Style; - - Qt_widget_styled_layer(Style* style = 0, - QObject * parent=0, const char * name=0); - - ~Qt_widget_styled_layer(); - - void setStyle(Style* style); - Style * style() { return style_; } -private: - Style* style_; - bool private_style; -}; - -} // namespace CGAL - -#endif // QT_WIDGET_STYLED_LAYER_H diff --git a/Mesh_2/demo/Mesh_2/README.txt b/Mesh_2/demo/Mesh_2/README.txt new file mode 100644 index 00000000000..2e91b85208e --- /dev/null +++ b/Mesh_2/demo/Mesh_2/README.txt @@ -0,0 +1,5 @@ +This directory contains non-graphical demos of the 2D Mesh Generator +package. An old Qt3-based demos lies in the qt3/ sub-directory. The +Constrained Delaunay triangulation Qt4 demos has a 2D meshing feature that +demonstrates the 2D Mesh Generator package. See in the directory +demo/Triangulation_2/ of the CGAL tarball. diff --git a/Mesh_2/demo/Mesh_2/Show_clusters.h b/Mesh_2/demo/Mesh_2/Show_clusters.h deleted file mode 100644 index 2fbdf310290..00000000000 --- a/Mesh_2/demo/Mesh_2/Show_clusters.h +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#ifndef MESH_2_SHOW_CLUSTERS_H -#define MESH_2_SHOW_CLUSTERS_H - -#include -#include - -#include - -#include - -class Show_clusters_aux : public CGAL::Qt_widget_layer -{ - Q_OBJECT -private: - virtual void reinit_clusters() {} - -public slots: - void reinitClusters() - { - reinit_clusters(); - } -public: - Show_clusters_aux(QObject* parent, const char* name) - : Qt_widget_layer(parent, name) - { - } -}; - -template -class Show_clusters : public Show_clusters_aux -{ -public: - typedef typename Mesher::Triangulation Tr; - typedef typename Tr::Point Point; - typedef typename Tr::Geom_traits Geom_traits; - typedef CGAL::Delaunay_triangulation_2 DT; - typedef typename DT::Finite_vertices_iterator Vertices_iterator; - typedef typename DT::Vertex_handle DT_vertex_handle; - typedef typename Tr::Segment Segment; - typedef typename Tr::Face_handle Face_handle; - typedef typename Tr::Vertex_handle Vertex_handle; - typedef typename Tr::Geom_traits::FT FT; - typedef typename Mesher::Clusters Clusters; - typedef typename Clusters::Cluster Cluster; - typedef typename Clusters::Cluster_vertices_iterator CVIt; - typedef typename Clusters::Vertices_in_cluster_iterator ViCIt; - typedef typename Clusters::const_iterator Clusters_const_iterator; - typedef std::list List_of_points; - typedef typename List_of_points::const_iterator Point_iterator; - - Show_clusters(Mesher* m, - CGAL::Color color_ = CGAL::GREEN, - int pointsize = 3, - CGAL::PointStyle pointstyle = CGAL::DISC, - CGAL::Color lc = CGAL::RED, - CGAL::Color reduced_line_color_ = CGAL::BLUE, - int linewidth = 2, - QObject* parent = 0, const char* name = 0) - : Show_clusters_aux(parent, name), - mesher(m), dt(), color(color_), - size(pointsize), style(pointstyle), line_color(lc), - reduced_line_color(reduced_line_color_), - width(linewidth) - { - reinit_clusters(); - } - - void activating() - { - reinit_clusters(); - } - - void change_mesher(Mesher* m) - { - mesher = m; - reinit_clusters(); - } - - void reinit_clusters() - { - if(!is_active()) return; - - dt.clear(); - - if( mesher != 0 ) - for(CVIt it = mesher->clusters().clusters_vertices_begin(); - it != mesher->clusters().clusters_vertices_end(); - ++it) - dt.push_back( (*it)->point() ); - } - - void draw() - { - widget->lock(); - - QColor oldColor = widget->color(); - int oldPointSize = widget->pointSize(); - CGAL::PointStyle oldStyle = widget->pointStyle(); - - *widget << color << CGAL::PointStyle(style) - << CGAL::PointSize(size); - - for(Vertices_iterator it = dt.finite_vertices_begin(); - it != dt.finite_vertices_end(); - ++it) - *widget << it->point(); - - widget->setPointStyle(oldStyle); - widget->setPointSize(oldPointSize); - widget->setColor(oldColor); - - widget->unlock(); - oldPixmap = widget->get_pixmap(); - } - - void mouseMoveEvent(QMouseEvent *e) - { - if( mesher == 0 ) return; - - FT x, y; - widget->x_real(e->x(), x); - widget->y_real(e->y(), y); - Point p(x, y); - - DT_vertex_handle v = dt.nearest_vertex(p); - - if(v == NULL) return; - if(v == oldVertex) return; - - oldVertex = v; - - QColor oldColor = widget->color(); - int oldWidth = widget->lineWidth(); - - widget->lock(); - - widget->get_painter().drawPixmap(0, 0, oldPixmap); - - *widget << CGAL::LineWidth(width); - - typename Tr::Locate_type lt; - int i; - Face_handle fh = mesher->triangulation().locate(v->point(), lt, i); - CGAL_assertion( lt == Tr::VERTEX ); - - Vertex_handle v2 = fh->vertex(i); - - int n = mesher->clusters().number_of_clusters_at_vertex(v2); - - for(int j = 0; j < n; ++j) - { - std::pair seq = - mesher->clusters().vertices_in_cluster_sequence(v2, j); - Cluster c; - Clusters_const_iterator dummy_c_it; - mesher->clusters().get_cluster(v2, *(seq.first), c, dummy_c_it); - if( c.is_reduced() ) - *widget << reduced_line_color; - else - *widget << line_color; - for(ViCIt it = seq.first; - it != seq.second; - ++it) - *widget << Segment(v2->point(), (*it)->point()); - } - - widget->setLineWidth(oldWidth); - widget->setColor(oldColor); - - widget->unlock(); - } - - void leaveEvent(QEvent *) - { - widget->get_painter().drawPixmap(0, 0, oldPixmap); - widget->update(); - } - -private: - Mesher* mesher; - DT dt; - DT_vertex_handle oldVertex; - QPixmap oldPixmap; - bool should_restore_pixmap; - CGAL::Color color; - int size; - CGAL::PointStyle style; - CGAL::Color line_color; - CGAL::Color reduced_line_color; - int width; -}; - -#endif diff --git a/Mesh_2/demo/Mesh_2/Show_points.cpp b/Mesh_2/demo/Mesh_2/Show_points.cpp deleted file mode 100644 index 72b44ead3f7..00000000000 --- a/Mesh_2/demo/Mesh_2/Show_points.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#include - - -#include "Show_points.h" - -namespace CGAL { - - Show_points_base::Show_points_base(Color c, - int pointsize, - PointStyle pointstyle, - QObject * parent, - const char * name) - : Qt_widget_styled_layer(0, parent, name) - { - color=tr("Color"); - size=tr("Point size"); - style_name=tr("Point style"); - - setColor(QColor(c.red(), c.green(), c.blue())); - setPointSize(pointsize); - setPointStyle(pointstyle); - } - - Show_points_base::Show_points_base(Style* style, - QString points_color_name, - QString points_size_name, - QString points_style_name, - QObject * parent, - const char * name) - : Qt_widget_styled_layer(style, parent, name), - color(points_color_name), - size(points_size_name), - style_name(points_style_name) - {} - - void Show_points_base::setColor(QColor c) - { style()->setColor(color, c); } - - void Show_points_base::setPointSize(int pointsize) - { style()->setInt(size, pointsize); } - - void Show_points_base::setPointStyle(PointStyle pointstyle) - { style()->setInt(style_name, static_cast(pointstyle)); } - -} // namespace CGAL - -// moc_source_file: Show_points.h -#include "Show_points.moc" - diff --git a/Mesh_2/demo/Mesh_2/Show_points.h b/Mesh_2/demo/Mesh_2/Show_points.h deleted file mode 100644 index 15b977358ba..00000000000 --- a/Mesh_2/demo/Mesh_2/Show_points.h +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#ifndef SHOW_POINTS_H -#define SHOW_POINTS_H - -#include -#include -#include -#include - -#include "Qt_widget_styled_layer.h" -#include - -namespace CGAL { - -class Show_points_base: public Qt_widget_styled_layer { - Q_OBJECT -public: - typedef Qt_widget_styled_layer::Style Style; - - Show_points_base(Color c, - int pointsize, - PointStyle pointstyle, - QObject * parent=0, const char * name=0); - - Show_points_base(Style* style, - QString points_color_name, - QString points_size_name, - QString points_style_name, - QObject * parent=0, const char * name=0); - -public slots: - void setColor(QColor); - void setPointSize(int); - void setPointStyle(PointStyle); - -protected: - QString color; - QString size; - QString style_name; -}; // end Show_points_base - -template > -class Show_points : public Show_points_base { -public: - typedef Qt_widget_styled_layer::Style Style; - - typedef It iterator; - typedef iterator (C::* iterator_function)() const; - - Show_points(C *container, - iterator_function begin, - iterator_function end, - Color c = CGAL::GREEN, - int pointsize = 3, - PointStyle pointstyle = CGAL::DISC, - QObject * parent=0, const char * name=0) - : Show_points_base(c, pointsize, pointstyle, - parent, name), - cont(container), _begin(begin), _end(end) {}; - - Show_points(C *container, - iterator_function begin, - iterator_function end, - Style* style, - QString points_color_name, - QString points_size_name, - QString points_style_name, - QObject * parent=0, const char * name=0) - : Show_points_base(style, - points_color_name, - points_size_name, - points_style_name, - parent, name), - cont(container), _begin(begin), _end(end) {}; - - void draw() - { - widget->lock(); - { - QColor old_color = widget->color(); - int old_size = widget->pointSize(); - PointStyle old_point_style = widget->pointStyle(); - - widget->setColor(style()->getColor(color)); - widget->setPointSize(style()->getInt(size)); - widget->setPointStyle(static_cast(style()-> - getInt(style_name))); - - for(iterator it = (cont->*_begin)(); - it!=(cont->*_end)(); - ++it) - *widget << Transform()(*it); - - widget->setColor(old_color); - widget->setPointSize(old_size); - widget->setPointStyle(old_point_style); - } - widget->unlock(); - }; - -private: - C *cont; - iterator_function _begin; - iterator_function _end; -};//end class - -} // namespace CGAL - -#endif // SHOW_POINTS_H diff --git a/Mesh_2/demo/Mesh_2/Show_segments.h b/Mesh_2/demo/Mesh_2/Show_segments.h deleted file mode 100644 index 9ffa7135265..00000000000 --- a/Mesh_2/demo/Mesh_2/Show_segments.h +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#ifndef SHOW_SEGMENTS_H -#define SHOW_SEGMENTS_H - -#include "Show_segments_base.h" - -namespace CGAL { - -template > -class Show_segments : public Show_segments_base { -public: - typedef Qt_widget_styled_layer::Style Style; - - typedef It iterator; - typedef iterator (C::* iterator_function)() const; - - Show_segments(C *container, - iterator_function begin, - iterator_function end, - Color c=CGAL::GREEN, - int linewidth=3, - QObject* parent = 0, const char* name = 0) - : Show_segments_base(c, linewidth, - parent, name), - cont(container), _begin(begin), _end(end) {}; - - Show_segments(C *container, - iterator_function begin, - iterator_function end, - Style* style, - QString line_color_name, - QString line_width_name, - QObject* parent = 0, const char* name = 0) - : Show_segments_base(style, line_color_name, line_width_name, - parent, name), - cont(container), _begin(begin), _end(end) {}; - - void set_container(C* container) - { - cont = container; - } - - void draw() - { - if( cont != 0 ) - { - widget->lock(); - { - QColor old_color = widget->color(); - int old_width = widget->lineWidth(); - - widget->setColor(style()->getColor(color)); - widget->setLineWidth(style()->getInt(width)); - - for(iterator it = (cont->*_begin)(); - it!=(cont->*_end)(); - ++it) - { - *widget << Transform()(*it); - } - - widget->setColor(old_color); - widget->setLineWidth(old_width); - } - widget->unlock(); - } - }; - -private: - C *cont; - iterator_function _begin; - iterator_function _end; -};//end class - -} // namespace CGAL - -#endif // SHOW_SEGMENTS_H diff --git a/Mesh_2/demo/Mesh_2/Show_segments_base.cpp b/Mesh_2/demo/Mesh_2/Show_segments_base.cpp deleted file mode 100644 index d8afe22c8d7..00000000000 --- a/Mesh_2/demo/Mesh_2/Show_segments_base.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#include - - -#include "Show_segments_base.h" - -namespace CGAL { - - Show_segments_base::Show_segments_base(Color c, - int linewidth, - QObject* parent, - const char* name) - : Qt_widget_styled_layer(0, parent, name) - { - color=tr("Color"); - width=tr("Line width"); - - setColor(QColor(c.red(), c.green(), c.blue())); - setLineWidth(linewidth); - } - - Show_segments_base::Show_segments_base(Style* style, - QString line_color_name, - QString line_width_name, - QObject* parent, - const char* name) - : Qt_widget_styled_layer(style, parent, name), - color(line_color_name), - width(line_width_name) - {} - - void Show_segments_base::setColor(QColor c) - { style()->setColor(color, c); } - - void Show_segments_base::setLineWidth(int line_width) - { style()->setInt(width, line_width); } - -} // namespace CGAL - -// moc_source_file: Show_segments_base.h -#include "Show_segments_base.moc" - diff --git a/Mesh_2/demo/Mesh_2/Show_segments_base.h b/Mesh_2/demo/Mesh_2/Show_segments_base.h deleted file mode 100644 index 8afcce240b5..00000000000 --- a/Mesh_2/demo/Mesh_2/Show_segments_base.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#ifndef SHOW_SEGMENTS_BASE_H -#define SHOW_SEGMENTS_BASE_H - -#include "Qt_widget_styled_layer.h" - -namespace CGAL { - -class Show_segments_base: public Qt_widget_styled_layer { - Q_OBJECT -public: - typedef Qt_widget_styled_layer::Style Style; - - Show_segments_base(Color c, - int linewidth, - QObject* parent = 0, const char* name = 0); - - Show_segments_base(Style* style, - QString line_color_name, - QString line_width_name, - QObject* parent = 0, const char* name = 0); - -public slots: - void setColor(QColor); - void setLineWidth(int); - -protected: - QString color; - QString width; -}; //end Show_segments_base - -} // namespace CGAL - -#endif // SHOW_SEGMENTS_BASE_H diff --git a/Mesh_2/demo/Mesh_2/contraints.xpm b/Mesh_2/demo/Mesh_2/contraints.xpm deleted file mode 100644 index 90533a05d14..00000000000 --- a/Mesh_2/demo/Mesh_2/contraints.xpm +++ /dev/null @@ -1,37 +0,0 @@ -/* XPM */ -const char * contraints_xpm[] = { -"32 32 2 1", -" c None", -". c #FF0000", -" ", -" ", -" ", -" ............. ", -" .. .. ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" . ... . ", -" . ... .... . ", -" . . . . . ", -" . . . . . ", -" . . . . . ", -" . . . . . ", -" .. . . . . ", -" .. . . . . ", -" . .. .. . ", -" . ..... .. ... ", -" . .... . ", -" . . ", -" . . ", -" . . ", -" . . ", -" ..... . ", -" ........ .. ", -" .... ", -" ", -" ", -" "}; diff --git a/Mesh_2/demo/Mesh_2/icons.cpp b/Mesh_2/demo/Mesh_2/icons.cpp deleted file mode 100644 index 962fbc6301b..00000000000 --- a/Mesh_2/demo/Mesh_2/icons.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#include - - -#include -#include -#include -#include "contraints.xpm" -#include "marked.xpm" -#include "seeds.xpm" -#include -#include - diff --git a/Mesh_2/demo/Mesh_2/icons.h b/Mesh_2/demo/Mesh_2/icons.h deleted file mode 100644 index 6c18a84ba1c..00000000000 --- a/Mesh_2/demo/Mesh_2/icons.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -extern const char *polygon_xpm[], - *point_xpm[], - *points_xpm[], - *contraints_xpm[], - *marked_xpm[], - *seeds_xpm[], - *circle_xpm[], - *triangulation_xpm[]; diff --git a/Mesh_2/demo/Mesh_2/marked.xpm b/Mesh_2/demo/Mesh_2/marked.xpm deleted file mode 100644 index 5a1c8d26513..00000000000 --- a/Mesh_2/demo/Mesh_2/marked.xpm +++ /dev/null @@ -1,39 +0,0 @@ -/* XPM */ -const char * marked_xpm[] = { -"32 32 4 1", -" c None", -". c #000080", -"+ c #0CFF00", -"@ c #FFFFFF", -" ", -" ", -" ", -" ............. ", -" ..++++++++++... ", -" .+.++++++++.@.+. ", -" .++.+++++++.+.++. ", -" .+++.+++++.++.+++. ", -" .+++.++++.+++.++++. ", -" .+++++.++.++++.+++++. ", -" .++++++..++++.++++... ", -" .+++++++...+++.++..@.. ", -" .+++++....@......++.+. ", -" .++++.+.@.@@@@.++++.+. ", -" .+++..++.@@.@@@.+++.++. ", -" .++.++++.@@.@@@.+++.+++. ", -" ...+++++.@@@.@@.++.++++. ", -" ..++++++.@@@@@.@.++.++++. ", -" ...+++++.@@@@@.@.+.+++++. ", -" .++......@@@@@@..+.+++++. ", -" .+++++++.....@@.......... ", -" .+++++..+.+++.....++++. ", -" .++++.++++.++++++.+++. ", -" .+++.++++++.+++++.++. ", -" .+..++++++++.+++.++. ", -" ..+++++++++++.++.++. ", -" .....+++++++++.+.+. ", -" ........++... ", -" .... ", -" ", -" ", -" "}; diff --git a/Mesh_2/demo/Mesh_2/mesh_2_demo.cpp b/Mesh_2/demo/Mesh_2/mesh_2_demo.cpp deleted file mode 100644 index 948171951d2..00000000000 --- a/Mesh_2/demo/Mesh_2/mesh_2_demo.cpp +++ /dev/null @@ -1,1531 +0,0 @@ -// Copyright (c) 2003-2006 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Laurent Rineau - -#include - - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#define CGAL_MESH_2_USE_TIMERS -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include "icons.h" - -#include "Show_points.h" -#include "Show_segments.h" -#include "Qt_layer_show_triangulation.h" -#include "Qt_layer_show_triangulation_constraints.h" -#include "Qt_layer_show_circles.h" -#include "Show_clusters.h" -#include -#include "Qt_widget_styled_layer.h" - -#ifdef CGAL_MESH_2_DEBUG_DRAW -#include "Debug_layer.h" -#endif - -#include "Qt_widget_style_editor.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef TESTING -# include - typedef CGAL::Simple_cartesian Kernel; -#else // !TESTING -# include - typedef CGAL::Simple_cartesian K1; - typedef CGAL::Filtered_kernel Kernel; -#endif // #ifdef TESTING - -struct K : public Kernel {}; -typedef K::FT FT; - -typedef CGAL::Triangulation_vertex_base_2 Vb; -typedef CGAL::Delaunay_mesh_face_base_2 Fb; -typedef CGAL::Triangulation_data_structure_2 Tds; -typedef CGAL::Constrained_Delaunay_triangulation_2 Tr; -typedef CGAL::Delaunay_mesh_local_size_criteria_2 Criteria; - -typedef K::Point_2 Point_2; -typedef K::Segment_2 Segment_2; -typedef K::Triangle_2 Triangle_2; -typedef K::Circle_2 Circle; -typedef CGAL::Polygon_2 CGALPolygon; - -typedef CGAL::Delaunay_mesher_2 Mesher; -typedef Tr::Vertex Vertex; -typedef Tr::Edge Edge; - -template -void -read_constraints(CDT& t, std::istream &f) -{ - typedef typename CDT::Point Point; - - t.clear(); - - int nedges = 0; - f>>nedges; - - for(int n = 0; n> p1 >> p2; - t.insert_constraint(p1, p2); - } -} - -template -void -write_constraints(const CDT& t, std::ostream &f) -{ - typedef typename CDT::Finite_edges_iterator Finite_edges_iterator; - - int number_of_constrained_edges = 0; - for(Finite_edges_iterator it = t.finite_edges_begin(); - it != t.finite_edges_end(); - ++it) - if((*it).first->is_constrained((*it).second)) - ++number_of_constrained_edges; - - f << number_of_constrained_edges << std::endl; - for(Finite_edges_iterator eit = t.finite_edges_begin(); - eit!=t.finite_edges_end(); - ++eit) - if((*eit).first->is_constrained((*eit).second)) - { - f << (*eit).first->vertex(t.cw((*eit).second))->point() << " " - << (*eit).first->vertex(t.ccw((*eit).second))->point() <vertex(Tr::cw (e.second))->point(), - e.first->vertex(Tr::ccw(e.second))->point()); - } -}; - -struct Background_color : public CGAL::Qt_widget_styled_layer -{ - Background_color (CGAL::Color c = CGAL::WHITE) - { - style()->setColor("Back ground color", - QColor(c.red(), c.green(), c.blue())); - } - - void draw() - { - widget->setBackgroundColor(style()->getColor("Back ground color")); - } -}; - -template -class Show_in_domain_faces : public CGAL::Qt_widget_styled_layer -{ - Tr *cdt; -public: - Show_in_domain_faces(Tr *t, CGAL::Color c=CGAL::GREEN, - QObject* parent = 0, const char* name = 0) - : Qt_widget_styled_layer(0, parent, name), - cdt(t) - { - QColor color(c.red(), c.green(), c.blue()); - style()->setColor("Fill color", color); - style()->setInt("Line width", 0); - style()->setColor("Segment color", color); - } - - typedef typename Tr::Finite_faces_iterator Face_iterator; - - void draw() - { - QColor old_fill_color = widget->fillColor(); - int old_line_width = widget->lineWidth(); - QColor old_line_color = widget->color(); - - widget->setColor(style()->getColor("Segment color")); - widget->setLineWidth(style()->getInt("Line width")); - widget->setFillColor(style()->getColor("Fill color")); - - for(Face_iterator fit=cdt->finite_faces_begin(); - fit!=cdt->finite_faces_end(); - ++fit) - if(fit->is_in_domain()) - *widget << cdt->triangle(fit); - - widget->setFillColor(old_fill_color); - widget->setLineWidth(old_line_width); - widget->setColor(old_line_color); - } -}; - -template -class Show_bad_faces : public CGAL::Qt_widget_layer -{ - Mesher *m; - CGAL::Color color; -public: - Show_bad_faces(Mesher *mesher, - CGAL::Color c=CGAL::Color(127,0,0), - QObject* parent = 0, const char* name = 0) - : Qt_widget_layer(parent, name), - m(mesher), - color(c) - {} - - void set_container(Mesher* mesher) - { - m = mesher; - } - - typedef typename Mesher::Bad_faces_const_iterator Bad_faces_iterator; - - void draw() - { - if( m != 0 ) - { - widget->lock(); - { - QColor old_fill_color = widget->fillColor(); - int old_line_width = widget->lineWidth(); - - *widget << CGAL::FillColor(color) - << CGAL::LineWidth(0); - - for(Bad_faces_iterator fit=m->bad_faces_begin(); - fit!=m->bad_faces_end(); - ++fit) - *widget << Triangle_2((*fit)->vertex(0)->point(), - (*fit)->vertex(1)->point(), - (*fit)->vertex(2)->point()); - widget->setFillColor(old_fill_color); - widget->setLineWidth(old_line_width); - } - widget->unlock(); - } - } -}; - -class Meshing_debugging_layer : public CGAL::Qt_widget_layer -{ - Q_OBJECT - Mesher* m; - bool point_on; -public: - Meshing_debugging_layer(QObject* parent = 0, const char* name = 0) - : Qt_widget_layer(parent, name), m(0), point_on(false) - { - } - - void set_container(Mesher* mesher) - { - m = mesher; - } - - void draw() - { - if( m != 0 ) - { - if( m->is_refinement_done() ) return; - - widget->lock(); - { - QColor old_color = widget->color(); - int old_line_width = widget->lineWidth(); - CGAL::PointStyle old_point_style = widget->pointStyle(); - int old_point_size = widget->pointSize(); - - if( m->is_edges_refinement_done() ) - { - QColor old_fill_color = widget->fillColor(); - - const Tr::Face_handle fh = m->next_bad_face(); - - *widget << CGAL::FillColor(CGAL::RED) - << CGAL::LineWidth(0) - << Triangle_2(fh->vertex(0)->point(), - fh->vertex(1)->point(), - fh->vertex(2)->point()); - - widget->setFillColor(old_fill_color); - } - else - { - Edge_to_segment edge_to_segment; - - *widget << CGAL::PURPLE - << CGAL::LineWidth(2) - << edge_to_segment(m->next_encroached_edge()); - } - - *widget << CGAL::BLACK - << CGAL::PointStyle(CGAL::PLUS) - << CGAL::PointSize(3) - << m->next_refinement_point() - << CGAL::PointSize(old_point_size) - << CGAL::PointStyle(old_point_style); - - widget->setLineWidth(old_line_width); - widget->setColor(old_color); - } - widget->unlock(); - } - } -}; - - -class Follow_mouse : public CGAL::Qt_widget_layer -{ - QCursor oldcursor; -public: - Follow_mouse(QObject* parent = 0, const char* name = 0) - : Qt_widget_layer(parent, name) - { - } - - void mouseMoveEvent(QMouseEvent *e) - { - FT x=static_cast(widget->x_real(e->x())); - FT y=static_cast(widget->y_real(e->y())); - const Point_2 current_point = Point_2(x, y); - widget->new_object(CGAL::make_object(current_point)); - previous_point = current_point; - just_entered = false; - } - - void enterEvent(QEvent*) - { - just_entered = true; - } - - void leaveEvent(QEvent*) - { - just_entered = false; - } - - void activating() - { - oldcursor = widget->cursor(); - widget->setCursor(crossCursor); - }; - - void deactivating() - { - widget->setCursor(oldcursor); - }; - - Point_2 previous_point; - bool just_entered; -}; - -class Preferences : public QWidget -{ - Q_OBJECT -private: - QGridLayout* layout; - QTabWidget* tab; - -public: - Preferences(QWidget* parent = 0, const char* name = 0, bool modal = false) - : QWidget(parent, name, modal) - { - layout = new QGridLayout(this, 1,1, 11, 6, "pref_layout"); - tab = new QTabWidget(this); - layout->addWidget(tab, 0, 0); - } - - template - void setLayers(LayersIterator begin, LayersIterator end) - { - QWidget* w; - while( (w = tab->currentPage()) != 0) - { - tab->removePage(w); - delete w; - } - - for(LayersIterator it = begin; it!=end; ++it) - { - QFrame* box = new QFrame(this); - QHBoxLayout* hor = new QHBoxLayout(box, 5, 0); - QVBoxLayout* layout = new QVBoxLayout(hor, 5); - - QCheckBox* check = new QCheckBox("&Activated", box); - layout->addWidget(check); - - check->setChecked((*it)->is_active()); - - connect(check, SIGNAL(stateChanged(int)), - *it, SLOT(stateChanged(int))); - connect(check, SIGNAL(stateChanged(int)), - this, SLOT(is_changed())); - - // QGroupBox* group = new QGroupBox("&Properties", box); - CGAL::Qt_widget_style_editor* editor = - new CGAL::Qt_widget_style_editor((*it)->style(), box); - editor->show(); - - layout->addWidget(editor); - layout->addItem(new QSpacerItem(0, 0, - QSizePolicy::Minimum, - QSizePolicy::Expanding)); - hor->addItem(new QSpacerItem(0, 0, - QSizePolicy::Expanding, - QSizePolicy::Minimum)); - - connect(editor, SIGNAL(styleChanged()), - this, SLOT(is_changed())); - - tab->addTab(box, (*it)->name()); - } - } - -private slots: - void is_changed() { emit changed(); } - -signals: - void changed(); -}; // end of class Preferences - -class MyWindow : public QMainWindow -{ - Q_OBJECT - - typedef std::list Seeds; -public: - MyWindow() : criteria(), mesher(0) - { - // --- DEMO WINDOW'S LAYOUT --- - // a main frame, with a QHBoxLayout (border=0, space=0) - QFrame* mainframe = new QFrame(this, "mainframe"); - QHBoxLayout *mainlayout = new QHBoxLayout(mainframe, 0, 0, - "mainlayout"); - - // a Qt_widget at the left of the main frame - widget = new CGAL::Qt_widget(mainframe, "Main widget"); - widget->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, - QSizePolicy::Expanding )); - mainlayout->addWidget(widget); - - // an other frame "infoframe" at the right of the main frame - // with a QVBoxLayout (border=10, space=5) - QFrame* infoframe = new QFrame(mainframe, "infoframe"); - infoframe->setFrameStyle( QFrame::Box | QFrame::Raised ); - infoframe->setLineWidth(2); - QVBoxLayout *infoframelayout = new QVBoxLayout(infoframe, 10, 5, - "infoframelayout"); - mainlayout->addWidget(infoframe); - - // a 3x2 QGridLayout in the info frame (space=5) - QGridLayout *numbers_layout = new QGridLayout(infoframelayout, - 3, 2, - 5, // space - "infolayout"); - // number of points - numbers_layout->addWidget(new QLabel("Number of points: ", - infoframe), - 0, 0, - AlignRight | AlignTop ); - - nb_of_points = new QLabel("0", infoframe); - numbers_layout->addWidget(nb_of_points, 0, 1, - AlignLeft | AlignTop ); - - // number of clusters - numbers_layout->addWidget(new QLabel("Number of clusters: ", - infoframe), - 1, 0, - AlignRight | AlignTop ); - - nb_of_clusters = new QLabel("", infoframe); - numbers_layout->addWidget(nb_of_clusters, 1, 1, - AlignLeft | AlignTop ); - - // initialization status - numbers_layout->addWidget(new QLabel("init status: ", infoframe), - 2, 0, - AlignRight | AlignTop ); - - init_status = new QLabel("no", infoframe); - numbers_layout->addWidget(init_status, 2, 1, - AlignLeft | AlignTop ); - - // a vertical spacer in the info frame - infoframelayout->addItem(new - QSpacerItem( 0, 0, - QSizePolicy::Minimum, - QSizePolicy::Expanding )); - - // another grid: a 2x3 QGridLayout (space=5) - QGridLayout *criteria_layout = - new QGridLayout(infoframelayout, 2, 3, - 5, // space - "criteria_layout"); - - // angle bound - criteria_layout->addWidget(new QLabel("Angle bound: ", - infoframe), - 0, 0, - AlignRight | AlignTop); - angle_bound = new QLineEdit("0.125", infoframe, - "angle_bound"); - angle_bound->setValidator(new QDoubleValidator(angle_bound)); - criteria_layout->addWidget(angle_bound, 0, 1, - AlignLeft | AlignTop ); - connect(angle_bound, SIGNAL(textChanged(const QString&)), - this, SLOT(setBound(const QString&))); - - - // size bound - criteria_layout->addWidget(new QLabel("Size bound: ", - infoframe), - 1, 0, - AlignRight | AlignTop); - size_bound = new QLineEdit("0", infoframe, - "size_bound"); - size_bound->setValidator(new QDoubleValidator(size_bound)); - criteria_layout->addWidget(size_bound, 1, 1, - AlignLeft | AlignTop ); - connect(size_bound, SIGNAL(textChanged(const QString&)), - this, SLOT(setSizeBound(const QString&))); - - // under mouse - under_mouse = new QCheckBox("Under mouse only", infoframe, - "under_mouse"); - criteria_layout->addMultiCellWidget(under_mouse, - 3, 3, 0, 1); - connect(under_mouse, SIGNAL(toggled(bool)), - this, SLOT(setLocal(bool))); - - setCentralWidget(mainframe); - resize(700,500); - mainframe->show(); - - // --- STATUSBAR --- - statusBar(); - - // --- LAYERS --- - - Background_color* background_color_layer = new Background_color(); - - show_points = - new Show_points_from_triangulation(&cdt, - &Tr::finite_vertices_begin, - &Tr::finite_vertices_end, - CGAL::BLACK, 2, - CGAL::DISC, - this, "Show points"); - - show_seeds = new Show_seeds(&seeds, - &Seeds::begin, - &Seeds::end, - CGAL::BLUE, - 5, - CGAL::CROSS, - this, "Show seeds"); - show_triangulation = - new CGAL::Qt_layer_show_triangulation(&cdt, - CGAL::BLUE,1, - this, - "Show triangulation edges"); - show_in_domain = - new Show_in_domain_faces(&cdt, CGAL::GREEN, - this, "Show in_domain faces"); - - show_constraints = - new CGAL::Qt_layer_show_triangulation_constraints - (&cdt, CGAL::RED, 1, - this, "Show constrained edges"); - - show_encroached_edges = - new Show_encroached_edges(0, - &Mesher::encroached_edges_begin, - &Mesher::encroached_edges_end, - CGAL::RED, 2, - this, "Encroached edges layer"); - - show_bad_faces = - new Show_bad_faces(0, CGAL::Color(0,160,0), - this, "Show bad faces"); - - debug_layer = new Meshing_debugging_layer(this, - "Debug layer"); - - show_circles = - new CGAL::Qt_layer_show_circles(&cdt, CGAL::GRAY, 1, - CGAL::WHITE, false, - this, "Show circles"); - - show_coordinates = - new CGAL::Qt_widget_show_mouse_coordinates(*this, - this, - "Follow mouse coordinates"); - - show_clusters = new Show_clusters(mesher, - CGAL::BLACK,3,CGAL::RECT, - CGAL::BLACK,CGAL::BLUE,2, - this, - "Show clusters"); - - // layers order, first attached are "under" last attached -#ifdef CGAL_MESH_2_DEBUG_DRAW - widget->attach(new CGAL::Debug_layer()); -#endif - widget->attach(background_color_layer); - widget->attach(show_in_domain); - widget->attach(show_bad_faces); - widget->attach(show_triangulation); - widget->attach(show_constraints); - widget->attach(show_circles); - widget->attach(show_encroached_edges); - widget->attach(show_points); - widget->attach(show_seeds); - widget->attach(show_coordinates); - widget->attach(debug_layer); - widget->attach(show_clusters); // should be last - - show_circles->deactivate(); - show_encroached_edges->deactivate(); - show_bad_faces->deactivate(); - show_clusters->deactivate(); - - get_point = new CGAL::Qt_widget_get_point(); - widget->attach(get_point); - get_point->deactivate(); - - get_polygon = new CGAL::Qt_widget_get_polygon(); - widget->attach(get_polygon); - get_polygon->deactivate(); - - get_seed = new CGAL::Qt_widget_get_point(); - widget->attach(get_seed); - get_seed->deactivate(); - - follow_mouse = new Follow_mouse(); - widget->attach(follow_mouse); - follow_mouse->deactivate(); - - connect(widget, SIGNAL(new_cgal_object(CGAL::Object)), - this, SLOT(get_cgal_object(CGAL::Object))); - - const int number_of_styled_layers = 6; - CGAL::Qt_widget_styled_layer* styled_layers[number_of_styled_layers] = - { background_color_layer, - show_points, - show_seeds, - show_triangulation, - show_constraints, - show_in_domain}; - - prefs = new Preferences(0, "Preferences", false); - prefs->setCaption("Layers properties"); - prefs->setLayers(styled_layers, styled_layers + number_of_styled_layers); - prefs->resize(300, 200); - - connect(prefs, SIGNAL(changed()), - widget, SLOT(redraw())); - - // --- TOOLBARS --- - - // Actions: bouding box and mesh - QToolBar *toolBarActions = new QToolBar("Actions", this); - QPushButton *pbBounding = - new QPushButton("Insert bounding box", toolBarActions); - connect(pbBounding, SIGNAL(clicked()), this, - SLOT(insert_bounding_box())); - - QPushButton *pbMesh = - new QPushButton("Mesh", toolBarActions); - connect(pbMesh, SIGNAL(clicked()), this, SLOT(refineMesh())); - - QPushButton *pbConform = - new QPushButton("Conform", toolBarActions); - connect(pbConform, SIGNAL(clicked()), this, - SLOT(conformMesh())); - - QPushButton *pbAdvanced = - new QPushButton("Advanced", toolBarActions); - pbAdvanced->setToggleButton(true); - pbAdvanced->setOn(false); - connect(pbAdvanced, SIGNAL(stateChanged(int)), - this, SLOT(advanced(int))); - - // Inputs: polygons or points - QToolBar *toolbarInputs = new QToolBar("Inputs",this); - QButtonGroup *bgChooseInputs = - new QButtonGroup("Choose inputs type", 0, - "InputType"); - bgChooseInputs->setExclusive(true); - QToolButton *pbPolygon = - new QToolButton(QPixmap( (const char**)polygon_xpm ), - "Polygon", "Insert polygonal constraints", - this, SLOT(fake_slot()), - toolbarInputs, "polygon"); - QToolButton *pbPoint = - new QToolButton(QPixmap( (const char**)point_xpm ), - "Point", "Insert points", - this, SLOT(fake_slot()), - toolbarInputs, "point"); - QToolButton *pbSeed = - new QToolButton(QPixmap( (const char**)marked_xpm ), - "Seed", "Insert a seed to define a region to mesh", - this, SLOT(fake_slot()), - toolbarInputs, "seed"); - - pbPoint->setToggleButton(true); - pbPolygon->setToggleButton(true); - pbSeed->setToggleButton(true); - bgChooseInputs->insert(pbPoint); - bgChooseInputs->insert(pbPolygon); - bgChooseInputs->insert(pbSeed); - - connect(pbPoint, SIGNAL(stateChanged(int)), - get_point, SLOT(stateChanged(int))); - connect(pbPolygon, SIGNAL(stateChanged(int)), - get_polygon, SLOT(stateChanged(int))); - connect(pbSeed, SIGNAL(stateChanged(int)), - get_seed, SLOT(stateChanged(int))); - - pbPolygon->setOn(true); - - // Layers: points, edges, constrained edges - QToolBar *toolbarLayers = new QToolBar("Layers",this); - - QToolButton *pbShowPoints - = new QToolButton(QPixmap( (const char**)points_xpm ), - "Show points", "Display mesh vertices", - this, SLOT(fake_slot()), - toolbarLayers, "show points"); - pbShowPoints->setToggleButton(true); - pbShowPoints->setOn(true); - connect(pbShowPoints, SIGNAL(stateChanged(int)), - show_points, SLOT(stateChanged(int))); - - QToolButton *pbShowSeeds - = new QToolButton(QPixmap( (const char**)seeds_xpm ), - "Show seeds", "Display seeds that define the " - "region not to mesh", - this, SLOT(fake_slot()), - toolbarLayers, "show points"); - pbShowSeeds->setToggleButton(true); - pbShowSeeds->setOn(true); - connect(pbShowSeeds, SIGNAL(stateChanged(int)), - show_seeds, SLOT(stateChanged(int))); - - QToolButton *pbShowTriangulation - = new QToolButton(QPixmap( (const char**)triangulation_xpm ), - "Show triangulation", "Display mesh edges", - this, SLOT(fake_slot()), - toolbarLayers, - "show triangulation"); - pbShowTriangulation->setToggleButton(true); - pbShowTriangulation->setOn(true); - connect(pbShowTriangulation, SIGNAL(stateChanged(int)), - show_triangulation, SLOT(stateChanged(int))); - - QToolButton *pbShowConstraints - = new QToolButton(QPixmap( (const char**)contraints_xpm ), - "Show constraints", "Display mesh constraints edges", - this, SLOT(fake_slot()), - toolbarLayers, - "show constraints"); - pbShowConstraints->setToggleButton(true); - pbShowConstraints->setOn(true); - connect(pbShowConstraints, SIGNAL(stateChanged(int)), - show_constraints, SLOT(stateChanged(int))); - - QToolButton *pbShowInDomain - = new QToolButton(QPixmap( (const char**)marked_xpm ), - "Show faces in domain", - "Display faces that will be refined", - this, SLOT(fake_slot()), - toolbarLayers, - "show in domain"); - pbShowInDomain->setToggleButton(true); - pbShowInDomain->setOn(true); - connect(pbShowInDomain, SIGNAL(stateChanged(int)), - show_in_domain, SLOT(stateChanged(int))); - - QToolButton *pbShowCircles - = new QToolButton(QPixmap( (const char**)circle_xpm ), - "Show circles", "Display circumcircles of faces", - this, SLOT(fake_slot()), - toolbarLayers, - "show circles"); - pbShowCircles->setToggleButton(true); - connect(pbShowCircles, SIGNAL(stateChanged(int)), - show_circles, SLOT(stateChanged(int))); - - bgChooseInputs->insert(pbShowCircles); - - // button group trick to connect to widget->redraw() slot - QButtonGroup *bgLayers = - new QButtonGroup("Layers", 0, "layers"); - bgLayers->insert(pbShowPoints); - bgLayers->insert(pbShowInDomain); - bgLayers->insert(pbShowTriangulation); - bgLayers->insert(pbShowConstraints); - bgLayers->insert(pbShowSeeds); - // bgLayers->insert(pbShowCircles); - connect(bgLayers, SIGNAL(clicked(int)), - widget, SLOT(redraw())); - - // the standard toolbar - CGAL::Qt_widget_standard_toolbar *std_toolbar = - new CGAL::Qt_widget_standard_toolbar(widget, this); - this->addToolBar(std_toolbar->toolbar(), Top, FALSE); - - // Steps actions: step by step meshing operations - toolBarAdvanced = new QToolBar("Advanced operations",this); - toolBarAdvanced->hide(); - - pbMeshStep = - new QPushButton("Mesh 1 step", toolBarAdvanced); - connect(pbMeshStep, SIGNAL(clicked()), this, - SLOT(refineMeshStep())); - - QSpinBox *sbStepLength = - new QSpinBox(1, INT_MAX, 1, toolBarAdvanced); - sbStepLength->setValue(1); - step_length = 1; - connect(sbStepLength, SIGNAL(valueChanged(int)), - this, SLOT(updateStepLength(int))); - - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), - this, SLOT(refineMeshStep())); - - pbMeshTimer = new QPushButton("Auto step", toolBarAdvanced); - pbMeshTimer->setToggleButton(true); - connect(pbMeshTimer, SIGNAL(stateChanged(int)), - this, SLOT(updateTimer(int))); - - QSpinBox *sbTimerInterval = - new QSpinBox(0, INT_MAX, 10, toolBarAdvanced); - sbTimerInterval->setValue(1000); - sbTimerInterval->setSuffix("ms"); - timer_interval=1000; - connect(sbTimerInterval, SIGNAL(valueChanged(int)), - this, SLOT(updateTimerInterval(int))); - - pbShowCluster = new QPushButton("Show clusters", toolBarAdvanced); - pbShowCluster->setToggleButton(true); - pbShowCluster->setEnabled(false); - connect(pbShowCluster, SIGNAL(stateChanged(int)), - show_clusters, SLOT(stateChanged(int))); - connect(pbShowCluster, SIGNAL(stateChanged(int)), - widget, SLOT(redraw())); - - pbShowEncroachedEdges = new QPushButton("Show encroached edges", - toolBarAdvanced); - pbShowEncroachedEdges->setToggleButton(true); - pbShowEncroachedEdges->setEnabled(false); - connect(pbShowEncroachedEdges, SIGNAL(stateChanged(int)), - show_encroached_edges, SLOT(stateChanged(int))); - connect(pbShowEncroachedEdges, SIGNAL(stateChanged(int)), - widget, SLOT(redraw())); - - pbShowBadFaces = new QPushButton("Show bad faces", - toolBarAdvanced); - pbShowBadFaces->setToggleButton(true); - pbShowBadFaces->setEnabled(false); - connect(pbShowBadFaces, SIGNAL(stateChanged(int)), - show_bad_faces, SLOT(stateChanged(int))); - connect(pbShowBadFaces, SIGNAL(stateChanged(int)), - widget, SLOT(redraw())); - - setUsesBigPixmaps(true); - - // --- MENUS --- - QPopupMenu *pmMesh = new QPopupMenu(this); - menuBar()->insertItem("&File", pmMesh); - pmMesh->insertItem("&Refine mesh", this, SLOT(refineMesh()), - CTRL+Key_R ); - pmMesh->insertItem("&Clear mesh", this, SLOT(clearMesh()), - CTRL+Key_C ); - pmMesh->insertItem("Clear seeds", this, SLOT(clearSeeds())); - pmMesh->insertItem("&Open constrained triangulation...", this, - SLOT(openTriangulation()), - CTRL+Key_O ); - pmMesh->insertItem("&Save constrained edges...", this, - SLOT(saveTriangulation()), - CTRL+Key_S ); - pmMesh->insertItem("&Quit", qApp, SLOT(closeAllWindows()), - CTRL+Key_Q ); - - connect(this, SIGNAL(insertedInput()), - this, SLOT(after_inserted_input())); - connect(this, SIGNAL(initializedMesher()), - this, SLOT(after_initialized_mesher())); - - QPopupMenu *pmOptions = new QPopupMenu(this); - menuBar()->insertItem("&Options", pmOptions); - pmOptions->insertItem("Set &layer properties...", this, - SLOT(displayPreferences())); - pmOptions->setCheckable(true); - - widget->set_window(-1.,1.,-1.,1.); - widget->setMouseTracking(TRUE); - }; - - // compute bounds of the mesh - void bounds(FT &xmin, FT &ymin, - FT &xmax, FT &ymax) - { - Tr::Finite_vertices_iterator vi=cdt.finite_vertices_begin(); - xmin=xmax=vi->point().x(); - ymin=ymax=vi->point().y(); - vi++; - while(vi != cdt.finite_vertices_end()) - { - if(vi->point().x() < xmin) xmin=vi->point().x(); - if(vi->point().x() > xmax) xmax=vi->point().x(); - if(vi->point().y() < ymin) ymin=vi->point().y(); - if(vi->point().y() > ymax) ymax=vi->point().y(); - vi++; - } - } - -signals: - void insertedInput(); - void initializedMesher(); - -private slots: - void after_initialized_mesher() - { - updatePointCounter(); - if( mesher !=0 ) - { - init_status->setText("yes"); - pbShowCluster->setEnabled(true); - pbShowEncroachedEdges->setEnabled(true); - pbShowBadFaces->setEnabled(true); - } - else - { - init_status->setText("no"); - pbShowCluster->setOn(false); - pbShowCluster->setEnabled(false); - pbShowEncroachedEdges->setOn(false); - pbShowEncroachedEdges->setEnabled(false); - pbShowBadFaces->setOn(false); - pbShowBadFaces->setEnabled(false); - } - show_clusters->change_mesher(mesher); - show_encroached_edges->set_container(mesher); - show_bad_faces->set_container(mesher); - debug_layer->set_container(mesher); - } - - void after_inserted_input() - { - delete mesher; - mesher = 0; - emit initializedMesher(); - mark_facets(); - nb_of_clusters_has_to_be_updated = true; - } - - void mark_facets() - { - Mesher::mark_facets(cdt, seeds.begin(), seeds.end()); - } - - void displayPreferences() - { - prefs->show(); - } - - -public slots: - - void get_cgal_object(CGAL::Object obj) - { - Point_2 p; - CGALPolygon poly; - - if(CGAL::assign(p,obj)) - if(follow_mouse->is_active()) - { - typedef Tr::Face_handle Face_handle; - Face_handle fh = cdt.locate(p); - std::vector faces_to_check; - - if(cdt.is_infinite(fh) && !follow_mouse->just_entered) - { // make the line walk in opposite direction, if p is outside - // the triangulation - fh = cdt.locate(follow_mouse->previous_point); - std::swap(follow_mouse->previous_point, p); - } - - if(cdt.is_infinite(fh)) return; - Segment_2 segment; - if(follow_mouse->just_entered) - { - faces_to_check.push_back(fh); - segment = Segment_2(p, p); - } - else - { - const Point_2& previous_point = follow_mouse->previous_point; - Tr::Line_face_circulator - fc = cdt.line_walk(p, - previous_point, - fh), - end(fc); - do - { - faces_to_check.push_back(fc); - ++fc; - } while(!cdt.is_infinite(fc) && - cdt.triangle(fc).has_on_unbounded_side(previous_point)); - - segment = Segment_2(p, follow_mouse->previous_point); - } - - criteria.set_local_size(true); - criteria.set_segment(segment); - - std::vector bad_faces; - - for(std::vector::const_iterator - fh_it = faces_to_check.begin(), - end = faces_to_check.end(); - fh_it != end; ++fh_it) - { - if( (*fh_it != NULL) && (!cdt.is_infinite(*fh_it)) && (*fh_it)->is_in_domain() ) - { - Criteria::Quality q; - if(criteria.is_bad_object().operator()(*fh_it, q) != - CGAL::Mesh_2::NOT_BAD) - bad_faces.push_back(*fh_it); - } - } - - if( mesher!=0 ) - { - mesher->set_criteria(criteria, false); - mesher->set_bad_faces(bad_faces.begin(), bad_faces.end()); - while( mesher->step_by_step_refine_mesh() ); - } - } - else - if(get_seed->is_active()) - { - seeds.push_back(p); - mark_facets(); - } - else // get_point is active - { - cdt.insert(p); - emit( insertedInput() ); - } - else - if (CGAL::assign(poly,obj)) - { - for(CGALPolygon::Edge_const_iterator it=poly.edges_begin(); - it!=poly.edges_end(); - it++) - cdt.insert((*it).source(),(*it).target()); - emit( insertedInput() ); - } - else // obj should be a polygon or a point! - CGAL_error(); - updatePointCounter(); - widget->redraw(); - } - - //insert a bounding box around the mesh - void insert_bounding_box() - { - FT xmin, xmax, ymin, ymax; - bounds(xmin, ymin, xmax, ymax); - - FT xcenter=(xmin+xmax)/2, - ycenter=(ymin+ymax)/2; - FT xspan = (xmax-xmin)/2, - yspan = (ymax-ymin)/2; - - Point_2 bb1(xcenter - FT(1.5)*xspan, ycenter - FT(1.5)*yspan); - Point_2 bb2(xcenter + FT(1.5)*xspan, ycenter - FT(1.5)*yspan); - Point_2 bb3(xcenter + FT(1.5)*xspan, ycenter + FT(1.5)*yspan); - Point_2 bb4(xcenter - FT(1.5)*xspan, ycenter + FT(1.5)*yspan); - cdt.insert(bb1); - cdt.insert(bb2); - cdt.insert(bb3); - cdt.insert(bb4); - cdt.insert(bb1, bb2); - cdt.insert(bb2, bb3); - cdt.insert(bb3, bb4); - cdt.insert(bb4, bb1); - emit( insertedInput() ); - widget->redraw(); - } - - void updatePointCounter() - { - nb_of_points->setNum(static_cast(cdt.number_of_vertices())); - if(nb_of_clusters_has_to_be_updated && - mesher != 0) - { - nb_of_clusters_has_to_be_updated = false; - nb_of_clusters->setNum(mesher->clusters().size()); - } - } - - void refineMesh() - { - dumpTriangulation("last_input.edg"); - if( mesher == 0 ) - mesher = create_mesher(); - mesher->refine_mesh(); - emit initializedMesher(); - widget->redraw(); - } - - void conformMesh() - { - dumpTriangulation("last_input.edg"); - CGAL::make_conforming_Gabriel_2(cdt); - mark_facets(); - delete mesher; - mesher = 0; - emit initializedMesher(); - updatePointCounter(); - widget->redraw(); - } - - void refineMeshStep() - { - int counter = step_length; - if(mesher == 0) - { - mesher = create_mesher(); - mesher->init(); - emit initializedMesher(); - dumpTriangulation("last_input.edg"); - } - while(counter>0) - { - --counter; - if(!mesher->try_one_step_refine_mesh()) - { - pbMeshTimer->setOn(false); - counter = 0; - } - } - updatePointCounter(); - widget->redraw(); - } - - void updateTimer(int i) - { - if(i==0) - timer->stop(); - else - timer->start(timer_interval); - } - - void updateStepLength(int i) - { - step_length = i; - QString s; - s = "Mesh " + QString::number(i) + " step"; - if(i > 1) - s+="s"; - pbMeshStep->setText(s); - } - - void updateTimerInterval(int i) - { - timer_interval=i; - if(timer->isActive()) - timer->changeInterval(timer_interval); - } - - void clearMesh() - { - cdt.clear(); - emit( insertedInput() ); - updatePointCounter(); - widget->clear_history(); - widget->redraw(); - } - - void clearSeeds_without_redraw() - { - seeds.clear(); - delete mesher; - mesher = 0; - emit initializedMesher(); - mark_facets(); - } - - void clearSeeds() - { - clearSeeds_without_redraw(); - widget->redraw(); - } - - void openTriangulation() { openTriangulation(QString()); } - - void openTriangulation(QString filename) - { - QString s; - if( filename.isEmpty() ) - s = QFileDialog::getOpenFileName( QString::null, - my_filters, this ); - else - s = filename; - - if ( s.isEmpty() ) - return; - std::ifstream f(s); - if (!f) return; - - if(s.right(5) == ".poly") - { - clearSeeds_without_redraw(); - CGAL::read_triangle_poly_file(cdt, f, std::back_inserter(seeds)); - } - else if(s.right(5) == ".data") - { - int nx, ny, niso, use_threshold; - float threshold; - - std::ifstream ins(s); - ins >> nx >> ny >> niso >> use_threshold >> threshold; - for(int c = 0; c < niso; c++) { - float f; - ins >> f; - } - - std::vector points(nx * ny); - double xmin,xmax,ymin,ymax; - ins >> xmin >> xmax >> ymin >> ymax; - - double dx = (xmax-xmin)/(nx-1); - double dy = (ymax-ymin)/(ny-1); - - int k2=0; - for (int i2=0; i2> num_lines; - std::vector num_vertex_per_line(num_lines); - for(int n = 0; n < num_lines; n++){ - ins2 >> num_vertex_per_line[n]; - } - - CGAL::Bbox_2 b; - for(int i = 0; i < num_lines; i++){ - Point_2 p, q; - ins2 >> p; - if(i == 0){ - b = p.bbox(); - } else { - b = b + p.bbox(); - } - for(int j = 1; j < num_vertex_per_line[i]; j++){ - ins2 >> q; - cdt.insert_constraint(p, q); - p = q; - b = b + p.bbox(); - } - } - - for(unsigned int k = 0; k < points.size(); k++) - if (CGAL::do_overlap(b,points[k].bbox())) - cdt.insert(points[k]); - - xmax = b.xmax(); - xmin = b.xmin(); - ymax = b.ymax(); - ymin = b.ymin(); - - dx = (xmax - xmin)/20.0; - dy = (ymax - ymin)/20.0; - xmin -= dx; - ymin -= dy; - xmax += dx; - ymax += dy; - Point_2 bl(xmin, ymin); - Point_2 br(xmax, ymin); - Point_2 tl(xmin, ymax); - Point_2 tr(xmax, ymax); - cdt.insert_constraint(bl, br); - cdt.insert_constraint(br, tr); - cdt.insert_constraint(tr, tl); - cdt.insert_constraint(tl, bl); - - clearSeeds_without_redraw(); - } - else - { - read_constraints(cdt, f); - clearSeeds_without_redraw(); - } - - // compute bounds - FT xmin, xmax, ymin, ymax; - bounds(xmin, ymin, xmax, ymax); - - FT xspan = (xmax-xmin)/2, - yspan = (ymax-ymin)/2; - - widget->set_window(CGAL::to_double(xmin-FT(1.1)*xspan), - CGAL::to_double(xmax+FT(1.1)*xspan), - CGAL::to_double(ymin-FT(1.1)*yspan), - CGAL::to_double(ymax+FT(1.1)*yspan)); - widget->clear_history(); - - emit( insertedInput() ); - updatePointCounter(); - // widget->set_window() calls widget->redraw() - // widget->redraw(); - } - - void saveTriangulation() - { - QString s( QFileDialog::getSaveFileName( "filename.edg", - my_filters, this ) ); - if ( s.isEmpty() ) - return; - std::ofstream of(s); - if(s.right(5) == ".poly") - CGAL::write_triangle_poly_file(cdt, of, seeds.begin(), seeds.end()); - else - write_constraints(cdt, of); - } - - void dumpTriangulation(QString s=QString("dump.edg")) - { - std::ofstream of(s); - write_constraints(cdt, of); - } - - inline - void fake_slot() - { - } - - void setBound(const QString& bound) - { - criteria.set_bound(bound.toDouble()); - if( mesher != 0 ) - mesher->set_criteria(criteria); - } - - void setSizeBound(const QString& size_bound) - { - criteria.set_size_bound(size_bound.toDouble()); - if ( mesher != 0 ) - mesher->set_criteria(criteria); - } - - void setLocal(bool checked) - { - if( mesher == 0 ) - { - mesher = create_mesher(); - mesher->init(); - emit initializedMesher(); - } - if(checked == false) - { - criteria.set_local_size(false); - mesher->set_criteria(criteria); - } - if(checked) - follow_mouse->activate(); - else - follow_mouse->deactivate(); - } - - void advanced(int state) - { - if( state == 0 ) - toolBarAdvanced->hide(); - else - toolBarAdvanced->show(); - } - -private: - Mesher* create_mesher() - { - Mesher* m = new Mesher(cdt, criteria); - m->set_seeds(seeds.begin(), seeds.end()); - return m; - } - -private: - static const QString my_filters; - Criteria criteria; - Tr cdt; - Mesher* mesher; - Seeds seeds; - - Preferences* prefs; - QPopupMenu *pmCriteria; - int menu_id; - - CGAL::Qt_widget* widget; - CGAL::Qt_widget_get_point* get_point; - CGAL::Qt_widget_get_point* get_seed; - CGAL::Qt_widget_get_polygon* get_polygon; - Follow_mouse* follow_mouse; - - typedef CGAL::Show_points - Show_points_from_triangulation; - - typedef CGAL::Show_points - Show_seeds; - - typedef CGAL::Show_segments - Show_encroached_edges; - - Show_points_from_triangulation* show_points; - Show_seeds* show_seeds; - Show_encroached_edges* show_encroached_edges; - Meshing_debugging_layer* debug_layer; - Show_bad_faces* show_bad_faces; - CGAL::Qt_layer_show_triangulation* show_triangulation; - CGAL::Qt_layer_show_triangulation_constraints* show_constraints; - CGAL::Qt_layer_show_circles* show_circles; - CGAL::Qt_widget_show_mouse_coordinates* show_coordinates; - Show_in_domain_faces* show_in_domain; - - bool nb_of_clusters_has_to_be_updated; - QLabel *nb_of_clusters; - Show_clusters* show_clusters; - - QLabel *nb_of_points; - QLabel *init_status; - QLineEdit* angle_bound; - QLineEdit* size_bound; - QCheckBox* under_mouse; - QTimer* timer; - QPushButton *pbMeshTimer; - QPushButton *pbMeshStep; - QPushButton* pbShowCluster; - QPushButton* pbShowEncroachedEdges; - QPushButton* pbShowBadFaces; - QToolBar *toolBarAdvanced; - int timer_interval; - int step_length; -}; - -const QString MyWindow::my_filters = -"Constrained edges (*.edg);;" -"Shewchuk Triangle .poly files (*.poly);;" -"All files (*)"; - -int main(int argc, char** argv) -{ - QApplication app( argc, argv ); - MyWindow* W = new MyWindow(); - app.setMainWidget(W); -#if !defined (__POWERPC__) - QPixmap cgal_icon = QPixmap((const char**)demoicon_xpm); - W->setIcon(cgal_icon); -#endif - W->show(); - - if( argc == 2 ) - W->openTriangulation(QString(argv[1])); - - return app.exec(); -} - -// moc_source_file: mesh_2_demo.cpp -#include "mesh_2_demo.moc" - -// moc_source_file: Show_clusters.h -#include "Show_clusters.moc" - diff --git a/Mesh_2/demo/Mesh_2/seeds.xpm b/Mesh_2/demo/Mesh_2/seeds.xpm deleted file mode 100644 index 36601fe36d4..00000000000 --- a/Mesh_2/demo/Mesh_2/seeds.xpm +++ /dev/null @@ -1,39 +0,0 @@ -/* XPM */ -const char * seeds_xpm[] = { -"32 32 4 1", -" c None", -". c #FF0000", -"+ c #00FF00", -"@ c #000000", -" ..++++++++++++++", -" ..+++++++++++++++", -" ..++++++++++++++++", -" ..++++++++++++++++++", -" ..+++++++++++++++++++", -" ..++++++++++++++++++++", -" ..++++++++++++@++++++++", -" @ ..++++++++++++@+++++++++", -" ..++++++++++++@@++++++++++", -" ..@@++++++++++@@+++++++++++", -" ..+++@+++++++++@++++++++++++", -" ..+++++@@+++++@@+++++++++++++", -" ..++++++++@@+++@@++++++++++++++", -"..++++++++++@@+@@+++++++++++++++", -".++++++++++++@@@++++++++++++++++", -"+++++++++++++@@@++++++++++++++++", -"++++++++++++@@+@@+++++++++++++++", -"+++++++++++@@+++@@@+++++++++++++", -"++++++++++@@++++++@@++++++++++++", -"+++++++++@@++++++++@@+++++++++++", -"++++++++@@++++++++++@@++++++++++", -"+++++++@@++++++++++++@@+++++++++", -"++++++@@++++++++++++++@@++++++++", -"..+++++++++++++++++++++@@+++++++", -" .....++++++++++++++++++++++++++", -" ....+++++++++++++++++++++++", -" ....++++++++++++++++++++", -" ...+++++++++++++++++", -" ....+++++++++++++", -" ....++++++++++", -" ....+++++++", -" ....+++"};