MeshLib
 
Loading...
Searching...
No Matches
MRRenderDimensions.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMesh/MRColor.h"
5#include "MRMesh/MRVector2.h"
6#include "MRViewer/exports.h"
7
8namespace MR
9{
10class Viewport;
11}
12
14{
15
16
18{
19 // The center point.
21
22 // The length of this is the radius. This is also the preferred drawing direction relative to `center`.
24
25 // The preferred normal for non-spherical radiuses. The length is ignored, and this is automatically adjusted to be perpendicular to `radiusAsVector`.
26 Vector3f normal = Vector3f( 0, 0, 1 );
27
28 // Whether we should draw this as a diameter instead of a radius.
29 bool drawAsDiameter = false;
30
31 // Whether this is a sphere radius, as opposed to circle/cylinder radius.
32 bool isSpherical = false;
33
34 // The visual leader line length multiplier, relative to the radius.
35 // You're recommended to set a min absolute value for the resulting length when rendering.
36 float visualLengthMultiplier = 2 / 3.f;
37};
38
40{
41 float menuScaling_ = 1;
42 Viewport* viewport_ = nullptr;
43 Color color_;
44 RadiusParams params_;
45
46public:
48 MRVIEWER_API RadiusTask( const UiRenderParams& uiParams, const AffineXf3f& xf, Color color, const RadiusParams& params );
49 MRVIEWER_API void renderPass();
50};
51
53{
54 // The center point.
56
57 // The two rays.
58 // Use the length of the shorter ray as the arc radius.
59 std::array<Vector3f, 2> rays;
60
61 // Whether this is a conical angle. The middle line between the rays is preserved, but the rays themselves can be rotated.
62 bool isConical = false;
63
64 // Whether we should draw a ray from the center point to better visualize the angle. Enable this if there isn't already a line object there.
65 std::array<bool, 2> shouldVisualizeRay{ true, true };
66};
67
69{
70 float menuScaling_ = 1;
71 Viewport* viewport_ = nullptr;
72 Color color_;
73 AngleParams params_;
74
75public:
77 MRVIEWER_API AngleTask( const UiRenderParams& uiParams, const AffineXf3f& xf, Color color, const AngleParams& params );
78 MRVIEWER_API void renderPass();
79};
80
81
83{
84 // The points between which we're measuring.
85 std::array<Vector3f, 2> points;
86
87 // Whether the distance should be displayed as a negative one.
88 bool drawAsNegative = false;
89
90 // If true, will also show deltas per coordinate axis.
91 bool showPerCoordDeltas = false;
92 // If true, will remove the sign from the per-coord deltas. Only makes sense when `showPerCoordDeltas == true`.
94};
95
97{
98 float menuScaling_ = 1;
99 Viewport* viewport_ = nullptr;
100 Color color_;
101 LengthParams params_;
102
103public:
105 MRVIEWER_API LengthTask( const UiRenderParams& uiParams, const AffineXf3f& xf, Color color, const LengthParams& params );
106 MRVIEWER_API void renderPass();
107};
108
109}
Definition MRRenderDimensions.h:69
AngleTask()
Definition MRRenderDimensions.h:76
MRVIEWER_API void renderPass()
This is the main rendering pass.
MRVIEWER_API AngleTask(const UiRenderParams &uiParams, const AffineXf3f &xf, Color color, const AngleParams &params)
Definition MRRenderDimensions.h:97
LengthTask()
Definition MRRenderDimensions.h:104
MRVIEWER_API LengthTask(const UiRenderParams &uiParams, const AffineXf3f &xf, Color color, const LengthParams &params)
MRVIEWER_API void renderPass()
This is the main rendering pass.
Definition MRRenderDimensions.h:40
MRVIEWER_API RadiusTask(const UiRenderParams &uiParams, const AffineXf3f &xf, Color color, const RadiusParams &params)
MRVIEWER_API void renderPass()
This is the main rendering pass.
RadiusTask()
Definition MRRenderDimensions.h:47
Definition MRViewport.h:49
represents a 3-dimentional float-typed vector
Definition MRDotNet/MRVector3.h:8
Definition MRRenderDimensions.h:14
Definition MRCameraOrientationPlugin.h:7
Vector3< float > Vector3f
Definition MRDotNet/MRMeshFwd.h:8
IRenderObject::renderUi() can emit zero or more or more of those tasks. They are sorted by depth ever...
Definition MRIRenderObject.h:60
Definition MRColor.h:9
Definition MRRenderDimensions.h:53
std::array< Vector3f, 2 > rays
Definition MRRenderDimensions.h:59
Vector3f center
Definition MRRenderDimensions.h:55
std::array< bool, 2 > shouldVisualizeRay
Definition MRRenderDimensions.h:65
bool isConical
Definition MRRenderDimensions.h:62
Definition MRRenderDimensions.h:83
std::array< Vector3f, 2 > points
Definition MRRenderDimensions.h:85
bool showPerCoordDeltas
Definition MRRenderDimensions.h:91
bool drawAsNegative
Definition MRRenderDimensions.h:88
bool perCoordDeltasAreAbsolute
Definition MRRenderDimensions.h:93
Definition MRRenderDimensions.h:18
bool drawAsDiameter
Definition MRRenderDimensions.h:29
bool isSpherical
Definition MRRenderDimensions.h:32
float visualLengthMultiplier
Definition MRRenderDimensions.h:36
Vector3f radiusAsVector
Definition MRRenderDimensions.h:23
Vector3f normal
Definition MRRenderDimensions.h:26
Vector3f center
Definition MRRenderDimensions.h:20
Definition MRIRenderObject.h:106