本文整理汇总了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;
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}
示例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;
}
示例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";
}