Feature description
Users may need to verify dimensions or analyze the spatial relationship between specific areas of a plot. This feature proposes a Measurement Tool that allows users to determine the precise distance between two points on the plot's bounding box planes.
Workflow:
-
Activation: The user activates the tool via the Plot Context Menu (e.g., Right-click -> "Measure").
-
Selection: The user clicks a point on any visible plane (grid) of the plot box to set Point A.
-
Measurement: The user clicks a second point on any visible plane to set Point B.
-
Feedback:
- Markers appear at both points.
- A line connects Point A and Point B.
- A tooltip or overlay displays the $\Delta X$, $\Delta Y$, $\Delta Z$, and the Euclidean distance (Length) between the points.
-
Cancellation/Reset: Pressing
ESC or right-clicking cancels the operation or clears the current measurement.
Constraints:
- Initially, point selection is restricted to the plot box planes (XY, XZ, YZ faces).
- The tool calculates distances based on the plot coordinates, not screen pixels.
Tasks
Feature description
Users may need to verify dimensions or analyze the spatial relationship between specific areas of a plot. This feature proposes a Measurement Tool that allows users to determine the precise distance between two points on the plot's bounding box planes.
Workflow:
ESCor right-clicking cancels the operation or clears the current measurement.Constraints:
Tasks
implot3d_internal.h)ImPlot3DPlotto track the measurement status:MeasureMode(Enum: None, SelectingP1, SelectingP2, Finished).MeasureP1andMeasureP2(ImPlot3DPoint).implot3d.cpp)ShowPlotContextMenuto toggle the mode.implot3d.cpp)HandleInput, implement logic to detect mouse clicks whenMeasureModeis active.GetMouseOverPlaneandPixelsToPlotPlaneto calculate the 3D coordinate of the mouse cursor projected onto the hovered plot face.MeasureP1andMeasureP2on click events.implot3d.cpp)MeasureP1(andMeasureP2if set).dX: ...dY: ...dZ: ...Len: ...implot3d_demo.cpp)implot3d_demo.cpp(can be implicitly tested via the context menu on existing plots).