Skip to content

Commit f25c262

Browse files
committed
rename pick functions
1 parent 80b4bb7 commit f25c262

File tree

8 files changed

+15
-14
lines changed

8 files changed

+15
-14
lines changed

examples/demo-app/demo_app.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ void callback() {
807807
std::tie(xInd, yInd) = polyscope::view::screenCoordsToBufferInds(screenCoords);
808808

809809
glm::vec3 worldRay = polyscope::view::screenCoordsToWorldRay(screenCoords);
810-
polyscope::PickResult pickResult = polyscope::queryPickAtScreenCoords(screenCoords);
810+
polyscope::PickResult pickResult = polyscope::pickAtScreenCoords(screenCoords);
811811

812812
std::cout << "Polyscope scene test click " << std::endl;
813813
std::cout << " io.MousePos.x: " << io.MousePos.x << " io.MousePos.y: " << io.MousePos.y << std::endl;

include/polyscope/pick.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ struct PickResult {
3838

3939
// Query functions to evaluate a pick.
4040
// Internally, these do a render pass to populate relevant information, then query the resulting buffers.
41-
PickResult queryPickAtScreenCoords(glm::vec2 screenCoords); // takes screen coordinates
42-
PickResult queryPickAtBufferInds(glm::ivec2 bufferInds); // takes indices into render buffer
41+
PickResult pickAtScreenCoords(glm::vec2 screenCoords); // takes screen coordinates
42+
PickResult pickAtBufferInds(glm::ivec2 bufferInds); // takes indices into render buffer
4343

4444

4545
// == Stateful picking: track and update a current selection

src/pick.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010

1111
namespace polyscope {
1212

13-
PickResult queryPickAtScreenCoords(glm::vec2 screenCoords) {
13+
PickResult pickAtScreenCoords(glm::vec2 screenCoords) {
1414
int xInd, yInd;
1515
glm::ivec2 bufferInds = view::screenCoordsToBufferIndsVec(screenCoords);
16-
return queryPickAtBufferInds(bufferInds);
16+
return pickAtBufferInds(bufferInds);
1717
}
18-
PickResult queryPickAtBufferInds(glm::ivec2 bufferInds) {
18+
19+
PickResult pickAtBufferInds(glm::ivec2 bufferInds) {
1920
PickResult result;
2021

2122
// Query the pick buffer

src/polyscope.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ void processInputEvents() {
405405
// Don't pick at the end of a long drag
406406
if (dragDistSinceLastRelease < dragIgnoreThreshold) {
407407
ImVec2 p = ImGui::GetMousePos();
408-
PickResult pickResult = queryPickAtScreenCoords(glm::vec2{p.x, p.y});
408+
PickResult pickResult = pickAtScreenCoords(glm::vec2{p.x, p.y});
409409
setSelection(pickResult);
410410
}
411411

test/src/camera_view_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ TEST_F(PolyscopeTest, CameraViewPick) {
7575

7676
// This probably doesn't actually click on anything, but it does populate the pick buffers and makes sure that nothing
7777
// crashes
78-
polyscope::pick::pickAtScreenCoords(glm::vec2{0.3, 0.8});
78+
polyscope::pickAtScreenCoords(glm::vec2{0.3, 0.8});
7979

8080
polyscope::show(3);
8181

test/src/curve_network_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ TEST_F(PolyscopeTest, CurveNetworkPick) {
3333
auto psCurve = registerCurveNetwork();
3434

3535
// Don't bother trying to actually click on anything, but make sure this doesn't crash
36-
polyscope::pick::evaluatePickQuery(77, 88);
36+
polyscope::pickAtBufferInds(glm::ivec2(77, 88));
3737

3838
polyscope::removeAllStructures();
3939
}

test/src/point_cloud_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ TEST_F(PolyscopeTest, PointCloudPick) {
6666
auto psPoints = registerPointCloud();
6767

6868
// Don't bother trying to actually click on anything, but make sure this doesn't crash
69-
polyscope::pick::evaluatePickQuery(77, 88);
69+
polyscope::pickAtBufferInds(glm::ivec2(77, 88));
7070

7171
psPoints->setPointRenderMode(polyscope::PointRenderMode::Quad);
72-
polyscope::pick::evaluatePickQuery(77, 88);
72+
polyscope::pickAtBufferInds(glm::ivec2(77, 88));
7373

7474
polyscope::removeAllStructures();
7575
}

test/src/surface_mesh_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ TEST_F(PolyscopeTest, SurfaceMeshPick) {
112112
auto psMesh = registerTriangleMesh();
113113

114114
// Don't bother trying to actually click on anything, but make sure this doesn't crash
115-
polyscope::pick::evaluatePickQuery(77, 88);
115+
polyscope::pickAtBufferInds(glm::ivec2(77, 88));
116116

117117
// Do it again with edges enabled
118118
psMesh->setEdgeWidth(1.0);
119-
polyscope::pick::evaluatePickQuery(77, 88);
119+
polyscope::pickAtBufferInds(glm::ivec2(77, 88));
120120

121121
polyscope::removeAllStructures();
122122
}
@@ -605,7 +605,7 @@ TEST_F(PolyscopeTest, SimpleTriangleMeshPick) {
605605
auto psMesh = registerSimpleTriangleMesh();
606606

607607
// Don't bother trying to actually click on anything, but make sure this doesn't crash
608-
polyscope::pick::evaluatePickQuery(77, 88);
608+
polyscope::pickAtBufferInds(glm::ivec2(77, 88));
609609

610610
polyscope::removeAllStructures();
611611
}

0 commit comments

Comments
 (0)