8 #ifndef META_OCEAN_TRACKING_MAPBUILDING_UNIFIED_DESCRIPTOR_MAP_H
9 #define META_OCEAN_TRACKING_MAPBUILDING_UNIFIED_DESCRIPTOR_MAP_H
24 class UnifiedDescriptorMap;
76 virtual std::unique_ptr<UnifiedDescriptorMap>
clone()
const = 0;
92 template <
typename TDescriptor>
148 std::unique_ptr<UnifiedDescriptorMap>
clone()
const override;
179 template <u
int16_t tElements>
188 template <
typename TDescriptor>
195 template <
typename TDescriptor>
198 descriptorMap_(std::move(descriptorMap))
203 template <
typename TDescriptor>
206 return descriptorMap_;
209 template <
typename TDescriptor>
212 return descriptorMap_;
215 template <
typename TDescriptor>
218 return descriptorMap_.size();
221 template <
typename TDescriptor>
225 ids.reserve(descriptorMap_.size());
227 for (
const typename DescriptorMap::value_type& descriptorPair : descriptorMap_)
229 ids.emplace_back(descriptorPair.first);
235 template <
typename TDescriptor>
238 const typename DescriptorMap::const_iterator i = descriptorMap_.find(objectPointId);
240 if (i == descriptorMap_.cend())
245 return i->second.size();
248 template <
typename TDescriptor>
251 const typename DescriptorMap::iterator i = descriptorMap_.find(objectPointId);
253 if (i == descriptorMap_.cend())
258 descriptorMap_.erase(i);
263 template <
typename TDescriptor>
266 return std::make_unique<UnifiedDescriptorMapT<TDescriptor>>(
DescriptorMap(descriptorMap_));
This class implements a helper class allowing to determine the descriptor type value for a descriptor...
Definition: UnifiedDescriptor.h:177
This class implements the base class for all unified descriptor objects.
Definition: UnifiedDescriptor.h:31
DescriptorType descriptorType() const
Returns the descriptor type of all descriptors hold in this object.
Definition: UnifiedDescriptor.h:492
DescriptorType
Definition of descriptor types.
Definition: UnifiedDescriptor.h:49
This class implements the base class for all unified descriptor maps in which ids are mapped to descr...
Definition: UnifiedDescriptorMap.h:38
virtual size_t numberDescriptors(const Index32 &objectPointId) const =0
Returns the number of descriptors associated with a specified object point id.
virtual std::unique_ptr< UnifiedDescriptorMap > clone() const =0
Returns a clone of this map.
virtual size_t numberObjectPoints() const =0
Returns the number of object points.
UnifiedDescriptorMap(const DescriptorType descriptorType)
Creates a new descriptors object.
Definition: UnifiedDescriptorMap.h:182
virtual Indices32 objectPointIds() const =0
Returns the ids of all object points.
virtual bool removeDescriptors(const Index32 &objectPointId)=0
Removes the descriptors for a specified object point id.
virtual ~UnifiedDescriptorMap()=default
Disposes the object.
This class implements the descriptor map for arbitrary descriptors.
Definition: UnifiedDescriptorMap.h:94
std::unordered_map< Index32, Descriptor > DescriptorMap
Definition of an unordered map mapping object point ids to multi-view float descriptors.
Definition: UnifiedDescriptorMap.h:105
bool removeDescriptors(const Index32 &objectPointId) override
Removes the descriptors for a specified object point id.
Definition: UnifiedDescriptorMap.h:249
DescriptorMap & descriptorMap()
Returns the actual underlying descriptor map.
size_t numberObjectPoints() const override
Returns the number of object points.
Definition: UnifiedDescriptorMap.h:216
TDescriptor Descriptor
Definition of the descriptors this map is using.
Definition: UnifiedDescriptorMap.h:100
std::unique_ptr< UnifiedDescriptorMap > clone() const override
Returns a clone of this map.
Definition: UnifiedDescriptorMap.h:264
size_t numberDescriptors(const Index32 &objectPointId) const override
Returns the number of descriptors associated with a specified object point id.
Definition: UnifiedDescriptorMap.h:236
const DescriptorMap & descriptorMap() const
Returns the actual underlying descriptor map.
Definition: UnifiedDescriptorMap.h:204
DescriptorMap descriptorMap_
The internal descriptor map.
Definition: UnifiedDescriptorMap.h:165
UnifiedDescriptorMapT()
Default constructor.
Definition: UnifiedDescriptorMap.h:189
Indices32 objectPointIds() const override
Returns the ids of all object points.
Definition: UnifiedDescriptorMap.h:222
std::vector< Index32 > Indices32
Definition of a vector holding 32 bit index values.
Definition: Base.h:96
uint32_t Index32
Definition of a 32 bit index value.
Definition: Base.h:84
std::shared_ptr< UnifiedDescriptorMap > SharedUnifiedDescriptorMap
Definition of a shared pointer holding a UnifiedDescriptorMap object.
Definition: UnifiedDescriptorMap.h:30
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15