AGX Dynamics 2.40.0.0
Loading...
Searching...
No Matches
agxSDK::MergeSplitAction Class Reference

Data for merge or split actions created in an implementation of an agxSDK::MergeSplitAlgorithm. More...

#include <MergeSplitAction.h>

Public Member Functions

 MergeSplitAction (const agxSDK::MergedState &mergedState, agxSDK::MergedState::Actions actionType, agx::MergedBody::EdgeInteraction *edge=nullptr)
 Construct given merged state, type of action and (optional) an edge to add or remove.
 
agx::MergedBody::EdgeInteractiongetEdge () const
 
const agxSDK::MergedStategetMergedState () const
 
agxSDK::MergedState::Actions getType () const
 
agx::Bool isValid () const
 
MergeSplitActionsync ()
 Synchronizes data to current state, e.g., bodies that has been merged or splitted after this action was create.
 

Static Public Member Functions

static MergeSplitAction empty ()
 Creates an empty action.
 
static MergeSplitAction merge (agx::MergedBody::EdgeInteraction *edge, const agxSDK::MergeSplitHandler *handler)
 Creates a merge action given an edge and the merge split handler.
 
static MergeSplitAction merge (const agxSDK::MergedState &mergedState, agx::MergedBody::EdgeInteraction *edge)
 Creates a merge action given a merged state and an edge.
 
static MergeSplitAction split (agx::MergedBody::EdgeInteraction *edge, const agxSDK::MergeSplitHandler *handler)
 Creates a split action given an edge and the merge split handler (to fetch allowed actions, i.e., 'may we split this edge').
 
static MergeSplitAction split (agx::RigidBody *rb, const agxSDK::MergeSplitHandler *handler)
 Creates a split action given a rigid body and the merge split handler.
 
static MergeSplitAction split (const agxSDK::MergedState &mergedState, agxSDK::MergedState::Actions action, agx::MergedBody::EdgeInteraction *edge=nullptr)
 Creates a split action given a merged state and action.
 

Detailed Description

Data for merge or split actions created in an implementation of an agxSDK::MergeSplitAlgorithm.

Instances of this class is generated by using the API of agxSDK::MergeSplitActionContainer.

Definition at line 27 of file MergeSplitAction.h.

Constructor & Destructor Documentation

◆ MergeSplitAction()

agxSDK::MergeSplitAction::MergeSplitAction ( const agxSDK::MergedState mergedState,
agxSDK::MergedState::Actions  actionType,
agx::MergedBody::EdgeInteraction edge = nullptr 
)

Construct given merged state, type of action and (optional) an edge to add or remove.

Parameters
mergedState- current merged state
actionType- type of action
edge- edge to add, or optionally, edge to remove (if split state)

Member Function Documentation

◆ empty()

static MergeSplitAction agxSDK::MergeSplitAction::empty ( )
static

Creates an empty action.

◆ getEdge()

agx::MergedBody::EdgeInteraction * agxSDK::MergeSplitAction::getEdge ( ) const
Returns
edge to add or remove (depending on action type)

Definition at line 220 of file MergeSplitAction.h.

◆ getMergedState()

const MergedState & agxSDK::MergeSplitAction::getMergedState ( ) const
Returns
current merged state (call sync to update)

Definition at line 210 of file MergeSplitAction.h.

◆ getType()

MergedState::Actions agxSDK::MergeSplitAction::getType ( ) const
Returns
the type of action

Definition at line 215 of file MergeSplitAction.h.

◆ isValid()

agx::Bool agxSDK::MergeSplitAction::isValid ( ) const
Returns
true if this is a valid action

◆ merge() [1/2]

static MergeSplitAction agxSDK::MergeSplitAction::merge ( agx::MergedBody::EdgeInteraction edge,
const agxSDK::MergeSplitHandler handler 
)
static

Creates a merge action given an edge and the merge split handler.

An empty action is created if the bodies in the edge interaction aren't allowed to merge.

◆ merge() [2/2]

static MergeSplitAction agxSDK::MergeSplitAction::merge ( const agxSDK::MergedState mergedState,
agx::MergedBody::EdgeInteraction edge 
)
static

Creates a merge action given a merged state and an edge.

An empty action is created if the bodies in the edge interaction aren't allowed to merge.

◆ split() [1/3]

static MergeSplitAction agxSDK::MergeSplitAction::split ( agx::MergedBody::EdgeInteraction edge,
const agxSDK::MergeSplitHandler handler 
)
static

Creates a split action given an edge and the merge split handler (to fetch allowed actions, i.e., 'may we split this edge').

An empty action is created if the edge isn't allowed to be splitted.

◆ split() [2/3]

static MergeSplitAction agxSDK::MergeSplitAction::split ( agx::RigidBody rb,
const agxSDK::MergeSplitHandler handler 
)
static

Creates a split action given a rigid body and the merge split handler.

An empty action is created if the body isn't allowed to be splitted.

◆ split() [3/3]

static MergeSplitAction agxSDK::MergeSplitAction::split ( const agxSDK::MergedState mergedState,
agxSDK::MergedState::Actions  action,
agx::MergedBody::EdgeInteraction edge = nullptr 
)
static

Creates a split action given a merged state and action.

An empty action is created if the allowed actions doesn't match the action.

Parameters
mergedState- the merged state
action- split action (split first or split second or split both)
edge- optional edge to split (i.e., will not split all edges)

◆ sync()

MergeSplitAction & agxSDK::MergeSplitAction::sync ( )

Synchronizes data to current state, e.g., bodies that has been merged or splitted after this action was create.

Returns
this, synchronized

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