User Tools

Site Tools


DzContentReplaceMgr

Manager responsible for scene item replacement based on content type.

More...

Inherits :

Enumerations

Methods

Signals

voidcontentReplaceModeChanged ( DzContentReplaceMgr::ContentReplaceMode mode )

Detailed Description

Responsible for the management of replacing scene items based on their respective content types.

There is only one instance of this manager in an application. This instance is created and owned by DzContentMgr. Request the instance via DzContentMgr::getContentReplaceMgr().

See Also:

Enumerations


: ContentReplaceMode

Replacment methods when loading content.

  • ALWAYS_REPLACE - When a piece of content of a specific type is loaded, any content already in the scene of the same type is removed so that the new item replaces the old one.
  • ASK_TO_REPLACE - When a piece of content is loaded, a dialog prompts the user to choose which (if any) items already in the scene should be removed.
  • NEVER_REPLACE - Items already in the scene are never removed when loading a piece of content.
  • ASK_WHEN_MATCHING - When a piece of content is loaded, a dialog prompts the user to choose which (if any) items already in the scene should be removed if there is an item of matching content type.

Methods


void : clearReplaceData()

Resets all replace data to default values, excluding replace mode.


void : doReplace()

Performs all the necessary steps to remove content marked for replacement.


Array : getDefaultReplaceNodeList( DzNode baseNode )

Parameter(s):

  • baseNode - The base node.

Return Value:

  • A list of nodes attached to baseNode that would be replaced by default.

Since:

  • 4.11.0.184

String : getNewContentPath()

Return Value:

  • The path of the new content.

String : getNewContentType()

Return Value:

  • The type of the new content.

Array : getPotentialReplaceNodeList( DzNode baseNode )

Parameter(s):

  • baseNode - The base node.

Return Value:

  • A list of nodes attached to baseNode that could potentially be replaced.

Since:

  • 4.11.0.184

ContentReplaceMode : getReplaceMode()

Return Value:

  • The content replace mode.

Array : getReplaceNodeList()

Return Value:

  • The nodes in the scene to be replaced.

Since:

  • 4.11.0.184

void : initReplaceForContentLoad( String path, DzNode baseNode )

Performs all the necessary initialization for doing content replacement when the given file will be loaded, using items attached to baseNode as potential items to replace.


void : removeReplaceNodes()

Removes all nodes in the replace list from the scene.


void : setNewContentPath( String contentPath )

Parameter(s):

  • contentPath - The path of the new content.

void : setNewContentType( String contentType )

Parameter(s):

  • contentType - The type of the new content.

void : setReplaceMode( ContentReplaceMode mode )

Sets the content replace mode.

Parameter(s):

  • mode - The mode to set.

void : setReplaceNodes( Array replaceNodes )

Sets the list of nodes in the scene to be replaced.

Parameter(s):

  • replaceNodes - The list of nodes to set.

void : updateReplaceNodes( DzNode baseNode )

Updates the replace list to contain all items that should be removed during content load. If the replace mode is ALWAYS_REPLACE, the list will contain all nodes attached (following, parented, etc.) to baseNode whose type matches the current “New Content Type” (as set through setNewContentType()). If the replace mode is ASK_TO_REPLACE, a dialog will allow the user to select what nodes should be replaced.

Signals


void : contentReplaceModeChanged( DzContentReplaceMgr::ContentReplaceMode mode )

Signature:“contentReplaceModeChanged(DzContentReplaceMgr::ContentReplaceMode)”

Emitted when the content replace mode has changed.

Parameter(s):

  • mode - The new content replace mode.