Image Component Library (ICL)
Public Member Functions | Private Attributes | List of all members
icl::qt::DefineQuadrangleMouseHandler Class Reference

Special MouseHandler Implementation that allows for defining a quadrangle. More...

#include <DefineQuadrangleMouseHandler.h>

Inheritance diagram for icl::qt::DefineQuadrangleMouseHandler:
icl::qt::MouseHandler icl::utils::Uncopyable icl::utils::Lockable

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::PointgetQuadrangle () 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...
 
Lockableoperator= (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...
 
MutexgetMutex () 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DefineQuadrangleMouseHandler() [1/2]

icl::qt::DefineQuadrangleMouseHandler::DefineQuadrangleMouseHandler ( )

empty constructor (creates a null handler)

◆ DefineQuadrangleMouseHandler() [2/2]

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

◆ ~DefineQuadrangleMouseHandler()

virtual icl::qt::DefineQuadrangleMouseHandler::~DefineQuadrangleMouseHandler ( )
virtual

destructor

Member Function Documentation

◆ getQuadrangle()

std::vector<utils::Point> icl::qt::DefineQuadrangleMouseHandler::getQuadrangle ( ) const

returns the current quadrangle

◆ init()

void icl::qt::DefineQuadrangleMouseHandler::init ( const utils::Size maxSize,
bool  convexOnly = true 
)

deferred intialization method

◆ isNull()

bool icl::qt::DefineQuadrangleMouseHandler::isNull ( ) const
inline

returns whether this mousehandler has been initialized yet

◆ process()

virtual void icl::qt::DefineQuadrangleMouseHandler::process ( const qt::MouseEvent e)
virtual

MouseHandler interface.

Reimplemented from icl::qt::MouseHandler.

◆ setHandleSize()

void icl::qt::DefineQuadrangleMouseHandler::setHandleSize ( float  size)

sets the size of the handles

◆ setOffset()

void icl::qt::DefineQuadrangleMouseHandler::setOffset ( const utils::Point p)

sets an offset that shifts both in- and outputs

◆ setQuadrangle()

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

◆ vis()

utils::VisualizationDescription icl::qt::DefineQuadrangleMouseHandler::vis ( ) const

returns a visualization

Member Data Documentation

◆ m_data

Data* icl::qt::DefineQuadrangleMouseHandler::m_data
private

pimpl type

pimpl pointer


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