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


C++ PointList::end方法代码示例

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


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

示例1: getBomberman

Point Board::getBomberman() const {
	PointList rslt;
	rslt.splice(rslt.end(), findAll(Element(LL("BOMBERMAN"))));
	rslt.splice(rslt.end(), findAll(Element(LL("BOMB_BOMBERMAN"))));
	rslt.splice(rslt.end(), findAll(Element(LL("DEAD_BOMBERMAN"))));
	return rslt.front();
}
开发者ID:vic-trouble,项目名称:snake,代码行数:7,代码来源:Board.cpp

示例2: getOtherBombermans

PointList Board::getOtherBombermans() const {
	PointList rslt;
	rslt.splice(rslt.end(), findAll(Element(LL("OTHER_BOMBERMAN"))));
	rslt.splice(rslt.end(), findAll(Element(LL("OTHER_BOMB_BOMBERMAN"))));
	rslt.splice(rslt.end(), findAll(Element(LL("OTHER_DEAD_BOMBERMAN"))));
	return rslt;
}
开发者ID:vic-trouble,项目名称:snake,代码行数:7,代码来源:Board.cpp

示例3: getBarriers

PointList Board::getBarriers() const {
	PointList rslt = getMeatChoppers();
	rslt.splice(rslt.end(), getWalls());
	rslt.splice(rslt.end(), getBombs());
	rslt.splice(rslt.end(), getDestoyWalls());
	rslt.splice(rslt.end(), getOtherBombermans());
	return removeDuplicates(rslt);
}
开发者ID:vic-trouble,项目名称:snake,代码行数:8,代码来源:Board.cpp

示例4: handleDual

void handleDual(Hyperbola_segment_2 hs, std::vector<PointList>& polylines)
{
        PointList p;
        hs.generate_points(p);
        PointList points;
        points.insert(points.end(), p.begin(), p.end());
        polylines.push_back(points);
}
开发者ID:AmbatiRao,项目名称:swp12,代码行数:8,代码来源:handle-dual-disamb.c

示例5: AppendLineToRing

/*!
  \brief Add linestring to a ring (private)

  \param[in,out] papoRing list of rings
  \param poLine pointer to linestring to be added to a ring 

  \return TRUE on success
  \return FALSE on failure
*/
bool IVFKDataBlock::AppendLineToRing(PointListArray *papoRing, const OGRLineString *poLine, bool bNewRing)
{
    OGRPoint *poFirst, *poLast;
    OGRPoint *poFirstNew, *poLastNew;

    OGRPoint  pt;
    PointList poList;

    /* OGRLineString -> PointList */
    for (int i = 0; i < poLine->getNumPoints(); i++) {
        poLine->getPoint(i, &pt);
        poList.push_back(pt);
    }

    /* create new ring */
    if (bNewRing) {
        papoRing->push_back(new PointList(poList));
        return TRUE;
    }
    
    poFirstNew = &(poList.front());
    poLastNew  = &(poList.back());
    for (PointListArray::const_iterator i = papoRing->begin(), e = papoRing->end();
         i != e; ++i) {
        PointList *ring = (*i);
        poFirst = &(ring->front());
        poLast  = &(ring->back());
        if (!poFirst || !poLast || poLine->getNumPoints() < 2)
            return FALSE;

        if (poFirstNew->Equals(poLast)) {
            /* forward, skip first point */
            ring->insert(ring->end(), poList.begin()+1, poList.end());
            return TRUE;
        }
        
        if (poFirstNew->Equals(poFirst)) {
            /* backward, skip last point */
            ring->insert(ring->begin(), poList.rbegin(), poList.rend()-1);
            return TRUE;
        }
        
        if (poLastNew->Equals(poLast)) {
            /* backward, skip first point */
            ring->insert(ring->end(), poList.rbegin()+1, poList.rend());
            return TRUE;
        }
        
        if (poLastNew->Equals(poFirst)) {
            /* forward, skip last point */
            ring->insert(ring->begin(), poList.begin(), poList.end()-1);
            return TRUE;
        }
    }

    return FALSE;
}
开发者ID:sylvainallard,项目名称:gdal,代码行数:66,代码来源:vfkdatablock.cpp

示例6: removeDuplicates

PointList Board::removeDuplicates(PointList lst) const {
	PointList res;
	for (auto pt : lst) {
		if (std::find(res.begin(), res.end(), pt) == res.end()) {
			res.push_back(pt);
		}
	}
	return res;
}
开发者ID:vic-trouble,项目名称:snake,代码行数:9,代码来源:Board.cpp

示例7: getBombs

PointList Board::getBombs() const {
	PointList rslt;
    rslt.splice(rslt.end(), findAll(Element(LL("BOMB_TIMER_1"))));
    rslt.splice(rslt.end(), findAll(Element(LL("BOMB_TIMER_2"))));
    rslt.splice(rslt.end(), findAll(Element(LL("BOMB_TIMER_3"))));
    rslt.splice(rslt.end(), findAll(Element(LL("BOMB_TIMER_4"))));
    rslt.splice(rslt.end(), findAll(Element(LL("BOMB_TIMER_5"))));
    rslt.splice(rslt.end(), findAll(Element(LL("BOMB_BOMBERMAN"))));
    return rslt;
}
开发者ID:vic-trouble,项目名称:snake,代码行数:10,代码来源:Board.cpp

示例8: handleDual

void handleDual(Hyperbola_ray_2 hr, Iso_rectangle_2 crect, std::vector<PointList>& polylines)
{
        std::cerr << "hyperbola ray" << std::endl; // hr.draw(str);
        PointList p;
        hr.generate_points(p);
        PointList points;
        points.insert(points.end(), p.begin(), p.end());
        polylines.push_back(points);
        for (unsigned int i = 0; i < p.size() - 1; i++) {
          Segment_2 seg(p[i], p[i+1]);
          // doing nothing here
        }
}
开发者ID:AmbatiRao,项目名称:swp12,代码行数:13,代码来源:create_polygons.cpp

示例9: CreateSplat

GLuint CreateSplat(GLuint quadVao, PointList positions)
{
    const int Size = 64;

    Surface surface = CreateVolume(Size, Size, Size);
    GLuint program = CreateProgram("Splat.VS", "Splat.GS", "Splat.FS");
    glUseProgram(program);

    GLint inverseSize = glGetUniformLocation(program, "InverseSize");
    glUniform1f(inverseSize, 1.0f / (float) Size);

    const float innerScale = 0.4f;

    GLint inverseVariance = glGetUniformLocation(program, "InverseVariance");
    glUniform1f(inverseVariance, -1.0f / (2.0f * innerScale * innerScale));

    GLint normalizationConstant = glGetUniformLocation(program, "NormalizationConstant");
    glUniform1f(normalizationConstant, 1.0f / std::pow(std::sqrt(TwoPi) * innerScale, 3.0f));

    glBindFramebuffer(GL_FRAMEBUFFER, surface.FboHandle);
    glBindTexture(GL_TEXTURE_3D, 0);
    glViewport(0, 0, Size, Size);
    glBindVertexArray(quadVao);
    
    glEnable(GL_BLEND);
    glBlendFunc(GL_ONE, GL_ONE);

    PointList::const_iterator i = positions.begin();
    for (; i != positions.end(); ++i) {

        PointList::const_iterator next = i;
        if (++next == positions.end())
            next = positions.begin();
        VectorMath::Vector3 velocity = (*next - *i);

        GLint center = glGetUniformLocation(program, "Center");
        glUniform4f(center, i->getX(), i->getY(), i->getZ(), 0);

        GLint color = glGetUniformLocation(program, "Color");
        glUniform3fv(color, 1, (float*) &velocity);

        glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, Size);
    }

    PezCheckCondition(GL_NO_ERROR == glGetError(), "Unable to create splat.");
    
    glViewport(0, 0, PEZ_VIEWPORT_WIDTH, PEZ_VIEWPORT_HEIGHT);
    glDisable(GL_BLEND);
    
    return surface.TextureHandle[0];
}
开发者ID:jsj2008,项目名称:blog-source,代码行数:51,代码来源:CreateSplat.cpp

示例10: RenderCallback

void RenderCallback()
{
	// Clear buffers
	glClearColor(1.0f,1.0f,1.0f,1.0f);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glPointSize(1.0);

	glColor3f(0,0,0);
	glLineWidth(2.0f);
	int i, j;
	glBegin(GL_LINES);
	//渲染凸多边形P
	for( i = gN - 1, j = 0 ; j < gN ; i = j, j += 1 )
	{
		glVertex2f(gP[i].x,gP[i].y);
		glVertex2f(gP[j].x,gP[j].y);
	}
	//渲染凸多边形Q
	for( i = gM - 1, j = 0 ; j < gM ; i = j, j += 1 )
	{
		glVertex2f(gQ[i].x,gQ[i].y);
		glVertex2f(gQ[j].x,gQ[j].y);
	}

	PointList::iterator it;
	for( it = gInterList.begin() ; it != gInterList.end() ; it ++ )
	{
		glVertex2f((*it).x,(*it).y - 20);
		glVertex2f((*it).x,(*it).y + 20);
	}
	glEnd();
	glutSwapBuffers();
}
开发者ID:chongbingbao,项目名称:Programmers_Computational_Geometry,代码行数:33,代码来源:ConvexIntersectConvex.cpp

