NDEVR
API Documentation
GroundSurface.h
1#pragma once
2#include <NDEVR/Model.h>
3#include <NDEVR/DesignCommand.h>
4#include <NDEVR/MercatorImageManager.h>
5#include <NDEVR/Translator.h>
6#if NDEVR_GROUND_SURFACE
7//#include <NDEVR/GeometrySurfacing.h>
8namespace NDEVR
9{
10 enum class AerialImageMode;
11 enum class ArialFeatureList;
12 class InfoPipe;
13 struct AerialImageRequest;
14 struct MercatorImage;
15 class DesignSelection;
16
22 class NDEVR_DESIGN_API GroundSurface : public Model
23 {
24 public:
30 GroundSurface(const Model& model, const void* lock_ptr = nullptr);
31
37 void setupSurface(const Bounds<2, fltp08>& size, fltp08 elevation);
38#if NDEVR_SURFACING
39 //void setupSurface(GeometrySurfacingParameters& params, const DesignSelection& info);
40#endif
41
45 void createFlatGeometry();
46
51 static constexpr StringView TypeName() { return "ground_surface"; }
52
60 void setupMaterial(AerialImageMode mode, uint04 resolution, const void* lock_ptr, LogPtr progress);
61
65 void setupMaterialCoordinates();
66
73 void setupPositionCoordinates(fltp08 grid_spacing, const void* lock_ptr, LogPtr progress);
74
84 void createLinework(AerialImageMode mode, uint04 resolution, bool apply_elevation, bool auto_surface, const void* lock_ptr, InfoPipe* progress);
85
90 bool canCreateLinework() const;
91
96 uint04 surfaceMaterialResolution() const;
97
102 uint04 lineworkResolution() const;
103
108 Model surfaceModel() const;
109
114 Model lineworkModel() const;
115
120 AerialImageMode lineworkMode() const;
121
126 AerialImageMode surfaceImageMode() const;
127
132 bool appliedLineworkElevation() const;
133
138 bool hasSurfacedLinework() const;
139
144 Bounds<2, fltp08> wgs84Bounds() const;
145
152 AerialImageRequest createImageRequest(AerialImageMode mode, uint04 resolution);
153
160 static Model FeatureLayer(ArialFeatureList feature, Model& reference);
161
166 fltp08 gridSpacing() const;
167 protected:
174 void setupElevationCoordinates(Vertex<2, uint04> grid_size, const void* lock_ptr, LogPtr progress);
175
186 void onLineworkImageFinished(const MercatorImage& generated_image, bool auto_surface, bool apply_elevation, LogPtr progress, uint04 resolution, AerialImageMode mode, const void* lock_ptr);
187
192 void initialize(const void* lock_ptr);
193 };
194
199 class GroundSurfaceMaterialCommand : public DesignCommand
200 {
201 public:
205 GroundSurfaceMaterialCommand()
206 : DesignCommand()
207 {}
208
213 virtual StringView icon() const override { return "aerial_view"; }
214
219 virtual TranslatedString name() const override { return _t("Surface Raster"); }
220
225 virtual void execute(DesignObjectLookup* lookup) override;
226
227 AerialImageMode mode = AerialImageMode::e_google_satellite;
228 uint04 resolution = 4090;
229 UUID target_id = Constant<UUID>::Invalid;
230 };
231
236 class GroundSurfaceSetBoundsCommand : public DesignCommand
237 {
238 public:
242 GroundSurfaceSetBoundsCommand()
243 : DesignCommand()
244 {
245 }
246
251 virtual StringView icon() const override { return "aerial_view"; }
252
257 virtual TranslatedString name() const override { return _t("Set Bounds"); }
258
263 virtual void execute(DesignObjectLookup* lookup) override;
264
265 Bounds<2, fltp08> bounds = Constant<Bounds<2, fltp08>>::Invalid;
266 fltp08 elevation = 0.0;
267 UUID target_id = Constant<UUID>::Invalid;
268 };
269}
270#endif
Forward declaration of the central design object registry.
A simple structure for storing a collection of data.
A light-weight base class for Log that allows processes to update, without the need for additional in...
A core class that represents a node on model hierarchy.
Definition Model.h:292
The primary namespace for the NDEVR SDK.
ArialFeatureList
Contains a list of common features that may be provided by Aerial tile services.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.
AerialImageMode
enum specifying what type of image to fetch.
@ name
The display name of the object.
@ icon
Icon identifier for the object.
Contains the information for requesting a 2D top-down view of a geographic location to be used with a...
Information output from a specific Aerial Tile request.