phu_bn
March 27, 2026, 10:25am
1
I’m using the Hoops Visualize app on iOS for picking
I have a modal tree (containing a list of model node items).
When I tap a line/face on the model, they are highlighted. When I tap again, the highlight should be canceled.
Furthermore, when I tap a line/face, I want to get the nodeId of the tapped line/face to link it to the node item in the modal tree.
I followed How to obtain edges for Communicator.Selection.FaceEntity ? . However, it only supports the web platform.
How to obtain on a mobile platform?
mike
March 27, 2026, 9:48pm
2
@phu_bn this is related to HOOPS Visualize for Desktop & Mobile.
Please consult Selection — HOOPS Visualize Desktop Documentation and look at obtaining selection results.
Mike
phu_bn
March 31, 2026, 10:00am
3
I researched the Selection Desktop documentation ( Selection — HOOPS Visualize Desktop Documentation ), but I haven’t obtained the nodeID yet. I used HPS::SelectionResults to get the selected item, but I couldn’t find it.
Could you please support me @simon @mike
Here is my code.
class SandboxHighlightOperator : public HPS::SelectOperator {
public:
// SandboxHighlightOperator(HPSWidget* widget);
// virtual ~SandboxHighlightOperator();
explicit SandboxHighlightOperator(HPS::Canvas const& in_canvas);
virtual ~SandboxHighlightOperator() = default;
virtual HPS::UTF8 GetName() const { return "Qt_SandboxHighlightOperator"; }
bool OnTouchDown(HPS::TouchState const& in_state) override;
bool OnTouchUp(HPS::TouchState const& in_state) override;
bool OnTouchMove(const HPS::TouchState& in_state) override;
static ::HPS::Selection::Level SelectionLevel;
void Unhighlight();
private:
void HighlightCommon();
// bool SelectCommon(HPS::Point const& in_loc, HPS::WindowKey& in_window, HPS::ModifierKeys in_modifiers);
private:
// HPSWidget* mainWidget;
HPS::Canvas canvas;
bool m_isMove = false;
HPS::TouchState m_mouseUpState;
std::vector<HPS::SelectionItem> m_selectItems; // edge face
};
#endif /* SandboxHighlightOperator_h */
SandboxHighlightOperator::SandboxHighlightOperator(HPS::Canvas const& in_canvas)
: HPS::SelectOperator(HPS::MouseButtons::ButtonLeft(), HPS::ModifierKeys())
, canvas(in_canvas)
{
}
bool SandboxHighlightOperator::OnTouchDown(HPS::TouchState const& in_state)
{
m_isMove = false;
m_mouseUpState = in_state;
return false;
}
bool SandboxHighlightOperator::OnTouchMove(const HPS::TouchState& in_state)
{
m_isMove = true;
return Operator::OnTouchMove(in_state);
}
bool SandboxHighlightOperator::OnTouchUp(const HPS::TouchState& in_state)
{
HighlightCommon();
return Operator::OnTouchUp(in_state);
}
void SandboxHighlightOperator::HighlightCommon()
{
HPS::SelectionResults selection_results = GetActiveSelection();
size_t selected_count = selection_results.GetCount();
HPS::SelectionResultsIterator iter = selection_results.GetIterator();
while (iter.IsValid()) {
HPS::SelectionItem selectionItem = iter.GetItem();
HPS::Key key;
selectionItem.ShowSelectedItem(key); // 'key' is the HPS::Key of the selected item
if (key.Type() == HPS::Type::ShellKey) {
// do something with this key
printf("found note");
}
iter.Next();
}
if (selected_count > 0) {
HPS::HighlightOptionsKit highlight_options(HPS::HighlightOptionsKit::GetDefault());
highlight_options.SetStyleName("highlight_style");
highlight_options.SetSubentityHighlighting(false);
highlight_options.SetOverlay(HPS::Drawing::Overlay::InPlace);
HPS::SelectionResultsIterator it = selection_results.GetIterator();
HPS::SelectionItem item = it.GetItem();
intptr_t nodeId = item.GetClassID();
}
canvas.Update();
}
phu_bn
April 13, 2026, 1:26am
4
Hi @simon
Could you please support me in this case? I’ve researched about HPS::SelectionResults, but have not completed it yet
mike
April 14, 2026, 6:57pm
5
@phu_bn it’s not clear what part isn’t working.
Is a selection made (i.e. a touch down event occurs)?
Is selected_count > 0 in HighlightCommon()?
What are you trying to achieve with the nodeId? You are assigning the return value of GetClassID() which is not unique to a specific node.
Mike
phu_bn
April 16, 2026, 6:54am
6
Thank you for your support @mike
I applied HPS::HighlightOperator to the highlight operator custom instead HPS::SelectOperator
I obtained the NodeID from key.owner().