2#include <NDEVR/Model.h>
3#if NDEVR_MEASURE_MODELS
10 enum MeasurePointType :
uint01
19 , e_measure_point_size
26 NDEVR_DESIGN_API
Model MeasurementLayer(
Scene& scene);
40 class NDEVR_DESIGN_API PointMeasureModel :
public Model
51 PointMeasureModel(
const Model& model);
57 PointMeasureModel(
const Model& model, Vector<7, Geometry>& markers);
62 Model pointMeasurementLayer();
67 void setupDecoration(Vector<7, Geometry>& geos);
72 static constexpr StringView TypeName() {
return (
"point_measurement"); }
77 static constexpr StringView SubTypeName() {
return "sub_point_measurement"; }
82 static constexpr StringView DecorationTypeName() {
return "point_measurement_decoration"; }
87 void setPoint(
const Vertex<3, fltp08>& location);
93 void setPoint(
const Vertex<3, fltp08>& location,
const Vertex<3, fltp08>& leader);
99 void setPointAndDirection(
const Vertex<3, fltp08>& location,
const Ray<3, fltp08>& direction);
104 void setLabel(
const TranslatedString& label);
109 Model labelModel()
const;
114 void setLabel(
const StringView& label);
119 void setFont(
const Font& font);
124 void setPointTypes(BitFlag pt_types);
130 void setPointTypes(BitFlag pt_types, Vector<7, Geometry>& markers);
135 void setMarkerScale(fltp08 scale);
139 void updateGeometry();
146 static Vector<7, Geometry> DefaultMarkers(
const Scene& scene, BitFlag pt_types =
BitFlag(0));
153 static void DefaultMarkers(
const Scene& scene, BitFlag pt_types, Vector<7, Geometry>& geos);
159 static void SetDefaultMarkers(Scene& scene, Vector<7, Geometry>& markers);
164 Vertex<3, fltp08> measurementPoint()
const;
169 Vector<7, Geometry> typeGeometry();
177 static void setupGeometry(MeasurePointType pt_type, Model geo_item, Vector<7, Geometry>& geos);
182 static void Setup90Crosshairs(Geometry geo);
187 static void Setup45Crosshairs(Geometry geo);
192 static void SetupSquare(Geometry geo);
197 static void SetupCircle(Geometry geo);
202 static void SetupArrow(Geometry geo);
208 void _setPointTypes(BitFlag pt_types, Vector<7, Geometry>& geos);
218 class NDEVR_DESIGN_API DistanceMeasureModel :
public Model
224 DistanceMeasureModel();
229 DistanceMeasureModel(
const Model& model);
235 DistanceMeasureModel(
const Model& model, Vector<7, Geometry>& markers);
240 void setPointTypes(BitFlag pt_types);
246 void setPointTypes(BitFlag pt_types, Vector<7, Geometry>& markers);
251 void setMarkerScale(fltp08 thickness);
256 static constexpr StringView TypeName() {
return "distance_measurement"; }
261 static constexpr StringView DecorationTypeName() {
return "distance_measurement_decoration"; }
268 void setEndpoints(
const Vertex<3, fltp08>& p1,
const Vertex<3, fltp08>& p2,
const Vertex<3, fltp08>& leader = Constant<Vertex<3, fltp08>>::Invalid);
273 void setLabel(
const TranslatedString& label);
278 void setFont(
const Font& font);
282 void updateGeometry();
287 void setupDecoration(Vector<7, Geometry>& geos);
292 Model distanceMeasurementLayer();
297 Text labelModel()
const;
303 static Vector<7, Geometry> DefaultMarkers(
const Scene& scene);
308 LineSegment<3, fltp08> measurementLine()
const;
314 Model decoration()
const;
320 PointMeasureModel endPoint(uint04 endpoint_number)
const;
330 class NDEVR_DESIGN_API AngleMeasureModel :
public Model
341 AngleMeasureModel(
const Model& model);
346 void setFont(
const Font& font);
351 static constexpr StringView TypeName() {
return "angle_measurement"; }
356 static constexpr StringView DecorationTypeName() {
return "angle_measurement_decoration"; }
364 void setPoints(Vertex<3, fltp08> start, Vertex<3, fltp08> middle, Vertex<3, fltp08> end, Vertex<3, fltp08> perspective);
369 void setLabel(
const TranslatedString& label);
374 void setFixedClockwise(
bool clockwise);
378 void clearFixedClockwise();
383 Angle<fltp08> measurementAngle()
const;
388 bool isClockwise()
const;
405 void updateGeometry();
A core class that represents a node on model hierarchy.
The root Model that is responsible for storing the underlying data for all Scene Models.
The core String View class for the NDEVR API.
The primary namespace for the NDEVR SDK.
@ BitFlag
Per-vertex bit flags (selected, hidden, etc.).
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...