User Tools

Site Tools


DzSelectionMap

Provides a mapping between face groups and nodes associated with a mesh.

More...

Inherits :

Constructors

DAZ Script
DzSelectionMap ()

Methods

DAZ Script
DzErroraddPair ( String faceGroupName, DzNode node, Boolean replaceIfExists=false )
voidclearAll ()
voidclearMissingGroups ( facetmesh_dz mesh )
StringfindGroupForNode ( DzNode node )
DzNodefindNodeForGroup ( String groupName )
NumberfindPair ( DzNode node )
NumberfindPair ( String groupName )
NumbergetNumPairs ()
StringgetPairGroup ( Number index )
DzNodegetPairNode ( Number index )
DzErrorremovePair ( Number index )

Signals

Detailed Description

This class provides a mapping between the names of the facegroup_dz objects associated with a facetmesh_dz and the DzNode objects that are likewise associated with that mesh. This mapping plays a part in the mechanism that allows a user to click on different areas of the mesh in the viewport and have that translate to the selection of a node.

Constructors


DzSelectionMap()

Default Constructor.

Methods


DzError : addPair( String faceGroupName, DzNode node, Boolean replaceIfExists=false )

Adds a new face group/node mapping to the selection map.

Parameter(s):

  • faceGroupName - The name of the face group that will map to the given node.
  • node - The node that will be selected when the face group is clicked on in the viewport.
  • replaceIfExists - If true, checks to see if the face group is already mapped, and replaces the mapped node with the given node. If false, the operation will fail if the face group is already mapped.

Return Value:

  • DZ_NO_ERROR on success, otherwise an error code.

void : clearAll()

Clears all pairs in the map.


void : clearMissingGroups( facetmesh_dz mesh )

Clears the missing groups based on the face groups on mesh.

Parameter(s):

  • mesh - The reference mesh.

String : findGroupForNode( DzNode node )

Searches for the first group for a node.

Parameter(s):

  • node - The node to find the group for.

Return Value:

  • The name of the group for node.

DzNode : findNodeForGroup( String groupName )

Searches for the first node for a group.

Parameter(s):

  • groupName - The name of the group to find.

Return Value:

  • null if it fails, else the found node for group.

Number : findPair( DzNode node )

Searches for the first pair.

Parameter(s):

  • node - The node to find the mapping for.

Return Value:

  • The list of indices mapping to the node, empty list if no mapping for the node exists.

Number : findPair( String groupName )

Searches for the first pair.

Parameter(s):

  • groupName - The name of the face group to find the mapping for.

Return Value:

  • The index of the mapping for the face group, or -1 if no mapping for the face group exists.

Number : getNumPairs()

Return Value:

  • The number of face group/node mappings in the selection map.

String : getPairGroup( Number index )

Parameter(s):

  • index - The index of the face group/node mapping to look up.

Return Value:

  • The name of the face group for the mapping.

DzNode : getPairNode( Number index )

Parameter(s):

  • index - The index of the face group/node mapping to look up.

Return Value:

  • The node for the mapping.

DzError : removePair( Number index )

Removes a face group/node mapping from the selection map.

Parameter(s):

  • index - The index of the mapping to remove.

Return Value:

  • DZ_NO_ERROR on success, otherwise an error code.

Signals


void : mapModified()

Signature:“mapModified()”

Emitted when the map changes.


void : visibilityChanged()

Signature:“visibilityChanged()”

Emitted when the visibility of the node in a given pair changes.