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


C++ setPoints函数代码示例

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


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

示例1: setKeyPoints

void graphics::InterpolationPlot::replot(){
    QVector<double> xIn,yIn;
    points.getPointsAsSeperateVectors(xIn,yIn);
    setKeyPoints(xIn,yIn);
    int i=1;
    if(points.size() > 2){
        int n =1000;
        custom_types::PointsVector PointsOut;
        QVector<double> xOut, yOut;
        double xMin,xMax,yMin,yMax;
        getRange(xMin,xMax,yMin,yMax);
        QList<QString>::iterator it = activeITypes.begin();
        for(;it != activeITypes.end(); ++it){
            PointsOut.clear();
            IType * tmpIType = iTypes[*it];
            tmpIType->algorithm->calculateInterpolation(points,PointsOut,xMin,xMax,n);
            PointsOut.getPointsAsSeperateVectors(xOut,yOut);
            setPoints(xOut,yOut,i,tmpIType->color);
            ++i;
        }
    }
    int oldActiveITypesCount = activeITypesCount;
    activeITypesCount = i-1;
    xIn.clear();
    yIn.clear();
    for(; i <= oldActiveITypesCount; ++i) setPoints(xIn,yIn,i);
    graphics::QStcePlot::replot();
}
开发者ID:pingo95,项目名称:SEP_Uebung,代码行数:28,代码来源:Interpolationplot.cpp

示例2: QRect

void FlowContainer::setFullBounds( bool full )
{
	if ( full || !b_expanded )
	{
		QRect bounds = b_expanded ? m_sizeRect : QRect( m_sizeRect.x(), m_sizeRect.y(), m_sizeRect.width(), topStrip );
		setPoints( QPolygon(bounds) );
		return;
	}
	
// 	kDebug() << k_funcinfo << "width="<<width()<<" height="<<height()<<endl;
	
	QPolygon pa(10);
	pa[0] = QPoint( 0, 0 );
	pa[1] = QPoint( width(), 0 );
	pa[2] = QPoint( width(), height() );
	pa[3] = QPoint( 0, height() );
	pa[4] = QPoint( 0, 0 );
	pa[5] = QPoint( 8, topStrip );
	pa[6] = QPoint( 8, height()-botStrip );
	pa[7] = QPoint( width()-8, height()-botStrip );
	pa[8] = QPoint( width()-8, topStrip );
	pa[9] = QPoint( 8, topStrip );
	pa.translate( offsetX(), offsetY() );
	setPoints(pa);
}
开发者ID:ktechlab,项目名称:ktechlab,代码行数:25,代码来源:flowcontainer.cpp

示例3: isFinished

void Game::onTaskAnswered()
{
    bool oldFinished = isFinished();
    m_tasksAnswered++;
    if(m_currentTask->isCorrect())
        m_tasksAnsweredCorrectly++;
    emit tasksAnsweredChanged(m_tasksAnswered);


    // Adding points
    if (getMode()==Mode::DRAG) {
        setPoints(getPoints() + m_currentTask->getScore());
    }
    else {
        if(m_currentTask->isCorrect()){
            int receivedPoints = 50 * getMultiplier();
            setPoints(getPoints() + receivedPoints);
            setMultiplier(getMultiplier()+1);
        } else {
            setMultiplier(1);
        }
    }

    bool newFinished = isFinished();
    if(oldFinished != newFinished)emit finishedChanged(newFinished);
}
开发者ID:MartinTonne,项目名称:Nerve-Blocker,代码行数:26,代码来源:game.cpp

示例4: setPointCount

//-------------------------------------------------------------
void ConeGeometry::init(DolfinGui *ui)
{
    setPointCount(6);
    setRadiusCount(2);
    setCreated(false);
    setGuiWindow(ui);
    setPoints(new double[getPointCount()]);
    setPoints(new double[getRadiusCount()]);
    setMyType("Cone");
}
开发者ID:nkylstad,项目名称:sommerjobb,代码行数:11,代码来源:ConeGeometry.cpp

示例5: setPoints

Triangle::Triangle(const QPoint& p1, const QPoint& p2, const QPoint& p3) {
    QList<QPoint> list;
    list.append(p1);
    list.append(p2);
    list.append(p3);
    setPoints(&list);
}
开发者ID:nothingelsematters7,项目名称:TP_Task1,代码行数:7,代码来源:Triangle.cpp

