Esempio n. 1
0
void Sprite::AddMultipleOverlaySprites(int overlay_type, int count, SpriteType sprite_id, int base, bool flip)
{
    LoFile lo = LoFile::GetOverlay(main_image->Type(), overlay_type);
    for (int i = 0; i < count; i++)
    {
        Point pos = lo.GetPosition(main_image, i + base);
        if (pos.IsValid())
        {
            Sprite *sprite = lone_sprites->AllocateLone(SpriteType(sprite_id.Raw() + i), pos, player);
            if (sprite)
            {
                sprite->elevation = elevation + 1;
                sprite->UpdateVisibilityPoint();
                if (flip)
                    sprite->SetFlipping(true);
            }
        }
    }
}
    void to::test<20>()
    {
        // Construct copy of 2nd point record from tested file
        Point pt;
        pt.SetCoordinates(630282.45, 4834500, 51.63);
        pt.SetIntensity(350);
        pt.SetClassification(1);
        pt.SetScanAngleRank(0);
        pt.SetUserData(3);
        pt.SetScanFlags(9);
        pt.SetTime(413665.52880000003);
        ensure(pt.IsValid());
        test_file10_point2(pt);

        lasreader_iterator it(reader_);
        lasreader_iterator end;

        // find 2nd point data record
        lasreader_iterator fit;
        fit = std::find(it, end, pt);
        ensure(fit != end);
        test_file10_point2(*fit);
    }
    void to::test<18>()
    {
        // Construct copy of 2nd point record from tested file
        Point pt;
        pt.SetCoordinates(630282.45, 4834500, 51.63);
        pt.SetIntensity(350);
        pt.SetClassification(1);
        pt.SetScanAngleRank(0);
        pt.SetUserData(3);
        pt.SetScanFlags(9);
        pt.SetTime(413665.52880000003);
        ensure(pt.IsValid());
        test_file10_point2(pt);

        lasreader_iterator it(reader_);
        lasreader_iterator end;

        // Count records equal to given point object
        typedef lasreader_iterator::difference_type difference_type;
        difference_type const expected = 1;
        difference_type n = std::count(it, end, pt);
        ensure_equals(n, expected);
    }