示例#1
0
ObjectIndexIterator::ObjectIndexIterator(BitmapTriples *trip, TripleID &pat) :
    triples(trip),
    pattern(pat),
    adjY(trip->arrayY, trip->bitmapY),
    adjZ(trip->arrayZ, trip->bitmapZ),
    adjIndex(trip->arrayIndex, trip->bitmapIndex)
{
    // Convert pattern to local order.
    swapComponentOrder(&pattern, SPO, triples->order);
    patX = pattern.getSubject();
    patY = pattern.getPredicate();
    patZ = pattern.getObject();

    if(patZ==0) {
        throw std::runtime_error("This iterator is not suitable for this pattern");
    }

#if 0
    cout << "Pattern: " << patX << " " << patY << " " << patZ << endl;
    cout << "AdjY: " << endl;
    adjY.dump();
    cout << "AdjZ: " << endl;
    adjZ.dump();
    cout << "AdjIndexObjects: " << endl;
    adjIndex.dump();
#endif

    calculateRange();
    goToStart();
}
示例#2
0
	void PiecewiseFunction::setIntervals(const std::vector<Interval>& intervals) 
		throw()
	{
		intervals_ = intervals;
		calculateRange();
		valid_ = isValid();
	}
示例#3
0
	void PiecewiseFunction::clear() throw()
	{
		intervals_.clear();
		coefficients_.clear();
		calculateRange();
		valid_ = false;
	}
示例#4
0
	void PiecewiseFunction::set(const std::vector<Interval>& intervals,
		const std::vector<Coefficients>& coeffs) throw()
	{
		intervals_ = intervals;
		coefficients_ = coeffs;
		calculateRange();
		valid_ = isValid();
	}
示例#5
0
	PiecewiseFunction::PiecewiseFunction(const std::vector<Interval>& intervals,
			const std::vector<Coefficients>& coeffs) throw()
		:	intervals_(intervals),
			coefficients_(coeffs)
	{
		calculateRange();
		valid_ = isValid();
	}
示例#6
0
void Player::setTextureIdx(size_t idx_)
{
	if (textureIdx != idx_)
	{
		textureIdx = idx_;
		calculateRange();
	}
}
示例#7
0
void Player::setDirection(PlayerDirection direction_)
{
	if (playerDirection != direction_)
	{
		playerDirection = direction_;
		calculateRange();
	}
}
示例#8
0
Player::Player(const PlayerClass* class__, const Level& level) : LevelObject(class__)
{
	animation.animType = AnimationType::Looped;
	cellSize.x = -2;
	cellSize.y = -2;
	sprite.setOutline(class__->Outline(), class__->OutlineIgnore());
	calculateRange();
	applyDefaults(level);
}
示例#9
0
void Player::setAnimation(PlayerAnimation animation_)
{
	if (playerAnimation != animation_)
	{
		playerAnimation = animation_;
		speed = Class()->getSpeed(playerAnimation);
		animation.elapsedTime.timeout = speed.animation;
		updateSpeed();
		calculateRange();
	}
}