Files
MapLibreParticleLab/src/mbgl/style/sources/raster_array_source_impl.hpp
2026-09-03 18:26:13 +08:00

56 lines
2.1 KiB
C++

#pragma once
#include <mbgl/particle/field/offline_fixture_particle_adapter.hpp>
#include <mbgl/style/sources/raster_array_source.hpp>
#include <mbgl/style/source_impl.hpp>
namespace mbgl::style {
class RasterArraySource::Impl final : public Source::Impl {
public:
Impl(std::string id,
std::string fixtureID_,
std::string metadataURL_,
std::string fieldURL_,
std::string nextFixtureID_ = {},
std::string nextMetadataURL_ = {},
std::string nextFieldURL_ = {},
std::vector<RasterArrayRuntimeFieldDescriptor> runtimeFields_ = {})
: Source::Impl(SourceType::RasterArray, std::move(id)),
fixtureID(std::move(fixtureID_)),
metadataURL(std::move(metadataURL_)),
fieldURL(std::move(fieldURL_)),
nextFixtureID(std::move(nextFixtureID_)),
nextMetadataURL(std::move(nextMetadataURL_)),
nextFieldURL(std::move(nextFieldURL_)),
runtimeFields(std::move(runtimeFields_)) {}
Impl(const Impl&) = default;
Impl(const Impl& other, particle::ParticleFieldSnapshot field_)
: Source::Impl(other),
fixtureID(other.fixtureID),
metadataURL(other.metadataURL),
fieldURL(other.fieldURL),
nextFixtureID(other.nextFixtureID),
nextMetadataURL(other.nextMetadataURL),
nextFieldURL(other.nextFieldURL),
runtimeFields(other.runtimeFields),
field(std::move(field_)) {}
Impl(const Impl& other, particle::ParticleFieldSnapshot field_, particle::ParticleFieldSnapshot nextField_)
: Impl(other, std::move(field_)) {
nextField = std::move(nextField_);
}
std::optional<std::string> getAttribution() const override { return {}; }
std::string fixtureID;
std::string metadataURL;
std::string fieldURL;
std::string nextFixtureID;
std::string nextMetadataURL;
std::string nextFieldURL;
std::vector<RasterArrayRuntimeFieldDescriptor> runtimeFields;
std::optional<particle::ParticleFieldSnapshot> field;
std::optional<particle::ParticleFieldSnapshot> nextField;
};
} // namespace mbgl::style