Create a custom operator for Navigation cube operator to have an additional behavior when clicking Navigation cube.
For general information for custom operators:
https://docs.techsoft3d.com/hps/latest/build/prog_guide/0602_custom_operators.html
Instructions
Create a custom operator by subclassingÂ
HPS::NavigationCubeOperator
Implement OnMouseDown to processing input events.
Push the custom operator to operator control in your view
Code Block |
---|
// Show Navigation cube
GetCanvas().GetFrontView().GetNavigationCubeControl().SetVisibility(true);
HPS::SegmentKey nav_cube_segment = GetCanvas().GetFrontView().GetNavigationCubeControl().GetSegmentKey();
// Set selectability so that the oeprator can select Navigation cube
nav_cube_segment.GetSelectabilityControl().SetFaces(HPS::Selectability::Value::On);
GetCanvas().GetFrontView().GetOperatorControl().Push(new MyNavigationCubeOperator(GetCanvas().GetFrontView()), Operator::Priority::High); |
Custom navigation cube operator sample
MyNavigationCubeOperator.h
Code Block |
---|
#pragma once
#include "sprk.h"
class MyNavigationCubeOperator : public HPS::NavigationCubeOperator
{
public:
MyNavigationCubeOperator(HPS::View);
~MyNavigationCubeOperator();
virtual bool OnMouseDown(HPS::MouseState const & in_state);
bool IsEventRelevant(HPS::Point const & event_location, HPS::KeyPath const & key_path);
HPS::View m_view;
HPS::SelectionOptionsKit selection_options;
}; |
MyNavigationCubeOperator.cpp
...
For step-by-step instructions, check out our forum post.
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Page Properties | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
|