Brief description of class still missing. More...
#include <LineEditor.h>
Public Member Functions | |
| LineEditor (LineLayer *layer) | |
| int | lineIndex () const |
| void | mouseMoveEvent (const QPoint &pt) |
| bool | mousePressEvent (QMouseEvent *e) |
| void | wheelEvent (QWheelEvent *e) |
| ~LineEditor () | |
Brief description of class still missing.
Full description of class still missing
| SciFigs::LineEditor::LineEditor | ( | LineLayer * | layer | ) |
| int SciFigs::LineEditor::lineIndex | ( | ) | const [inline] |
Referenced by SciFigs::LineLayer::mouseMoveEvent().
{return _lineIndex;}
| void SciFigs::LineEditor::mouseMoveEvent | ( | const QPoint & | pt | ) |
| bool SciFigs::LineEditor::mousePressEvent | ( | QMouseEvent * | e | ) |
Return true if this object can be deleted
References TRACE.
Referenced by SciFigs::LineLayer::mousePressEvent().
{
TRACE;
if(_lineIndex<0) { // The first click which generated this object
pointAt(e->pos());
if(_lineIndex<0) return true;
_deformZ=e->modifiers() & Qt::ShiftModifier;
_deformationWidth=0.2;
_dx=0.0;
_dy=0.0;
saveOriginal();
} else {
if(e->buttons() & Qt::LeftButton) {
// By removing the current index, the curve cannot be modified any more
// The destructor won't restore the original curve
_lineIndex=-1;
return true;
}
}
return false;
}
| void SciFigs::LineEditor::wheelEvent | ( | QWheelEvent * | e | ) |
References TRACE.
Referenced by SciFigs::LineLayer::wheelEvent().
{
TRACE;
int d=e->delta()/120;
if(e->modifiers() & Qt::ShiftModifier) {
_pointIndex +=d;
if(_pointIndex>=_count) _pointIndex=_count-1;
else if(_pointIndex<0) _pointIndex=0;
} else {
_deformationWidth *= pow(1.2, d);
if(_deformationWidth<0.2) _deformationWidth=0.2;
}
setDeformation();
deformLine();
}