Generate Json::Value for this object
| 161 | |
| 162 | // Generate Json::Value for this object |
| 163 | Json::Value Tracker::JsonValue() const { |
| 164 | |
| 165 | // Create root json object |
| 166 | Json::Value root = EffectBase::JsonValue(); // get parent properties |
| 167 | |
| 168 | // Save the effect's properties on root |
| 169 | root["type"] = info.class_name; |
| 170 | root["protobuf_data_path"] = protobuf_data_path; |
| 171 | root["BaseFPS"]["num"] = BaseFPS.num; |
| 172 | root["BaseFPS"]["den"] = BaseFPS.den; |
| 173 | root["TimeScale"] = this->TimeScale; |
| 174 | |
| 175 | // Add trackedObjects IDs to JSON |
| 176 | Json::Value objects; |
| 177 | for (auto const& trackedObject : trackedObjects){ |
| 178 | Json::Value trackedObjectJSON = trackedObject.second->JsonValue(); |
| 179 | // add object json |
| 180 | objects[trackedObject.second->Id()] = trackedObjectJSON; |
| 181 | } |
| 182 | root["objects"] = objects; |
| 183 | |
| 184 | // return JsonValue |
| 185 | return root; |
| 186 | } |
| 187 | |
| 188 | // Load JSON string into this object |
| 189 | void Tracker::SetJson(const std::string value) { |