Loading...
Searching...
No Matches
VdfIsolatedSubnetwork Class Reference

A VdfIsolatedSubnetwork builds a collection of VdfNodes and VdfConnections that are disconnected from the owning network. More...

#include <isolatedSubnetwork.h>

Public Types

using ConnectionSet = pxr_tsl::robin_set< VdfConnection *, TfHash >
 A set of isolated connections.
 
using EditFilter = TfFunctionRef< bool(const VdfNode *)>
 A function that returns true if the given node is allowed to be isolated and deleted.
 

Public Member Functions

 VdfIsolatedSubnetwork (const VdfIsolatedSubnetwork &)=delete
 
VdfIsolatedSubnetworkoperator= (const VdfIsolatedSubnetwork &)=delete
 
VDF_API bool AddIsolatedBranch (VdfConnection *connection, EditFilter canDelete)
 Isolates all nodes and connections reachable via input connections from connection that are not connected via additional output connections to other parts of the network.
 
VDF_API bool AddIsolatedBranch (VdfNode *node, EditFilter canDelete)
 Isolates all nodes and connections reachable via input connections from node that are not connected via additional output connections to other parts of the network.
 
VDF_API void RemoveIsolatedObjectsFromNetwork ()
 Removes all isolated objects from the network.
 
const std::vector< VdfNode * > & GetIsolatedNodes () const
 Returns the set of isolated nodes.
 
const ConnectionSetGetIsolatedConnections () const
 Returns the set of isolated nodes.
 

Static Public Member Functions

static VDF_API std::unique_ptr< VdfIsolatedSubnetworkIsolateBranch (VdfConnection *connection, EditFilter canDelete)
 Isolates all nodes and connections reachable via input connections from connection that are not connected via additional output connections to other parts of the network.
 
static VDF_API std::unique_ptr< VdfIsolatedSubnetworkIsolateBranch (VdfNode *node, EditFilter canDelete)
 Isolates all nodes and connections reachable via input connections from node that are not connected via additional output connections to other parts of the network.
 
static VDF_API std::unique_ptr< VdfIsolatedSubnetworkNew (VdfNetwork *network)
 Creates an empty isolated subnetwork.
 

Detailed Description

A VdfIsolatedSubnetwork builds a collection of VdfNodes and VdfConnections that are disconnected from the owning network.

Building an isolated subnetwork proceeds in three phases:

  1. A traversal starts from one or more nodes or connections and proceeds in the input direction, and identifies all reachable objects that are not otherwise connected to the network. I.e., the traversal stops at nodes that have output connections that are not part of the isolated subnetwork.
  2. Isolated objects are removed from the network, which causes WillDelete notices to be sent, out even though objects have not yet been deleted. This process transfers ownership of network objects from the VdfNetwork to the VdfIsolatedSubnetwork.
  3. The objects are deleted when the VdfIsolatedSubnetwork is deleted.

Definition at line 48 of file isolatedSubnetwork.h.

Member Typedef Documentation

◆ ConnectionSet

A set of isolated connections.

Definition at line 58 of file isolatedSubnetwork.h.

◆ EditFilter

using EditFilter = TfFunctionRef<bool(const VdfNode *)>

A function that returns true if the given node is allowed to be isolated and deleted.

Definition at line 62 of file isolatedSubnetwork.h.

Member Function Documentation

◆ AddIsolatedBranch() [1/2]

VDF_API bool AddIsolatedBranch ( VdfConnection connection,
EditFilter  canDelete 
)

Isolates all nodes and connections reachable via input connections from connection that are not connected via additional output connections to other parts of the network.

Note that connection is added to the set of isolated objects.

The canDelete object is used to prune the traversal.

Note
Isolated objects are not immediately removed from the network. See RemoveIsolatedObjectsFromNetwork.

◆ AddIsolatedBranch() [2/2]

VDF_API bool AddIsolatedBranch ( VdfNode node,
EditFilter  canDelete 
)

Isolates all nodes and connections reachable via input connections from node that are not connected via additional output connections to other parts of the network.

The canDelete object is used to prune the traversal.

Note
If node has output connections or canDelete returns false for node, no objects are added to the isolated subnetwork and false is returned.
Isolated objects are not immediately removed from the network. See RemoveIsolatedObjectsFromNetwork.

◆ GetIsolatedConnections()

const ConnectionSet & GetIsolatedConnections ( ) const
inline

Returns the set of isolated nodes.

Definition at line 159 of file isolatedSubnetwork.h.

◆ GetIsolatedNodes()

const std::vector< VdfNode * > & GetIsolatedNodes ( ) const
inline

Returns the set of isolated nodes.

Definition at line 154 of file isolatedSubnetwork.h.

◆ IsolateBranch() [1/2]

static VDF_API std::unique_ptr< VdfIsolatedSubnetwork > IsolateBranch ( VdfConnection connection,
EditFilter  canDelete 
)
static

Isolates all nodes and connections reachable via input connections from connection that are not connected via additional output connections to other parts of the network.

Note that connection is added to the set of isolated objects.

The canDelete object is used to prune the traversal.

Removes the isolated objects from the network and returns a unique pointer to the isolated network object that holds onto the isolated nodes and connections. When the isolated network object is deleted, the isolated nodes and connections are deleted.

◆ IsolateBranch() [2/2]

static VDF_API std::unique_ptr< VdfIsolatedSubnetwork > IsolateBranch ( VdfNode node,
EditFilter  canDelete 
)
static

Isolates all nodes and connections reachable via input connections from node that are not connected via additional output connections to other parts of the network.

The canDelete object is used to prune the traversal.

Removes the isolated objects from the network and returns a strong reference to the isolated network object that holds onto the isolated nodes and connections. When the isolated network object is deleted, the isolated nodes and connections are deleted.

Note
An error is emitted if node has output connections.

◆ New()

static VDF_API std::unique_ptr< VdfIsolatedSubnetwork > New ( VdfNetwork network)
static

Creates an empty isolated subnetwork.

The subnetwork can be populated via calls to the AddIsolatedBranch methods.

◆ RemoveIsolatedObjectsFromNetwork()

VDF_API void RemoveIsolatedObjectsFromNetwork ( )

Removes all isolated objects from the network.

This method is called upon destruction, if it isn't called before then.


The documentation for this class was generated from the following file: