WanaPlan

API Docs for: 2.7.0
Show:

GroupManager

Module: Wanaplan

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:

Methods

addToGroup

Syntax

addToGroup

(
  • object
  • group
  • [isHistoryAction]
)

Summary

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

Syntax

createGroup

(
  • id
  • parent
)
BABYLON.Mesh

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

Syntax

deleteGroup

(
  • group
  • [isHistoryAction]
)

Summary

Deletes a group.

Parameters:

  • group BABYLON.Mesh

    A group.

  • [isHistoryAction] Boolean optional

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

BABYLON.Mesh:

The current virtual group.

historyGroup

Syntax

historyGroup

(
  • target
  • params
  • valueField
)
private

Summary

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

Syntax

isGroup

(
  • object
)
Boolean

Summary

Checks if a mesh is a group.

Parameters:

  • object BABYLON.Mesh

    The mesh to check.

Returns:

Boolean:

Is a group or not.

isVirtualGroup

Syntax

isVirtualGroup

(
  • object
)
Boolean

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

    The mesh to check.

Returns:

Boolean:

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

    The group cloned.

onGroup

Syntax

onGroup

(
  • event
)

Summary

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

Parameters:

  • event Event

    The JS event.

redoGroup

Syntax

redoGroup

(
  • target
  • params
)
private

Summary

The redo function for the group action history.

Parameters:

  • target Object

    The target of the history action.

  • params Object

    Parameters.

removeFromGroup

Syntax

removeFromGroup

(
  • object
  • group
)

Summary

Removes an object from a group.

Parameters:

  • object BABYLON.Mesh

    A group or an object.

  • group BABYLON.Mesh

    A group or an object.

removeGroupId

Syntax

removeGroupId

(
  • object
)
private

Summary

Removes the group id from an object.

Parameters:

  • object BABYLON.Mesh

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

    A mesh to restore as a group

  • groupId Number

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

setGroupId

Syntax

setGroupId

(
  • object
  • groupId
)
private

Summary

Sets the id of an object or group.

Parameters:

  • object BABYLON.Mesh

    Group or Selectable object.

  • groupId Number

    The id.

undoGroup

Syntax

undoGroup

(
  • target
  • params
)
private

Summary

The undo function for the group action history.

Parameters:

  • target Object

    The target of the history action.

  • params Object

    Parameters.

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.