mirror of https://github.com/CGAL/cgal
fix line width in demos using GraphicsView
This commit is contained in:
parent
cb479491d5
commit
f864b0a8e8
|
|
@ -14,7 +14,7 @@ include(${CGAL_USE_FILE})
|
||||||
|
|
||||||
set( QT_USE_QTMAIN TRUE )
|
set( QT_USE_QTMAIN TRUE )
|
||||||
|
|
||||||
find_package(Qt5 QUIET COMPONENTS Widgets Script)
|
find_package(Qt5 QUIET COMPONENTS Widgets Script Svg)
|
||||||
|
|
||||||
include_directories (BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../include )
|
include_directories (BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../include )
|
||||||
include_directories (BEFORE ${CMAKE_CURRENT_BINARY_DIR})
|
include_directories (BEFORE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
@ -33,7 +33,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND )
|
||||||
|
|
||||||
# The executable itself.
|
# The executable itself.
|
||||||
add_executable ( boolean_operations_2 ${CMAKE_CURRENT_SOURCE_DIR}/boolean_operations_2.cpp boolean_operations_2.moc ${CDT_UI_FILES} ${CDT_RESOURCE_FILES} )
|
add_executable ( boolean_operations_2 ${CMAKE_CURRENT_SOURCE_DIR}/boolean_operations_2.cpp boolean_operations_2.moc ${CDT_UI_FILES} ${CDT_RESOURCE_FILES} )
|
||||||
qt5_use_modules(boolean_operations_2 Widgets Script)
|
qt5_use_modules(boolean_operations_2 Widgets Script Svg)
|
||||||
# Link with Qt libraries
|
# Link with Qt libraries
|
||||||
target_link_libraries( boolean_operations_2 ${QT_LIBRARIES} )
|
target_link_libraries( boolean_operations_2 ${QT_LIBRARIES} )
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,6 @@ MainWindow::MainWindow()
|
||||||
QObject::connect(this, SIGNAL(changed()),
|
QObject::connect(this, SIGNAL(changed()),
|
||||||
pgi, SLOT(modelChanged()));
|
pgi, SLOT(modelChanged()));
|
||||||
|
|
||||||
pgi->setVerticesPen(QPen(Qt::red, 3, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
|
||||||
scene.addItem(pgi);
|
scene.addItem(pgi);
|
||||||
|
|
||||||
kgongi = new CGAL::Qt::PolygonGraphicsItem<Polygon2>(&kgon);
|
kgongi = new CGAL::Qt::PolygonGraphicsItem<Polygon2>(&kgon);
|
||||||
|
|
|
||||||
|
|
@ -123,8 +123,8 @@ MainWindow::MainWindow()
|
||||||
QColor segmentColor(::Qt::blue);
|
QColor segmentColor(::Qt::blue);
|
||||||
QColor voronoiColor(::Qt::black);
|
QColor voronoiColor(::Qt::black);
|
||||||
segmentColor.setAlpha(150);
|
segmentColor.setAlpha(150);
|
||||||
sdggi->setSegmentPen(segmentColor);
|
sdggi->setSegmentPen(QPen(segmentColor,0));
|
||||||
sdggi->setVoronoiPen(voronoiColor);
|
sdggi->setVoronoiPen(QPen(voronoiColor,0));
|
||||||
|
|
||||||
QObject::connect(this, SIGNAL(changed()),
|
QObject::connect(this, SIGNAL(changed()),
|
||||||
sdggi, SLOT(modelChanged()));
|
sdggi, SLOT(modelChanged()));
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<author>GeometryFactory</author>
|
<author>GeometryFactory</author>
|
||||||
<class>Segment_voronoi_2</class>
|
<class>Segment_voronoi_2</class>
|
||||||
|
|
@ -64,7 +65,6 @@
|
||||||
</attribute>
|
</attribute>
|
||||||
<addaction name="actionInsertPolyline"/>
|
<addaction name="actionInsertPolyline"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionShowConstraints" />
|
|
||||||
<addaction name="actionShowVoronoi"/>
|
<addaction name="actionShowVoronoi"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionRecenter"/>
|
<addaction name="actionRecenter"/>
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>800</width>
|
||||||
<height>19</height>
|
<height>26</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuFile">
|
<widget class="QMenu" name="menuFile">
|
||||||
|
|
@ -101,7 +101,6 @@
|
||||||
<addaction name="actionInsertPolyline"/>
|
<addaction name="actionInsertPolyline"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionShowVoronoi"/>
|
<addaction name="actionShowVoronoi"/>
|
||||||
<addaction name="actionShowConstraints" />
|
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionRecenter"/>
|
<addaction name="actionRecenter"/>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
@ -127,7 +126,6 @@
|
||||||
<string>Ctrl+Q</string>
|
<string>Ctrl+Q</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
<action name="actionInsertPolyline">
|
<action name="actionInsertPolyline">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
|
@ -182,7 +180,6 @@
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
<action name="actionLoadSegments">
|
<action name="actionLoadSegments">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../icons/File.qrc">
|
<iconset resource="../icons/File.qrc">
|
||||||
|
|
@ -207,7 +204,6 @@
|
||||||
<string>Ctrl+S</string>
|
<string>Ctrl+S</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
<action name="actionRecenter">
|
<action name="actionRecenter">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../icons/Input.qrc">
|
<iconset resource="../icons/Input.qrc">
|
||||||
|
|
@ -220,7 +216,6 @@
|
||||||
<string>Ctrl+R</string>
|
<string>Ctrl+R</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
<action name="actionShowConstraints">
|
<action name="actionShowConstraints">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
|
@ -236,7 +231,6 @@
|
||||||
<string>Ctrl+C</string>
|
<string>Ctrl+C</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="Segment_voronoi_2.qrc"/>
|
<include location="Segment_voronoi_2.qrc"/>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<h2>Constrained Delaunay Triangulation</h2>
|
<h2>2D Segment Voronoi Diagram</h2>
|
||||||
<p>Copyright © 2008 GeometryFactory</p>
|
<p>Copyright © 2008 GeometryFactory</p>
|
||||||
<p>This application illustrates the 2D Constrained Delaunay
|
<p>This application illustrates the 2D segment Voronoi diagram
|
||||||
of <a href="http://www.cgal.org/">CGAL</a>.</p>
|
of <a href="http://www.cgal.org/">CGAL</a>.</p>
|
||||||
<p>See also <a href="http://www.cgal.org/Pkg/Triangulation2">the online
|
<p>See also <a href="http://www.cgal.org/Pkg/SegmentDelaunayGraph2">the online
|
||||||
manual</a>.</p>
|
manual</a>.</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -131,8 +131,8 @@ MainWindow::MainWindow()
|
||||||
QColor segmentColor(::Qt::blue);
|
QColor segmentColor(::Qt::blue);
|
||||||
QColor voronoiColor(::Qt::black);
|
QColor voronoiColor(::Qt::black);
|
||||||
segmentColor.setAlpha(150);
|
segmentColor.setAlpha(150);
|
||||||
sdggi->setSegmentPen(segmentColor);
|
sdggi->setSegmentPen(QPen(segmentColor,0));
|
||||||
sdggi->setVoronoiPen(voronoiColor);
|
sdggi->setVoronoiPen(QPen(voronoiColor,0));
|
||||||
|
|
||||||
QObject::connect(this, SIGNAL(changed()),
|
QObject::connect(this, SIGNAL(changed()),
|
||||||
sdggi, SLOT(modelChanged()));
|
sdggi, SLOT(modelChanged()));
|
||||||
|
|
|
||||||
|
|
@ -271,9 +271,9 @@ qDebug()<<"setting des Pens";
|
||||||
dgi->setVerticesPen(
|
dgi->setVerticesPen(
|
||||||
QPen(Qt::red, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
QPen(Qt::red, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
dgi->setVoronoiPen(
|
dgi->setVoronoiPen(
|
||||||
QPen(Qt::darkGreen, 2, Qt::DashLine, Qt::RoundCap, Qt::RoundJoin));
|
QPen(Qt::darkGreen, 0, Qt::DashLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
dgi->setSeedsPen(
|
dgi->setSeedsPen(
|
||||||
QPen(Qt::darkBlue, 5, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
QPen(Qt::darkBlue, 0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
|
|
||||||
dgi->setZValue(-1);
|
dgi->setZValue(-1);
|
||||||
scene.addItem(dgi);
|
scene.addItem(dgi);
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ TriangulationPointInputAndConflictZone<T>::mousePressEvent(QGraphicsSceneMouseEv
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPen blackPen(::Qt::black, 0, ::Qt::SolidLine, ::Qt::RoundCap, ::Qt::RoundJoin);
|
||||||
dt->find_conflicts(p, faces);
|
dt->find_conflicts(p, faces);
|
||||||
for(typename std::list<Face_handle>::iterator it = faces.begin();
|
for(typename std::list<Face_handle>::iterator it = faces.begin();
|
||||||
it != faces.end();
|
it != faces.end();
|
||||||
|
|
@ -71,6 +71,7 @@ TriangulationPointInputAndConflictZone<T>::mousePressEvent(QGraphicsSceneMouseEv
|
||||||
QColor color(::Qt::blue);
|
QColor color(::Qt::blue);
|
||||||
color.setAlpha(150);
|
color.setAlpha(150);
|
||||||
item->setBrush(color);
|
item->setBrush(color);
|
||||||
|
item->setPen(blackPen);
|
||||||
scene_->addItem(item);
|
scene_->addItem(item);
|
||||||
qfaces.push_back(item);
|
qfaces.push_back(item);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,7 @@ PolygonGraphicsItem<P>::PolygonGraphicsItem(P * p_)
|
||||||
draw_edges(true), draw_vertices(true)
|
draw_edges(true), draw_vertices(true)
|
||||||
{
|
{
|
||||||
setVerticesPen(QPen(::Qt::red, 3.));
|
setVerticesPen(QPen(::Qt::red, 3.));
|
||||||
|
setEdgesPen(QPen(::Qt::black, 0));
|
||||||
updateBoundingBox();
|
updateBoundingBox();
|
||||||
setZValue(3);
|
setZValue(3);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,8 +55,8 @@ class SegmentDelaunayGraphGraphicsItem : public GraphicsItem
|
||||||
public:
|
public:
|
||||||
SegmentDelaunayGraphGraphicsItem(T * t_)
|
SegmentDelaunayGraphGraphicsItem(T * t_)
|
||||||
: t(t_), painterostream(0),
|
: t(t_), painterostream(0),
|
||||||
segment_pen(::Qt::blue),
|
segment_pen(::Qt::blue, 0),
|
||||||
voronoi_pen(::Qt::blue)
|
voronoi_pen(::Qt::blue, 0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,7 @@ TriangulationGraphicsItem<T>::TriangulationGraphicsItem(T * t_)
|
||||||
visible_edges(true), visible_vertices(true)
|
visible_edges(true), visible_vertices(true)
|
||||||
{
|
{
|
||||||
setVerticesPen(QPen(::Qt::red, 4.));
|
setVerticesPen(QPen(::Qt::red, 4.));
|
||||||
|
setEdgesPen(QPen(::Qt::black, 0, ::Qt::SolidLine, ::Qt::RoundCap, ::Qt::RoundJoin));
|
||||||
if(t->number_of_vertices() == 0){
|
if(t->number_of_vertices() == 0){
|
||||||
this->hide();
|
this->hide();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue