Locus No Pilotus
Project of four first grade MIPT DAFE/RSE students (for engineering practical work in the second semester) in Qt C++
Loading...
Searching...
No Matches
open.cpp File Reference
#include "gui_json_file.h"
Include dependency graph for open.cpp:

Functions

std::vector< lib::HillGetHillsFromFile (QJsonArray arr)
 
std::vector< lib::TargetGetTargetsFromFile (QJsonArray arr)
 
std::vector< lib::TrappyCircleGetTrappyCirclesFromFile (QJsonArray arr)
 
bool IsExistId (const std::vector< unsigned short > &ids, unsigned short curr_id)
 

Function Documentation

◆ GetHillsFromFile()

std::vector< lib::Hill > GetHillsFromFile ( QJsonArray arr)
24 {
25 std::vector<lib::Hill> hills;
26 for (size_t i = 0; i < static_cast<size_t>(arr.size()); i++) {
27 lib::Hill h;
28 h.SetJsonInfo(arr.at(i).toObject());
29 hills.push_back(h);
30 }
31 return hills;
32}
Рельеф с высотой
Definition hill.h:13
void SetJsonInfo(const QJsonObject &hill_obj) override
Definition hill.cpp:25
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTargetsFromFile()

std::vector< lib::Target > GetTargetsFromFile ( QJsonArray arr)
4 {
5 std::vector<lib::Target> targets;
6 for (size_t i = 0; i < static_cast<size_t>(arr.size()); i++) {
8 t.SetJsonInfo(arr.at(i).toObject());
9 targets.push_back(t);
10 }
11 return targets;
12}
Контрольная точка
Definition target.h:12
void SetJsonInfo(const QJsonObject &target_obj) override
Definition target.cpp:16
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTrappyCirclesFromFile()

std::vector< lib::TrappyCircle > GetTrappyCirclesFromFile ( QJsonArray arr)
14 {
15 std::vector<lib::TrappyCircle> trappy_circles;
16 for (size_t i = 0; i < static_cast<size_t>(arr.size()); i++) {
18 tc.SetJsonInfo(arr.at(i).toObject());
19 trappy_circles.push_back(tc);
20 }
21 return trappy_circles;
22}
Опасная зона
Definition trappy_circle.h:9
void SetJsonInfo(const QJsonObject &trappy_circle_obj) override
Definition trappy_circle.cpp:29
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsExistId()

bool IsExistId ( const std::vector< unsigned short > & ids,
unsigned short curr_id )
34 {
35 for (const auto& id : ids) {
36 if (curr_id == id) return true;
37 }
38 return false;
39}
Here is the caller graph for this function: