AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agxSDK::ConstraintMergedState Class Reference

#include <MergedState.h>

+ Inheritance diagram for agxSDK::ConstraintMergedState:

Public Types

typedef agx::BitState
< ActionType, agx::Int16 > 
Actions
 
enum  ActionType : agx::Int16 { MERGE = 1 << 0, SPLIT_FIRST = 1 << 1, SPLIT_SECOND = 1 << 2 }
 
enum  EState {
  VALID = 1 << 0, BOTH_ARE_NULL = 1 << 1, ONE_IS_NULL = 1 << 2, BOTH_ARE_VALID = 1 << 3,
  MERGED_BODIES_ARE_SAME = 1 << 4, MERGED_BODIES_ARE_DIFFERENT = 1 << 5, WIRE_BODY_INCLUDED = 1 << 6, GRANULATE_BODY_INCLUDED = 1 << 7
}
 
typedef agx::BitState< EState,
agx::Int32 > 
State
 

Public Member Functions

 ConstraintMergedState (const agx::HighLevelConstraintImplementation *constraint, const agxSDK::MergeSplitHandler *handler)
 Find merged state given constraint. More...
 
agx::Bool firstIsMerged () const
 
Actions getAllowedActions () const
 
const
agxSDK::MergeSplitProperties * 
getConstraintProperties () const
 
agx::MergedBody * getMergedBody () const
 
agx::MergedBody * getMergedBody1 () const
 
agx::MergedBody * getMergedBody2 () const
 
agx::MergedBody * getOtherMergedBody () const
 
const
agxSDK::MergeSplitProperties * 
getProperties1 () const
 
const
agxSDK::MergeSplitProperties * 
getProperties2 () const
 
agx::RigidBody * getRigidBody1 () const
 
agx::RigidBody * getRigidBody2 () const
 
State getState () const
 
agx::Bool isValid () const
 
agx::Bool secondIsMerged () const
 
MergedState & update ()
 Update the current state of how the bodies are merged and return this. More...
 

Static Public Member Functions

static ConstraintMergedState invalid ()
 Creates an invalid merged state. More...
 

Protected Member Functions

void construct (agx::RigidBody *rb1, agx::RigidBody *rb2)
 Delegating constructor. More...
 

Protected Attributes

Actions m_allowedActions
 
const
agxSDK::MergeSplitProperties * 
m_constraintProperties
 
agx::MergedBody * m_mergedBody [2]
 
agx::MergedBody * m_preferredMergedBody
 
const
agxSDK::MergeSplitProperties * 
m_properties [2]
 
agx::RigidBody * m_rigidBodies [2]
 
State m_state
 

Detailed Description

Definition at line 158 of file MergedState.h.

Member Typedef Documentation

typedef agx::BitState< ActionType, agx::Int16 > agxSDK::MergedState::Actions
inherited

Definition at line 50 of file MergedState.h.

typedef agx::BitState< EState, agx::Int32 > agxSDK::MergedState::State
inherited

Definition at line 42 of file MergedState.h.

Member Enumeration Documentation

Enumerator
MERGE 
SPLIT_FIRST 
SPLIT_SECOND 

Definition at line 44 of file MergedState.h.

Enumerator
VALID 

Valid state.

BOTH_ARE_NULL 

None of the bodies are merged.

ONE_IS_NULL 

One of the bodies are merged.

BOTH_ARE_VALID 

Both of the bodies are merged.

MERGED_BODIES_ARE_SAME 

The bodies are merged together.

MERGED_BODIES_ARE_DIFFERENT 

Both bodies are merged but has different parents (i.e., not merged with each other).

WIRE_BODY_INCLUDED 
GRANULATE_BODY_INCLUDED 

Definition at line 31 of file MergedState.h.

Constructor & Destructor Documentation

agxSDK::ConstraintMergedState::ConstraintMergedState ( const agx::HighLevelConstraintImplementation *  constraint,
const agxSDK::MergeSplitHandler *  handler 
)

Find merged state given constraint.

If the constraint doesn't have properties, allowed actions will be NOTHING.

Parameters
constraint- constraint

Member Function Documentation

void agxSDK::MergedState::construct ( agx::RigidBody *  rb1,
agx::RigidBody *  rb2 
)
protectedinherited

Delegating constructor.

agx::Bool agxSDK::MergedState::firstIsMerged ( ) const
inherited
Returns
true if first object during construct is merged
MergedState::Actions agxSDK::MergedState::getAllowedActions ( ) const
inherited
Returns
the allowed actions a merge split algorithm may perform

Definition at line 191 of file MergedState.h.

References agxSDK::MergedState::m_allowedActions.

const agxSDK::MergeSplitProperties* agxSDK::ConstraintMergedState::getConstraintProperties ( ) const
Returns
the merge split properties of the constraint
agx::MergedBody* agxSDK::MergedState::getMergedBody ( ) const
inherited
Returns
the preferred merged body (larges if two, non-null if one)
agx::MergedBody* agxSDK::MergedState::getMergedBody1 ( ) const
inherited
Returns
the merged body associated to the first object during construct
agx::MergedBody* agxSDK::MergedState::getMergedBody2 ( ) const
inherited
Returns
the merged body associated to the second object during construct
agx::MergedBody* agxSDK::MergedState::getOtherMergedBody ( ) const
inherited
Returns
the other (not preferred) if both bodies are merged, otherwise null
const agxSDK::MergeSplitProperties* agxSDK::MergedState::getProperties1 ( ) const
inherited
Returns
properties used for first rigid body (the properties could belong to a geometry)
const agxSDK::MergeSplitProperties* agxSDK::MergedState::getProperties2 ( ) const
inherited
Returns
properties used for second rigid body (the properties could belong to a geometry)
agx::RigidBody* agxSDK::MergedState::getRigidBody1 ( ) const
inherited
Returns
first rigid body (coupled to getMergedBody1)
agx::RigidBody* agxSDK::MergedState::getRigidBody2 ( ) const
inherited
Returns
second rigid body (coupled to getMergedBody2)
MergedState::State agxSDK::MergedState::getState ( ) const
inherited
Returns
true if one or more masks matches current state

Definition at line 186 of file MergedState.h.

References agxSDK::MergedState::m_state.

static ConstraintMergedState agxSDK::ConstraintMergedState::invalid ( )
static

Creates an invalid merged state.

agx::Bool agxSDK::MergedState::isValid ( ) const
inherited
Returns
true if the state is valid, i.e., a state different from NONE

Definition at line 196 of file MergedState.h.

References agxSDK::MergedState::m_state, and agxSDK::MergedState::VALID.

agx::Bool agxSDK::MergedState::secondIsMerged ( ) const
inherited
Returns
true if second object during construct is merged
MergedState& agxSDK::MergedState::update ( )
inherited

Update the current state of how the bodies are merged and return this.

Member Data Documentation

Actions agxSDK::MergedState::m_allowedActions
protectedinherited

Definition at line 155 of file MergedState.h.

Referenced by agxSDK::MergedState::getAllowedActions().

const agxSDK::MergeSplitProperties* agxSDK::ConstraintMergedState::m_constraintProperties
protected

Definition at line 180 of file MergedState.h.

agx::MergedBody* agxSDK::MergedState::m_mergedBody[2]
protectedinherited

Definition at line 150 of file MergedState.h.

agx::MergedBody* agxSDK::MergedState::m_preferredMergedBody
protectedinherited

Definition at line 151 of file MergedState.h.

const agxSDK::MergeSplitProperties* agxSDK::MergedState::m_properties[2]
protectedinherited

Definition at line 153 of file MergedState.h.

agx::RigidBody* agxSDK::MergedState::m_rigidBodies[2]
protectedinherited

Definition at line 152 of file MergedState.h.

State agxSDK::MergedState::m_state
protectedinherited

Definition at line 154 of file MergedState.h.

Referenced by agxSDK::MergedState::getState(), and agxSDK::MergedState::isValid().


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