API Docs for: 2.7.3
Show:

GroupManager Class

Module: Wanaplan

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:

Methods

addToGroup

(
  • object
  • group
  • [isHistoryAction]
)

Adds an object to a group.

Parameters:

  • object BABYLON.Mesh

    A group or an object.

  • group BABYLON.Mesh

    A group, an object or null.

  • [isHistoryAction] Boolean optional

    Add or not to the history.

createGroup

(
  • id
  • parent
)
BABYLON.Mesh

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 Number

    The id of the group.

  • parent BABYLON.Mesh

    The parent, in general the floor mesh.

Returns:

BABYLON.Mesh:

The new mesh of the group (can be virtual or not).

deleteGroup

(
  • group
  • [isHistoryAction]
)

Deletes a group.

Parameters:

  • group BABYLON.Mesh

    A group.

  • [isHistoryAction] Boolean optional

    Add 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:

BABYLON.Mesh:

The current virtual group.

historyGroup

(
  • target
  • params
  • valueField
)
private

The action done when the redo of undo function is called.

Parameters:

  • target Object

    The target of the history action.

  • params Object

    Parameters.

  • valueField Number

    The value.

isGroup

(
  • object
)
Boolean

Checks if a mesh is a group.

Parameters:

  • object BABYLON.Mesh

    The mesh to check.

Returns:

Boolean:

Is a group or not.

isVirtualGroup

(
  • object
)
Boolean

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.Mesh

    The mesh to check.

Returns:

Boolean:

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.Mesh

    The group cloned.

onGroup

(
  • event
)

Triggered on event wnp.engine3D.contextMenu.group. Called when the user solidifies a group.

Parameters:

  • event Event

    The JS event.

redoGroup

(
  • target
  • params
)
private

The redo function for the group action history.

Parameters:

  • target Object

    The target of the history action.

  • params Object

    Parameters.

removeFromGroup

(
  • object
  • group
)

Removes an object from a group.

Parameters:

  • object BABYLON.Mesh

    A group or an object.

  • group BABYLON.Mesh

    A group or an object.

removeGroupId

(
  • object
)
private

Removes the group id from an object.

Parameters:

  • object BABYLON.Mesh

    Group 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.Mesh

    A mesh to restore as a group

  • groupId Number

    The id of the group the object belonged to before serialization.

setGroupId

(
  • object
  • groupId
)
private

Sets the id of an object or group.

Parameters:

  • object BABYLON.Mesh

    Group or Selectable object.

  • groupId Number

    The id.

undoGroup

(
  • target
  • params
)
private

The undo function for the group action history.

Parameters:

  • target Object

    The target of the history action.

  • params Object

    Parameters.

virtualToRealGroup

()

Changes a virtual group into a real group.

Events

wnp.request.saveHistory

Fired to request a save of the history.