MeshLib C++ Docs
Loading...
Searching...
No Matches
MRRenderNameObject.h
Go to the documentation of this file.
1#pragma once
2
4#include "MRMesh/MRVector2.h"
7#include "MRViewer/exports.h"
8#include "MRViewer/MRImGui.h"
9
10#include <optional>
11
12namespace MR
13{
16
17
18class MRVIEWER_CLASS RenderNameObject : public virtual IRenderObject
19{
21 {
22 const VisualObject* object = nullptr;
23 const UiRenderParams* params = nullptr;
24
25 ImVec2 point;
26 ImVec2 point2;
27 ImVec2 textCenter;
28
30 ImVec2 textPos;
31 ImVec2 paddingA;
32 ImVec2 paddingB;
33
39
40 MRVIEWER_API void renderPass() override;
41 MRVIEWER_API void onClick() override;
42 };
43 Task task_;
44public:
45 RenderNameObject( const VisualObject& object ) { task_.object = &object; }
46
47 MRVIEWER_API void renderUi( const UiRenderParams& params ) override;
48
50 MRVIEWER_API virtual ImGuiMeasurementIndicators::Text getObjectNameText( const VisualObject& object, ViewportId viewportId ) const;
51
55 MRVIEWER_API virtual ImGuiMeasurementIndicators::Text getObjectNameExtraText( const VisualObject& object, ViewportId viewportId ) const;
56
60
62 Vector3f nameUiPoint;
63
67
70
74
78
82};
83
84}
Definition MRRenderClickableRect.h:17
Definition MRIRenderObject.h:134
Definition MRViewportId.h:16
Visual Object.
Definition MRVisualObject.h:115
void renderPass() override
Vector2f nameUiScreenOffset
Definition MRRenderNameObject.h:73
ImVec2 point2
Definition MRRenderNameObject.h:26
bool nameUiPointIsRelativeToBoundingBoxCenter
Definition MRRenderNameObject.h:66
Vector3f nameUiLocalOffset
Which way the name is moved relative to the point, in model space. The length is respected.
Definition MRRenderNameObject.h:69
const UiRenderParams * params
Definition MRRenderNameObject.h:23
void renderUi(const UiRenderParams &params) override
RenderNameObject(const VisualObject &object)
Definition MRRenderNameObject.h:45
ImVec2 paddingA
Definition MRRenderNameObject.h:31
ImGuiMeasurementIndicators::Text text
Definition MRRenderNameObject.h:29
ImVec2 point
Definition MRRenderNameObject.h:25
std::optional< Vector3f > nameUiRotateToScreenPlaneAroundSphereCenter
Definition MRRenderNameObject.h:77
virtual ImGuiMeasurementIndicators::Text getObjectNameText(const VisualObject &object, ViewportId viewportId) const
The text displayed as the clickable object name.
ImVec2 textPos
Definition MRRenderNameObject.h:30
float textToExtraTextSpacing
Definition MRRenderNameObject.h:38
ImVec2 paddingB
Definition MRRenderNameObject.h:32
Vector3f nameUiPoint
The line attachment point.
Definition MRRenderNameObject.h:62
virtual ImGuiMeasurementIndicators::Text getObjectNameExtraText(const VisualObject &object, ViewportId viewportId) const
bool nameUiRotateLocalOffset90Degrees
Definition MRRenderNameObject.h:81
ImGuiMeasurementIndicators::Text textExtra
Definition MRRenderNameObject.h:37
ImVec2 textCenter
Definition MRRenderNameObject.h:27
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Represents an arbitrary block of text, possibly with icons, colors, etc.
Definition MRImGuiMeasurementIndicators.h:133
Definition MRIRenderObject.h:110