Adds a listener to an event type.
When an event of the type pType fires, the callback pListener will be called. This function
returns a unique string id that may be used in removeEventListenerById to allow simple
listener removal.
It is possible to add an object that will be included in the callback to avoid creating too many closures.
The id of the inserted callback (actually an UUID).
Adds a listener to an event type.
When an event of the type pType fires, the callback pListener will be called. This function
returns a unique string id that may be used in removeEventListenerById to allow simple
listener removal.
The id of the inserted callback (actually an UUID).
Creates a new plane given a point position and a normal vector.
The normal does not
need to be unit length, but a zero vector is invalid.
Each vertex on the side of the normal pNormal will be discarded.
Returns the id (non zero) of the newly created cut plane, or 0 if the maximum number of cut planes have already been reached or if pNormal is equal to (0,0,0).
The newly created cut plane is enabled by default.
The id of the created plane. If the maximum number of available cut planes slots has been reached or if pNormal is equal to (0,0,0), returns 0.
Instantiates a cut plane manipulator.
The CutPlaneManipulatorInterface is a GUI widget that allows a user to change the position/orientation of the cut plane.
A cut plane manipulator object.
Gets the cut plane equation of the given plane.
Be N : (Nx,Ny, Nz) the normal of the cut plane, Be P a point of the plane,
we get the equation : {x,y,z} / Nx.x + Ny.y + Nz.z = dot(N,P).
pCutPlaneEquation will be set such as
pCutPlaneEquation.x = Nx
pCutPlaneEquation.y = Ny
pCutPlaneEquation.z = Nz
pCutPlaneEquation.w = dot(N,P).
Returns false if the cut plane was not found.
true if pCutPlaneId refers to a valid cut plane.
Gets the normal used to determine the given plane normal. The cut plane normal is unit length.
Returns false if the plane was not found.
true if pCutPlaneId refers to a valid cut plane.
Gets the point used to determine the given plane position.
Returns false if the cut plane was not found.
true if pCutPlaneId refers to a valid cut plane.
Tells if the EventDispatcher has such a callback registered for the given event type.
true if such a listener is installed for the given type of event.
Tells if the given cut plane is enabled.
Returns false if the cut plane was not found or if the cut plane is disabled.
true if the given cut plane exists and is enabled.
Removes a listener from an event type.
If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.
true if the callback was removed else false.
The listener function that gets removed.
The listener object that was used when addEventListener was called.
Removes a listener from an event type.
If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.
true if the callback was removed else false.
The listener function that gets removed.
Removes a listener by its id.
If no such listener is found, then the function returns false and does nothing. You must use the return value of addEventListener to actually remove the listener.
true if the callback was removed else false.
Sets the enabled status of the cut plane.
A disabled cut plane does not cut anything.
Returns false if the cut plane was not found.
true if pCutPlaneId refers to a valid cut plane.
Updates the shape of the plane pCutPlaneId, changes the point position and the normal vector of the given plane.
Returns false if the plane was not found or if pNormal is (0,0,0).
true if the plane was found, pNormal is not (0,0,0) and therefore the plane orientation/position is updated.
The CutPlaneManagerInterface interface is used to create cut planes, that are used to hide half of the scene.
The CutPlaneManagerInterface is included in the InfiniteEngineInterface and accessed through getCutPlaneManager.
There are no javascript cut plane objects, cut planes are modified through the CutPlaneManagerInterface by their ids. Indeed, each cut plane is assigned an integer id upon its creation, 0 is an invalid id, and is the expected result if the cut plan creation fails. Ids are recycled upon cut planes deletion, so there may be cases when a new cut plane is assigned an id that belonged to a deleted cut plane.
There is a limited number of cut planes that may be created by an application (shader limitations) : only 16 different cut planes may be created / manipulated.
A cut plane is defined by a position
Pthat belong to the plane and a normalN : (Nx,Ny,Nz). This defines a plane (hyperplane) in 3D dimension. Such a plane has the equation : {x,y,z} / Nx.x + Ny.y + Nz.z = dot(N,P). Each vertex on the side of the normalNwill be discarded, so every vertex V : {Vx,Vy,Vz} / Nx.Vx + Ny.Vy + Nz.Vz > dot(N,P) will be discarded.A CutPlaneManipulatorInterface may be created and bound to a cut plane to display a GUI element that allows the end user to change the cut plane orientation / position through createCutPlaneManipulator.
When a cut plane is modified or disabled/enabled, CutPlaneManagerInterfaceSignal signals are sent.
Suppose that we want to hide all items whose "altitude" (z) is superior to 10.
Please refer to the [CutPlaneManipulatorInterface](CutPlaneManipulatorInterface.html) for more information.
See