1 #ifndef FREESPACEVIEW_H 2 #define FREESPACEVIEW_H 14 #include <QGraphicsItemGroup> 16 namespace frechet {
namespace view {
102 void setColor(QColor areaColor, QColor borderColor=QColor());
110 void update(
double eps,
bool showBounds, QLineF bounds[4]);
113 virtual QPainterPath
shape()
const {
142 QGraphicsPolygonItem*
getPoly();
161 static void setBrushColor(QAbstractGraphicsShapeItem* item, QColor col);
165 static void setPenColor(QAbstractGraphicsShapeItem* item, QColor col);
174 static void setPenStyle(QAbstractGraphicsShapeItem* item, Qt::PenStyle style);
179 static void setPenStyleWidth(QAbstractGraphicsShapeItem* item, Qt::PenStyle style,
float width);
311 virtual void saveSettings(QSettings& settings, QString group);
377 QLineF
boundsLine(QPointF a, QPointF b,
int i,
int j);
413 #endif // FREESPACEVIEW_H base class for view widgets.
QGraphicsPolygonItem * _poly
content area may be a polygon (created on demand)
QGraphicsLineItem * _bounds[4]
boundary lines of the content area
virtual void segmentSelected(GraphicsHoverLineItem *item) override
called when the mouse hovers over a sensitve line item
void setColor(QColor areaColor, QColor borderColor=QColor())
update drawing colors
static void setPenStyle(QAbstractGraphicsShapeItem *item, Qt::PenStyle style)
update pen style (dotted,solid,...) of a graphics item
void showOptimalResult()
show the optimal result of the k-Frechet (brute-force) algorithms. Highlights all components that are...
static bool validTransform(const QTransform &tf)
validity test for a transformation. If transform parameters become excessively large,...
QPen BOUNDS_PEN
pen for bounding rectangles
bool path_ok
true, if there is a feasible path
What
display mode; what is displayed? Flags can be combined (except Poly and Ellipse).
QGraphicsPathItem * select
highlighted line segment (or nullptr)
void addGridLine(QLineF line, LineStyle style)
add a grid line to the graphics scene
static const QColor LIGHT_GRAY
used for disabled components (k-Frechet)
FreeSpaceView * parent
pointer to parent
bool _showBounds
true, if bounding rectangle are shown
virtual QPainterPath shape() const
void dropUnusedItem(QGraphicsItem **item)
release an unused item
QGraphicsEllipseItem * getEllipse()
global definitions for all algorithms.
bool useEllipse
true if an ellipse is to be shown
IntervalView * intervalView[2]
k-Frechet: show component intervals below and to the left
static void setBoundsPenColor(QGraphicsLineItem **bounds, int len, QColor col)
update pen color of several graphics item
display a clipped ellipse
void hiliteSegment(int loc, int a, int b)
raised when the mouse moves over a highlighted segment This signal triggers the display of associated...
FreeSpaceView(QWidget *parent=0)
default constructor
void populateScene()
create the grid lines and an array of CellView objects
void createReachabilityRect(int i, int j, QLineF result[4])
create a set of line segments for reachability intervals
QGraphicsItemGroup * pathView
the feasible path
void onHiliteSegment(int loc, int a, int b)
highlight a segment of the feasible path
CellView(FreeSpaceView *parent, int i, int j)
default constructor
virtual QRectF boundingRect() const
static const QColor AREA_COLOR
color for content area (except k-Frechet)
Display k-Frechet intervals, i.e. projections of connected components to the domain axes.
static const QBrush AREA_BRUSH2
brush (fill color) for content area
display the free-space diagram.
boost::shared_ptr< Matrix > MatrixPtr
pointer to an array of cell views
QGraphicsLineItem * getBounds(int i)
void setBounds(QLineF bounds[4])
update bounding rectangle
void onAlgorithmChanged(int alg)
updatee free-space diagram when a new algorithm is selected. For example, for the k-Frechet algorithm...
QPainterPath clipShape
shape used for clipping ellipses
void updateBounds()
update bounding rectangles
void createBoundsRect(int i, int j, QLineF result[4])
create a boundary rectangle for a cell
QPen PATH_PEN
pen for feasible path
QGraphicsPolygonItem * getPoly()
QPolygonF createPolygon(int i, int j, bool *thin)
create a polygon that draws the content area
void showGreedyResult()
show the result of the k-Frechet greedy algorithms. Highlights all components that are part of the so...
a QGraphicsLitem that can handle mouse hover events. It is used to highlight mouse sensitve polygon s...
int i
column index in free-space grid
virtual ~FreeSpaceView()
destructor; releases all items
display polygon plus bounding rect
QTransform createEllipseTransform(int i, int j)
compute the transformation for drawing an ellipse
void hideResult()
hide results of the k-Frechet algorithms. Remove gray-out, display all components in their original c...
static const double DET_MINIMUM
determines when a hige ellipse is replaced by two parallel lines
bool dropUnusedItems()
release graphics items that are not currently displayed
enum frechet::view::CellView::What what
QRectF cellBounds
bounding rectangle
void update(double eps, bool showBounds, QLineF bounds[4])
update display
virtual void dropUnusedItems() override
release graphics items that are currently not drawn implements empty method from super-class
static void setPenStyleWidth(QAbstractGraphicsShapeItem *item, Qt::PenStyle style, float width)
update pen style and pen width of a graphics item
QPen AREA_PEN
pen for content area
QLineF boundsLine(QPointF a, QPointF b, int i, int j)
calculates one boundary line
void curveFinished(bool yes)
raised when after decision variant of the curve algorithm
A simple two-dimensional array of fixed size.
virtual void restoreSettings(QSettings &settings, QString group)
load settings from application preferences
void dodraw(What what)
update content
static const double TF_MAX_ARG
max. value for affine transforms
CellView * getCellView(int i, int j)
get a free-space cell view
virtual ~CellView()
destructor
display ellipse plus bounding rect
virtual void saveSettings(QSettings &settings, QString group)
store settings to application preferences
static void setBrushColor(QAbstractGraphicsShapeItem *item, QColor col)
update brush (fill) color of a graphics item
A simple bit vector of fixed size.
displays one cell of the free-space diagram.
empty cell. display nothing
LineStyle
display style of grid lines in free-space diagram
void showPath(bool show)
show or hide feasible path
static const double MAX_DIAMETER
what's this?
static bool validTransformArg(double x)
validity test for a transformation
static void setPenColor(QAbstractGraphicsShapeItem *item, QColor col)
update pen (edge) color of a graphics item
int j
row index in free-space grid
data::Array2D< CellView * > Matrix
an array of cell views
void updateIntervals()
update component intervals (k-Frechet only)
CellView::MatrixPtr cells
free space areas for all cells (i,j)
static const QBrush AREA_BRUSH1
brush (fill color) for content area
QGraphicsEllipseItem * _ellipse
void doHiliteSegment(GraphicsHoverLineItem::Location loc, int a, int b)
highlight a line segment
Location
location of the polygon segment
void hilitePoint(QPointF p)
hilite on point inf the diagram (used for animation only)
void updateView(double eps)
update free-space view in response to a change of epsilon
void showResult(const data::BitSet *resultSet)
show the result of a k-Frechet algorithm
void calculateFreeSpace(double epsilon)
update free-space diagram when epsilon changes. If the curve algorithm is selected,...