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

Special MouseHandler Implementation that allows several quadrangular grids to be defined. More...

#include <AdjustGridMouseHandler.h>

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

Public Member Functions

 AdjustGridMouseHandler ()
 empty constructor (creates a null handler) More...
 
 AdjustGridMouseHandler (const utils::Rect &bounds, bool convexOnly=true)
 constructor with given max size More...
 
virtual void process (const MouseEvent &e)
 MouseHandler interface. More...
 
virtual ~AdjustGridMouseHandler ()
 destructor More...
 
void init (const utils::Rect &bounds, bool convexOnly=true)
 deferred intialization method More...
 
void init (const utils::Rect &bounds, const std::vector< std::vector< utils::Point > > &grids, bool convexOnly=true)
 
void clear ()
 
void setHandleSize (float size)
 sets the size of the handles More...
 
size_t getNumGrids () const
 returns number of internal grids More...
 
const utils::RectgetBounds () const
 returns the internal bounds rectangle More...
 
void defineGridTexture (size_t idx, const utils::Size32f &dim, const std::vector< core::Line32f > &lines)
 
std::vector< utils::Point32fmapPoints (size_t idx, const std::vector< utils::Point32f > &ps) const
 
std::vector< utils::PointgetGrid (size_t idx) const
 returns the current quadrangle More...
 
void setGrid (size_t idx, 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 several quadrangular grids to be defined.

Constructor & Destructor Documentation

◆ AdjustGridMouseHandler() [1/2]

icl::qt::AdjustGridMouseHandler::AdjustGridMouseHandler ( )

empty constructor (creates a null handler)

◆ AdjustGridMouseHandler() [2/2]

icl::qt::AdjustGridMouseHandler::AdjustGridMouseHandler ( const utils::Rect bounds,
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

◆ ~AdjustGridMouseHandler()

virtual icl::qt::AdjustGridMouseHandler::~AdjustGridMouseHandler ( )
virtual

destructor

Member Function Documentation

◆ clear()

void icl::qt::AdjustGridMouseHandler::clear ( )

◆ defineGridTexture()

void icl::qt::AdjustGridMouseHandler::defineGridTexture ( size_t  idx,
const utils::Size32f dim,
const std::vector< core::Line32f > &  lines 
)

◆ getBounds()

const utils::Rect& icl::qt::AdjustGridMouseHandler::getBounds ( ) const

returns the internal bounds rectangle

◆ getGrid()

std::vector<utils::Point> icl::qt::AdjustGridMouseHandler::getGrid ( size_t  idx) const

returns the current quadrangle

◆ getNumGrids()

size_t icl::qt::AdjustGridMouseHandler::getNumGrids ( ) const

returns number of internal grids

◆ init() [1/2]

void icl::qt::AdjustGridMouseHandler::init ( const utils::Rect bounds,
bool  convexOnly = true 
)

deferred intialization method

◆ init() [2/2]

void icl::qt::AdjustGridMouseHandler::init ( const utils::Rect bounds,
const std::vector< std::vector< utils::Point > > &  grids,
bool  convexOnly = true 
)

◆ isNull()

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

returns whether this mousehandler has been initialized yet

◆ mapPoints()

std::vector<utils::Point32f> icl::qt::AdjustGridMouseHandler::mapPoints ( size_t  idx,
const std::vector< utils::Point32f > &  ps 
) const

◆ process()

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

MouseHandler interface.

Reimplemented from icl::qt::MouseHandler.

◆ setGrid()

void icl::qt::AdjustGridMouseHandler::setGrid ( size_t  idx,
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

◆ setHandleSize()

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

sets the size of the handles

◆ vis()

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

returns a visualization

Member Data Documentation

◆ m_data

Data* icl::qt::AdjustGridMouseHandler::m_data
private

pimpl type

pimpl pointer


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