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) | |
DefineQuadrangleMouseHandler (const utils::Size &maxSize, bool convexOnly=true) | |
constructor with given max size | |
virtual void | process (const qt::MouseEvent &e) |
MouseHandler interface. | |
virtual | ~DefineQuadrangleMouseHandler () |
destructor | |
void | init (const utils::Size &maxSize, bool convexOnly=true) |
deferred intialization method | |
void | setOffset (const utils::Point &p) |
sets an offset that shifts both in- and outputs | |
void | setHandleSize (float size) |
sets the size of the handles | |
std::vector< utils::Point > | getQuadrangle () const |
returns the current quadrangle | |
void | setQuadrangle (const utils::Point ps[4]) throw (utils::ICLException) |
sets the current quadrangle | |
bool | isNull () const |
returns whether this mousehandler has been initialized yet | |
utils::VisualizationDescription | vis () const |
returns a visualization | |
Private Attributes | |
Data * | m_data |
pimpl type |
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.
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 icl::qt::DefineQuadrangleMouseHandler::~DefineQuadrangleMouseHandler | ( | ) | [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
bool icl::qt::DefineQuadrangleMouseHandler::isNull | ( | ) | const [inline] |
returns whether this mousehandler has been initialized yet
virtual void icl::qt::DefineQuadrangleMouseHandler::process | ( | const qt::MouseEvent & | e | ) | [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] | ) | throw (utils::ICLException) |
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
returns a visualization
Data* icl::qt::DefineQuadrangleMouseHandler::m_data [private] |
pimpl type
pimpl pointer