示例6: optionTimes_

    SwaptionVolCube1::Cube::Cube(
                                    const std::vector<Date>& optionDates,
                                    const std::vector<Period>& swapTenors,
                                    const std::vector<Time>& optionTimes,
                                    const std::vector<Time>& swapLengths,
                                    Size nLayers,
                                    bool extrapolation)
    : optionTimes_(optionTimes), swapLengths_(swapLengths),
      optionDates_(optionDates), swapTenors_(swapTenors),
      nLayers_(nLayers), extrapolation_(extrapolation) {

        QL_REQUIRE(optionTimes.size()>1,"Cube::Cube(...): optionTimes.size()<2");
        QL_REQUIRE(swapLengths.size()>1,"Cube::Cube(...): swapLengths.size()<2");

        QL_REQUIRE(optionTimes.size()==optionDates.size(),
                   "Cube::Cube(...): optionTimes/optionDates mismatch");
        QL_REQUIRE(swapTenors.size()==swapLengths.size(),
                   "Cube::Cube(...): swapTenors/swapLengths mismatch");

        std::vector<Matrix> points(nLayers_, Matrix(optionTimes_.size(),
                                                    swapLengths_.size(), 0.0));

        for (Size k=0;k<nLayers_;k++) {
            transposedPoints_.push_back(transpose(points[k]));

            boost::shared_ptr<Interpolation2D> interpolation (new
                BilinearInterpolation (optionTimes_.begin(), optionTimes_.end(),
                                       swapLengths_.begin(), swapLengths_.end(),
                                       transposedPoints_[k]));
            interpolators_.push_back(boost::shared_ptr<Interpolation2D>(
                new FlatExtrapolator2D(interpolation)));
            interpolators_[k]->enableExtrapolation();
        }
        setPoints(points);
     }
开发者ID:AlexJiaeHwang,项目名称:quantlib,代码行数:35,代码来源:swaptionvolcube1.cpp

示例7: QL_REQUIRE

    void SwaptionVolCube1::Cube::expandLayers(
                                                 Size i, bool expandOptionTimes,
                                                 Size j, bool expandSwapLengths) {
        QL_REQUIRE(i<=optionTimes_.size(),"Cube::expandLayers: incompatible size 1");
        QL_REQUIRE(j<=swapLengths_.size(),"Cube::expandLayers: incompatible size 2");

        if (expandOptionTimes) {
            optionTimes_.insert(optionTimes_.begin()+i,0.);
            optionDates_.insert(optionDates_.begin()+i, Date());
        }
        if (expandSwapLengths) {
            swapLengths_.insert(swapLengths_.begin()+j,0.);
            swapTenors_.insert(swapTenors_.begin()+j, Period());
        }

        std::vector<Matrix> newPoints(nLayers_,Matrix(optionTimes_.size(),
                                                      swapLengths_.size(), 0.));

        for (Size k=0; k<nLayers_; ++k) {
            for (Size u=0; u<points_[k].rows(); ++u) {
                 Size indexOfRow = u;
                 if (u>=i && expandOptionTimes) indexOfRow = u+1;
                 for (Size v=0; v<points_[k].columns(); ++v) {
                      Size indexOfCol = v;
                      if (v>=j && expandSwapLengths) indexOfCol = v+1;
                      newPoints[k][indexOfRow][indexOfCol]=points_[k][u][v];
                 }
            }
        }
        setPoints(newPoints);
    }
开发者ID:AlexJiaeHwang,项目名称:quantlib,代码行数:31,代码来源:swaptionvolcube1.cpp

