Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

  1. Create a custom operator by subclassing HPS::NavigationCubeOperator

  2. Implement OnMouseDown to processing input events.

  3. 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.

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@2318a5
sortmodified
showSpacefalse
reversetrue
typepage
cqllabel = "kb-how-to-article" and type = "page" and space = "KBHV"
labelskb-how-to-article
Page Properties
hiddentrue

Related issues

Jira Legacy
serverId43f371d0-7091-3b3c-9683-94c0b791358d
keySDHV-10430