RosAna
A rosette analyzer and synthesizer tool
 All Classes Namespaces Functions Variables Properties
Public Slots | Signals | Public Member Functions | Private Member Functions | List of all members
ProcessWidget Class Reference

The ProcessWidget class handles image display and pattern tracing. More...

Public Slots

void manualTrace ()
 Initiates manual trace.
 

Signals

void manualTraceInProgress (QString text)
 This signal is emitted once a trace has been initiated. More...
 
void traceDone (QStandardItemModel *traceModel)
 This signal is emitted when the trace is completed. More...
 

Public Member Functions

 ProcessWidget (QWidget *parent=0)
 Constructs ProcessWidget. More...
 
 ~ProcessWidget ()
 Destroys ProcessWidget. More...
 
bool saveTrace (QString filepath)
 Saves a normalized pattern trace to disk. More...
 
bool openImage (const QString &filepath)
 Loads an image from disk. More...
 

Private Member Functions

cv::Point convertPoint (QPoint old)
 Converts between Qt::Qpoint and cv::Point. More...
 
void drawLine (cv::Point start, cv::Point end)
 Draws a line on traceImg. More...
 
void keyPressEvent (QKeyEvent *ev)
 Captures key press events. More...
 
void mousePressEvent (QMouseEvent *ev)
 Records mouse clicks if a trace is active. More...
 
QVector< QPointF > * normalize (QVector< QPoint > *samples)
 Normalizes trace points. More...
 

Detailed Description

The ProcessWidget class handles image display and pattern tracing.

Constructor & Destructor Documentation

ProcessWidget::ProcessWidget ( QWidget parent = 0)
explicit

Constructs ProcessWidget.

Reads an example file and sets up gui elements.

Parameters
parentThe parent widget.
ProcessWidget::~ProcessWidget ( )

Destroys ProcessWidget.

Releases resources held by img and traceImg.

Member Function Documentation

Point ProcessWidget::convertPoint ( QPoint  old)
private

Converts between Qt::Qpoint and cv::Point.

Parameters
oldQPoint to be converted.
Returns
a cv::Point.
void ProcessWidget::drawLine ( cv::Point  start,
cv::Point  end 
)
private

Draws a line on traceImg.

Parameters
startStart point.
endEnd point.
void ProcessWidget::keyPressEvent ( QKeyEvent ev)
privatevirtual

Captures key press events.

Using the Enter key triggers a stop to the current trace. The trace is normalized and passed on to FourierAnalysis::analyze(QVector<QPointF>)

Parameters
evKey press event.

Reimplemented from QWidget.

void ProcessWidget::manualTraceInProgress ( QString  text)
signal

This signal is emitted once a trace has been initiated.

Parameters
textThe message
void ProcessWidget::mousePressEvent ( QMouseEvent ev)
privatevirtual

Records mouse clicks if a trace is active.

Parameters
evthe mouse event.

Reimplemented from QWidget.

QVector< QPointF > * ProcessWidget::normalize ( QVector< QPoint > *  samples)
private

Normalizes trace points.

Parameters
samplesThe trace to be normalized.
Returns
a normalized trace on the range [0,1].
bool ProcessWidget::openImage ( const QString filepath)

Loads an image from disk.

Parameters
filepathThe image file path.
Returns
True if the load is successful; otherwise False.
bool ProcessWidget::saveTrace ( QString  filepath)

Saves a normalized pattern trace to disk.

Format: x1, y1, \n x2, y2, \n etc.

Parameters
filepathThe image file path.
Returns
True if the save is successful; otherwise False.
void ProcessWidget::traceDone ( QStandardItemModel traceModel)
signal

This signal is emitted when the trace is completed.

Parameters
traceModelThe model resulting from the Fourier Analysis.

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