Interface CutPlaneManipulatorInterface

The CutPlaneManipulatorInterface interface is used to manipulate cut planes.

This is a GUI element that allows an end-user to modify the orientation/position of a cut plane.

The usage is very simple :

  • Instantiate/recycle a CutPlaneManipulatorInterface.
  • Bind the CutPlaneManipulatorInterface to a cut plane.
  • Show the CutPlaneManipulatorInterface.
  • The user changes the cut plane through the interactions with the GUI element.
/** 
* Sample to illustrate the creation of a cut plane, manipulated with a CutPlaneManipulatorInterface.
*/
import { InfiniteEngineInterface, CutPlaneManagerInterface, Vector3, CutPlaneManipulatorInterface } from 'generated/documentation/appinfiniteapi';

// lEngine has been created previously
let lEngine : InfiniteEngineInterface;

// we want to hide items that are above (and not under), thus the normal is in the positive side.
const lNormal : Vector3 = new Vector3(0, 0, 1);
// any point with z = 10 is ok
const lPoint : Vector3 = new Vector3(Math.random(), Math.random(), 10);
// get the cut plane manager
const lCutPlaneManager : CutPlaneManagerInterface = lEngine.getCutPlaneManager();
const lCutPlaneId = lCutPlaneManager.createCutPlane(lPoint, lNormal);
console.assert(lCutPlaneId !== 0);
// do what you want, the cut plane is working as it is enabled upon creation
// and create a cut plane manipulator to allow the end user to change the cut plane geometry.
const lCutPlaneManipulator : CutPlaneManipulatorInterface = lCutPlaneManager.createCutPlaneManipulator();
// bind the manipulator to the newly created cut plane
lCutPlaneManipulator.setCutPlaneId(lCutPlaneId);
// hide it for the moment, we may need it later
lCutPlaneManipulator.setVisible(false);

The user may know when the bound cut plane is modified through the [CutPlaneManagerInterfaceSignal](../enums/CutPlaneManagerInterfaceSignal.html) from the [CutPlaneManagerInterface](CutPlaneManagerInterface.html).
3D Rendering

See

CutPlaneManagerInterface

Hierarchy

Methods

  • Gets the Cut plane manipulator handler.

    Returns

    The HTMLelement representing the cut plane manipulator.

    Returns undefined | HTMLElement

  • Gets the manipulated cut plane id.

    Returns

    The manipulated cut plane id. Return 0 if no cut plane is bound.

    Returns number

  • Gets the visibility state of the manipulator.

    Returns

    true if the manipulator is visible.

    Returns boolean

  • Sets the cut plane id to manipulate.

    Setting the id 0 is valid, it effectively unbinds the cut plane manipulator from a cut plane.

    Setting an invalid id to the cut plane manipulator has the same affect as unbinding the manipulator from a cut plane.

    Setting the same id has no effect.

    Returns true if the cut plane id exists or if 0 is set.

    Returns

    true if the cut plane corresponding to the id is valid or 0.

    Parameters

    • pCutPlaneId: number
      in
      The id of the cut plane to manipulate.

    Returns boolean

  • Sets the manipulator visibility.

    Returns

    'true' if the the cut plane manipulator has changed his visibility.

    Parameters

    • pVisible: boolean
      in
      Shows the manipulator if true else hide it.

    Returns boolean