knowL: Knowledge Libraries
Loading...
Searching...
No Matches
knowl
src
knowGIS
Point.h
1
#pragma once
2
3
#include <knowCore/ReturnValue.h>
4
5
#include <Cartography/Point.h>
6
#include "EuclidSystem.h"
7
8
namespace
knowGIS
9
{
10
class
Point
:
public
Cartography::Point
11
{
12
public
:
13
using
Cartography::Point::Point;
14
Point
(
const
Cartography::Point& _rhs) : Cartography::Point(_rhs) {}
15
QByteArray md5()
const
;
16
QJsonValue toJsonValue()
const
;
17
static
knowCore::ReturnValue<Point>
fromJsonValue(
const
QJsonValue& _value);
18
QCborValue toCborValue()
const
;
19
static
knowCore::ReturnValue<Point>
fromCborValue(
const
QCborValue& _value);
20
};
21
}
22
23
#include <knowCore/Formatter.h>
24
#include <Cartography/CoordinateSystem.h>
25
KNOWCORE_CORE_DECLARE_FORMATTER(
knowGIS::Point
)
26
{
27
if
(p.isValid())
28
{
29
int
srid = p.coordinateSystem().isValid() ? p.coordinateSystem().srid() : -1;
30
return
fmt::format_to(ctx.out(),
"[{} {} {}]@{}"
, p.x(), p.y(), p.z(), srid);
31
}
else
{
32
return
forward(
"[invalid point]"
, ctx);
33
}
34
}
35
36
#include <knowCore/MetaType.h>
37
KNOWCORE_DECLARE_FULL_METATYPE(knowGIS, Point)
38
knowCore::ReturnValue
Definition
ReturnValue.h:29
knowGIS::Point
Definition
Point.h:11
Generated by
1.12.0