API Documentation
Loading...
Searching...
No Matches
MeasurementModels.h
Go to the documentation of this file.
1#pragma once
2#include <NDEVR/Model.h>
3#if NDEVR_MEASURE_MODELS
4namespace NDEVR
5{
6 class Text;
7 enum MeasurePointType
8 {
9 e_label
10 , e_leader
11 , e_90_crosshair
12 , e_45_crosshair
13 , e_square
14 , e_circle
15 , e_arrow
16 , e_measure_point_size
17 };
18 NDEVR_DESIGN_API Model MeasurementLayer(Scene& scene);
19 static constexpr const char* MeasureGroupTypeName() { return "measurement_group"; }
20 class NDEVR_DESIGN_API PointMeasureModel : public Model
21 {
22 public:
23 PointMeasureModel();
24 PointMeasureModel(const Model& model);
25 Model pointMeasurementLayer();
26 void setupDecoration();
27 static constexpr const char* TypeName() { return "point_measurement"; }
28 static constexpr const char* SubTypeName() { return "sub_point_measurement"; }
29 static constexpr const char* DecorationTypeName() { return "point_measurement_decoration"; }
30 void setPoint(const Vertex<3, fltp08>& location);
31 void setPoint(const Vertex<3, fltp08>& location, const Vertex<3, fltp08>& leader);
32 void setPointAndDirection(const Vertex<3, fltp08>& location, const Ray<3, fltp08>& direction);
33 void setLabel(const TranslatedString& label);
34 void setLabel(const String& label);
35 void setFont(const Font& font);
36 void setPointTypes(BitFlag pt_types);
37 void setMarkerScale(fltp08 scale);
38 void updateGeometry();
39 Vertex<3, fltp08> measurementPoint() const;
40 protected:
41 void setupGeometry(MeasurePointType pt_type);
42 void setup90Crosshairs(Geometry geo);
43 void setup45Crosshairs(Geometry geo);
44 void setupSquare(Geometry geo);
45 void setupCircle(Geometry geo);
46 void setupArrow(Geometry geo);
47 };
48 class NDEVR_DESIGN_API DistanceMeasureModel : public Model
49 {
50 public:
51 DistanceMeasureModel();
52 DistanceMeasureModel(const Model& model);
53 void setPointTypes(BitFlag pt_types);
54 void setMarkerScale(fltp08 thickness);
55 static constexpr const char* TypeName() { return "distance_measurement"; }
56 static constexpr const char* DecorationTypeName() { return "distance_measurement_decoration"; }
57 void setEndpoints(const Vertex<3, fltp08>& p1, const Vertex<3, fltp08>& p2, const Vertex<3, fltp08>& leader = Constant<Vertex<3, fltp08>>::NaN);
58 void setLabel(const TranslatedString& label);
59 void setFont(const Font& font);
60 void updateGeometry();
61 void setupDecoration();
62 Model distanceMeasurementLayer();
63 Text labelModel() const;
64 LineSegment<3, fltp08> measurementLine() const;
65 protected:
66 Model decoration() const;
67 PointMeasureModel endPoint(uint04 endpoint_number) const;
68 };
69 class NDEVR_DESIGN_API AngleMeasureModel : public Model
70 {
71 public:
72 AngleMeasureModel();
73 AngleMeasureModel(const Model& model);
74
75 static constexpr const char* TypeName() { return "angle_measurement"; }
76 static constexpr const char* DecorationTypeName() { return "angle_measurement_decoration"; }
77 void setPoints(Vertex<3, fltp08> start, Vertex<3, fltp08> middle, Vertex<3, fltp08> end, Vertex<3, fltp08> perspective);
78 void setLabel(const TranslatedString& label);
79 void setFixedClockwise(bool clockwise);
80 void clearFixedClockwise();
81 Angle<fltp08> measurementAngle() const;
82 bool isClockwise() const;
83 protected:
84 Model decoration();
85 void init();
86 void updateGeometry();
87
88 };
89}
90#endif
#define NDEVR_DESIGN_API
Definition DLLInfo.h:77
Definition ACIColor.h:37