AGX Dynamics  2.35.0.1
agxModel::Deformable1DNode Class Reference

Special node implementation of segments in e.g., a Deformable1D object. More...

#include <Deformable1DNode.h>

+ Inheritance diagram for agxModel::Deformable1DNode:

Classes

struct  DeformationData
 Structure containing relevant data for elasto-plastic deformation. More...
 

Public Member Functions

 Deformable1DNode (const agx::AffineMatrix4x4 &transform)
 Construct given full transform of the rigid body in this node. More...
 
 Deformable1DNode (const agx::AffineMatrix4x4 &transform, agxModel::NodeAttachment *attachment)
 Construct given full transform of the rigid body in this node and an external attachment. More...
 
agx::Bool add (agxModel::NodeAttachmentRef attachment)
 Add an external attachment to this node. More...
 
agx::Vec3 calculateAreaMomentOfInertia (const agxModel::Deformable1DGeometryFactory *geometryFactory) const
 Calculates the moment of area given a geometry factory containing values such as width and height. More...
 
virtual agxModel::Tree::Branch * clone () override
 
virtual agx::ConstraintRef createConstraintWithParent () const override
 Internal method that creates the constraint between this node and its parent. More...
 
agxModel::NodeAttachment * getAttachment (agx::UInt index) const
 Finds attachment given index index. More...
 
agxModel::NodeAttachment * getAttachment (const agx::String &name) const
 Find attachment given name name. More...
 
agxModel::Deformable1DNode * getChild (agx::UInt i=0) const
 
const char * getClassName () const override
 
const agxModel::Deformable1DNode::DeformationData & getDeformationData () const
 
agx::Real getLength () const
 
virtual agx::Real getLength (const agxCollide::Geometry *geometry) const override
 Internal method that calculates/estimate the length of geometry. More...
 
agx::UInt getNumAttachments () const
 
agx::UInt getNumChildren () const
 
agxModel::Deformable1DNode * getParent () const
 
agx::Vec3 getPosition () const
 Position of this node is defined to be at the start of this node given this node has an extent. More...
 
agxModel::Segment * getSegment ()
 
const agxModel::Segment * getSegment () const
 
agxStream::StorageAgent * getStorageAgent () const override
 
agx::Bool hasChildren () const
 
virtual void removeNotification (agxSDK::Assembly *assembly, agxSDK::Simulation *simulation)
 Remove notification from an assembly (typically the agxModel::Deformable1D object) and the simulation. More...
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore structural independent data from stream. More...
 
virtual agxCollide::Shape * splitShape (agxCollide::Shape *shapeInBranch, agx::Real shapePosition, agxModel::Tree::Branch *newBranch, agx::Real &newBelowLength, agx::Real &newAboveLength) override
 Internal method that splits a geometry in two. More...
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store structural independent data to stream. More...
 
const agxModel::Deformable1DNode::DeformationData & updateDeformationData ()
 Updates deformation data (current constraint forces and relative rotations) given current state. More...
 
- Public Member Functions inherited from agxModel::Tree::Branch
 Branch (const agx::AffineMatrix4x4 &transform)
 Construct branch given transform. More...
 
 Branch (const agx::Vec3 &start, const agx::Vec3 &end)
 Construct branch given start- and end point in world. More...
 
bool addBranch (agxModel::Tree::Branch *branch)
 Add child branch to this branch. More...
 
agxModel::Tree::Branch * getBranch (size_t i) const
 
agx::Constraint * getConstraint () const
 
agx::Vec2 getCurrentLoad () const
 
agx::Real getCurrentRotationalLoad () const
 
agx::Real getCurrentTranslationalLoad () const
 
agx::Referenced * getCustomData () const
 
agx::Vec3 getDirection () const
 
agx::Vec3 getLocalDirection () const
 
agx::Vec2 getMaxLoad () const
 
agx::Real getMaxRotationalLoad () const
 
agx::Real getMaxTranslationalLoad () const
 
size_t getNumBranches () const
 
agxModel::Tree::Branch * getParent () const
 
agx::RigidBody * getRigidBody () const
 
bool removeBranch (agxModel::Tree::Branch *branch)
 Remove a child branch. More...
 
bool removeBranch (size_t index)
 Remove child given index. More...
 
void setCustomData (agx::Referenced *customData)
 Assign custom/user data of any type. More...
 
void setMaxLoad (agx::Real translational, agx::Real rotational)
 Assign max load for this branch (connection at start). More...
 
void setMaxRotationalLoad (agx::Real maxLoad)
 Assign rotational max load for this branch. More...
 
void setMaxTranslationalLoad (agx::Real maxLoad)
 Assign translational max load for this branch. More...
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor. More...
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object. More...
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings. More...
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object. More...
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object. More...
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More...
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object. More...
 

Static Public Member Functions

static agxStream::Serializable * create ()
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static const char * getConstructClassId ()
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More...
 

Protected Types

typedef agx::Vector< NodeAttachmentRef > AttachmentContainer
 

Protected Member Functions

 Deformable1DNode ()
 A node has to have a transform, hidden default constructor. More...
 
virtual ~Deformable1DNode ()
 Reference counted object, protected destructor. More...
 
agx::Bool getCurrentConstraintForce (agx::Vec3 &translational, agx::Vec3 &rotational) const
 
void setLength (agx::Real length)
 Assign the length of this node. More...
 
- Protected Member Functions inherited from agxModel::Tree::Branch
virtual ~Branch ()
 
void setConstraint (agx::Constraint *constraint)
 Assign constraint attached at start point of this branch. More...
 
void setParent (agxModel::Tree::Branch *parent)
 Assign parent to this branch. More...
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor. More...
 
 Serializable (const Serializable &other)
 Copy constructor. More...
 
void generateUuid ()
 

Protected Attributes

AttachmentContainer m_attachments
 
DeformationData m_deformationData
 
agx::Real m_length
 
Segment m_segment
 
- Protected Attributes inherited from agxModel::Tree::Branch
BranchContainer m_branches
 
agx::ConstraintRef m_constraint
 
agx::ref_ptr< agx::Referenced > m_customData
 
agx::Vec2 m_maxLoad
 
BranchObs m_parent
 
agx::RigidBodyRef m_rb
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Public Types inherited from agxModel::Tree::Branch
enum  MaxLoadType { TRANSLATIONAL = 0 , ROTATIONAL }
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Detailed Description

Special node implementation of segments in e.g., a Deformable1D object.

Definition at line 36 of file Deformable1DNode.h.

Member Typedef Documentation

◆ AttachmentContainer

Constructor & Destructor Documentation

◆ Deformable1DNode() [1/3]

agxModel::Deformable1DNode::Deformable1DNode ( const agx::AffineMatrix4x4 &  transform)

Construct given full transform of the rigid body in this node.

Parameters
transform- full transform of the rigid body in this node

◆ Deformable1DNode() [2/3]

agxModel::Deformable1DNode::Deformable1DNode ( const agx::AffineMatrix4x4 &  transform,
agxModel::NodeAttachment *  attachment 
)

Construct given full transform of the rigid body in this node and an external attachment.

Parameters
transform- full transform of the rigid body in this node
attachment- external attachment to this node

◆ Deformable1DNode() [3/3]

agxModel::Deformable1DNode::Deformable1DNode ( )
protected

A node has to have a transform, hidden default constructor.

◆ ~Deformable1DNode()

virtual agxModel::Deformable1DNode::~Deformable1DNode ( )
protectedvirtual

Reference counted object, protected destructor.

Member Function Documentation

◆ add()

agx::Bool agxModel::Deformable1DNode::add ( agxModel::NodeAttachmentRef  attachment)

Add an external attachment to this node.

Parameters
attachment- attachment to add
Returns
true if added, otherwise false

◆ calculateAreaMomentOfInertia()

agx::Vec3 agxModel::Deformable1DNode::calculateAreaMomentOfInertia ( const agxModel::Deformable1DGeometryFactory *  geometryFactory) const

Calculates the moment of area given a geometry factory containing values such as width and height.

If geometryFactory is null width and height will be estimated as one (1).

Parameters
geometryFactory- geometry factory holding values such as width and height
Returns
moment of area about all three rotational degrees of freedom

◆ clone()

virtual agxModel::Tree::Branch* agxModel::Deformable1DNode::clone ( )
overridevirtual
Returns
clone of this node

Reimplemented from agxModel::Tree::Branch.

◆ create() [1/2]

static agxStream::Serializable* agxModel::Deformable1DNode::create ( )
inlinestatic

Definition at line 188 of file Deformable1DNode.h.

◆ create() [2/2]

static agxStream::Serializable* agxModel::Deformable1DNode::create ( agxStream::InputArchive &  )
inlinestatic

Definition at line 188 of file Deformable1DNode.h.

◆ createConstraintWithParent()

virtual agx::ConstraintRef agxModel::Deformable1DNode::createConstraintWithParent ( ) const
overridevirtual

Internal method that creates the constraint between this node and its parent.

Reimplemented from agxModel::Tree::Branch.

◆ getAttachment() [1/2]

agxModel::NodeAttachment* agxModel::Deformable1DNode::getAttachment ( agx::UInt  index) const

Finds attachment given index index.

Parameters
index- index of attachment
Returns
external attachment given index if present, if index is out of bounds null

◆ getAttachment() [2/2]

agxModel::NodeAttachment* agxModel::Deformable1DNode::getAttachment ( const agx::String &  name) const

Find attachment given name name.

Parameters
name- name of the attachment (naming by attachment->setName( "name" ))
Returns
attachment with name name, null if not present

◆ getChild()

agxModel::Deformable1DNode* agxModel::Deformable1DNode::getChild ( agx::UInt  i = 0) const
Parameters
i- index of child
Returns
child number i (null if out of bound)

◆ getClassName()

const char* agxModel::Deformable1DNode::getClassName ( ) const
inlineoverridevirtual
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

Definition at line 188 of file Deformable1DNode.h.

◆ getConstructClassId()

