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/analytics/i_object_metadata.h>
9 #include <nx/sdk/helpers/attribute.h>
10 #include <nx/sdk/helpers/ref_countable.h>
11 #include <nx/sdk/ptr.h>
12 #include <nx/sdk/uuid.h>
13
14 namespace nx::sdk::analytics {
15
16 class ObjectMetadata: public RefCountable<IObjectMetadata>
17 {
18 public:
19 virtual const char* typeId() const override;
20 virtual float confidence() const override;
21 virtual const char* subtype() const override;
22 virtual int attributeCount() const override;
23
24 void setTypeId(std::string typeId);
25 void setConfidence(float confidence);
26 void setTrackId(const Uuid& value);
27 void setSubtype(const std::string& value);
28 void addAttribute(nx::sdk::Ptr<Attribute> attribute);
29 void addAttributes(const std::vector<nx::sdk::Ptr<Attribute>>& value);
30 void addAttributes(std::vector<nx::sdk::Ptr<Attribute>>&& value);
31 void setBoundingBox(const Rect& rect);
32
33 protected:
34 virtual const IAttribute* getAttribute(int index) const override;
35 virtual void getTrackId(Uuid* outValue) const override;
36 virtual void getBoundingBox(Rect* outValue) const override;
37
38 private:
39 std::string m_typeId;
40 float m_confidence = 1.0;
41 Uuid m_trackId;
42 std::string m_subtype;
43 std::vector<nx::sdk::Ptr<Attribute>> m_attributes;
44 Rect m_rect;
45 };
46
47 } // namespace nx::sdk::analytics
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::analytics::ObjectMetadata
Definition: object_metadata.h:16
nx::sdk::analytics
Definition: consuming_device_agent.cpp:24
nx::sdk::Uuid
Definition: uuid.h:22
nx::sdk::IAttribute
Definition: i_attribute.h:9
nx::sdk::RefCountable
Definition: ref_countable.h:83
nx::sdk::analytics::Rect
Definition: rect.h:9