44
55#include < cstdint>
66#include < string>
7+ #include < tuple>
78#include < utility>
89
910#include " polyscope/utilities.h"
@@ -13,6 +14,7 @@ namespace polyscope {
1314
1415// Forward decls
1516class Structure ;
17+ class Quantity ;
1618
1719// == Main query
1820
@@ -26,9 +28,11 @@ class Structure;
2628struct PickResult {
2729 bool isHit = false ;
2830 Structure* structure = nullptr ;
31+ Quantity* quantity = nullptr ;
2932 WeakHandle<Structure> structureHandle; // same as .structure, but with lifetime tracking
3033 std::string structureType = " " ;
3134 std::string structureName = " " ;
35+ std::string quantityName = " " ;
3236 glm::vec2 screenCoords;
3337 glm::ivec2 bufferInds;
3438 glm::vec3 position;
@@ -60,18 +64,21 @@ namespace pick {
6064std::pair<Structure*, uint64_t > pickAtScreenCoords (glm::vec2 screenCoords); // takes screen coordinates
6165std::pair<Structure*, uint64_t > pickAtBufferCoords (int xPos, int yPos); // takes indices into the buffer
6266std::pair<Structure*, uint64_t > evaluatePickQuery (int xPos, int yPos); // old, badly named. takes buffer coordinates.
67+ std::tuple<Structure*, Quantity*, uint64_t > evaluatePickQueryFull (int xPos,
68+ int yPos); // badly named. takes buffer coordinates.
6369
6470
6571// == Helpers
6672
6773// Set up picking (internal)
68- // Called by a structure to figure out what data it should render to the pick buffer.
74+ // Called by a structure/quantity to figure out what data it should render to the pick buffer.
6975// Request 'count' contiguous indices for drawing a pick buffer. The return value is the start of the range.
7076uint64_t requestPickBufferRange (Structure* requestingStructure, uint64_t count);
77+ uint64_t requestPickBufferRange (Quantity* requestingQuantity, uint64_t count);
7178
7279// Convert between global pick indexing for the whole program, and local per-structure pick indexing
73- std::pair <Structure*, uint64_t > globalIndexToLocal (uint64_t globalInd);
74- uint64_t localIndexToGlobal (std::pair <Structure*, uint64_t > localPick);
80+ std::tuple <Structure*, Quantity *, uint64_t > globalIndexToLocal (uint64_t globalInd);
81+ uint64_t localIndexToGlobal (std::tuple <Structure*, Quantity *, uint64_t > localPick);
7582
7683// Convert indices to float3 color and back
7784// Structures will want to use these to fill their pick buffers
0 commit comments