Fréchet View  1.6.0
A Tool for Exploring Fréchet Distance Algorithms
frechet::view::IntervalView Class Reference

Detailed Description

Display k-Frechet intervals, i.e. projections of connected components to the domain axes.

Overlapping intervals are stacked.

Author
Peter Schäfer

Definition at line 33 of file intervalview.h.

#include <intervalview.h>

Inherits QGraphicsItemGroup.

Public Types

enum  Orientation { HORIZONTAL, VERTICAL }
 orientation: horizontal or vertical More...
 

Public Member Functions

 IntervalView (Grid::ptr grid, Orientation orient, Palette *palette, double pen_width, QGraphicsItem *parent=0)
 constructor More...
 
void clear ()
 remove all intervals More...
 
void add (const Interval &ival, size_t component)
 add an interval More...
 
void add (const k::MappedInterval &mval)
 add an interval More...
 
void addAll (const k::IntervalMap &mvals)
 add a set of intervals More...
 
void showResult (const frechet::data::BitSet *resultSet)
 highlight result set of a k-Frechet algorithm. All intervals that are not part of the result set are grayed. More...
 
double extent () const
 

Public Attributes

enum frechet::view::IntervalView::Orientation orientation
 
double ROW_HEIGHT
 height of a row More...
 

Private Types

typedef boost::icl::interval_set< double > boost_ivalset
 set of intervals More...
 
typedef boost::icl::continuous_interval< double > boost_ival
 what's this? More...
 

Private Member Functions

QLineF insert (const boost_ival &ival)
 insert an interval More...
 
int findRow (const boost_ival &ival)
 place a new interval in a free space More...
 
QGraphicsLineItem * createItem ()
 create a line item More...
 
void releaseItem (QGraphicsItem *)
 release item More...
 
void setItemColor (QGraphicsLineItem *item, QColor col)
 update ttem color More...
 

Private Attributes

Grid::ptr grid
 coordinate grid More...
 
std::vector< boost_ivalsetstack
 stack of intervals More...
 
int stack_watermark
 stack watermark More...
 
Palettepalette
 color palette More...
 
QQueue< QGraphicsLineItem * > itemPool
 pool of unused QGraphicsItems More...
 
QPen LINE_PEN
 pen for drawing lines More...
 

Member Typedef Documentation

◆ boost_ival

typedef boost::icl::continuous_interval<double> frechet::view::IntervalView::boost_ival
private

what's this?

Definition at line 45 of file intervalview.h.

◆ boost_ivalset

typedef boost::icl::interval_set<double> frechet::view::IntervalView::boost_ivalset
private

set of intervals

Definition at line 43 of file intervalview.h.

Member Enumeration Documentation

◆ Orientation

orientation: horizontal or vertical

Enumerator
HORIZONTAL 
VERTICAL 

Definition at line 37 of file intervalview.h.

Constructor & Destructor Documentation

◆ IntervalView()

IntervalView::IntervalView ( Grid::ptr  grid,
Orientation  orient,
Palette palette,
double  pen_width,
QGraphicsItem *  parent = 0 
)

constructor

Parameters
gridfree-space grid
orientorientation of intervals (horizonral or vertical)
palettea color palette
pen_widthpen width
parentparent item

Definition at line 15 of file intervalview.cpp.

Member Function Documentation

◆ add() [1/2]

void IntervalView::add ( const Interval ival,
size_t  component 
)

add an interval

Parameters
ivalinterval
componentassociated component; determines color

Definition at line 53 of file intervalview.cpp.

◆ add() [2/2]

void frechet::view::IntervalView::add ( const k::MappedInterval mval)

add an interval

Parameters
mvalan interval and a component ID

◆ addAll()

void IntervalView::addAll ( const k::IntervalMap mvals)

add a set of intervals

Parameters
mvalsa set of intervals and associated component IDs

Definition at line 80 of file intervalview.cpp.

◆ clear()

void IntervalView::clear ( )

remove all intervals

Definition at line 30 of file intervalview.cpp.

◆ createItem()

QGraphicsLineItem * IntervalView::createItem ( )
private

create a line item

Returns
new item

Definition at line 37 of file intervalview.cpp.

◆ extent()

double frechet::view::IntervalView::extent ( ) const
inline
Returns
width/height that is needed to display the stack of intervals

Definition at line 104 of file intervalview.h.

◆ findRow()

int IntervalView::findRow ( const boost_ival ival)
private

place a new interval in a free space

Parameters
ivalinterval
Returns
stack row

Definition at line 121 of file intervalview.cpp.

◆ insert()

QLineF IntervalView::insert ( const boost_ival ival)
private

insert an interval

Parameters
ivalinterval
Returns
line that represents the interval

Definition at line 107 of file intervalview.cpp.

◆ releaseItem()

void IntervalView::releaseItem ( QGraphicsItem *  item)
private

release item

Definition at line 45 of file intervalview.cpp.

◆ setItemColor()

void IntervalView::setItemColor ( QGraphicsLineItem *  item,
QColor  col 
)
private

update ttem color

Parameters
itema line item
colnew color

Definition at line 88 of file intervalview.cpp.

◆ showResult()

void IntervalView::showResult ( const frechet::data::BitSet resultSet)

highlight result set of a k-Frechet algorithm. All intervals that are not part of the result set are grayed.

Parameters
resultSetset of component IDs.

Definition at line 95 of file intervalview.cpp.

Member Data Documentation

◆ grid

Grid::ptr frechet::view::IntervalView::grid
private

coordinate grid

Definition at line 48 of file intervalview.h.

◆ itemPool

QQueue<QGraphicsLineItem*> frechet::view::IntervalView::itemPool
private

pool of unused QGraphicsItems

Definition at line 56 of file intervalview.h.

◆ LINE_PEN

QPen frechet::view::IntervalView::LINE_PEN
private

pen for drawing lines

Definition at line 58 of file intervalview.h.

◆ orientation

enum frechet::view::IntervalView::Orientation frechet::view::IntervalView::orientation

◆ palette

Palette* frechet::view::IntervalView::palette
private

color palette

Definition at line 54 of file intervalview.h.

◆ ROW_HEIGHT

double frechet::view::IntervalView::ROW_HEIGHT

height of a row

Definition at line 39 of file intervalview.h.

◆ stack

std::vector<boost_ivalset> frechet::view::IntervalView::stack
private

stack of intervals

Definition at line 50 of file intervalview.h.

◆ stack_watermark

int frechet::view::IntervalView::stack_watermark
private

stack watermark

Definition at line 52 of file intervalview.h.


The documentation for this class was generated from the following files: