AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxSDK::MergeSplitActionContainer Class Reference

Object containing merge-split actions to be processed by the agxSDK::MergeSplitHandler. More...

#include <MergeSplitAction.h>

Public Types

typedef agx::Vector< MergeSplitAction > Actions
 
typedef Actions::const_iterator ActionsConstIterator
 
typedef Actions::iterator ActionsIterator
 

Public Member Functions

 MergeSplitActionContainer (agx::UInt capacity=agx::UInt(256))
 Default constructor.
 
agx::Bool add (const MergeSplitAction &action)
 Adds the action to the container.
 
void append (const MergeSplitActionContainer &other)
 Append actions to this container.
 
ActionsIterator begin ()
 
ActionsConstIterator begin () const
 
void clear ()
 Clears data.
 
agx::Bool empty () const
 
ActionsIterator end ()
 
ActionsConstIterator end () const
 
agx::Bool merge (const agxSDK::MergedState &mergedState, agx::MergedBody::EdgeInteraction *edge)
 Merge given merged state and an edge.
 
agx::Bool split (const agxSDK::MergedState &mergedState)
 Split given allowed actions in the merged state.
 
agx::Bool split (const agxSDK::MergedState &mergedState, agxSDK::MergedState::Actions action)
 Split given action mask.
 
agx::Bool split (const MergedState &mergedState, agx::MergedBody::EdgeInteraction *edge)
 Split a single edge.
 

Detailed Description

Object containing merge-split actions to be processed by the agxSDK::MergeSplitHandler.

Definition at line 115 of file MergeSplitAction.h.

Member Typedef Documentation

◆ Actions

◆ ActionsConstIterator

◆ ActionsIterator

Constructor & Destructor Documentation

◆ MergeSplitActionContainer()

agxSDK::MergeSplitActionContainer::MergeSplitActionContainer ( agx::UInt  capacity = agx::UInt(256))

Default constructor.

Member Function Documentation

◆ add()

agx::Bool agxSDK::MergeSplitActionContainer::add ( const MergeSplitAction &  action)

Adds the action to the container.

Consider using merge and split methods instead. Example usage: actions.add( MergeSplitAction::merge( edge, handler ) ), when you're splitting or merging without a given mergedState.

Parameters
action- action to add
Returns
true if the action is valid and added

◆ append()

void agxSDK::MergeSplitActionContainer::append ( const MergeSplitActionContainer &  other)

Append actions to this container.

Parameters
other- other container

◆ begin() [1/2]

MergeSplitActionContainer::ActionsIterator agxSDK::MergeSplitActionContainer::begin ( )
Returns
begin iterator of the actions

Definition at line 225 of file MergeSplitAction.h.

References agx::Vector< T, Allocator >::begin().

◆ begin() [2/2]

MergeSplitActionContainer::ActionsConstIterator agxSDK::MergeSplitActionContainer::begin ( ) const
Returns
begin iterator of the actions

Definition at line 230 of file MergeSplitAction.h.

References agx::Vector< T, Allocator >::begin().

◆ clear()

void agxSDK::MergeSplitActionContainer::clear ( )

Clears data.

◆ empty()

agx::Bool agxSDK::MergeSplitActionContainer::empty ( ) const
Returns
true if no actions are present

◆ end() [1/2]

MergeSplitActionContainer::ActionsIterator agxSDK::MergeSplitActionContainer::end ( )
Returns
end iterator of the actions

Definition at line 235 of file MergeSplitAction.h.

References agx::Vector< T, Allocator >::end().

◆ end() [2/2]

MergeSplitActionContainer::ActionsConstIterator agxSDK::MergeSplitActionContainer::end ( ) const
Returns
end iterator of the actions

Definition at line 240 of file MergeSplitAction.h.

References agx::Vector< T, Allocator >::end().

◆ merge()

agx::Bool agxSDK::MergeSplitActionContainer::merge ( const agxSDK::MergedState &  mergedState,
agx::MergedBody::EdgeInteraction *  edge 
)

Merge given merged state and an edge.

The action wont be added if it violates the allowed actions in the merged state.

Parameters
mergedState- merged state of the interaction
edge- edge that merged the objects
Returns
true if the edge is valid and doesn't violate the allowed actions

◆ split() [1/3]

agx::Bool agxSDK::MergeSplitActionContainer::split ( const agxSDK::MergedState &  mergedState)

Split given allowed actions in the merged state.

Fails (returns false) when none of the objects may be split.

Parameters
mergedState- current merged state
Returns
true if at least one of the objects may be split

◆ split() [2/3]

agx::Bool agxSDK::MergeSplitActionContainer::split ( const agxSDK::MergedState &  mergedState,
agxSDK::MergedState::Actions  action 
)

Split given action mask.

E.g., actions.split( mergedState, MergedState::Actions( MergeSplitAction::SPLIT_FIRST ) ).

Parameters
mergedState- current merged state
action- split action
Returns
true if the action may be performed and the split action was added

◆ split() [3/3]

agx::Bool agxSDK::MergeSplitActionContainer::split ( const MergedState &  mergedState,
agx::MergedBody::EdgeInteraction *  edge 
)

Split a single edge.

Parameters
mergedState- current merged state
edge- edge to split
Returns
true if the edge is valid to split

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