Merge change 53094 from branches/unsorted-branches/eric/CMAKE/GraphicsView

This commit is contained in:
Laurent Rineau 2009-11-18 15:17:14 +00:00
parent a8bcb00307
commit 23131c40b5
5 changed files with 31 additions and 7 deletions

View File

@ -24,7 +24,9 @@ set( QT_USE_QTOPENGL TRUE )
find_package(Qt4)
include_directories (BEFORE ../../include)
include_directories (BEFORE ./include)
include_directories (BEFORE ../../../Triangulation_2/include)
include_directories (BEFORE ../../../Kernel_23/include)
include_directories (BEFORE ../../../Cartesian_kernel/include)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
@ -96,6 +98,9 @@ target_link_libraries( Regular_triangulation_2 ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( Regular_triangulation_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
add_executable( poly poly.cpp )
target_link_libraries( poly ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )
else()
message(STATUS "NOTICE: This demo requires CGAL and Qt4, and will not be compiled.")

View File

@ -6,7 +6,7 @@
// CGAL headers
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Constrained_Delaunay_triangulation_2.h>
#include <CGAL/Delaunay_mesher_2.h>
#include <CGAL/Delaunay_mesher_no_edge_refinement_2.h>
#include <CGAL/Delaunay_mesh_face_base_2.h>
#include <CGAL/Delaunay_mesh_size_criteria_2.h>
#include <CGAL/Lipschitz_sizing_field_2.h>
@ -102,7 +102,7 @@ typedef CGAL::Delaunay_mesh_size_criteria_2<CDT> Criteria;
typedef CGAL::Lipschitz_sizing_field_2<K> Lipschitz_sizing_field;
typedef CGAL::Lipschitz_sizing_field_criteria_2<CDT, Lipschitz_sizing_field> Lipschitz_criteria;
typedef CGAL::Delaunay_mesher_2<CDT, Lipschitz_criteria> Lipschitz_mesher;
typedef CGAL::Delaunay_mesher_no_edge_refinement_2<CDT, Lipschitz_criteria> Lipschitz_mesher;
typedef CDT::Vertex_handle Vertex_handle;
typedef CDT::Face_handle Face_handle;
@ -353,7 +353,7 @@ MainWindow::dropEvent(QDropEvent *event)
void
MainWindow::processInput(CGAL::Object o)
{
std::cerr << "Object " << o.type().name() << std::endl;
std::list<Point_2> points;
if(CGAL::assign(points, o)){
if(points.size() == 1) {
@ -612,7 +612,7 @@ MainWindow::on_actionMakeDelaunayMesh_triggered()
discoverComponents(cdt);
int nv = cdt.number_of_vertices();
CGAL::refine_Delaunay_mesh_2(cdt, Criteria(0.125, edge_length), true);
CGAL::refine_Delaunay_mesh_2_without_edge_refinement(cdt, Criteria(0.125, edge_length), true);
timer.stop();
nv = cdt.number_of_vertices() - nv;
initializeID(cdt);

View File

@ -1,7 +1,7 @@
<html>
<body>
<p><img src=":/cgal/logos/CGAL.gif"></p>
<h2>Computational Geometry Algorithms Library</h2>
<h2>Computational Geometry Algorithms Library<!--CGAL_VERSION--></h2>
<p>CGAL provides efficient and reliable geometric algorithms in the form of a C++ library.</p>
<p>For more information visit <a href="http://www.cgal.org/">www.cgal.org</a></p>
</body>

View File

@ -88,6 +88,7 @@ public:
GraphicsViewPolylineInput(QObject* parent, QGraphicsScene* s, int n = 0, bool closed = true)
: GraphicsViewPolylineInput_non_templated_base(parent, s, n, closed)
{
std::cerr << "GraphicsViewPolylineInput\n";
}
protected:
@ -98,6 +99,7 @@ protected:
if(closed_){
points.push_back(points.front());
}
std::cerr << "emit\n";
emit(generate(CGAL::make_object(points)));
}
}; // end class GraphicsViewPolylineInput

View File

@ -182,11 +182,28 @@ DemosMainWindow::popupAboutBox(QString title, QString html_resource_name)
{
QFile about_CGAL(html_resource_name);
about_CGAL.open(QIODevice::ReadOnly);
QString about_CGAL_txt = QTextStream(&about_CGAL).readAll();
#ifdef CGAL_VERSION_STR
about_CGAL_txt.replace("<!--CGAL_VERSION-->",
QString(" (version %1, svn r%2)")
.arg(CGAL_VERSION_STR).arg(CGAL_SVN_REVISION));
#endif
QMessageBox mb(QMessageBox::NoIcon,
title,
QTextStream(&about_CGAL).readAll(),
about_CGAL_txt,
QMessageBox::Ok,
this);
QLabel* mb_label = mb.findChild<QLabel*>("qt_msgbox_label");
if(mb_label) {
mb_label->setTextInteractionFlags(mb_label->textInteractionFlags() |
::Qt::LinksAccessibleByMouse |
::Qt::LinksAccessibleByKeyboard);
}
else {
std::cerr << "Cannot find child \"qt_msgbox_label\" in QMessageBox\n"
<< " with Qt version " << QT_VERSION_STR << "!\n";
}
mb.exec();
}