In MVC architecture, this is the controller for the corresponding TimeSlider
. More...
Header: | #include <TimeSliderController> |
Inherits: | QObject |
Properties
- endStep : const int
- geoView : QObject*
- numberOfSteps : const int
- startStep : const int
Public Functions
TimeSliderController(QObject *parent = nullptr) | |
virtual | ~TimeSliderController() override |
int | endStep() const |
Esri::ArcGISRuntime::TimeExtent | fullTimeExtent() const |
QObject * | geoView() const |
int | numberOfSteps() const |
void | setGeoView(QObject *geoView) |
void | setSteps(std::pair<int, int> steps) |
void | setSteps(int s, int e) |
int | startStep() const |
QDateTime | timeForStep(int step) const |
Esri::ArcGISRuntime::TimeValue | timeInterval() const |
Signals
void | extentsChanged() |
void | geoViewChanged() |
void | stepsChanged() |
Detailed Description
This controller calculates interval steps and the range of the full extent for the TimeSlider
. This is based on the combined extents of time-aware layers in the given GeoView
.
The time-extent of the GeoView itself can be manipulated using steps with calls to TimeSliderController::setSteps.
Property Documentation
[read-only]
endStep : const int
Access functions:
int | endStep() const |
Notifier signal:
void | stepsChanged() |
geoView : QObject*
Access functions:
QObject * | geoView() const |
void | setGeoView(QObject *geoView) |
Notifier signal:
void | geoViewChanged() |
[read-only]
numberOfSteps : const int
Access functions:
int | numberOfSteps() const |
Notifier signal:
void | extentsChanged() |
[read-only]
startStep : const int
Access functions:
int | startStep() const |
Notifier signal:
void | stepsChanged() |
Member Function Documentation
[explicit invokable]
TimeSliderController::TimeSliderController (QObject *parent = nullptr)
Constructor
- parent Parent owning
QObject
.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
[override virtual]
TimeSliderController::~TimeSliderController ()
Destructor.
int TimeSliderController::endStep () const
Returns the current end step.
Note: Getter function for property endStep.
[signal]
void TimeSliderController::extentsChanged ()
Emitted when the extents of any TimeAware
layer changes.
Note: Notifier signal for property numberOfSteps.
Esri::ArcGISRuntime::TimeExtent TimeSliderController::fullTimeExtent () const
Calculates the union of all extents of all TimeAware
layers in the current GeoView
. Returns a TimeExtent
covering the combined range of all extents.
QObject *TimeSliderController::geoView () const
Returns the GeoView
as a QObject
.
Note: Getter function for property geoView.
See also setGeoView().
[signal]
void TimeSliderController::geoViewChanged ()
Emitted when the geoView changes.
Note: Notifier signal for property geoView.
int TimeSliderController::numberOfSteps () const
Calculates the number of steps the TimeSlider should display based on fullTimeExtent dividied by timeInterval. Returns number of steps for TimeSlider.
Note: Getter function for property numberOfSteps.
void TimeSliderController::setGeoView (QObject *geoView )
Set the GeoView
object this Controller uses.
Internally this is cast to a MapView
or SceneView
using qobject_cast
, which is why the paremeter is of form QObject
and not GeoView
.
- geoView Object which must inherit from
GeoView*
andQObject*
.
Note: Setter function for property geoView.
See also geoView().
void TimeSliderController::setSteps (std::pair <int, int> steps)
Sets the current steps.
Setting steps changes the current time-extent of the GeoView
to a TimeExtent
range calculated by the current steps using timeForStep.
- steps Pair of start end steps.
[invokable]
void TimeSliderController::setSteps (int s, int e)
Sets the current steps.
Setting steps changes the current time-extent of the GeoView
to a TimeExtent
range calculated by the current steps using timeForStep.
- s start-step to set.
- e end-step to set.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
int TimeSliderController::startStep () const
Returns the current start step.
Note: Getter function for property startStep.
[signal]
void TimeSliderController::stepsChanged ()
Emitted when either the start or end step changes.
[invokable]
QDateTime TimeSliderController::timeForStep (int step) const
Calculates a QDateTIme
from a step.
Given step and numberOfSteps we can calculate the date-time for an arbitrary step step interpolated between the start and end times of fullTimeExtent.
- step Step to calculate a time for.
Returns a QDateTime
that is the time calculated for step.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
Esri::ArcGISRuntime::TimeValue TimeSliderController::timeInterval () const
Calculates the time-interval as a TimeValue
, which is the smallest possible interval of all TimeAware
layers in the current GeoView
.
Returns a TimeValue
which is the minimum time-interval of all intervals.