• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ qwtMin函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中qwtMin函数的典型用法代码示例。如果您正苦于以下问题:C++ qwtMin函数的具体用法?C++ qwtMin怎么用?C++ qwtMin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了qwtMin函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: qwtMin

int TimelineWidget::transform(double value) const
{
   const double min = qwtMin(mpD->map.s1(), mpD->map.s2());
   const double max = qwtMax(mpD->map.s1(), mpD->map.s2());
   value = qwtMax(qwtMin(value, max), min);
   return mpD->map.transform(value);
}
开发者ID:Siddharthk,项目名称:coan,代码行数:7,代码来源:TimelineWidget.cpp


示例2: internalBorder

/*!
  \brief Set the internal border width of the wheel.

  The internal border must not be smaller than 1
  and is limited in dependence on the wheel's size.
  Values outside the allowed range will be clipped.

  The internal border defaults to 2.

  \param w border width
  \sa internalBorder()
*/
void QwtWheel::setInternalBorder(int w)
{
    const int d = qwtMin( width(), height() ) / 3;
    w = qwtMin( w, d );
    d_data->intBorder = qwtMax( w, 1 );
    layoutWheel();
}
开发者ID:AlexKraemer,项目名称:RFID_ME_HW_GUI,代码行数:19,代码来源:qwt_wheel.cpp


示例3: qwtMin

void PreviewPlot2D::onZoomRec(const QMouseEvent& e)
{
    // some shortcuts
    int axl= QwtPlot::yLeft, axb= QwtPlot::xBottom;
 
	// Don't invert any scales which aren't inverted
	int x1 = qwtMin(memPoint.x(), e.pos().x());
    int x2 = qwtMax(memPoint.x(), e.pos().x());
    int y1 = qwtMin(memPoint.y(), e.pos().y());
    int y2 = qwtMax(memPoint.y(), e.pos().y());
        
	// limit selected area to a minimum of 11x11 points
	int lim = 5 - (y2 - y1) / 2;
	if (lim > 0)
	{
		y1 -= lim;
		y2 += lim;
	}
	lim = 5 - (x2 - x1 + 1) / 2;
	if (lim > 0)
	{
		x1 -= lim;
		x2 += lim;
	}
        
	// Set fixed scales
	if(!autoscaleY)
		pPlot->setAxisScale(axl, pPlot->invTransform(axl,y1), pPlot->invTransform(axl,y2));
	if(!autoscaleX)
		pPlot->setAxisScale(axb, pPlot->invTransform(axb,x1), pPlot->invTransform(axb,x2));
	pPlot->replot();
}
开发者ID:cseyve,项目名称:piaf,代码行数:32,代码来源:previewplot2d.cpp


示例4: qwtMax

int DiMap::limTransform(double x) const
{
	if (x > qwtMax(d_x1, d_x2))
		x = qwtMax(d_x1, d_x2);
	else if (x < qwtMin(d_x1, d_x2))
		x = qwtMin(d_x1, d_x2);
	return transform(x);
}
开发者ID:ViktorNova,项目名称:los,代码行数:8,代码来源:dimap.cpp


示例5: QwtDoubleSize

/*!
    Returns a size with the minimum width and height of this size and other.
*/
QwtDoubleSize QwtDoubleSize::boundedTo(
    const QwtDoubleSize &other) const
{
    return QwtDoubleSize(
        qwtMin(d_width, other.d_width),
        qwtMin(d_height, other.d_height)
    );
}
开发者ID:luisMbedder,项目名称:SpectrumScan,代码行数:11,代码来源:qwt_double_rect.cpp


示例6: QRect

QRect QwtPicker::trackerRect(QPainter *painter) const
{
    if ( trackerMode() == AlwaysOff || 
        (trackerMode() == ActiveOnly && !isActive() ) )
    {
        return QRect();
    }

    if ( d_data->labelPosition.x() < 0 || d_data->labelPosition.y() < 0 )
        return QRect();

    QwtText text = trackerText(d_data->labelPosition);
    if ( text.isEmpty() )
        return QRect();

    QRect textRect(QPoint(0, 0), text.textSize(painter->font()));

    const QPoint &pos = d_data->labelPosition;

    int alignment = 0;
    if ( isActive() && d_data->selection.count() > 1 
        && rubberBand() != NoRubberBand )
    {
        const QPoint last = 
            d_data->selection[int(d_data->selection.count()) - 2];

        alignment |= (pos.x() >= last.x()) ? Qt::AlignRight : Qt::AlignLeft;
        alignment |= (pos.y() > last.y()) ? Qt::AlignBottom : Qt::AlignTop;
    }
    else
        alignment = Qt::AlignTop | Qt::AlignRight;

    const int margin = 5;

    int x = pos.x();
    if ( alignment & Qt::AlignLeft )
        x -= textRect.width() + margin;
    else if ( alignment & Qt::AlignRight )
        x += margin;

    int y = pos.y();
    if ( alignment & Qt::AlignBottom )
        y += margin;
    else if ( alignment & Qt::AlignTop )
        y -= textRect.height() + margin;
    
    textRect.moveTopLeft(QPoint(x, y));

    int right = qwtMin(textRect.right(), pickRect().right() - margin);
    int bottom = qwtMin(textRect.bottom(), pickRect().bottom() - margin);
    textRect.moveBottomRight(QPoint(right, bottom));

    int left = qwtMax(textRect.left(), pickRect().left() + margin);
    int top = qwtMax(textRect.top(), pickRect().top() + margin);
    textRect.moveTopLeft(QPoint(left, top));

    return textRect;
}
开发者ID:chongle,项目名称:prorata,代码行数:58,代码来源:qwt_picker.cpp


示例7: hint

QRect QwtPlotLayout::layoutLegend(int options, 
    const QRect &rect) const
{
    const QSize hint(d_data->layoutData.legend.hint);

    int dim;
    if ( d_data->legendPos == QwtPlot::LeftLegend 
        || d_data->legendPos == QwtPlot::RightLegend )
    {
        // We don't allow vertical legends to take more than
        // half of the available space.

        dim = qwtMin(hint.width(), int(rect.width() * d_data->legendRatio));

        if ( !(options & IgnoreScrollbars) )
        {
            if ( hint.height() > rect.height() )
            {
                // The legend will need additional
                // space for the vertical scrollbar. 

                dim += d_data->layoutData.legend.vScrollBarWidth;
            }
        }
    }
    else
    {
        dim = qwtMin(hint.height(), int(rect.height() * d_data->legendRatio));
        dim = qwtMax(dim, d_data->layoutData.legend.hScrollBarHeight);
    }

    QRect legendRect = rect;
    switch(d_data->legendPos)
    {
        case QwtPlot::LeftLegend:
            legendRect.setWidth(dim);
            break;
        case QwtPlot::RightLegend:
            legendRect.setX(rect.right() - dim + 1);
            legendRect.setWidth(dim);
            break;
        case QwtPlot::TopLegend:
            legendRect.setHeight(dim);
            break;
        case QwtPlot::BottomLegend:
            legendRect.setY(rect.bottom() - dim + 1);
            legendRect.setHeight(dim);
            break;
        case QwtPlot::ExternalLegend:
            break;
    }

    return legendRect;
}
开发者ID:Miguel-J,项目名称:eneboo-core,代码行数:54,代码来源:qwt_plot_layout.cpp


示例8: qwtMax

/*!
  Move the the current zoom rectangle.

  \param x X value
  \param y Y value

  \sa QwtDoubleRect::move
  \note The changed rectangle is limited by the zoom base
*/
void QwtPlotZoomer::move(double x, double y)
{
    x = qwtMax(x, zoomBase().left());
    x = qwtMin(x, zoomBase().right() - zoomRect().width());

    y = qwtMax(y, zoomBase().top());
    y = qwtMin(y, zoomBase().bottom() - zoomRect().height());

    if ( x != zoomRect().left() || y != zoomRect().top() )
    {
        d_data->zoomStack[d_data->zoomRectIndex].moveTo(x, y);
        rescale();
    }
}
开发者ID:chongle,项目名称:prorata,代码行数:23,代码来源:qwt_plot_zoomer.cpp


示例9: qwtMin

/*!
  Returns the bounding rectangle of this rectangle and rectangle other.
  The bounding rectangle of a nonempty rectangle and an empty or
  invalid rectangle is defined to be the nonempty rectangle.
*/
QwtDoubleRect QwtDoubleRect::operator|(const QwtDoubleRect &other) const
{
    if ( isEmpty() )
        return other;

    if ( other.isEmpty() )
        return *this;

    const double minX = qwtMin(d_left, other.d_left);
    const double maxX = qwtMax(d_right, other.d_right);
    const double minY = qwtMin(d_top, other.d_top);
    const double maxY = qwtMax(d_bottom, other.d_bottom);

    return QwtDoubleRect(minX, minY, maxX - minX, maxY - minY);
}
开发者ID:luisMbedder,项目名称:SpectrumScan,代码行数:20,代码来源:qwt_double_rect.cpp


示例10: QwtDoubleRect

/*!
  Returns the intersection of this rectangle and rectangle other.
  Returns an empty rectangle if there is no intersection.
*/
QwtDoubleRect QwtDoubleRect::operator&(const QwtDoubleRect &other) const
{
    if (isNull() || other.isNull())
        return QwtDoubleRect();

    const QwtDoubleRect r1 = normalized();
    const QwtDoubleRect r2 = other.normalized();

    const double minX = qwtMax(r1.left(), r2.left());
    const double maxX = qwtMin(r1.right(), r2.right());
    const double minY = qwtMax(r1.top(), r2.top());
    const double maxY = qwtMin(r1.bottom(), r2.bottom());

    return QwtDoubleRect(minX, minY, maxX - minX, maxY - minY);
}
开发者ID:luisMbedder,项目名称:SpectrumScan,代码行数:19,代码来源:qwt_double_rect.cpp


示例11: qwtMin

/*!
  \brief No docs

  Description
  \param x ???
  \param align
  \todo Documentation
*/
void QwtDoubleRange::setNewValue(double x, bool align)
{
    double vmin,vmax;

    d_prevValue = d_value;

    vmin = qwtMin(d_minValue, d_maxValue);
    vmax = qwtMax(d_minValue, d_maxValue);

    //
    // Range check
    //
    if (x < vmin)
    {
        if ((d_periodic) && (vmin != vmax))
            d_value = x + ::ceil( (vmin - x) / (vmax - vmin ) )
                      * (vmax - vmin);
        else
            d_value = vmin;
    }
    else if (x > vmax)
    {
        if ((d_periodic) && (vmin != vmax))
            d_value = x - ::ceil( ( x - vmax) / (vmax - vmin ))
                      * (vmax - vmin);
        else
            d_value = vmax;
    }
    else
        d_value = x;

    d_exactPrevValue = d_exactValue;
    d_exactValue = d_value;

    // align to grid
    if (align)
    {
        if (d_step != 0.0)
        {
            d_value = d_minValue +
                      qwtRound((d_value - d_minValue) / d_step) * d_step;
        }
        else
            d_value = d_minValue;

        // correct rounding error at the border
        if (fabs(d_value - d_maxValue) < MinEps * qwtAbs(d_step))
            d_value = d_maxValue;

        // correct rounding error if value = 0
        if (::fabs(d_value) < MinEps * qwtAbs(d_step))
            d_value = 0.0;
    }

    if (!d_isValid || d_prevValue != d_value)
    {
        d_isValid = true;
        valueChange();
    }
}
开发者ID:einnas,项目名称:epics,代码行数:68,代码来源:qwt_double_range.cpp


示例12: qwtMin

bool ScaleDiv::rebuild(double x1, double x2, int maxMajSteps, int maxMinSteps,
		bool log, double step, bool ascend)
{

	int rv;

	d_lBound = qwtMin(x1, x2);
	d_hBound = qwtMax(x1, x2);
	d_log = log;

	if (d_log)
		rv = buildLogDiv(maxMajSteps, maxMinSteps, step);
	else
		rv = buildLinDiv(maxMajSteps, maxMinSteps, step);

	if ((!ascend) && (x2 < x1))
	{
		d_lBound = x1;
		d_hBound = x2;
		qwtTwistArray(d_majMarks.data(), d_majMarks.size());
		qwtTwistArray(d_minMarks.data(), d_minMarks.size());
	}

	return rv;

}
开发者ID:ViktorNova,项目名称:los,代码行数:26,代码来源:scldiv.cpp


示例13: interval

/*!
    Align and divide an interval

   \param maxNumSteps Max. number of steps
   \param x1 First limit of the interval (In/Out)
   \param x2 Second limit of the interval (In/Out)
   \param stepSize Step size (Out)

   \sa QwtScaleEngine::setAttribute()
*/
void QwtLog10ScaleEngine::autoScale(int maxNumSteps, 
    double &x1, double &x2, double &stepSize) const
{
    if ( x1 > x2 )
        qSwap(x1, x2);

    QwtDoubleInterval interval(x1 / pow(10.0, lowerMargin()), 
        x2 * pow(10.0, upperMargin()) );

    if (interval.maxValue() / interval.minValue() < 10.0)
    {
        // scale width is less than one decade -> build linear scale

        QwtLinearScaleEngine linearScaler;
        linearScaler.setAttributes(attributes());
        linearScaler.setReference(reference());
        linearScaler.setMargins(lowerMargin(), upperMargin());

        linearScaler.autoScale(maxNumSteps, x1, x2, stepSize);
        stepSize = ::log10(stepSize);

        return;
    }

    double logRef = 1.0;
    if (reference() > LOG_MIN / 2)
        logRef = qwtMin(reference(), LOG_MAX / 2);

    if (testAttribute(QwtScaleEngine::Symmetric))
    {
        const double delta = qwtMax(interval.maxValue() / logRef,  
            logRef / interval.minValue());
        interval.setInterval(logRef / delta, logRef * delta);
    }

    if (testAttribute(QwtScaleEngine::IncludeReference))
        interval = interval.extend(logRef);

    interval = interval.limited(LOG_MIN, LOG_MAX);

    if (interval.width() == 0.0)
        interval = buildInterval(interval.minValue());

    stepSize = divideInterval(log10(interval).width(), qwtMax(maxNumSteps, 1));
    if ( stepSize < 1.0 )
        stepSize = 1.0;

    if (!testAttribute(QwtScaleEngine::Floating))
        interval = align(interval, stepSize);

    x1 = interval.minValue();
    x2 = interval.maxValue();

    if (testAttribute(QwtScaleEngine::Inverted))
    {
        qSwap(x1, x2);
        stepSize = -stepSize;
    }
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:69,代码来源:qwt_scale_engine.cpp


示例14: qwtMin

void Slider::setBorderWidth(int bd)
{
	d_borderWidth = qwtMin(qwtMax(bd, 0), 10);
	if (d_bgStyle & BgTrough)
		d_bwTrough = d_borderWidth;
	else
		d_bwTrough = 0;
}
开发者ID:Adamiko,项目名称:los,代码行数:8,代码来源:slider.cpp


示例15: setBorderWidth

//! Set the border width of the pipe.
void QwtThermo::setBorderWidth(int w)
{
    if ((w >= 0) && (w < (qwtMin(d_data->thermoRect.width(),
                                 d_data->thermoRect.height()) + d_data->borderWidth) / 2  - 1))
    {
        d_data->borderWidth = w;
        layoutThermo();
    }
}
开发者ID:BackupTheBerlios,项目名称:liveplayer0-svn,代码行数:10,代码来源:qwt_thermo.cpp


示例16: scaleDraw

QSize TimelineWidget::minimumSizeHint() const
{
   int scaleWidth = scaleDraw()->minLength(QPen(), font());
   int scaleHeight = scaleDraw()->extent(QPen(), font());
   int animHeight = mpD->animRect.height();
   int w = qwtMin(scaleWidth, 200); // at least 200 pixels wide
   int h = scaleHeight + animHeight + mpD->scaleDist + 2 * mpD->borderWidth;
   return QSize(w, h);
}
开发者ID:Siddharthk,项目名称:coan,代码行数:9,代码来源:TimelineWidget.cpp


示例17: selectionFlags

/*!
  Handle a key press event for the observed widget.

  Selections can be completely done by the keyboard. The arrow keys
  move the cursor, the abort key aborts a selection. All other keys
  are handled by the current state machine.

  \sa QwtPicker, selectionFlags()
  \sa eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(),
      widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(),
      widgetWheelEvent(), widgetKeyReleaseEvent(), stateMachine(),
      QwtEventPattern::KeyPatternCode
*/
void QwtPicker::widgetKeyPressEvent(QKeyEvent *ke)
{
    int dx = 0;
    int dy = 0;

    int offset = 1;
    if ( ke->isAutoRepeat() )
        offset = 5;

    if ( keyMatch(KeyLeft, ke) )
        dx = -offset;
    else if ( keyMatch(KeyRight, ke) )
        dx = offset;
    else if ( keyMatch(KeyUp, ke) )
        dy = -offset;
    else if ( keyMatch(KeyDown, ke) )
        dy = offset;
    else if ( keyMatch(KeyAbort, ke) )
    {
        if ( d_data->stateMachine )
            d_data->stateMachine->reset();

        if (isActive())
            end(false);
    }
    else
        transition(ke);

    if ( dx != 0 || dy != 0 )
    {
        const QRect rect = pickRect();
        const QPoint pos = parentWidget()->mapFromGlobal(QCursor::pos());

        int x = pos.x() + dx;
        x = qwtMax(rect.left(), x);
        x = qwtMin(rect.right(), x);

        int y = pos.y() + dy;
        y = qwtMax(rect.top(), y);
        y = qwtMin(rect.bottom(), y);

        QCursor::setPos(parentWidget()->mapToGlobal(QPoint(x, y)));
    }
}
开发者ID:chongle,项目名称:prorata,代码行数:57,代码来源:qwt_picker.cpp


示例18: qwtMin

bool QwtScaleDiv::contains(double v) const
{
    if ( !d_isValid )
        return false;

    const double min = qwtMin(d_lBound, d_hBound);
    const double max = qwtMax(d_lBound, d_hBound);

    return v >= min && v <= max;
}
开发者ID:chongle,项目名称:prorata,代码行数:10,代码来源:qwt_scale_div.cpp


示例19: LOG_MIN

/*!
  \brief Specify a reference point
  \param r new reference value

  The reference point is needed if the auto-scaler options IncludeRef or
  Symmetric are active. Its default value is 0 for linear scales and 1 for
  logarithmic scales.

  \warning The reference value for logarithmic scales is limited to
  ( LOG_MIN / 2 <= reference <= LOG_MAX /2 ). If the specified
  value is less than LOG_MIN (defined in qwt_math.h), it will
  be set to 1.0 for logarithmic scales.
*/
void QwtAutoScale::setReference(double r)
{
    d_ref = r;
    
    if (r > LOG_MIN / 2) 
        d_lref = qwtMin(r, LOG_MAX / 2);
    else
       d_lref = 1.0;

    build();
}
开发者ID:ahinoamp,项目名称:Research,代码行数:24,代码来源:qwt_autoscl.cpp


示例20: qwtGetMin

/*!
  \brief Find the smallest value in an array
  \param array Pointer to an array
  \param size Array size
*/
double qwtGetMin(const double *array, int size)
{
    if (size <= 0)
       return 0.0;

    double rv = array[0];
    for (int i = 1; i < size; i++)
       rv = qwtMin(rv, array[i]);

    return rv;
}
开发者ID:376473984,项目名称:pvb,代码行数:16,代码来源:qwt_math.cpp



注:本文中的qwtMin函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ qxt_d函数代码示例发布时间:2022-05-30
下一篇:
C++ qwtMax函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap