Image Component Library (ICL)
|
Special MouseHandler Implementation that allows for defining a quadrangle. More...
#include <DefineQuadrangleMouseHandler.h>
Public Member Functions | |
DefineQuadrangleMouseHandler () | |
empty constructor (creates a null handler) More... | |
DefineQuadrangleMouseHandler (const utils::Size &maxSize, bool convexOnly=true) | |
constructor with given max size More... | |
virtual void | process (const qt::MouseEvent &e) |
MouseHandler interface. More... | |
virtual | ~DefineQuadrangleMouseHandler () |
destructor More... | |
void | init (const utils::Size &maxSize, bool convexOnly=true) |
deferred intialization method More... | |
void | setOffset (const utils::Point &p) |
sets an offset that shifts both in- and outputs More... | |
void | setHandleSize (float size) |
sets the size of the handles More... | |
std::vector< utils::Point > | getQuadrangle () const |
returns the current quadrangle More... | |
void | setQuadrangle (const utils::Point ps[4]) |
sets the current quadrangle More... | |
bool | isNull () const |
returns whether this mousehandler has been initialized yet More... | |
utils::VisualizationDescription | vis () const |
returns a visualization More... | |
Public Member Functions inherited from icl::qt::MouseHandler | |
MouseHandler (mouse_handler handler) | |
Create a mouse handler with given callback function. More... | |
Public Member Functions inherited from icl::utils::Lockable | |
Lockable (bool recursive=false) | |
Default constructor. More... | |
Lockable (const Lockable &l) | |
copy constructor (does not copy the source mutex) More... | |
Lockable & | operator= (const Lockable &l) |
assignment operator (does not copy the source mutex) More... | |
~Lockable () | |
Destructor. More... | |
void | lock () const |
lock object More... | |
void | unlock () const |
unlock object More... | |
Mutex & | getMutex () const |
returns mutex of this object More... | |
Private Attributes | |
Data * | m_data |
pimpl type More... | |
Additional Inherited Members | |
Public Types inherited from icl::qt::MouseHandler | |
typedef void(* | mouse_handler) (const MouseEvent &event) |
mouse_handler function type More... | |
Public Slots inherited from icl::qt::MouseHandler | |
void | handleEvent (const MouseEvent &event) |
connected to the ICLWidget's signal mouseEventOccured More... | |
Protected Member Functions inherited from icl::qt::MouseHandler | |
MouseHandler () | |
This constructor can be called from derived classes. More... | |
Protected Member Functions inherited from icl::utils::Uncopyable | |
Uncopyable () | |
Empty base constructor. More... | |
Special MouseHandler Implementation that allows for defining a quadrangle.
The resulting quadrangle (defined by it's four corners points) can be restricted to be always convex. The quadrangle is initialized as a rectangle that is 20 px smaller than the given max-size rectangle.
icl::qt::DefineQuadrangleMouseHandler::DefineQuadrangleMouseHandler | ( | ) |
empty constructor (creates a null handler)
icl::qt::DefineQuadrangleMouseHandler::DefineQuadrangleMouseHandler | ( | const utils::Size & | maxSize, |
bool | convexOnly = true |
||
) |
constructor with given max size
The maxSize must be identical to the image the mousehandler is used as a overlay with. Convex means that the quadrangle is convex and that its opposing edges do not intersect
|
virtual |
destructor
std::vector<utils::Point> icl::qt::DefineQuadrangleMouseHandler::getQuadrangle | ( | ) | const |
returns the current quadrangle
void icl::qt::DefineQuadrangleMouseHandler::init | ( | const utils::Size & | maxSize, |
bool | convexOnly = true |
||
) |
deferred intialization method
|
inline |
returns whether this mousehandler has been initialized yet
|
virtual |
MouseHandler interface.
Reimplemented from icl::qt::MouseHandler.
void icl::qt::DefineQuadrangleMouseHandler::setHandleSize | ( | float | size | ) |
sets the size of the handles
void icl::qt::DefineQuadrangleMouseHandler::setOffset | ( | const utils::Point & | p | ) |
sets an offset that shifts both in- and outputs
void icl::qt::DefineQuadrangleMouseHandler::setQuadrangle | ( | const utils::Point | ps[4] | ) |
sets the current quadrangle
If the given quadrangle is not completely covered by the image rect, or the convexOnly flag is activated and the given quadrangle is not convex, an exception is thrown
utils::VisualizationDescription icl::qt::DefineQuadrangleMouseHandler::vis | ( | ) | const |
returns a visualization
|
private |
pimpl type
pimpl pointer