本文整理汇总了C++中Bounds::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Bounds::begin方法的具体用法?C++ Bounds::begin怎么用?C++ Bounds::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bounds
的用法示例。
在下文中一共展示了Bounds::begin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateRandomParticles
void generateRandomParticles(
ParticleStore& particles,
Bounds const& bounds,
Generator& gen
) {
typedef typename ParticleStore::value_type Particle;
typedef typename ParticleStore::iterator PvIter;
for(PvIter p(particles.begin()); p!=particles.end(); ++p) {
generateRandomPosition(bounds.begin(), bounds.end(), p->beginPosition(), gen);
}
}
示例2: checkBoundsOK
static bool checkBoundsOK(
PositionIter posIter,
Bounds const& bounds
) {
typedef typename Bounds::const_iterator BvIter;
BvIter
b(bounds.begin()),
e(bounds.end());
for(; b!=e; ++b, ++posIter) if(*posIter < b->first || *posIter > b->second) return false;
return true;
}
示例3: moveParticleInbounds
static void moveParticleInbounds(
PositionIter posIter,
Bounds const& bounds,
NT jitter,
Generator& gen
) {
typedef typename Bounds::const_iterator BvIter;
BvIter
bb(bounds.begin());
for(; bb!=bounds.end(); ++bb, ++posIter) {
if(*posIter < bb->first) *posIter = bb->first + gen() * (bb->second - bb->first) * jitter;
else if(*posIter > bb->second) *posIter = bb->second - gen() * (bb->second - bb->first) * jitter;
}
}
示例4: runtime_error
std::vector< Projection::MappedPoint >
ScaledProjection::cut_region_of_interest_( const ROISpecification& r ) const
{
std::vector< MappedPoint > rv;
Bounds bb = get_region_of_interest_( r );
if ( r.guaranteed_row_width ) {
quantity< camera::length, int >
one =1 * camera::pixel, width = bb.width(Direction_X),
lower = bb.get_lower_edge( Direction_X ), upper = bb.get_upper_edge( Direction_X );
if ( width < *r.guaranteed_row_width ) {
lower -= one; width += one;
if ( width < *r.guaranteed_row_width )
{ upper += one; width += one; }
} else if ( width > *r.guaranteed_row_width ) {
upper -= one; width -= one;
}
assert( width == *r.guaranteed_row_width );
while ( upper >= size.x() )
{ upper -= one; lower -= one; }
while ( lower < 0 * camera::pixel )
{ lower += one; upper += one; }
if ( upper >= size.x() )
throw std::runtime_error("Image is too small for desired ROI");
bb.set_range( lower, upper, Direction_X );
}
ImagePosition pos;
typedef ImagePosition::Scalar Pixel;
rv.reserve( bb.volume().value() );
SamplePosition sample;
for ( Bounds::const_iterator i = bb.begin(); i != bb.end(); ++i ) {
rv.push_back( MappedPoint( *i, pixel_in_sample_space(*i) ) );
}
return rv;
}