nx_metadata_sdk 1.0 Metadata SDK

object_metadata.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #pragma once
4
5 #include <string>
6 #include <vector>
7
8 #include <nx/sdk/helpers/attribute.h>
9 #include <nx/sdk/helpers/ref_countable.h>
10 #include <nx/sdk/ptr.h>
11
12 #include <nx/sdk/uuid.h>
13 #include <nx/sdk/analytics/i_object_metadata.h>
14 #include <nx/sdk/helpers/attribute.h>
15
16 namespace nx {
17 namespace sdk {
18 namespace analytics {
19
20 class ObjectMetadata: public RefCountable<IObjectMetadata>
21 {
22 public:
23 virtual const char* typeId() const override;
24 virtual float confidence() const override;
25 virtual const char* subtype() const override;
26 virtual int attributeCount() const override;
27
28 void setTypeId(std::string typeId);
29 void setConfidence(float confidence);
30 void setTrackId(const Uuid& value);
31 void setSubtype(const std::string& value);
32 void addAttribute(nx::sdk::Ptr<Attribute> attribute);
33 void addAttributes(const std::vector<nx::sdk::Ptr<Attribute>>& value);
34 void setBoundingBox(const Rect& rect);
35
36 protected:
37 virtual const IAttribute* getAttribute(int index) const override;
38 virtual void getTrackId(Uuid* outValue) const override;
39 virtual void getBoundingBox(Rect* outValue) const override;
40
41 private:
42 std::string m_typeId;
43 float m_confidence = 1.0;
44 Uuid m_trackId;
45 std::string m_subtype;
46 std::vector<nx::sdk::Ptr<Attribute>> m_attributes;
47 Rect m_rect;
48 };
49
50 } // namespace nx
51 } // namespace sdk
52 } // namespace nx
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::analytics::ObjectMetadata
Definition: object_metadata.h:20
nx::sdk::Uuid
Definition: uuid.h:22
nx::sdk::IAttribute
Definition: i_attribute.h:10
nx
Definition: apple_utils.h:6
nx::sdk::RefCountable
Definition: ref_countable.h:84
nx::sdk::analytics::Rect
Definition: rect.h:11