Skip to content

Commit e503558

Browse files
committed
docs for quantity picking
1 parent aeb99d1 commit e503558

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

cpp/source/basics/interactive_UIs_and_animation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,11 @@ A pick query returns a combined struct with info such as what structure was clic
270270
struct PickResult {
271271
bool isHit = false; // did we hit anything?
272272
Structure* structure = nullptr; // pointer to the structure under the cursor
273+
Quantity* quantity = nullptr; // pointer to the quantity under the cursor (most quantities cannot be picked, you pick the structure instead)
273274
WeakHandle<Structure> structureHandle; // same as .structure, but with lifetime tracking
274275
std::string structureType = ""; // structure type which was hit, like "Point Cloud"
275276
std::string structureName = ""; // name of structure which was hit, like "my_points"
277+
std::string quantityName = ""; // name of quantity which was hit (most quantities cannot be picked, you pick the structure instead)
276278
glm::vec2 screenCoords; // coordinates of the query location
277279
glm::ivec2 bufferInds; // render buffer indices of the query location
278280
glm::vec3 position; // 3d position which was hit, in world space

py/source/basics/interactive_UIs_and_animation.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -413,15 +413,16 @@ A pick query returns a combined struct with info such as what structure was clic
413413

414414
```python
415415
class PickResult:
416-
self.is_hit = # did we hit anything?
417-
self.structure_type_name = # structure type which was hit, like "Point Cloud"
418-
self.structure_name = # name of structure which was hit, like "my_points"
419-
self.screen_coords = # coordinates of the query location
420-
self.buffer_inds = # render buffer indices of the query location
421-
self.position = # 3d position which was hit, in world space
422-
self.depth = # depth to the hit, in world units
423-
self.local_index = # structure-specific index of the element which was hit
424-
self.structure_data = # a dictionary of additional fields for the clicked structure
416+
self.is_hit = ... # did we hit anything?
417+
self.structure_type_name = ... # structure type which was hit, like "Point Cloud"
418+
self.structure_name = ... # name of structure which was hit, like "my_points"
419+
self.quantity_name = ... # name of quantity which was hit (most quantities cannot be picked, you pick the structure instead)
420+
self.screen_coords = ... # coordinates of the query location
421+
self.buffer_inds = ... # render buffer indices of the query location
422+
self.position = ... # 3d position which was hit, in world space
423+
self.depth = ... # depth to the hit, in world units
424+
self.local_index = ... # structure-specific index of the element which was hit
425+
self.structure_data = ... # a dictionary of additional fields for the clicked structure
425426
```
426427

427428
Additionally, many structures will report additional information about the pick, in the `structure_data` field. For instance, a `SurfaceMesh` gives info on whether a vertex/face/edge/etc was clicked on, the index of that element, and barycentric coordinates of the click within a face.

0 commit comments

Comments
 (0)