hivemind 1.0.0
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1#pragma once
2
3#include "core/serializer.h"
4
5namespace Core
6{
7
8 ///
9 /// \brief A structure that represents a cartesian coordinate
10 ///
12 {
13 CartesianCoordinate(double x = 0.0, double y = 0.0, double z = 0.0)
14 : X(x), Y(y), Z(z)
15 {}
16
17 double X;
18 double Y;
19 double Z;
20
23 };
24
25 ///
26 /// \brief A structure that represents a geographic coordinate
27 ///
29 {
30 GeographicalCoordinate(double lat, double lon)
31 : Latitude(lat), Longitude(lon)
32 {}
33
34 double Latitude;
35 double Longitude;
36
39 };
40
41 ///
42 /// \ A structure that represents a coordinate in the Universal Transverse
43 /// Mercator coordinate system
44 ///
46 {
47 UTMCoordinate(double northing = 0.0, double easting = 0.0,
48 int zone = 33, bool isNorthHemisphere = true,
49 double meridian = 1)
50 : Northing(northing), Easting(easting), Zone(zone),
51 IsNorthHemisphere(isNorthHemisphere), Meridian(meridian)
52 {}
53
55 int Zone;
57 double Meridian;
58
62 };
63
64 ///
65 /// \brief A structure representing an agent's position in cartesian space
66 /// at a given point in time
67 ///
68 struct Keyframe : JSON
69 {
70 Keyframe() : AgentId(0), TimeStamp(0), Position(0, 0, 0) {}
71
72 Keyframe(int agentId, float timeStamp, CartesianCoordinate position)
73 : AgentId(agentId), TimeStamp(timeStamp), Position(position)
74 {}
75
77 float TimeStamp;
79
83 };
84
85 struct Agent : JSON
86 {
87 Agent(int id = 0, std::string name = "Untitled Agent",
88 std::string color = "#FFFFFF")
89 : Id(id), Name(name), Color(color)
90 {}
91
92 int Id;
93 std::string Name;
94 std::string Color;
95
98 };
99
100} // namespace Core
Definition: types.h:6
#define JSONEND
Definition: serializer.h:590
#define JSONSTART
Definition: serializer.h:529
#define JSONMEMBER(T, m)
Definition: serializer.h:577
#define JSON
Macros To serialize an object you need to have the GetProperty() function in the object.
Definition: serializer.h:525
#define JSONINT(m)
Definition: serializer.h:533
#define JSONSTRING(m)
Definition: serializer.h:561
#define JSONDOUBLE(m)
Definition: serializer.h:549
int Id
Definition: types.h:92
Agent(int id=0, std::string name="Untitled Agent", std::string color="#FFFFFF")
Definition: types.h:87
std::string Color
Definition: types.h:94
std::string Name
Definition: types.h:93
JSONSTART JSONINT(Id)
A structure that represents a cartesian coordinate.
Definition: types.h:12
CartesianCoordinate(double x=0.0, double y=0.0, double z=0.0)
Definition: types.h:13
A structure that represents a geographic coordinate.
Definition: types.h:29
GeographicalCoordinate(double lat, double lon)
Definition: types.h:30
JSONSTART JSONDOUBLE(Latitude)
A structure representing an agent's position in cartesian space at a given point in time.
Definition: types.h:69
JSONSTART JSONFLOAT(TimeStamp)
Keyframe(int agentId, float timeStamp, CartesianCoordinate position)
Definition: types.h:72
CartesianCoordinate Position
Definition: types.h:78
int AgentId
Definition: types.h:76
float TimeStamp
Definition: types.h:77
\ A structure that represents a coordinate in the Universal Transverse Mercator coordinate system
Definition: types.h:46
bool IsNorthHemisphere
Definition: types.h:56
double Easting
Definition: types.h:54
double Meridian
Definition: types.h:57
double Northing
Definition: types.h:54
JSONSTART JSONBOOL(IsNorthHemisphere)
UTMCoordinate(double northing=0.0, double easting=0.0, int zone=33, bool isNorthHemisphere=true, double meridian=1)
Definition: types.h:47
JSONSTART JSONDOUBLE(Northing)