PointData
PointData
#include <Point_Data.hpp>
Inherits from RaggedTimeSeries< Point2D< float > >, ObserverData
Public Classes
| Name | |
|---|---|
| struct | DataTraits Type traits for PointData. |
Public Functions
| Name | |
|---|---|
| PointData() =default Default constructor. |
|
| PointData(std::map< TimeFrameIndex, Point2D< float > > const & data) Constructor for PointData from a map of TimeFrameIndex to Point2D |
|
| PointData(std::map< TimeFrameIndex, std::vector< Point2D< float > > > const & data) Constructor for PointData from a map of TimeFrameIndex to vector of Point2D |
|
| void | setImageSize(ImageSize const & image_size) Set the image size. |
| void | changeImageSize(ImageSize const & image_size) Change the size of the canvas the points belong to. |
Additional inherited members
Public Classes inherited from RaggedTimeSeries< Point2D< float > >
| Name | |
|---|---|
| struct | RaggedElement Element type for flattened iteration over ragged time series. |
Public Types inherited from RaggedTimeSeries< Point2D< float > >
| Name | |
|---|---|
| using ModificationHandle< TData > | DataModifier Type alias for modification handle. |
Public Functions inherited from RaggedTimeSeries< Point2D< float > >
| Name | |
|---|---|
| RaggedTimeSeries() =default | |
| virtual | ~RaggedTimeSeries() =default |
| RaggedTimeSeries(RaggedTimeSeries && ) =default | |
| RaggedTimeSeries & | operator=(RaggedTimeSeries && ) =default |
| RaggedTimeSeries(RaggedTimeSeries const & ) =delete | |
| RaggedTimeSeries & | operator=(RaggedTimeSeries const & ) =delete |
| template <std::ranges::input_range R> |
RaggedTimeSeries(R && time_data_pairs) |
| RaggedTimeSeries< TData > | createFilteredCopy(std::unordered_set< EntityId > const & entity_ids) const Create a filtered copy containing only entries with specified EntityIds. |
| RaggedTimeSeries< TData > | createTimeRangeCopy(TimeFrameIndex start_time, TimeFrameIndex end_time) const Create a filtered copy containing only entries in a time range. |
| void | setTimeFrame(std::shared_ptr< TimeFrame > time_frame) Set the time frame for this data structure. |
| std::shared_ptr< TimeFrame > | getTimeFrame() const Get the current time frame. |
| ImageSize | getImageSize() const Get the image size associated with this data. |
| void | setIdentityContext(std::string const & data_key, EntityRegistry * registry) Set identity context for automatic EntityId maintenance. |
| void | rebuildAllEntityIds() Rebuild EntityIds for all entries using the current identity context. |
| void | addEntryAtTime(TimeFrameIndex time, TData const & data, EntityId entity_id, NotifyObservers notify) Add a data entry at a specific time with a specific entity ID. |
| template <typename DerivedTarget > std::size_t |
copyByEntityIds(DerivedTarget & target, std::unordered_set< EntityId > const & entity_ids, NotifyObservers notify) Copy entries with specific EntityIds to another RaggedTimeSeries. |
| template <typename DerivedTarget > std::size_t |
moveByEntityIds(DerivedTarget & target, std::unordered_set< EntityId > const & entity_ids, NotifyObservers notify) Move entries with specific EntityIds to another RaggedTimeSeries. |
| template <typename DerivedTarget > std::optional< std::size_t > |
mergeOverwriteTo(DerivedTarget & target, NotifyObservers notify) const Merge all entries from this series into the target with per-time overwrite. |
| std::optional< std::reference_wrapper< TData const > > | getDataByEntityId(EntityId entity_id) const Find the data associated with a specific EntityId. |
| std::optional< TimeFrameIndex > | getTimeByEntityId(EntityId entity_id) const Find the time frame index for a specific EntityId. |
| auto | getDataByEntityIds(std::span< EntityId const > entity_ids) const Get all data that match the given EntityIds as a lazy view. |
| auto | getDataByEntityIds(std::vector< EntityId > const & entity_ids) const Get all data that match the given EntityIds (vector overload). |
| std::optional< DataModifier > | getMutableData(EntityId entity_id, NotifyObservers notify) Get a mutable handle to data by EntityId. |
| bool | clearByEntityId(EntityId entity_id, NotifyObservers notify) Clear data by its EntityId. |
| size_t | clearByEntityIds(std::unordered_set< EntityId > const & entity_ids, NotifyObservers notify) Clear multiple data entries by their EntityIds in a single pass. |
| bool | clearAtTime(TimeIndexAndFrame const & time_index_and_frame, NotifyObservers notify) Clear all data at a specific time with timeframe conversion. |
| EntityId | addAtTime(TimeFrameIndex time, TData const & data, NotifyObservers notify) Add data at a specific time (by copying). |
| EntityId | addAtTime(TimeIndexAndFrame const & time_index_and_frame, TData const & data, NotifyObservers notify) Add data at a specific time with timeframe conversion (by copying). |
| EntityId | addAtTime(TimeFrameIndex time, TData && data, NotifyObservers notify) Add data at a specific time (by moving). |
| EntityId | addAtTime(TimeIndexAndFrame const & time_index_and_frame, TData && data, NotifyObservers notify) Add data at a specific time with timeframe conversion (by moving). |
| template <typename… TDataArgs> void |
emplaceAtTime(TimeFrameIndex time, TDataArgs &&… args) Construct a data entry in-place at a specific time. |
| void | addAtTime(TimeFrameIndex time, std::vector< TData > const & data_to_add, NotifyObservers notify) Add a batch of data at a specific time by copying them. |
| void | addAtTime(TimeFrameIndex time, std::vector< TData > && data_to_add, NotifyObservers notify) Add a batch of data at a specific time by moving them. |
| std::size_t | getTimeCount() const Get the number of distinct time frames with data. |
| std::size_t | getMaxEntriesAtAnyTime() const Get the maximum number of entries at any single time frame. |
| std::size_t | getTotalEntryCount() const Get the total number of entries across all time frames. |
| auto | getTimesWithData() const Get all times with data. |
| auto | getAtTime(TimeFrameIndex time) const |
| auto | getAtTime(TimeFrameIndex time, TimeFrame const & source_timeframe) const |
| auto | getAtTime(TimeIndexAndFrame const & time_index_and_frame) const |
| auto | getEntityIdsAtTime(TimeFrameIndex time) const |
| auto | getEntityIdsAtTime(TimeFrameIndex time, TimeFrame const & source_timeframe) const |
| auto | getElementsInRange(TimeFrameInterval const & interval) const Get data entries with their associated times as a zero-copy range within a TimeFrameInterval. |
| auto | getElementsInRange(TimeFrameInterval const & interval, TimeFrame const & source_timeframe) const Get a filtered view of elements within a TimeFrameInterval with timeframe conversion. |
| auto | elements() const A flattened view of (Time, DataEntry) pairs. |
| auto | elementsView() const A flattened view of RaggedElement objects (concept-compliant). |
| auto | flattened_data() const A flattened view of (Time, EntityId, TData) tuples. |
| auto | view() const Create a view of this time series. This works for RaggedTimeSeries and any derived class (like PointData). |
| RaggedStorageCache< TData > const & | getStorageCache() const Get the storage cache for fast-path iteration. |
| bool | isStorageContiguous() const Check if storage is currently using the owning backend. |
| RaggedStorageType | getStorageType() const Get the underlying storage type. |
| bool | isLazy() const Check if storage uses lazy evaluation. |
| std::shared_ptr< RaggedTimeSeries< TData > > | materialize() const |
| template std::shared_ptr< Derived > |
createFromView(ViewType view, std::shared_ptr< TimeFrame > time_frame, ImageSize image_size =ImageSize) Create RaggedTimeSeries from a lazy view. |
| template <std::ranges::input_range ViewType> std::shared_ptr< RaggedTimeSeries< TData > > |
createFromViewWithNewIds(ViewType view, std::shared_ptr< TimeFrame > time_frame, std::string const & data_key, EntityRegistry * registry, ImageSize image_size =ImageSize) Create RaggedTimeSeries from a lazy view with new EntityIds. |
Protected Functions inherited from RaggedTimeSeries< Point2D< float > >
| Name | |
|---|---|
| EntityKind | getEntityKind() Get the EntityKind for this data type. |
| void | _ensureOwningStorage() Materialize View/Lazy storage to owning storage in-place. |
| void | _appendPreservedEntries(std::vector< std::tuple< TimeFrameIndex, TData, EntityId > > const & entries, NotifyObservers notify) Append multiple entries preserving EntityIds with a single cache update. |
| bool | _clearAtTime(TimeFrameIndex time, NotifyObservers notify) Clear all data at a specific time (internal helper). |
| void | _updateStorageCache() const Update the cached storage pointers. |
| void | _invalidateStorageCache() const Invalidate the storage cache. |
Protected Attributes inherited from RaggedTimeSeries< Point2D< float > >
| Name | |
|---|---|
| RaggedStorageWrapper< TData > | _storage |
| RaggedStorageCache< TData > | _cached_storage |
| ImageSize | _image_size Image size metadata. |
| std::shared_ptr< TimeFrame > | _time_frame Associated time frame for temporal indexing. |
| std::string | _identity_data_key Data key for EntityRegistry lookups. |
| EntityRegistry * | _identity_registry Pointer to EntityRegistry for automatic EntityId management. |
Public Classes inherited from ObserverData
| Name | |
|---|---|
| struct | ObserverEntry Entry in the observer map. |
Public Types inherited from ObserverData
| Name | |
|---|---|
| using std::function< void()> | ObserverCallback Type alias for observer callback functions. |
| using int | CallbackID Type alias for callback identifiers. |
Public Functions inherited from ObserverData
| Name | |
|---|---|
| ObserverData(std::string name =“UnnamedObservable”) | |
| CallbackID | addObserver(ObserverCallback callback, std::string name =“Anonymous”) Register a new observer callback. |
| void | notifyObservers() Notify all registered observers. |
| void | removeObserver(CallbackID id) Remove a previously registered observer. |
Detailed Description
class PointData;PointData is used for storing 2D point collections at specific time frames. Each time frame can contain multiple points, making it suitable for tracking multiple features or keypoints over time.
For example, keypoints for multiple body points could be a PointData object
Public Functions Documentation
function PointData
PointData() =defaultDefault constructor.
This constructor creates an empty PointData with no data
function PointData
explicit PointData(
std::map< TimeFrameIndex, Point2D< float > > const & data
)Constructor for PointData from a map of TimeFrameIndex to Point2D
Parameters:
- data Map of TimeFrameIndex to Point2D
function PointData
explicit PointData(
std::map< TimeFrameIndex, std::vector< Point2D< float > > > const & data
)Constructor for PointData from a map of TimeFrameIndex to vector of Point2D
Parameters:
- data Map of TimeFrameIndex to vector of Point2D
function setImageSize
inline void setImageSize(
ImageSize const & image_size
)Set the image size.
Parameters:
- image_size The image size
function changeImageSize
void changeImageSize(
ImageSize const & image_size
)Change the size of the canvas the points belong to.
Parameters:
- image_size
This will scale all points in the data structure by the ratio of the new size to the old size.
Updated on 2026-11-13 at 20:25:40 +0000