33#include <NDEVR/Vector.h>
34#include <NDEVR/Buffer.h>
35#include <NDEVR/Model.h>
36#include <NDEVR/Geometry.h>
37#include <NDEVR/TimeSpan.h>
38#include <NDEVR/Angle.h>
43 class DesignObjectLookup;
50 enum class DeploymentQualityFactor
56 , e_warning_magnetometer
68 struct DeploymentRecord
70 Vector<3, Angle<fltp08>> computed_orientation = Vector<3, Angle<fltp08>>(Angle<fltp08>(
DEGREES, 0.0));
71 Vector<3, Angle<fltp08>> measured_orientation = Vector<3, Angle<fltp08>>(Angle<fltp08>(
DEGREES, 0.0));
75 Vertex<3, fltp08> location = Constant<Vertex<3, fltp08>>
::Invalid;
76 Ray<3, fltp08> direction = Constant<Vertex<3, fltp08>>
::Invalid;
78 DeploymentQualityFactor quality_factor = DeploymentQualityFactor::e_none;
79 bool operator==(
const DeploymentRecord& record)
const
81 return memcmp(
this, &record,
sizeof(DeploymentRecord)) == 0;
83 bool operator!=(
const DeploymentRecord& record)
const
85 return memcmp(
this, &record,
sizeof(DeploymentRecord)) != 0;
95 explicit Deployment(
const Model& root);
96 Model addSegment(
const Vector<3, fltp08>& location,
bool animate =
false,
bool calc_linework =
true);
97 Model addSegment(fltp08 distance, Vector<3, Angle<sint04>> tilt,
bool animate =
false,
bool calc_linework =
true);
98 Model addSegment(fltp08 distance, Vector<3, Angle<sint04>> tilt,
const Unit& unit,
bool animate =
false,
bool calc_linework =
true);
99 Model addSegment(fltp08 distance, Vector<3, Angle<fltp08>> tilt,
bool animate =
false,
bool calc_linework =
true);
100 Model addSegment(fltp08 distance, Vector<3, Angle<fltp08>> tilt,
const Unit& unit,
bool animate =
false,
bool calc_linework =
true);
101 Model segment(uint04 index)
const;
102 void setQualityFactor(uint04 segment, DeploymentQualityFactor is_valid);
103 static String QualityFactorIcon(DeploymentQualityFactor factor);
104 static DeploymentQualityFactor QualityFactorIcon(
const String& factor);
105 void addSegments(
const Buffer<Vertex<3, fltp08>>& locations,
const Buffer<Time>& times = Buffer<Time>());
106 Model deploymentLayer();
107 DeploymentQualityFactor deploymentQuality()
const;
108 static UUID DeploymentLayerUUID();
109 void ensureModelFormat(uint08 version);
110 Model plannedLayer();
111 static UUID PlannedLayerUUID();
112 Model& deploymentLinework() {
return m_linework_model; }
113 Model& deploymentModels() {
return m_boretrak_model; }
114 Model& visualModel() {
return m_deployment; }
115 void removeSegment(uint04 segment_index,
bool update_linework =
true);
116 void removeAllSegments();
117 void straightenSegment(uint04 segment_index);
118 Vertex<3, fltp08> endPoint()
const;
119 void updateEndpoint(
const Vertex<3, fltp08>& end_point);
120 Vector<3, Angle<fltp08>> lastTilt()
const;
121 const Buffer<DeploymentRecord>& records()
const;
122 fltp08 deploymentLength()
const;
123 fltp08 currentLocationLength()
const;
124 Vertex<3, fltp08> currentLocation()
const;
125 fltp08 addToLocationLengthAndReturnRemainder(fltp08 length);
126 void setCurrentLocationLength(fltp08 length);
127 uint04 recordCount()
const;
128 void setUseTube(Geometry::ThicknessMode mode, fltp08 radius);
129 fltp08 tubeThickness()
const;
131 void updateIconFromReadings();
132 fltp08 locationAt(
const Vertex<3, fltp08>& location)
const;
133 Vertex<3, fltp08> pointAtLength(fltp08 location)
const;
134 StationModel getStation()
const;
135 Calibration getCalibration()
const;
136 Effect invalidSegmentEffect();
137 Effect growEffect()
const;
138 bool isHorizontal()
const;
139 bool isVertical()
const;
140 void cancelGrowEffect();
141 bool hasMissingRecords()
const;
142 void updateLineworkFromRecords(uint04 start_index = 0);
143 void updateModelsFromRecords(uint04 start_index = 0);
152 uint04 adjustTilt(
const Time& time,
const Vector<3, Angle<sint04>>& angle, TimeSpan max_time = TimeSpan(2.0));
153 uint04 adjustTilt(
const Time& time,
const Vector<3, Angle<fltp08>>& angle, TimeSpan max_time = TimeSpan(2.0));
154 void adjustLength(uint04 segment, fltp08 length);
155 void adjustTilt(uint04 segment,
const Vector<3, Angle<fltp08>>& angle);
156 Polyline<3, fltp08> toPolyline()
const;
158 bool isPlanned()
const;
159 void setIsPlanned(
bool is_design);
160 void setupAsDefaultPlanned(
bool add_segment);
161 Deployment getPlanned()
const;
162 void setupInvalidEffect();
163 static Deployment GetAssociatedPlan(
const Model& model);
164 static constexpr const char* TypeName() {
return "deployment"; }
165 static constexpr const char* DecorationTypeName() {
return "deployment_decoration"; }
166 static DynamicPointer<Model> s_deployment_model;
167 static void SetupMaterialToLayerDefaults(Material& mat);
169 UUID growTarget()
const;
170 uint04 segmentCount()
const;
171 void setupBoretrakModel();
172 void createSegmentChild();
173 void setupLineworkGeometry();
174 void calculateRecords(uint04 segment = 0)
const;
175 void updateRecordLocations(uint04 segment = 0)
const;
176 void setRecord(uint04 index,
const DeploymentRecord& record)
const;
178 void validateRecords()
const;
179 void ensureRecordsCached()
const;
182 mutable Buffer<DeploymentRecord> m_cached_records;
183 mutable Time m_record_cache_time;
185 Model m_boretrak_model;
186 Model m_linework_model;
bool operator==(const char(&v1)[t_size], const String &v2)
Definition String.h:912
constexpr bool operator!=(const Vector< t_dims, t_type > &vec_a, const Vector< t_dims, t_type > &vec_b)
Definition Vector.hpp:668
@ DEGREES
Definition Angle.h:58
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
static const t_type Invalid
Definition BaseValues.hpp:234