I want that when I click on a point on the screen, the item containing that point will be highlighted. Then, I would like to maintain the highlight state while still being able to perform panOrbit actions.
My idea is to customize the class MyCustomOperator_s1 : public HPS::PanOrbitZoomOperator.
Then, when touchDown → get point → get item with the selected point → set highlight item.
Please let me know if I’m on the right track. Currently, I am pursuing this direction but have not found the function to convert the point into an item. @simon
bool OnTouchDown(HPS::TouchState const& in_state)
{
doubleTap_test_count++;
HPS::TouchArray touches = in_state.GetTouches();
if (doubleTap_test_count == 1)
{
// get location in window space for first touch object
HPS::Touch touch = touches.at(0);
HPS::WindowPoint windowPoint = touch.Location;
//Setup a start a timer
firstPoint = windowPoint;
// Get touch object
HPS::SelectionResults new_selection;
HPS::SelectionOptionsKit selection_options;
selection_options.SetRelatedLimit(0).SetLevel(HPS::Selection::Level::Entity);
}
// Please also check for the time difference between the first and second touch event
if (doubleTap_test_count == 2 ) // and the
{
// check timer - If timer is less then 0.5 seconds, then doubleTap event is trigger
// Check position - Check the position of the first touch event and compare it to lastest position
// They should be close
// if ()
//Double tap event
printf("");
// Select and highlight option
}
// Test to see if OnTouchDown is triggered.
// canvas.GetFrontView().GetAttachedModel().GetSegmentKey().GetVisibilityControl().SetEdges(true);
// canvas.UpdateWithNotifier().Wait();
// PanOrbitZoomOperator need to record the first touch position for reference.
HPS::PanOrbitZoomOperator::OnTouchDown(in_state);
return true;
}