static const char* agxModel::Deformable1DNode::getConstructClassId ( )
inlinestatic

Definition at line 188 of file Deformable1DNode.h.

◆ getCurrentConstraintForce()

agx::Bool agxModel::Deformable1DNode::getCurrentConstraintForce ( agx::Vec3 &  translational,
agx::Vec3 &  rotational 
) const
protected
Parameters
[out]translational- translational force applied by the constraint
[out]rotational- rotational force applied by the constraint
Returns
true if the values have been set

◆ getDeformationData()

const agxModel::Deformable1DNode::DeformationData& agxModel::Deformable1DNode::getDeformationData ( ) const
Returns
the deformation data from last call to updateDeformationData

◆ getLength() [1/2]

agx::Real agxModel::Deformable1DNode::getLength ( ) const
Returns
the length of this node

Referenced by agxModel::Deformable1DRadiusGeometryFactory< T >::createGeometry().

◆ getLength() [2/2]

virtual agx::Real agxModel::Deformable1DNode::getLength ( const agxCollide::Geometry *  geometry) const
overridevirtual

Internal method that calculates/estimate the length of geometry.

Parameters
geometry- geometry to estimate length

Reimplemented from agxModel::Tree::Branch.

◆ getNumAttachments()

agx::UInt agxModel::Deformable1DNode::getNumAttachments ( ) const
Returns
the number of attachments this node has

◆ getNumChildren()

agx::UInt agxModel::Deformable1DNode::getNumChildren ( ) const
Returns
the number of children to this node

◆ getParent()

agxModel::Deformable1DNode* agxModel::Deformable1DNode::getParent ( ) const
Returns
parent node of this node

◆ getPosition()

agx::Vec3 agxModel::Deformable1DNode::getPosition ( ) const

Position of this node is defined to be at the start of this node given this node has an extent.

Returns
position of this node

◆ getSegment() [1/2]

agxModel::Segment* agxModel::Deformable1DNode::getSegment ( )
Note
If this is the end node this segment will only have an end position, not an end node.
Returns
the segment between this node and the next

◆ getSegment() [2/2]

const agxModel::Segment* agxModel::Deformable1DNode::getSegment ( ) const
Note
If this is the end node this segment will only have an end position, not an end node.
Returns
the segment between this node and the next

◆ getStorageAgent()

agxStream::StorageAgent* agxModel::Deformable1DNode::getStorageAgent ( ) const
inlineoverridevirtual
Returns
the storage agent

Implements agxStream::Serializable.

Definition at line 188 of file Deformable1DNode.h.

◆ hasChildren()

agx::Bool agxModel::Deformable1DNode::hasChildren ( ) const
Returns
true if number of children > 0, otherwise false

◆ removeNotification()

virtual void agxModel::Deformable1DNode::removeNotification ( agxSDK::Assembly *  assembly,
agxSDK::Simulation *  simulation 
)
virtual

Remove notification from an assembly (typically the agxModel::Deformable1D object) and the simulation.

Note
Any rigid body, constraint, geometry, etc has to be removed from both the assembly and the simulation.

◆ restore()

virtual void agxModel::Deformable1DNode::restore ( agxStream::InputArchive &  in)
overridevirtual

◆ restoreLightData()

virtual void agxModel::Deformable1DNode::restoreLightData ( agxStream::StorageStream &  str)
overridevirtual

Restore structural independent data from stream.

◆ setLength()

void agxModel::Deformable1DNode::setLength ( agx::Real  length)
protected

Assign the length of this node.

Parameters
length- new length of this node

◆ splitShape()

virtual agxCollide::Shape* agxModel::Deformable1DNode::splitShape ( agxCollide::Shape *  shapeInBranch,
agx::Real  shapePosition,
agxModel::Tree::Branch *  newBranch,
agx::Real &  newBelowLength,
agx::Real &  newAboveLength 
)
overridevirtual

Internal method that splits a geometry in two.

Reimplemented from agxModel::Tree::Branch.

◆ store()

virtual void agxModel::Deformable1DNode::store ( agxStream::OutputArchive &  out) const
overridevirtual

◆ storeLightData()

virtual void agxModel::Deformable1DNode::storeLightData ( agxStream::StorageStream &  str) const
overridevirtual

Store structural independent data to stream.

◆ updateDeformationData()

const agxModel::Deformable1DNode::DeformationData& agxModel::Deformable1DNode::updateDeformationData ( )

Updates deformation data (current constraint forces and relative rotations) given current state.

Returns
the updated deformation data

Member Data Documentation

◆ m_attachments

AttachmentContainer agxModel::Deformable1DNode::m_attachments
protected

Definition at line 231 of file Deformable1DNode.h.

◆ m_deformationData

DeformationData agxModel::Deformable1DNode::m_deformationData
protected

Definition at line 232 of file Deformable1DNode.h.

◆ m_length

agx::Real agxModel::Deformable1DNode::m_length
protected

Definition at line 230 of file Deformable1DNode.h.

◆ m_segment

Segment agxModel::Deformable1DNode::m_segment
protected

Definition at line 233 of file Deformable1DNode.h.


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