-
-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Labels
prio:mediumMedium priorityMedium prioritystatus:todoTask identified but not startedTask identified but not startedtype:featNew feature or requestNew feature or request
Description
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
ESCor 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
- Internal State (
implot3d_internal.h)- Add state variables to
ImPlot3DPlotto track the measurement status:MeasureMode(Enum: None, SelectingP1, SelectingP2, Finished).MeasureP1andMeasureP2(ImPlot3DPoint).
- Add state variables to
- User Interface (
implot3d.cpp)- Add a "Measure" menu item to
ShowPlotContextMenuto toggle the mode.
- Add a "Measure" menu item to
- Input Handling (
implot3d.cpp)- In
HandleInput, implement logic to detect mouse clicks whenMeasureModeis active. - Utilize
GetMouseOverPlaneandPixelsToPlotPlaneto calculate the 3D coordinate of the mouse cursor projected onto the hovered plot face. - Update
MeasureP1andMeasureP2on click events.
- In
- Rendering (
implot3d.cpp)- Render circles at
MeasureP1(andMeasureP2if set). - Render a line connecting the two points.
- Render a text tooltip or overlay box displaying:
dX: ...dY: ...dZ: ...Len: ...
- Render circles at
- Demo (
implot3d_demo.cpp)- Add a demonstration of the tool in the
implot3d_demo.cpp(can be implicitly tested via the context menu on existing plots).
- Add a demonstration of the tool in the
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
prio:mediumMedium priorityMedium prioritystatus:todoTask identified but not startedTask identified but not startedtype:featNew feature or requestNew feature or request