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.
Calling twice addEventListener with the same parameters results in the second call to be ignored,
only unique pairs callback / object are allowed, in order to avoid calling multiple times the same
thing.
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.
Creates a new plane given a plane equation.
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 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 the normal 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.
Sets the content of the CutPlaneManagerInterface from a former call to toJSON.
Cut plane parameters may be streamed, using the following schema :
{
"$defs": {
"cutplane": {
"additionalProperties": false,
"properties": {
"enabled": {
"default": true,
"description": "If disabled, this filter is completely ignored during all the computations",
"example": true,
"type": "boolean"
},
"group": {
"default": 0,
"description": "Cut planes may be grouped together. In that case, an area is considered 'cut' if ALL cut planes cut this area.",
"example": 0,
"maximum": 7,
"minimum": 0,
"type": "integer"
},
"normal": {
"$ref": "#/$defs/vec3"
},
"point": {
"$ref": "#/$defs/vec3"
}
},
"required": [
"enabled",
"point",
"normal"
],
"title": "Cut plane definition",
"type": "object"
},
"cutplanes": {
"additionalProperties": false,
"properties": {
"cutplanes": {
"items": {
"$ref": "#/$defs/cutplane"
},
"type": "array"
},
"type": {
"const": "cutplanes",
"type": "string"
},
"version": {
"description": "Define the version of the object",
"example": 1,
"type": "integer"
}
},
"required": [
"type",
"cutplanes"
],
"title": "Cut planes definition",
"type": "object"
},
"vec3": {
"description": "Define the coordinates [x,y,z] of a point / vector",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"title": "3D Vector definition",
"type": "array"
}
},
"$ref": "#/$defs/cutplanes",
"$schema": "https://json-schema.org/draft-07/schema#"
}
true if the data is set.
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 point used to determine the given plane position.
Returns false if the cut plane was not found. Returns false if pCutPlaneNormal and pCutPlanePoint are both undefined.
true if pCutPlaneId refers to a valid cut plane and pCutPlaneNormal or pCutPlanePoint is not undefined.
Gets the given cut plane group.
Valid groups are values in the [0 : 7] range.
A returned value of 0 means that the given cut plane does not belong to a group. In case of an invalid cut plane, -1 is returned.
The cut plane group the given cut plane belongs to, or -1 if the cut plane does not exist.
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.
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.
The listener function that gets removed.
The listener object that was used when addEventListener was called.
true if the callback was removed else false.
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.
The listener function that gets removed.
true if the callback was removed else false.
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.
Assigns the given cut plane to the given group.
Cut planes can be grouped together in a cut plane group, in this case a 3D point is considered 'cut' when its position is in the cut half plane of ALL the cut planes that belong to the same group. The group 0 is not a "real group", this is the default group that has no special behavior.
Valid groups are values in the [0 : 7] range. Setting a cut plane group of 0 removes the cut plane from its past group.
In case of an invalid group, false is returned. In case of an invalid cut plane, false is returned. `true' is returned if the call succeeded.
@param pCutPlaneId
true if the call succeeded.
Gets a deep copy of the internal data of the CutPlaneManagerInterface.
Please refer to JSON.stringify.
Optional pKey: anyThe internal CutPlaneManagerInterface data.
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.
Updates the shape of the plane pCutPlaneId, changes the 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 plane was not found or if the resulting normal is (0,0,0). The reference point is the projection of the center of the DMU on the given plane equation.
true if the plane was found, the resulting normal 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 InfiniteEngineInterface.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 (getMaxCutPlanesCount).
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.When an equation is provided, the reference point is the projection of the center of the DMU to this cut plane. The equation is a Vector4(a,b,c,d) such that all points P(x,y,z) satisfy the equation : ax + by + cz = d.
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 CutPlaneManagerInterface.createCutPlaneManipulator.
Cut planes can be grouped together, in this case, a 3D point is considered 'cut' when its position is in the cut half plane of ALL the cut planes that belong to the same group. By default, cut planes are assigned the group
0which is not a cut plane group. The0group is the default behavior of cut planes. There is a limited number of cut plane groups (shader limitation), only 7 real cut plane groups exist, ranging from1to7included. Groups are set with setCutPlaneGroup.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 for more information.
See