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


C++ Indices类代码示例

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


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

示例1: indexConcreteCellPath

Octree::Indices Octree::indexCellPath(const Locations& path) {
    // First through the allocated cells
    Indices cellPath = indexConcreteCellPath(path);

    // Catch up from the last allocated cell on the path
    auto currentIndex = cellPath.back();

    for (int l = (Index) cellPath.size(); l < (Index) path.size(); l++) {
        auto& location = path[l];

        // Allocate the new index & connect it to the parent
        auto newIndex = allocateCell(currentIndex, location);

        // One more cell index on the path, moving on
        currentIndex = newIndex;
        cellPath.push_back(currentIndex);

        // Except !!! if we actually couldn't allocate anymore
        if (newIndex == INVALID_CELL) {
            // no more cellID available, stop allocating
            // THe last index added is INVALID_CELL so the caller will know we failed allocating everything
            break;
        }
    }

    return cellPath;
}
开发者ID:AlphaStaxLLC,项目名称:hifi,代码行数:27,代码来源:SpatialTree.cpp

示例2: Tile

// Copy and validate indices.
Tiles::Tiles(Indices const& rIndices, bool remoteFlag) {
    ConstIterator i_index;
    for (i_index = rIndices.begin(); i_index != rIndices.end(); i_index++) {
        IndexType const index = *i_index;
        Tile const tile = Tile(index, remoteFlag); // validation happens here
        Add(tile);
    }
}
开发者ID:stephengold,项目名称:gold-tiles,代码行数:9,代码来源:tiles.cpp

示例3: assert

void pcl::gpu::Octree::radiusSearch(const Queries& queries, const Indices& indices, float radius, int max_results, NeighborIndices& results) const
{
    assert(queries.size() > 0 && indices.size() > 0);
    results.create(static_cast<int> (indices.size()), max_results);
    results.sizes.create(indices.size());
    
    const OctreeImpl::Queries& q = (const OctreeImpl::Queries&)queries;
    static_cast<OctreeImpl*>(impl)->radiusSearch(q, indices, radius, results);
}
开发者ID:SunBlack,项目名称:pcl,代码行数:9,代码来源:octree.cpp

示例4: ParsePatterns

 void ParsePatterns(const Indices& pats, Builder& builder) const
 {
   Dbg("Patterns: %1% to parse", pats.Count());
   for (Indices::Iterator it = pats.Items(); it; ++it)
   {
     const uint_t patIndex = *it;
     Dbg("Parse pattern %1%", patIndex);
     ParsePattern(patIndex, builder);
   }
 }
开发者ID:fgroen,项目名称:zxtune,代码行数:10,代码来源:etracker.cpp

示例5: _indexCount

AssignStatement::AssignStatement(Expression *target, Indices const &indices, Expression *value) 
    : _indexCount(0)
{
    _args.add(value);
    _indexCount = dint(indices.size());
    for(Indices::const_reverse_iterator i = indices.rbegin(); i != indices.rend(); ++i)
    {
        _args.add(*i);
    }
    _args.add(target);
}
开发者ID:cmbruns,项目名称:Doomsday-Engine,代码行数:11,代码来源:assignstatement.cpp

示例6: compute

void
FilterIndices::compute (PointCloud3D& output) const
{
  Indices indices;

  output.clear ();

  compute (indices);

  for (Indices::const_iterator it = indices.begin (); it != indices.end (); ++it) {
    output += this->operator[] (*it);
  }
}
开发者ID:gcorvala,项目名称:Cloud9,代码行数:13,代码来源:FilterIndices.cpp

示例7: ParseOrnaments

 void ParseOrnaments(const Indices& ornaments, Builder& builder) const
 {
   Dbg("Ornaments: %1% to parse", ornaments.Count());
   const std::size_t ornamentsTable = fromLE(Source.OrnamentsOffset);
   for (Indices::Iterator it = ornaments.Items(); it; ++it)
   {
     const uint_t ornIdx = *it;
     Dbg("Parse ornament %1%", ornIdx);
     const std::size_t ornOffset = ReadWord(ornamentsTable, ornIdx);
     Ornament result;
     ParseOrnament(ornOffset, result);
     builder.SetOrnament(ornIdx, result);
   }
 }
开发者ID:fgroen,项目名称:zxtune,代码行数:14,代码来源:etracker.cpp

示例8: ParseSamples

 void ParseSamples(const Indices& samples, Builder& builder) const
 {
   Dbg("Samples: %1% to parse", samples.Count());
   const std::size_t samplesTable = fromLE(Source.SamplesOffset);
   for (Indices::Iterator it = samples.Items(); it; ++it)
   {
     const uint_t samIdx = *it;
     Dbg("Parse sample %1%", samIdx);
     const std::size_t samOffset = ReadWord(samplesTable, samIdx);
     Sample result;
     ParseSample(samOffset, result);
     builder.SetSample(samIdx, result);
   }
 }
开发者ID:fgroen,项目名称:zxtune,代码行数:14,代码来源:etracker.cpp

示例9: filterParticles

	virtual Indices filterParticles(const Particles&)
	{
		Indices indices;

		const float time = parentDocument()->getAnimationTime();
		int nb = birth.size();
		float age = maxAge.getValue();
		for(int i=0; i<nb; ++i)
		{
			if(time >= birth[i] + age)
				indices.insert(i);
		}

		return indices;
	}
