Ejemplo n.º 1
0
CCurveControl::CCurveControl(int id, ColorCurveEditable* editable)
    : ExprControl(id, editable, true), _curveEditable(editable) {
    _curve = new ExprColorCurve(this, "Pos:", "Val:", "Interp:");
    _curve->setFixedHeight(80);

    const int numVal = _curveEditable->cvs.size();
    for (int i = 0; i < numVal; i++) {
        const SeExpr2::Curve<SeExpr2::Vec3d>::CV& cv = _curveEditable->cvs[i];
        _curve->addPoint(cv._pos, cv._val, cv._interp);
    }
    hbox->addWidget(_curve, 3);
    connect(_curve->_scene, SIGNAL(curveChanged()), SLOT(curveChanged()));
    // unneeded? updateControl();
}
Ejemplo n.º 2
0
/*!
  \brief Initialize data with x- and y-arrays (explicitly shared)

  \param xData x data
  \param yData y data

  \sa QwtData::setData.
*/
void QwtCurve::setData(const QwtArray<double> &xData, 
    const QwtArray<double> &yData)
{
    delete d_data;
    d_data = new QwtArrayData(xData, yData);
    curveChanged();
}
Ejemplo n.º 3
0
/*!
  \brief Assign a brush. 
         In case of brush.style() != QBrush::NoBrush 
         and style() != QwtCurve::Sticks
         the area between the curve and the baseline will be filled.
         In case !brush.color().isValid() the area will be filled by
         pen.color(). The fill algorithm simply connects the first and the
         last curve point to the baseline. So the curve data has to be sorted 
         (ascending or descending). 
  \param brush New brush
    \sa QwtCurve::brush, QwtCurve::setBaseline, QwtCurve::baseline
*/
void QwtCurve::setBrush(const QBrush &brush)
{
    if ( brush != d_brush )
    {
        d_brush = brush;
        curveChanged();
    }
}
Ejemplo n.º 4
0
/*!
  \brief Assign a pen
  \param p New pen
*/
void QwtCurve::setPen(const QPen &p)
{
    if ( p != d_pen )
    {
        d_pen = p;
        curveChanged();
    }
}
Ejemplo n.º 5
0
void InputSettings::connectCanvasView(widgets::CanvasView *view)
{
	_canvasview = view;
	view->setStrokeSmoothing(_ui->smoothing->value());
	view->setPressureCurve(_ui->stylusCurve->curve());
	view->setDistanceCurve(_ui->distanceCurve->curve());
	view->setVelocityCurve(_ui->velocityCurve->curve());
	updateFakePressureMode();

	connect(_ui->smoothing, SIGNAL(valueChanged(int)), view, SLOT(setStrokeSmoothing(int)));
	connect(_ui->stylusCurve, SIGNAL(curveChanged(KisCubicCurve)), view, SLOT(setPressureCurve(KisCubicCurve)));
	connect(_ui->distanceCurve, SIGNAL(curveChanged(KisCubicCurve)), view, SLOT(setDistanceCurve(KisCubicCurve)));
	connect(_ui->velocityCurve, SIGNAL(curveChanged(KisCubicCurve)), view, SLOT(setVelocityCurve(KisCubicCurve)));

	connect(_ui->pressuresrc, SIGNAL(currentIndexChanged(int)), this, SLOT(updateFakePressureMode()));
	connect(_ui->distance, SIGNAL(valueChanged(int)), this, SLOT(updateFakePressureMode()));
	connect(_ui->velocity, SIGNAL(valueChanged(int)), this, SLOT(updateFakePressureMode()));
}
Ejemplo n.º 6
0
CurveEditorItem::CurveEditorItem(QQuickItem* parent)
    : QQuickPaintedItem(parent)
    , d(new Private(this))
{
    setFlag(QQuickItem::ItemHasContents, true);
    setAcceptedMouseButtons( Qt::LeftButton | Qt::RightButton | Qt::MidButton );
    connect(d->curveWidget, SIGNAL(pointSelectedChanged()), SIGNAL(pointSelectedChanged()));
    connect(d->curveWidget, SIGNAL(modified()), SIGNAL(curveChanged()));
    qRegisterMetaType<KisCubicCurve>();
}
Ejemplo n.º 7
0
void ProcessModel::setCurve_impl()
{
    connect(m_curve, &Curve::Model::changed,
            this, [&] () {
        emit curveChanged();

        m_startState->messagesChanged(m_startState->messages());
        m_endState->messagesChanged(m_endState->messages());
    });
}
Ejemplo n.º 8
0
/*!
  \brief Copy Assignment
*/
const QwtCurve& QwtCurve::operator=(const QwtCurve &c)
{
    if (this != &c)
    {
        copy(c);
        curveChanged();
    }

    return *this;
}
Ejemplo n.º 9
0
int Window::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: curveChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: pathChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 2: periodChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 3: amplitudeChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 4: overshootChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 5;
    }
    return _id;
}
Ejemplo n.º 10
0
/*!
  \brief Set the value of the baseline

  The baseline is needed for filling the curve with a brush or
  the QwtCurve::Sticks drawing style. 
  The default value is 0.0. The interpretation
  of the baseline depends on the style options. With QwtCurve::Yfx,
  the baseline is interpreted as a horizontal line at y = baseline(),
  with QwtCurve::Yfy, it is interpreted as a vertical line at
  x = baseline().
  \param ref baseline
  \sa QwtCurve::setBrush(), QwtCurve::setStyle(), QwtCurve::setOptions()
*/
void QwtCurve::setBaseline(double ref)
{
    d_ref = ref;
    curveChanged();
}
Ejemplo n.º 11
0
/*!
  \brief Change the number of interpolated points
  \param s new size
  \warning The default is 250 points.
*/
void QwtCurve::setSplineSize(int s)
{
    d_splineSize = qwtMax(s, 10);
    curveChanged();
}
Ejemplo n.º 12
0
/*!
  \brief Specify options for the drawing style  

  The options can be used to modify the drawing style.
  Options can be or-combined.
  The following options are defined:<dl>
  <dt>QwtCurve::Auto</dt>
  <dd>The default setting. For QwtCurve::spline,
      this means that the type of the spline is
      determined automatically, depending on the data.
      For all other styles, this means that y is
      regarded as a function of x.</dd>
  <dt>QwtCurve::Yfx</dt>
  <dd>Draws y as a function of x (the default). The
      baseline is interpreted as a horizontal line
      with y = baseline().</dd>
  <dt>QwtCurve::Xfy</dt>
  <dd>Draws x as a function of y. The baseline is
      interpreted as a vertical line with x = baseline().</dd>
  <dt>QwtCurve::Parametric</dt>
  <dd>For QwtCurve::Spline only. Draws a parametric spline.</dd>
  <dt>QwtCurve::Periodic</dt>
  <dd>For QwtCurve::Spline only. Draws a periodic spline.</dd>
  <dt>QwtCurve::Inverted</dt>
  <dd>For QwtCurve::Steps only. Draws a step function
      from the right to the left.</dd></dl>

  \param opt new options
  /sa QwtCurve::options()
*/
void QwtCurve::setOptions(int opt)
{
    d_options = opt;
    curveChanged();
}
Ejemplo n.º 13
0
/*!
  \brief Assign a title to a curve
  \param title new title
*/
void QwtCurve::setTitle(const QString &title)
{
    d_title = title;
    curveChanged();
}
Ejemplo n.º 14
0
/*!
  \brief Initialize the data by pointing to memory blocks which are not managed
  by QwtCurve.

  setRawData is provided for efficiency. It is important to keep the pointers
  during the lifetime of the underlying QwtCPointerData class.

  \param xData pointer to x data
  \param yData pointer to y data
  \param size size of x and y

  \sa QwtCPointerData::setData.
*/
void QwtCurve::setRawData(const double *xData, const double *yData, int size)
{
    delete d_data;
    d_data = new QwtCPointerData(xData, yData, size);
    curveChanged();
}
Ejemplo n.º 15
0
/*!
  Initialize data with a pointer to QwtData.

  \param data Data

  \sa QwtData::copy.
*/
void QwtCurve::setData(const QwtData &data)
{
    delete d_data;
    d_data = data.copy();
    curveChanged();
}
Ejemplo n.º 16
0
/*!
  Initialize data with an array of points (explicitly shared).

  \param data Data

  \sa QwtDoublePointData::setData.
*/
void QwtCurve::setData(const QwtArray<QwtDoublePoint> &data)
{
    delete d_data;
    d_data = new QwtDoublePointData(data);
    curveChanged();
}
Ejemplo n.º 17
0
void CurveEditorItem::setCurve(KisCubicCurve curve)
{
    d->curveWidget->setCurve(curve);
    emit curveChanged();
}
Ejemplo n.º 18
0
// return points in reverse order in order to use same parsing in editor
void CCurveScene::emitCurveChanged()
{
    emit curveChanged();
}
Ejemplo n.º 19
0
/*!
  \brief Assign a symbol
  \param s symbol
  \sa QwtSymbol
*/
void QwtCurve::setSymbol(const QwtSymbol &s )
{
    d_sym = s;
    curveChanged();
}
Ejemplo n.º 20
0
/*!
  \brief Set the curve's drawing style

  Valid styles are:
  <dl>
  <dt>QwtCurve::NoCurve</dt>
  <dd>Don't draw a curve. Note: This doesn't affect the symbol. </dd>
  <dt>QwtCurve::Lines</dt>
  <dd>Connect the points with straight lines.</dd>
  <dt>QwtCurve::Sticks</dt>
  <dd>Draw vertical sticks from a baseline which is defined by setBaseline().</dd>
  <dt>QwtCurve::Steps</dt>
  <dd>Connect the points with a step function. The step function
      is drawn from the left to the right or vice versa,
      depending on the 'Inverted' option.</dd>
  <dt>QwtCurves::Dots</dt>
  <dd>Draw dots at the locations of the data points. Note:
      This is different from a dotted line (see setPen()).</dd>
  <dt>QwtCurve::Spline</dt>
  <dd>Interpolate the points with a spline. The spline
      type can be specified with setOptions(),
      the size of the spline (= number of interpolated points)
      can be specified with setSplineSize().</dd>
  <dt>QwtCurve::UserCurve ...</dt>
  <dd>Styles >= QwtCurve::UserCurve are reserved for derived
      classes of QwtCurve that overload QwtCurve::draw() with
      additional application specific curve types.</dd>
  </dl>
  \sa QwtCurve::style()
*/
void QwtCurve::setStyle(int style, int options)
{
    d_options = options;
    d_style = style;
    curveChanged();
}