GroupManager Class
This class abstracts groups of objects
It provides an interface to group objects together, historize the actions, etc
It requires EditionComponent3D
to manage the scene objects
Constructor
GroupManager
-
editionComponent
Parameters:
-
editionComponent
EditionComponent3DThe parent edition component.
Item Index
Methods
Events
Methods
addToGroup
-
object
-
group
-
[isHistoryAction]
Adds an object to a group.
Parameters:
-
object
BABYLON.MeshA group or an object.
-
group
BABYLON.MeshA group, an object or null.
-
[isHistoryAction]
Boolean optionalAdd or not to the history.
createGroup
-
id
-
parent
Creates a group mesh, ready for decoration and serialization. A group has a particular decoration behavior : all parts having the same name will be decorated together, regardless of what object they belong to.
Parameters:
-
id
NumberThe id of the group.
-
parent
BABYLON.MeshThe parent, in general the floor mesh.
Returns:
The new mesh of the group (can be virtual or not).
deleteGroup
-
group
-
[isHistoryAction]
Deletes a group.
Parameters:
-
group
BABYLON.MeshA group.
-
[isHistoryAction]
Boolean optionalAdd or not to the history.
deleteSelectedGroup
()
Deletes the currently selected group.
getCurrentVirtualGroup
()
BABYLON.Mesh
Returns the current virtual group, formed when the user selects several objects without grouping them explicitly.
Returns:
The current virtual group.
historyGroup
-
target
-
params
-
valueField
The action done when the redo of undo function is called.
isGroup
-
object
Checks if a mesh is a group.
Parameters:
-
object
BABYLON.MeshThe mesh to check.
Returns:
Is a group or not.
isVirtualGroup
-
object
Checks if a mesh is a virtual group. A virtual group is a group created only with the ctrl button. The group property is not set permanently.
Parameters:
-
object
BABYLON.MeshThe mesh to check.
Returns:
Is a group or not.
onCloneGroup
-
group
Called when the user clones a group. Careful this function is used in onCloneObject but does not react to an event.
Parameters:
-
group
BABYLON.MeshThe group cloned.
onGroup
-
event
Triggered on event wnp.engine3D.contextMenu.group
.
Called when the user solidifies a group.
Parameters:
-
event
EventThe JS event.
redoGroup
-
target
-
params
The redo function for the group action history.
removeFromGroup
-
object
-
group
Removes an object from a group.
Parameters:
-
object
BABYLON.MeshA group or an object.
-
group
BABYLON.MeshA group or an object.
removeGroupId
-
object
Removes the group id from an object.
Parameters:
-
object
BABYLON.MeshGroup or Selectable object.
restore
-
object
-
groupId
Restores a group from the groupId set during serialization. If the group does not exist, it is automatically created. Note : It is kind of a deserialization.
Parameters:
-
object
BABYLON.MeshA mesh to restore as a group
-
groupId
NumberThe id of the group the object belonged to before serialization.
setGroupId
-
object
-
groupId
Sets the id of an object or group.
Parameters:
-
object
BABYLON.MeshGroup or Selectable object.
-
groupId
NumberThe id.
undoGroup
-
target
-
params
The undo function for the group action history.
virtualToRealGroup
()
Changes a virtual group into a real group.
Events
wnp.request.saveHistory
Fired to request a save of the history.