示例8: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    iScore1(0), iScore2(0)
{
    ui->setupUi(this);

    QGraphicsScene *scene = new QGraphicsScene(this);
    scene->setSceneRect(0, 0, ui->boardView->size().width()-30, ui->boardView->size().height()-30);

    QGraphicsRectItem *p1 = new QGraphicsRectItem(0, 0, 20, 80);
    p1->setBrush(QBrush(Qt::blue));
    QGraphicsRectItem *p2 = new QGraphicsRectItem(0, 0, 20, 80);
    p2->setBrush(QBrush(Qt::green));

    QGraphicsEllipseItem *ball = new QGraphicsEllipseItem(0, 0, 15, 15);
    ball->setBrush(QBrush(Qt::magenta));

    ui->boardView->setScene(scene);

    iLoop = new Gameplay(*scene, p1, p2, ball, this);
    QSize m(scene->sceneRect().size().width() + 10, scene->sceneRect().size().height() + 10);
    ui->boardView->setMinimumSize(m);
    ui->boardView->installEventFilter(iLoop);

    QObject::connect(iLoop, SIGNAL(goal(int)),
                     this, SLOT(addScore(int)));


    panel =  new ControlPanel(this);
    connect(panel, SIGNAL(pointsReady(std::vector<glm::vec2>)), iLoop, SLOT(setPoints(std::vector<glm::vec2>)));

    panel->show();
}
开发者ID:kaajo,项目名称:WccPong,代码行数:34,代码来源:mainwindow.cpp

示例9: setPoints

void BoxGeom::setSize(double width, double height, double depth) {

	if(width >= 0.0) {
		mWidth = width;
	}
	if(height >= 0.0) {
		mHeight = height;
	}
	if(depth >= 0.0) {
		mDepth = depth;
	}
		
	width = width / 2.0;
	height = height / 2.0;
	depth = depth / 2.0;

	QVector<Vector3D> points;

	points.append(Vector3D(-width, -height,  depth));
	points.append(Vector3D(-width,  height,  depth));
	points.append(Vector3D( width,  height,  depth));
	points.append(Vector3D( width, -height,  depth));
	points.append(Vector3D(-width,  height, -depth));
	points.append(Vector3D(-width, -height, -depth));
	points.append(Vector3D( width, -height, -depth));
	points.append(Vector3D( width,  height, -depth));
	
	setPoints(points);
}
开发者ID:nerd-toolkit,项目名称:nerd,代码行数:29,代码来源:BoxGeom.cpp

示例10: LineString

 LineString::LineString(QList<Point*> const points, QString name, QPen* pen)
         :Curve(name)
 {
     mypen = pen;
     LineString();
     setPoints(points);
 }
开发者ID:volthouse,项目名称:desktop,代码行数:7,代码来源:linestring.cpp

示例11: QCanvasLine

	//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	//
	// KviCanvasLine
	//
	KviCanvasLine::KviCanvasLine(QCanvas * c,int x1,int y1,int x2,int y2)
	: QCanvasLine(c)
	{
		setPoints(x1,y1,x2,y2);
		m_properties.insert("uLineWidth",QVariant((unsigned int)0));
		m_properties.insert("clrForeground",QVariant(QColor()));
	}
开发者ID:netrunner-debian-kde-extras,项目名称:kvirc,代码行数:11,代码来源:canvaswidget.cpp

示例12: setBackground

Format::Format (QTextCharFormat tcf, QObject* parent):QObject (parent)
{
	setBackground( tcf.background().color() );
	setForeground( tcf.foreground().color() );
	setBold( tcf.fontWeight() >= QFont::Bold );
	setItalic( tcf.fontItalic() );
	setPoints ( tcf.fontPointSize() );
}
开发者ID:tazio,项目名称:QtTail,代码行数:8,代码来源:format.cpp

示例13: setPoints

Polygon& Polygon::operator=(const Polygon& val)
{

	//vertices and color
	setPoints(val.m_points, val.m_colors);

	return *this;
}
开发者ID:veloxsouth,项目名称:GenVec,代码行数:8,代码来源:Polygon.cpp

示例14: BoundingBox

//=====================================================
void GlRegularPolygon::computePolygon() {
  boundingBox = BoundingBox();
  boundingBox.expand(position+size/2.f);
  boundingBox.expand(position-size/2.f);

  setPoints(computeRegularPolygon(numberOfSides, position, size, startAngle));

  clearGenerated();
}
开发者ID:mneumann,项目名称:tulip,代码行数:10,代码来源:GlRegularPolygon.cpp

示例15: setKillsBottom

Shell::Shell()
{
	setKillsBottom(true);
	setKillsSide(true);
	setKillsTop(false);
	setPoints(0);
	setXVelocity(2.0);
	setYVelocity(0.0);
}
开发者ID:jsj2008,项目名称:CS330,代码行数:9,代码来源:Shell.cpp


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