Geodot Plugin
Loading...
Searching...
No Matches
geofeatures.h
1#ifndef __FEATURES_H__
2#define __FEATURES_H__
3
4#include <godot_cpp/classes/curve3d.hpp>
5#include <godot_cpp/classes/global_constants.hpp>
6
7#include <godot_cpp/core/binder_common.hpp>
8
9#include "Feature.h"
10#include "LineFeature.h"
11#include "PointFeature.h"
12#include "PolygonFeature.h"
13#include "defines.h"
14
15namespace godot {
16
17// Wrapper for any georeferenced feature from GDAL.
18class EXPORT GeoFeature : public Resource {
19 GDCLASS(GeoFeature, Resource)
20
21 protected:
22 static void _bind_methods();
23
24 public:
25 GeoFeature() = default;
26 virtual ~GeoFeature() = default;
27
28 String get_attribute(String name) const;
29 void set_attribute(String name, String value);
30
31 int get_id() const;
32
33 Dictionary get_attributes() const;
34
35 void set_gdal_feature(std::shared_ptr<Feature> gdal_feature);
36
37 void set_deleted(bool is_deleted);
38
39 bool intersects_with(Ref<GeoFeature> other);
40
41 protected:
42 std::shared_ptr<Feature> gdal_feature;
43};
44
45// Wrapper for a PointFeature from the VectorExtractor.
46class EXPORT GeoPoint : public GeoFeature {
47 GDCLASS(GeoPoint, GeoFeature)
48
49 protected:
50 static void _bind_methods();
51
52 public:
53 GeoPoint() = default;
54 ~GeoPoint() = default;
55
56 Vector3 get_float_offset_vector3(double offset_x, double offset_y, double offset_z);
57 Vector3 get_offset_vector3(int offset_x, int offset_y, int offset_z);
58 void set_float_offset_vector3(Vector3 vector, double offset_x, double offset_y, double offset_z);
59 void set_offset_vector3(Vector3 vector, int offset_x, int offset_y, int offset_z);
60
61 Vector3 get_vector3();
62 void set_vector3(Vector3 vector);
63};
64
65// Wrapper for a LineFeature from the VectorExtractor.
66class EXPORT GeoLine : public GeoFeature {
67 GDCLASS(GeoLine, GeoFeature)
68
69 protected:
70 static void _bind_methods();
71
72 public:
73 GeoLine() = default;
74 ~GeoLine() = default;
75
76 Ref<Curve3D> get_float_offset_curve3d(double offset_x, double offset_y, double offset_z);
77 Ref<Curve3D> get_offset_curve3d(int offset_x, int offset_y, int offset_z);
78 void set_float_offset_curve3d(Ref<Curve3D> curve, double offset_x, double offset_y, double offset_z);
79 void set_offset_curve3d(Ref<Curve3D> curve, int offset_x, int offset_y, int offset_z);
80
81 Ref<Curve3D> get_curve3d();
82 void set_curve3d(Ref<Curve3D> curve);
83
84 void add_point(Vector3 point);
85};
86
87// Wrapper for a PolygonFeature from the VectorExtractor.
88class EXPORT GeoPolygon : public GeoFeature {
89 GDCLASS(GeoPolygon, GeoFeature)
90
91 protected:
92 static void _bind_methods();
93
94 public:
95 GeoPolygon() = default;
96 ~GeoPolygon() = default;
97
99 PackedVector2Array get_outer_vertices();
100
102 PackedVector2Array get_float_offset_outer_vertices(double offset_x, double offset_y);
103 PackedVector2Array get_offset_outer_vertices(int offset_x, int offset_y);
104
105 void set_outer_vertices(PackedVector2Array vertices);
106
107 void set_float_offset_outer_vertices(double offset_x, double offset_y, PackedVector2Array vertices);
108 void set_offset_outer_vertices(int offset_x, int offset_y, PackedVector2Array vertices);
109
113 Array get_holes();
114 Array get_float_offset_holes(double offset_x, double offset_y);
115 Array get_offset_holes(int offset_x, int offset_y);
116 void add_hole(PackedVector2Array hole);
117};
118
119} // namespace godot
120
121#endif // __FEATURES_H__
Definition: geofeatures.h:18
Definition: geofeatures.h:66
Definition: geofeatures.h:46
Definition: geofeatures.h:88