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

Detailed Description

a QGraphicsLitem that can handle mouse hover events. It is used to highlight mouse sensitve polygon segments.

Each line segment has a "logical" identifier within a polygonal curve, or feasible paht.

Definition at line 239 of file baseview.h.

#include <baseview.h>

Inherits QGraphicsLineItem.

Public Types

enum  Location {
  None, P, Q, Pdiag,
  Qdiag, FS
}
 location of the polygon segment More...
 

Public Member Functions

 GraphicsHoverLineItem (QLineF line, Location loc, int a, int b, QGraphicsItemGroup *group)
 default constructor More...
 
void update (int a, int b)
 update identifiers More...
 
bool is_close_to (QPointF scene_pos, int distance) const
 check if the mouse is close to the line segment More...
 

Public Attributes

const Location loc
 location on screen More...
 
const int a
 parameters loc,a, and b identify a segment. More...
 
const int b
 

Member Enumeration Documentation

◆ Location

location of the polygon segment

Enumerator
None 

used for segments that are not mouse sensitive

a boundary segment of P

a boundary segment of Q

Pdiag 

a diagonal of P

Qdiag 

a diagonal of Q

FS 

a segment of the feasible paht (displayed in the free-space diagram)

Definition at line 243 of file baseview.h.

Constructor & Destructor Documentation

◆ GraphicsHoverLineItem()

GraphicsHoverLineItem::GraphicsHoverLineItem ( QLineF  line,
Location  loc,
int  a,
int  b,
QGraphicsItemGroup *  group 
)

default constructor

Parameters
linea line
loclocation on screen
asegment identifier
bsegment identifier
groupgroup to add to

Definition at line 661 of file baseview.cpp.

Member Function Documentation

◆ is_close_to()

bool GraphicsHoverLineItem::is_close_to ( QPointF  scene_pos,
int  distance 
) const

check if the mouse is close to the line segment

Parameters
scene_posmouse position in scene coordinates
distancemax. distance to accept as hover
Returns
true if the mouse is close to the line segment

Definition at line 674 of file baseview.cpp.

◆ update()

void GraphicsHoverLineItem::update ( int  a,
int  b 
)

update identifiers

Definition at line 669 of file baseview.cpp.

Member Data Documentation

◆ a

const int frechet::view::GraphicsHoverLineItem::a

parameters loc,a, and b identify a segment.

  • loc==P,Q,Pdiag,Qdiag: a,b are vertex indexes into P,Q.
  • loc==FS: a is an index into the feasible path.

Definition at line 257 of file baseview.h.

◆ b

const int frechet::view::GraphicsHoverLineItem::b

Definition at line 257 of file baseview.h.

◆ loc

const Location frechet::view::GraphicsHoverLineItem::loc

location on screen

Definition at line 251 of file baseview.h.


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