CAVAPA-GUI  30.5.2014
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Member Functions | Static Public Member Functions | List of all members
cavapa_gui::CalibrationPoints Class Reference

CalibrationPoints stores a collection of calibration points that can be drawn on a QPainter. More...

#include <calibrationpoints.h>

Public Member Functions

void push_back (QPointF newPoint)
 Adds a new calibration point. More...
 
void draw (QPainter &painter) const
 Draws all the points on a QPainter. More...
 
unsigned int size () const
 Returns the number of control points in CalibrationPoints. More...
 
void setHighlightedPoint (const int i)
 Sets the highlighted calibration point. More...
 
QPointF at (const int pos)
 Returns the calibration point at specified location. More...
 
QPointF & operator[] (const int pos)
 Returns the calibration point at specified location. More...
 
void clear ()
 Removes all the calibration points.
 
void removeHighlighted ()
 Removes the highlighted calibration point. More...
 

Static Public Member Functions

static QColor getComplementaryColor (const QColor color)
 Returns the complementary color of the specified color. More...
 

Detailed Description

CalibrationPoints stores a collection of calibration points that can be drawn on a QPainter.

A point can be highlighted and the highlighted point or all points can be removed.

The points are stored as relative values so that the coordinates are values between 0 and 1.

Author
Oskari Leppäaho

Member Function Documentation

QPointF cavapa_gui::CalibrationPoints::at ( const int  pos)
inline

Returns the calibration point at specified location.

Parameters
posPosition of the calibration point to return.
Returns
The calibration point at specified location.
void cavapa_gui::CalibrationPoints::draw ( QPainter &  painter) const

Draws all the points on a QPainter.

Draws the points as filled circles and the index (+1) of the point next to the point

Parameters
painterThe QPainter to draw on.
QColor cavapa_gui::CalibrationPoints::getComplementaryColor ( const QColor  color)
static

Returns the complementary color of the specified color.

Parameters
colorThe color whose complementary color is to be returned.
Returns
The complementary color.
QPointF& cavapa_gui::CalibrationPoints::operator[] ( const int  pos)
inline

Returns the calibration point at specified location.

Parameters
posPosition of the calibration point to return.
Returns
The calibration point at specified location.
void cavapa_gui::CalibrationPoints::push_back ( QPointF  newPoint)

Adds a new calibration point.

Parameters
newPointThe new point. The values of the coordinates should be between 0 and 1.
void cavapa_gui::CalibrationPoints::removeHighlighted ( )

Removes the highlighted calibration point.

Points with an index bigger than the highlighted index will have their index reduced by one. The point next to the removed point will be the new highlighted point. If the last calibration point was removed, the point before that will be the new highlighted point.

void cavapa_gui::CalibrationPoints::setHighlightedPoint ( const int  i)
inline

Sets the highlighted calibration point.

The highlighted calibration point will be drawn with the complementary color of the current drawing color.

Parameters
iThe index of the point that will be highlighted.
unsigned int cavapa_gui::CalibrationPoints::size ( ) const
inline

Returns the number of control points in CalibrationPoints.

Returns
Number of control points.

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