开发者ID:cguebert,项目名称:Panda,代码行数:15,代码来源:ParticleDestruction.cpp

示例10: GenerateOddRank

            std::vector<Indices> GenerateOddRank(const Indices& indices) const {
                // Get all the three partitions of indices
                auto partitions = indices.GetAllPartitions(3);

                std::vector<Indices> result;

                // Iterate over all partitions
                for (auto& partition : partitions) {
                    if (partition.second.Size() != 0) {
                        // Generate the two-partitions of the rest with GenerateEvenRank
                        auto list = GenerateEvenRank(partition.second);

                        // Iterate over all the possible gamma indices
                        for (auto &l : list) {
                            auto current = partition.first;
                            current.Append(l);
                            result.push_back(current);
                        }
                    } else {
                        result.push_back(partition.first);
                    }
                }

                return result;
            }
开发者ID:constructivegravity,项目名称:construct,代码行数:25,代码来源:base_tensor.hpp

示例11: reshape

   index_t
 reshape( Indices const& a_sizes)
 {
     index_t const rankp1=a_sizes.size()+1;
     my_strides.resize(rankp1);
     return init_strides( a_sizes);
 }
开发者ID:cppljevans,项目名称:variadic_templates,代码行数:7,代码来源:box_domain.hpp

示例12: setIndices

void RenderObject::setIndices( const Indices& indices )
{
    m_indices.clear();
    for ( int i = 0; i < indices.count(); ++i )
    {
        m_indices.append( indices.at( i ) );
    }
    if ( !m_indexBuffer.isCreated() )
    {
        m_indexBuffer.create();
    }

    m_vao.bind();;
    m_indexBuffer.bind();
    m_indexBuffer.allocate( m_indices.data(), m_indices.count() * sizeof( unsigned int ) );
    m_vao.release();
}
开发者ID:GromeTT,项目名称:KinectTracker,代码行数:17,代码来源:RenderObject.cpp

示例13: ok_indices

   bool
 ok_indices( Indices const& a_indices)
   /**@brief
    *  Is a_index... a valid argument to
    *  offset_at_indices?
    */
 {
     unsigned n=a_indices.size();
     bool result= n<=rank();
     auto index_iter=a_indices.begin();
     for( unsigned i=0; i<n && result; ++i,++index_iter)
     {
         index_t index_i=*index_iter;
         result = index_i<size(i);
     }
     return result;
 }
开发者ID:cppljevans,项目名称:variadic_templates,代码行数:17,代码来源:box_domain.hpp

示例14: GenerateTwoPartition

            /**
                Generates the
             */
            std::vector<std::pair<Indices, Indices>> GenerateTwoPartition(const Indices& indices) const {
                assert(indices.Size() > 1);

                std::vector<std::pair<Indices, Indices>> result;

                // Take the first letter
                auto first = indices[0];

                for (int i=1; i<indices.Size(); i++) {
                    auto current = indices[i];

                    Indices remaining = indices;

                    Indices gamma;
                    gamma.Insert(first);
                    gamma.Insert(current);

                    remaining.Remove(i);
                    remaining.Remove(0);

                    result.push_back({ gamma, remaining });
                }

                return result;
            }
开发者ID:constructivegravity,项目名称:construct,代码行数:28,代码来源:base_tensor.hpp

示例15: insert_constraints_using_spatial_sort

void
insert_constraints_using_spatial_sort(SDG& sdg)
{
  typedef typename Points_container::const_iterator Points_iterator;
  typedef std::vector<Points_iterator> Indices;
  typedef std::vector<typename SDG::Vertex_handle> Vertices;

  Sort_traits_2<K, Points_iterator> sort_traits;

  Indices indices;
  indices.reserve(points.size());
  for(Points_iterator it = points.begin(); it != points.end(); ++it) {
    indices.push_back(it);
  }
  std::random_shuffle(indices.begin(), indices.end());
  CGAL::spatial_sort(indices.begin(), indices.end(),
                     sort_traits);

  std::cerr << "Inserting " << points.size() << " points...";
  CGAL::Timer timer;
  timer.start();
  Vertices vertices;
  vertices.resize(points.size());
  typename SDG::Vertex_handle hint;
  for(typename Indices::const_iterator
        pt_it_it = indices.begin(), end = indices.end();
      pt_it_it != end; ++pt_it_it) {
    typename SDG::Vertex_handle vh = sdg.insert(**pt_it_it, hint);
    hint = vh;
    vertices[*pt_it_it - points.begin()] = vh;
  }
  timer.stop();
  std::cerr << " done (" << timer.time() << "s)\n";

  std::cerr << "Inserting " << constraints.size() << " constraints...";

  timer.reset();
  timer.start();
  for(typename Constraints_container::const_iterator
        cit = constraints.begin(), end = constraints.end();
      cit != end; ++cit) {
    const typename SDG::Vertex_handle& v1 = vertices[cit->first];
    const typename SDG::Vertex_handle& v2 = vertices[cit->second];
    if(v1 != v2)
      sdg.insert(v1, v2);
  }

  timer.stop();
  std::cerr << " done (" << timer.time() << "s)\n";
}
开发者ID:Asuzer,项目名称:cgal,代码行数:50,代码来源:benchmark-gen.cpp


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