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 )
|
||||
|
||||
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_BINARY_DIR})
|
||||
|
|
@ -33,7 +33,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND )
|
|||
|
||||
# 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} )
|
||||
qt5_use_modules(boolean_operations_2 Widgets Script)
|
||||
qt5_use_modules(boolean_operations_2 Widgets Script Svg)
|
||||
# Link with Qt libraries
|
||||
target_link_libraries( boolean_operations_2 ${QT_LIBRARIES} )
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,6 @@ MainWindow::MainWindow()
|
|||
QObject::connect(this, SIGNAL(changed()),
|
||||
pgi, SLOT(modelChanged()));
|
||||
|
||||
pgi->setVerticesPen(QPen(Qt::red, 3, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||
scene.addItem(pgi);
|
||||
|
||||
kgongi = new CGAL::Qt::PolygonGraphicsItem<Polygon2>(&kgon);
|
||||
|
|
|
|||
|
|
@ -123,8 +123,8 @@ MainWindow::MainWindow()
|
|||
QColor segmentColor(::Qt::blue);
|
||||
QColor voronoiColor(::Qt::black);
|
||||
segmentColor.setAlpha(150);
|
||||
sdggi->setSegmentPen(segmentColor);
|
||||
sdggi->setVoronoiPen(voronoiColor);
|
||||
sdggi->setSegmentPen(QPen(segmentColor,0));
|
||||
sdggi->setVoronoiPen(QPen(voronoiColor,0));
|
||||
|
||||
QObject::connect(this, SIGNAL(changed()),
|
||||
sdggi, SLOT(modelChanged()));
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<author>GeometryFactory</author>
|
||||
<class>Segment_voronoi_2</class>
|
||||
|
|
@ -64,7 +65,6 @@
|
|||
</attribute>
|
||||
<addaction name="actionInsertPolyline"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionShowConstraints" />
|
||||
<addaction name="actionShowVoronoi"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionRecenter"/>
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>19</height>
|
||||
<height>26</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
|
|
@ -101,7 +101,6 @@
|
|||
<addaction name="actionInsertPolyline"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionShowVoronoi"/>
|
||||
<addaction name="actionShowConstraints" />
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionRecenter"/>
|
||||
</widget>
|
||||
|
|
@ -127,7 +126,6 @@
|
|||
<string>Ctrl+Q</string>
|
||||
</property>
|
||||
</action>
|
||||
|
||||
<action name="actionInsertPolyline">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
|
|
@ -182,7 +180,6 @@
|
|||
<bool>false</bool>
|
||||
</property>
|
||||
</action>
|
||||
|
||||
<action name="actionLoadSegments">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons/File.qrc">
|
||||
|
|
@ -207,7 +204,6 @@
|
|||
<string>Ctrl+S</string>
|
||||
</property>
|
||||
</action>
|
||||
|
||||
<action name="actionRecenter">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons/Input.qrc">
|
||||
|
|
@ -220,7 +216,6 @@
|
|||
<string>Ctrl+R</string>
|
||||
</property>
|
||||
</action>
|
||||
|
||||
<action name="actionShowConstraints">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
|
|
@ -236,7 +231,6 @@
|
|||
<string>Ctrl+C</string>
|
||||
</property>
|
||||
</action>
|
||||
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="Segment_voronoi_2.qrc"/>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<html>
|
||||
<body>
|
||||
<h2>Constrained Delaunay Triangulation</h2>
|
||||
<h2>2D Segment Voronoi Diagram</h2>
|
||||
<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>
|
||||
<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>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -131,8 +131,8 @@ MainWindow::MainWindow()
|
|||
QColor segmentColor(::Qt::blue);
|
||||
QColor voronoiColor(::Qt::black);
|
||||
segmentColor.setAlpha(150);
|
||||
sdggi->setSegmentPen(segmentColor);
|
||||
sdggi->setVoronoiPen(voronoiColor);
|
||||
sdggi->setSegmentPen(QPen(segmentColor,0));
|
||||
sdggi->setVoronoiPen(QPen(voronoiColor,0));
|
||||
|
||||
QObject::connect(this, SIGNAL(changed()),
|
||||
sdggi, SLOT(modelChanged()));
|
||||
|
|
|
|||
|
|
@ -271,9 +271,9 @@ qDebug()<<"setting des Pens";
|
|||
dgi->setVerticesPen(
|
||||
QPen(Qt::red, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||
dgi->setVoronoiPen(
|
||||
QPen(Qt::darkGreen, 2, Qt::DashLine, Qt::RoundCap, Qt::RoundJoin));
|
||||
QPen(Qt::darkGreen, 0, Qt::DashLine, Qt::RoundCap, Qt::RoundJoin));
|
||||
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);
|
||||
scene.addItem(dgi);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ TriangulationPointInputAndConflictZone<T>::mousePressEvent(QGraphicsSceneMouseEv
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
QPen blackPen(::Qt::black, 0, ::Qt::SolidLine, ::Qt::RoundCap, ::Qt::RoundJoin);
|
||||
dt->find_conflicts(p, faces);
|
||||
for(typename std::list<Face_handle>::iterator it = faces.begin();
|
||||
it != faces.end();
|
||||
|
|
@ -71,6 +71,7 @@ TriangulationPointInputAndConflictZone<T>::mousePressEvent(QGraphicsSceneMouseEv
|
|||
QColor color(::Qt::blue);
|
||||
color.setAlpha(150);
|
||||
item->setBrush(color);
|
||||
item->setPen(blackPen);
|
||||
scene_->addItem(item);
|
||||
qfaces.push_back(item);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ PolygonGraphicsItem<P>::PolygonGraphicsItem(P * p_)
|
|||
draw_edges(true), draw_vertices(true)
|
||||
{
|
||||
setVerticesPen(QPen(::Qt::red, 3.));
|
||||
setEdgesPen(QPen(::Qt::black, 0));
|
||||
updateBoundingBox();
|
||||
setZValue(3);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,8 +55,8 @@ class SegmentDelaunayGraphGraphicsItem : public GraphicsItem
|
|||
public:
|
||||
SegmentDelaunayGraphGraphicsItem(T * t_)
|
||||
: t(t_), painterostream(0),
|
||||
segment_pen(::Qt::blue),
|
||||
voronoi_pen(::Qt::blue)
|
||||
segment_pen(::Qt::blue, 0),
|
||||
voronoi_pen(::Qt::blue, 0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ TriangulationGraphicsItem<T>::TriangulationGraphicsItem(T * t_)
|
|||
visible_edges(true), visible_vertices(true)
|
||||
{
|
||||
setVerticesPen(QPen(::Qt::red, 4.));
|
||||
setEdgesPen(QPen(::Qt::black, 0, ::Qt::SolidLine, ::Qt::RoundCap, ::Qt::RoundJoin));
|
||||
if(t->number_of_vertices() == 0){
|
||||
this->hide();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue