当前位置: 首页>>代码示例>>C++>>正文


C++ QwtPlotMarker::setLineStyle方法代码示例

本文整理汇总了C++中QwtPlotMarker::setLineStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotMarker::setLineStyle方法的具体用法?C++ QwtPlotMarker::setLineStyle怎么用?C++ QwtPlotMarker::setLineStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QwtPlotMarker的用法示例。


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

示例1: clear

void Plot::clear()
{
    this->detachItems();
    pointsArr.clear();

    //  ...a horizontal line at y = 1...
    QwtPlotMarker *mY1 = new QwtPlotMarker();
    mY1->setLabel( QString::fromLatin1( "y = 1" ) );
    mY1->setLabelAlignment( Qt::AlignRight | Qt::AlignTop );
    mY1->setLineStyle( QwtPlotMarker::HLine );
    mY1->setYValue( 1.0 );
    mY1->setLinePen(Qt::black, 1, Qt::DashLine);
    mY1->attach( this );

    QwtPlotMarker *mY = new QwtPlotMarker();
    mY->setLabel( QString::fromLatin1( "y = 0" ) );
    mY->setLabelAlignment( Qt::AlignRight | Qt::AlignTop );
    mY->setLineStyle( QwtPlotMarker::HLine );
    mY->setYValue( 0.0 );
    mY->attach( this );

    //  ...a vertical line at x = 0
    QwtPlotMarker *mX = new QwtPlotMarker();
    mX->setLabel( QString::fromLatin1( "x = 0" ) );
    mX->setLabelAlignment( Qt::AlignLeft | Qt::AlignBottom );
    mX->setLabelOrientation( Qt::Vertical );
    mX->setLineStyle( QwtPlotMarker::VLine );
    mX->setLinePen( Qt::black, 0, Qt::DashDotLine );
    mX->setXValue( 0 );
    mX->attach( this );
}
开发者ID:kmi9work,项目名称:Fires,代码行数:31,代码来源:plot.cpp

示例2: QDialog

SimDialog::SimDialog( QWidget * parent, Qt::WFlags f) 
	: QDialog(parent, f)
{
  setupUi(this);

  // setup the plot ...
  m_plot->setTitle("Comparing Similarity Measures");
  m_plot->insertLegend(new QwtLegend(), QwtPlot::BottomLegend);

  // set up the axes ...
  m_plot->setAxisTitle(QwtPlot::xBottom, "Variations");
  m_plot->setAxisScale(QwtPlot::xBottom, -10, 10);

  m_plot->setAxisTitle(QwtPlot::yLeft, "Similarity");
  m_plot->setAxisScale(QwtPlot::yLeft, -1.5, 1.5);

  // enable grid ...
  QwtPlotGrid *grid = new QwtPlotGrid;
  grid->enableXMin(true);
  grid->enableYMin(true);
  grid->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
  grid->setMinPen(QPen(Qt::gray, 0 , Qt::DotLine));
  grid->attach(m_plot);

  //  Insert zero line at y = 0
  QwtPlotMarker *mY = new QwtPlotMarker();
  mY->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
  mY->setLineStyle(QwtPlotMarker::HLine);
  mY->setYValue(0.0);
  mY->attach(m_plot);

  //  Insert zero line at x = 0
  QwtPlotMarker *mX = new QwtPlotMarker();
  mX->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
  mX->setLineStyle(QwtPlotMarker::VLine);
  mX->setXValue(0.0);
  mX->attach(m_plot);

  // Insert new curves
  cReg = new QwtPlotCurve("Regular Similarity Measure");
  cReg->attach(m_plot);

  cOct = new QwtPlotCurve("Octree based Similarity Measure");
  cOct->attach(m_plot);

  // Set curve styles
  cReg->setPen(QPen(Qt::red, 2));
  cOct->setPen(QPen(Qt::blue, 2));

  // Populate the volume combos ...
  MainWindow* _win  = (MainWindow *)this->parent();
  viewer3d *  _view = (viewer3d *) _win->getViewer();
  QList<Volume*> _vols = _view->getVolumes();

  // append Volume names to combo boxes ...
  // Need to modify Volume class so that it stored patient name ...
  // More importantly modify PatientBrowser so that the data can be directly
  // loaded.
}
开发者ID:hsundar,项目名称:thesis.code,代码行数:59,代码来源:simDialog.cpp

示例3: setTitle

Plot::Plot()
{
    setTitle("A Simple QwtPlot Demonstration");
    insertLegend(new QwtLegend(), QwtPlot::RightLegend);

    // Set axis titles
    setAxisTitle(xBottom, "x -->");
    setAxisTitle(yLeft, "y -->");
    
    // Insert new curves
    QwtPlotCurve *cSin = new QwtPlotCurve("y = sin(x)");
#if QT_VERSION >= 0x040000
    cSin->setRenderHint(QwtPlotItem::RenderAntialiased);
#endif
    cSin->setPen(QPen(Qt::red));
    cSin->attach(this);

    QwtPlotCurve *cCos = new QwtPlotCurve("y = cos(x)");
#if QT_VERSION >= 0x040000
    cCos->setRenderHint(QwtPlotItem::RenderAntialiased);
#endif
    cCos->setPen(QPen(Qt::blue));
    cCos->attach(this);

    // Create sin and cos data
    const int nPoints = 100;
    cSin->setData(SimpleData(::sin, nPoints));
    cCos->setData(SimpleData(::cos, nPoints));

    // Insert markers
    
    //  ...a horizontal line at y = 0...
    QwtPlotMarker *mY = new QwtPlotMarker();
    mY->setLabel(QString::fromLatin1("y = 0"));
    mY->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
    mY->setLineStyle(QwtPlotMarker::HLine);
    mY->setYValue(0.0);
    mY->attach(this);

    //  ...a vertical line at x = 2 * pi
    QwtPlotMarker *mX = new QwtPlotMarker();
    mX->setLabel(QString::fromLatin1("x = 2 pi"));
    mX->setLabelAlignment(Qt::AlignLeft | Qt::AlignBottom);
    mX->setLabelOrientation(Qt::Vertical);
    mX->setLineStyle(QwtPlotMarker::VLine);
    mX->setLinePen(QPen(Qt::black, 0, Qt::DashDotLine));
    mX->setXValue(2.0 * M_PI);
    mX->attach(this);
}
开发者ID:376473984,项目名称:pvb,代码行数:49,代码来源:simple.cpp

示例4: enableZeroLineY

void Grid::enableZeroLineY(bool enable) {
  Plot *d_plot = dynamic_cast<Plot *>(plot());
  if (!d_plot)
    return;

  if (mrkY < 0 && enable) {
    QwtPlotMarker *m = new QwtPlotMarker();
    mrkY = d_plot->insertMarker(m);
    m->setRenderHint(QwtPlotItem::RenderAntialiased, false);
    m->setAxis(xAxis(), yAxis());
    m->setLineStyle(QwtPlotMarker::HLine);
    m->setValue(0.0, 0.0);

    double width = 1;
    if (d_plot->canvas()->lineWidth())
      width = d_plot->canvas()->lineWidth();
    else if (d_plot->axisEnabled(QwtPlot::xBottom) ||
             d_plot->axisEnabled(QwtPlot::xTop))
      width = d_plot->axesLinewidth();

    m->setLinePen(QPen(Qt::black, width, Qt::SolidLine));
  } else if (mrkY >= 0 && !enable) {
    d_plot->removeMarker(mrkY);
    mrkY = -1;
  }
}
开发者ID:liyulun,项目名称:mantid,代码行数:26,代码来源:Grid.cpp

示例5: insertLineMarker

/*!
  This function is a shortcut to insert a horizontal or vertical
  line marker, dependent on the specified axis.
  \param label Label
  \param axis Axis to be attached
  \return New key if the marker could be inserted, 0 if not.
*/
long QwtPlot::insertLineMarker(const QString &label, int axis)
{
    QwtMarker::LineStyle lineStyle = QwtMarker::NoLine;
    int xAxis = QwtPlot::xBottom;
    int yAxis = QwtPlot::yLeft;

    switch(axis)
    {
        case yLeft:
        case yRight:
            yAxis = axis;
            lineStyle = QwtMarker::HLine;
            break;
        case xTop:
        case xBottom:
            xAxis = axis;
            lineStyle = QwtMarker::VLine;
            break;
    }

    QwtPlotMarker *marker = new QwtPlotMarker(this);
    if ( marker == 0 )
        return 0;

    marker->setAxis(xAxis, yAxis);
    marker->setLabel(label);
    marker->setLineStyle(lineStyle);
    marker->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);

    long key = insertMarker(marker);
    if ( key == 0 )
        delete marker;

    return key;
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:42,代码来源:qwt_plot_marker.cpp

示例6: enableZeroLineX

void Grid::enableZeroLineX(bool enable)
{
    Plot *d_plot = (Plot *)plot();
    if (!d_plot)
        return;

    if (mrkX<0 && enable) {
        QwtPlotMarker *m = new QwtPlotMarker();
        mrkX = d_plot->insertMarker(m);
        m->setRenderHint(QwtPlotItem::RenderAntialiased, false);
        m->setAxis(xAxis(), yAxis());
        m->setLineStyle(QwtPlotMarker::VLine);
        m->setValue(0.0, 0.0);

        double width = 1;
        if (d_plot->canvas()->lineWidth())
            width = d_plot->canvas()->lineWidth();
        else if (d_plot->axisEnabled (QwtPlot::yLeft) || d_plot->axisEnabled (QwtPlot::yRight))
            width =  d_plot->axesLinewidth();

        m->setLinePen(QPen(Qt::black, width, Qt::SolidLine));
    } else if (mrkX >= 0 && !enable) {
        d_plot->removeMarker(mrkX);
        mrkX=-1;
    }
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:26,代码来源:Grid.cpp

示例7: drawLapMarkers

void PlotWindow::drawLapMarkers()
{
	if (_data_log->numLaps() > 1)
	{
		for (int i=0; i < _data_log->numLaps(); ++i)
		{
			QwtPlotMarker* marker = new QwtPlotMarker;
			marker->setLineStyle(QwtPlotMarker::VLine);
			marker->setLinePen(QPen(Qt::DotLine));
			if (_x_axis_measurement->currentIndex() == 0) // time
			{
				const double time = _data_log->time(_data_log->lap(i).second);
				marker->setXValue(time);
			}
			else // distance
			{
				const double dist = _data_log->dist(_data_log->lap(i).second);
				marker->setXValue(dist);
			}
			marker->attach(_plot);
			marker->show();
			_lap_markers.push_back(marker);
		}
	}
}
开发者ID:McWare,项目名称:cycling-data-view,代码行数:25,代码来源:plotwindow.cpp

示例8: fm

DataPlot::DataPlot(QWidget *parent, TelemetryStateReceiver* collector, OdometryStateReceiver* odometryReceiver,QMap<QString, QStringList> *list) :
    QwtPlot(parent),
    d_interval(0),
    d_timerId(-1)
{
    node=collector;
    odom_receiver=odometryReceiver;
    connect_status=false;
    QObject::connect( node, SIGNAL( parameterReceived( )), this, SLOT( onParameterReceived( )));

    data_count=0;
    posicionBuffer=PLOT_SIZE;
    colors_list <<"red"<<"blue"<<"green"<<"black"<<"yellow"<<"magenta"<<"cyan"<<"gray"<<"darkCyan"<<"darkMagenta"<<"darkYellow"<<"darkGray"<<"darkRed"<<"darkBlue"<<"darkGreen"<<"lightGray" <<"red"<<"blue"<<"green"<<"black"<<"yellow"<<"magenta"<<"cyan"<<"gray"<<"darkCyan"<<"darkMagenta"<<"darkYellow"<<"darkGray"<<"darkRed"<<"darkBlue"<<"darkGreen"<<"lightGray" <<"red"<<"blue"<<"green"<<"black"<<"yellow"<<"magenta"<<"cyan"<<"gray"<<"darkCyan"<<"darkMagenta"<<"darkYellow"<<"darkGray"<<"darkRed"<<"darkBlue"<<"darkGreen"<<"lightGray" <<"red"<<"blue"<<"green"<<"black"<<"yellow"<<"magenta"<<"cyan"<<"gray"<<"darkCyan"<<"darkMagenta"<<"darkYellow"<<"darkGray"<<"darkRed"<<"darkBlue"<<"darkGreen"<<"lightGray";

    iterator_colors=0;
    is_stop_pressed=false;
    alignScales();
    setAutoReplot(false);

    parameters_list = setCurveLabels(*list);
    current_min_limit=0;
    current_max_limit=0;


    QwtPlotZoomer* zoomer = new MyZoomer(canvas());


    QwtPlotPanner *panner = new QwtPlotPanner(canvas());
    panner->setAxisEnabled(QwtPlot::yRight, true);
    panner->setMouseButton(Qt::MidButton);

    // Avoid jumping when labels with more/less digits
    // appear/disappear when scrolling vertically
    const QFontMetrics fm(axisWidget(QwtPlot::yLeft)->font());
    QwtScaleDraw *sd = axisScaleDraw(QwtPlot::yLeft);
    sd->setMinimumExtent( fm.width("100.00") );

    const QColor c(Qt::darkBlue);
    zoomer->setRubberBandPen(c);
    zoomer->setTrackerPen(c);

    setGridPlot();
    initTimeData();

#if 0
    //  Insert zero line at y = 0
    QwtPlotMarker *mY = new QwtPlotMarker();
    mY->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
    mY->setLineStyle(QwtPlotMarker::HLine);
    mY->setYValue(0.0);
    mY->attach(this);
#endif

    initAxisX();
    initAxisY();
    initCurves();

    setTimerInterval(1000);// 1 second = 1000
}
开发者ID:AloshkaD,项目名称:human_machine_interface,代码行数:59,代码来源:data_plot.cpp

示例9: dodaj_naj

void wykres::dodaj_naj(double d) {
    QwtPlotMarker *mY = new QwtPlotMarker();
    mY->setLabel(QString::fromLatin1("Osobnik najlepszy = ")+QString::number(-d));
    mY->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
    mY->setLineStyle(QwtPlotMarker::HLine);
    mY->setYValue(-d);
    mY->attach(this);
}
开发者ID:maxbog,项目名称:f1,代码行数:8,代码来源:wykres.cpp

示例10: Plot_AddHLine

void Plot_AddHLine(QwtPlot* plot, double value , double r , double g, double b)
{
    QwtPlotMarker *marker = new QwtPlotMarker();
    marker->setLineStyle ( QwtPlotMarker::HLine );
    marker->setLinePen(QPen(QColor(r, g, b, 128), 1, Qt::DashDotLine));
    marker->attach( plot );
    marker->setYValue( value );
}
开发者ID:hsoerensen,项目名称:qctools,代码行数:8,代码来源:Plot.cpp

示例11: createVerticalPlotMarker

//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
QwtPlotMarker* RicGridStatisticsDialog::createVerticalPlotMarker(const QColor& color, double xValue)
{
    QwtPlotMarker* marker = new QwtPlotMarker();
    marker->setXValue(xValue);
    marker->setLineStyle(QwtPlotMarker::VLine);
    marker->setLinePen(color, 2, Qt::SolidLine);
    return marker;
}
开发者ID:OPM,项目名称:ResInsight,代码行数:11,代码来源:RicGridStatisticsDialog.cpp

示例12: setMarkerLineStyle

/*!
  \brief Specify the line style for a marker
  \param key Marker key
  \param st Line style: <code>QwtMarker::HLine, QwtMarker::VLine,
                        QwtMarker::NoLine</code> or a combination of them.
  \return \c TRUE if the specified marker exists
*/
bool QwtPlot::setMarkerLineStyle(long key, QwtMarker::LineStyle st)
{
    int rv = FALSE;
    QwtPlotMarker *m;
    if ((m = d_markers->find(key)))
    {
        m->setLineStyle(st);
        rv = TRUE;
    }
    return rv;
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:18,代码来源:qwt_plot_marker.cpp

示例13: markerPen

  /**
   * This is a helper method to create new band markers with the same line
   *   style and a custom color.
   *
   * @param color The color of the band marker
   * @return The requested plot marker; ownership is passed to the caller
   */
  QwtPlotMarker *SpectralPlotWindow::createMarker(QColor color) {
    QPen markerPen(color);
    markerPen.setWidth(1);

    QwtPlotMarker *newMarker = new QwtPlotMarker;
    newMarker->setLineStyle(QwtPlotMarker::LineStyle(2));
    newMarker->setLinePen(markerPen);
    newMarker->attach(plot());
    newMarker->setVisible(false);

    return newMarker;
  }
开发者ID:corburn,项目名称:ISIS,代码行数:19,代码来源:SpectralPlotWindow.cpp

示例14: setExtraCaption

/**
 * Dodaje dodatkowy opis wykresu.
 *
 * @param caption opis wykresu
 * @param x pozycja na wykresie w skali czasu
 * @param y pozycja na wykresie w skali pionowej (np. częstotliwości)
 */
void SpectrogramPlot::setExtraCaption(QString caption, double x, double y)
{
    QwtPlotMarker* marker = new QwtPlotMarker();
    QwtText label(caption);
    label.setColor(QColor::fromRgba(0x88FFFFFF));
    label.setFont(QFont("Arial", 10, QFont::Bold));
    marker->setLabel(label);
    marker->setLineStyle(QwtPlotMarker::NoLine);
    marker->setValue(x, y);
    marker->setLabelAlignment(Qt::AlignRight | Qt::AlignBottom);
    marker->attach(this);
}
开发者ID:akhmadzaki,项目名称:SimpleBird,代码行数:19,代码来源:SpectrogramPlot.cpp

示例15: populate

void Plot::populate()
{
    // Insert new curves
    QwtPlotCurve *cSin = new QwtPlotCurve("y = sin(x)");
    cSin->setRenderHint(QwtPlotItem::RenderAntialiased);
    cSin->setLegendAttribute(QwtPlotCurve::LegendShowLine, true);
    cSin->setPen(QPen(Qt::red));
    cSin->attach(this);

    QwtPlotCurve *cCos = new QwtPlotCurve("y = cos(x)");
    cCos->setRenderHint(QwtPlotItem::RenderAntialiased);
    cCos->setLegendAttribute(QwtPlotCurve::LegendShowLine, true);
    cCos->setPen(QPen(Qt::blue));
    cCos->attach(this);

    // Create sin and cos data
    cSin->setData(new FunctionData(::sin));
    cCos->setData(new FunctionData(::cos));

    // Insert markers
    
    //  ...a horizontal line at y = 0...
    QwtPlotMarker *mY = new QwtPlotMarker();
    mY->setLabel(QString::fromLatin1("y = 0"));
    mY->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
    mY->setLineStyle(QwtPlotMarker::HLine);
    mY->setYValue(0.0);
    mY->attach(this);

    //  ...a vertical line at x = 2 * pi
    QwtPlotMarker *mX = new QwtPlotMarker();
    mX->setLabel(QString::fromLatin1("x = 2 pi"));
    mX->setLabelAlignment(Qt::AlignLeft | Qt::AlignBottom);
    mX->setLabelOrientation(Qt::Vertical);
    mX->setLineStyle(QwtPlotMarker::VLine);
    mX->setLinePen(QPen(Qt::black, 0, Qt::DashDotLine));
    mX->setXValue(2.0 * M_PI);
    mX->attach(this);
}
开发者ID:albore,项目名称:pandora,代码行数:39,代码来源:sinusplot.cpp


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