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


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

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


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

示例1: BuildAttribs

Contour::Contour( const PointArray& pts, const EdgeArray& ea, const TriangleArray& ta )
{
    // 将点数据复制一份
    std::copy( pts.begin(), pts.end(), std::back_inserter( pa ) );
    // 构造边和三角形属性数据
    BuildAttribs( ea, ta, eaa, taa );
}
开发者ID:kanbang,项目名称:myexercise,代码行数:7,代码来源:Trace.cpp

示例2: enclosedPoints

	IntVectorDataPtr enclosedPoints( const Box &bound )
	{
		typedef std::vector<typename T::Iterator> PointArray;

		PointArray points;

		m_tree->enclosedPoints( bound, std::back_insert_iterator<PointArray>( points ) );

		IntVectorDataPtr indices = new IntVectorData();

		indices->writable().reserve( points.size() );

		for (typename PointArray::const_iterator it = points.begin(); it != points.end(); ++it)
		{
			indices->writable().push_back(  std::distance( m_points->readable().begin(), *it ) );
		}

		return indices;
	}
开发者ID:AtomicFiction,项目名称:cortex,代码行数:19,代码来源:KDTreeBinding.cpp

示例3: nearestNeighbours

	IntVectorDataPtr nearestNeighbours(const typename T::Point &p, typename T::Point::BaseType r)
	{
		assert(m_tree);

		typedef std::vector<typename T::Iterator> PointArray;

		PointArray points;

		unsigned int num = m_tree->nearestNeighbours(p, r, points);

		IntVectorDataPtr indices = new IntVectorData();

		indices->writable().reserve( num );

		for (typename PointArray::const_iterator it = points.begin(); it != points.end(); ++it)
		{
			indices->writable().push_back(  std::distance( m_points->readable().begin(), *it ) );
		}

		return indices;

	}
开发者ID:AtomicFiction,项目名称:cortex,代码行数:22,代码来源:KDTreeBinding.cpp

示例4: saveData

/*******************************************************************************
 * Save current frame's feature point, 3Dpoints, camera position (3x4 SE)
 *  to file named as 'fnOut'
 *
 * File format:
 *      nf np
 *      cam (3x4 matrix)
 *      1 x y (feature index, x, y)
 *      2 x y
 *      ...
 *      20 X Y Z 2  (point index, x, y, z, feature index)
 *      10 X Y Z 1
 *      ...
 *
 ******************************************************************************/
int SfM_Frame::saveData(string fnOut, PointArray &pta)
{
    vector<Point3d>     pa;
    vector<int>         pai, kpi;

    FILE                *fp = NULL;
    int                 i, j;

    // extract points
    {
        PointArray::iterator    it;
        map<int, int>           *m;
        map<int, int>::iterator itmii;

        pa.reserve(pta.size());
        pai.reserve(pta.size());
        kpi.reserve(pta.size());

        i = 0;
        for(it=pta.begin(); it!=pta.end(); it++) {
            m = &( it->img_kp );

            itmii = m->find(idx);
            if( itmii != m->end() ) {
                kpi.push_back(itmii->second);
                pai.push_back(i);
                pa.push_back(it->pt);
            }

            i++;
        }
    }

    // open file
    fp = fopen(fnOut.c_str(), "wt");
    if( fp == NULL ) {
        dbg_pe("Failed to open file: %s\n", fnOut.c_str());
        return -1;
    }

    // save feature number, 3D point numnber
    fprintf(fp, "%d %d\n", kpRaw.size(), pa.size());

    // save cmaera SE3 (3x4 matrix) (row first)
    for(j=0; j<3; j++) for(i=0; i<4; i++)
        fprintf(fp, "%g ", camP(j, i));
    fprintf(fp, "\n");

    // save feature points
    for(i=0; i<kpRaw.size(); i++)
        fprintf(fp, "%d %g %g\n", i, kpRaw[i].pt.x, kpRaw[i].pt.y);

    // save 3D points
    for(i=0; i<pa.size(); i++) {
        fprintf(fp, "%d %g %g %g %d\n", pai[i], pa[i].x, pa[i].y, pa[i].z, kpi[i]);
    }


    fclose(fp);

    return 0;
}
开发者ID:bushuhui,项目名称:SequenceSFM,代码行数:77,代码来源:sfm_frame.cpp


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