GroupManager
Summary
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
Syntax
GroupManager
-
editionComponent
Summary
Parameters:
-
editionComponent
EditionComponent3DThe parent edition component.
Item Index
Methods
Events
Methods
addToGroup
Syntax
addToGroup
-
object
-
group
-
[isHistoryAction]
Summary
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
Syntax
createGroup
-
id
-
parent
Summary
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
Syntax
deleteGroup
-
group
-
[isHistoryAction]
Summary
Deletes a group.
Parameters:
-
group
BABYLON.MeshA group.
-
[isHistoryAction]
Boolean optionalAdd or not to the history.
deleteSelectedGroup
Syntax
deleteSelectedGroup
()
Summary
Deletes the currently selected group.
getCurrentVirtualGroup
Syntax
getCurrentVirtualGroup
()
BABYLON.Mesh
Summary
Returns the current virtual group, formed when the user selects several objects without grouping them explicitly.
Returns:
The current virtual group.
historyGroup
Syntax
historyGroup
-
target
-
params
-
valueField
Summary
The action done when the redo of undo function is called.
isGroup
Syntax
Summary
Checks if a mesh is a group.
Parameters:
-
object
BABYLON.MeshThe mesh to check.
Returns:
Is a group or not.
isVirtualGroup
Syntax
Summary
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
Syntax
onCloneGroup
-
group
Summary
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
Syntax
onGroup
-
event
Summary
Triggered on event wnp.engine3D.contextMenu.group
.
Called when the user solidifies a group.
Parameters:
-
event
EventThe JS event.
redoGroup
Syntax
redoGroup
-
target
-
params
Summary
The redo function for the group action history.
removeFromGroup
Syntax
removeFromGroup
-
object
-
group
Summary
Removes an object from a group.
Parameters:
-
object
BABYLON.MeshA group or an object.
-
group
BABYLON.MeshA group or an object.
removeGroupId
Syntax
removeGroupId
-
object
Summary
Removes the group id from an object.
Parameters:
-
object
BABYLON.MeshGroup or Selectable object.
restore
Syntax
restore
-
object
-
groupId
Summary
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
Syntax
setGroupId
-
object
-
groupId
Summary
Sets the id of an object or group.
Parameters:
-
object
BABYLON.MeshGroup or Selectable object.
-
groupId
NumberThe id.
undoGroup
Syntax
undoGroup
-
target
-
params
Summary
The undo function for the group action history.
virtualToRealGroup
Syntax
virtualToRealGroup
()
Summary
Changes a virtual group into a real group.
Events
wnp.request.saveHistory
Syntax
wnp.request.saveHistory
Summary
Fired to request a save of the history.