示例11: draw_hand_trace

    void draw_hand_trace(sf::RenderWindow& window,
                         const PointList& pointList,
                         const sf::Color& color,
                         const float depthScale)
    {
        if (pointList.size() < 2) { return; }

        const float thickness = 4;
        auto it = pointList.begin();
        astra::Vector2i previousPoint = *it;

        while (it != pointList.end())
        {
            const astra::Vector2i currentPoint = *it;
            ++it;

            const sf::Vector2f p1((previousPoint.x + .5f) * depthScale,
                                  (previousPoint.y + .5f) * depthScale);
            const sf::Vector2f p2((currentPoint.x + .5f) * depthScale,
                                  (currentPoint.y + .5f) * depthScale);
            previousPoint = currentPoint;

            window.draw(sfLine(p1, p2, color, thickness));
        }
    }
开发者ID:gaocan1992,项目名称:astra,代码行数:25,代码来源:main.cpp

示例12: getFrontiers

FrontierList Planner::getFrontiers(GridMap* map, GridPoint start)
{
	// Initialization
	mFrontierCellCount = 0;
	mFrontierCount = 0;
	GridMap plan = GridMap(map->getWidth(), map->getHeight());
	FrontierList result;
	
	// Initialize the queue with the robot position
	Queue queue;
	queue.insert(Entry(0, start));
	plan.setData(start, VISIBLE);
	
	// Do full search with weightless Dijkstra-Algorithm
	while(!queue.empty())
	{		
		// Get the nearest cell from the queue
		Queue::iterator next = queue.begin();
		int distance = next->first;
		GridPoint point = next->second;
		queue.erase(next);
		
		// Add neighbors
		bool isFrontier = false;
		PointList neighbors = getNeighbors(point, false);
        char c = 0;
		for(PointList::const_iterator cell = neighbors.begin(); cell < neighbors.end(); cell++)
		{   
            if(map->getData(*cell,c) && c == UNKNOWN)
            {
                plan.setData(*cell, OBSTACLE);
                isFrontier = true;
                break;
            }
            if(map->getData(*cell, c) && c == VISIBLE && 
                plan.getData(*cell, c) && c == UNKNOWN)
            {
                queue.insert(Entry(distance+1, *cell));
                plan.setData(*cell, VISIBLE);
            }
		}
		
		if(isFrontier)
		{
			result.push_back(getFrontier(map, &plan, point));
		}
	}
	
	// Set result message and return the point list
	if(result.size() > 0)
	{
		mStatus = SUCCESS;
		sprintf(mStatusMessage, "Found %d frontiers with %d frontier cells.", mFrontierCount, mFrontierCellCount);
	}else
	{
		mStatus = NO_GOAL;
		sprintf(mStatusMessage, "No reachable frontiers found.");
	}
	return result;
}
开发者ID:rock-planning,项目名称:planning-exploration,代码行数:60,代码来源:Planner.cpp

示例13:

 void Dataset<D, ELEM_TYPE>::load(const PointList& newPoints)
 {
     // Pre-allocate memory in one sys call
     m_points.reserve(m_points.size() + newPoints.size());
     // Append given points to end of current point list
     m_points.insert(m_points.end(), newPoints.begin(), newPoints.end());
 }
开发者ID:DonaldWhyte,项目名称:mdsearch,代码行数:7,代码来源:dataset.hpp

示例14: setCoverageMap

void Planner::setCoverageMap(PointList points, char value)
{
	PointList::iterator i;
	for(i = points.begin(); i < points.end(); i++)
	{
		mCoverageMap->setData(*i, value);
	}
}
开发者ID:rock-planning,项目名称:planning-exploration,代码行数:8,代码来源:Planner.cpp

示例15: addReading

void Planner::addReading(Pose p)
{
    PointList points = willBeExplored(p);
    for(PointList::iterator i = points.begin(); i < points.end(); ++i)
    {
        mCoverageMap->setData(*i, VISIBLE);
    }
}
开发者ID:rock-planning,项目名称:planning-exploration,代码行数:8,代码来源:Planner.cpp


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