5 #include <QAbstractGraphicsShapeItem> 8 namespace frechet {
namespace view {
45 virtual void saveSettings(QSettings& settings, QString group);
182 #endif // CURVEVIEW_H base class for view widgets.
Represents a polygon line segment from node i to j.
QGraphicsItemGroup * addPolygonToScene(const Curve &poly, QPen pen, GraphicsHoverLineItem::Location hover)
add a polygon curve to the graphics scene
void onAlgorithmChanged(int alg)
called when the user changes the current algorithm. Update the curve display accordingly (e....
QGraphicsItemGroup * polygon_b
graphics items for (boundary of) curve Q
bool separateCurves() const
QGraphicsLineItem * createLineItem(QLineF line, QPen pen, frechet::poly::Segment seg, QGraphicsItemGroup *group, GraphicsHoverLineItem::Location hover)
create a line segment graphics item
global definitions for all algorithms.
static const QPen PEN_PASSIVE_DIAGS
std::set< Segment > Segments
a set of Segment objects
void hiliteSegment(int loc, int a, int b)
raised when a mouse sensitive line segment is highlighted. Parameters identify the location of the li...
void populateScene(const Curve &P, const Curve &Q, frechet::poly::Algorithm::ptr alg)
set up the graphics scene with polygonal curves
void setSeparateCurves(bool sep)
update the display to show curves separately, or not
boost::shared_ptr< Algorithm > ptr
(smart) pointer to an Algorithm object
displays input curves P and Q.
virtual void restoreSettings(QSettings &settings, QString group)
load settings from application preferences
static const QPen PEN_T_DIAGS
pen for drawing the t-diagonals in P
QGraphicsItemGroup * diagonals_b
std::pair< Edge_iterator, Edge_iterator > Edge_range
a range of edges
static const QPen PEN_A
pen for drawing the curve P
CurveView(QWidget *parent=0)
default constructor with parent
a QGraphicsLitem that can handle mouse hover events. It is used to highlight mouse sensitve polygon s...
static const QPen PEN_C_DIAGS
pen for drawing the c-diagonals in P
virtual void saveSettings(QSettings &settings, QString group)
store settings to application preferences
static const QPen PEN_B
pen for drawing the curve Q
QGraphicsItemGroup * addSegmentsToScene(QGraphicsItemGroup *group, frechet::poly::Triangulation::Edge_range d, const frechet::poly::Segments &exclude, bool with_edges, QPen pen, GraphicsHoverLineItem::Location hover)
add a number of line segments to the graphics scene
static const double SEPARATOR
distance when curves are displayed separately
QPolygonF Curve
a polygonal curve in the plane; with double floating point precision. This type is heavily used throu...
QRectF polygon_bounds
boundary rectangle for both curves
void onHiliteSegment(int loc, int a, int b)
called when a line segment should be highlighted
QGraphicsItemGroup * diagonals_a
graphics items for diagonals of curve P
QGraphicsItemGroup * polygon_a
graphics items for (boundary of) curve P
void doHiliteSegment(GraphicsHoverLineItem::Location loc, int a, int b)
highlight a line segment
bool _separate
draw curves separately?
QGraphicsPathItem * select_a
highlited items for curve P
virtual void segmentSelected(GraphicsHoverLineItem *item) override
called when the mouse hovers over a sensitive line segment. Updates the corresponding line segments.
Location
location of the polygon segment
QGraphicsPathItem * select_b
highlited items for curve Q