Click or drag to resize
SoSelectionSetPickFilterCallback Method (SoSelectionPickCB, Boolean)

The pick filter callback is invoked when a pick has occurred and the selection node is about to change the selection list.

Namespace: OIV.Inventor.Nodes
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 2023.1.3.0 (2023.1.3)
Syntax
public void SetPickFilterCallback(
	SoSelectionPickCB f,
	bool callOnlyIfSelectable
)

Parameters

f
Type: OIV.Inventor.NodesSoSelectionPickCB
callOnlyIfSelectable
Type: SystemBoolean
Remarks

The callback function returns the path that the selection node should use when selecting and deselecting. If no pick callback is registered (the default), the selection node will use the path returned by OIV.Inventor.SoPickedPoint.GetPath() on the picked point associated with the event being processed. The returned path should not be ref'd - selection will ref() and unref() it. (See SoPath.unrefNoDelete().)

Note that a picked object may or may not be a child of the selection node. A selection node will only select paths that pass through it. Possible return values from the callback:

[a] NULL - selection behaves as if nothing was picked (i.e. for SINGLE and SHIFT policies, this clears the selection list). Handle event action traversal halts.

[b] Path - this path will be selected/deselected according to the selection policy (it must lie under the selection node). Handle event action traversal halts.

[c] Path containing only the selection node - apply the selection policy as if nothing was picked. Handle event action traversal continues.

[d] Path not passing through the selection node - selection ignores this pick event and no change is made to the selection list. Handle event action traversal continues.

A simple way to tell selection to ignore the pick is to return an OIV.Inventor.SoPath with no nodes in it. (i.e. return new OIV.Inventor.SoPath; ) Selection will always ref the path returned by the callback, make a copy of the path, then unref the path.

The callOnlyIfSelectable argument, when set to true, means the pick callback function will only be invoked on picks which pass through the selection node. When false, all picks will be passed to the callback whether they pass through the selection or not.

See Also