AGX Dynamics  2.35.0.1
Deformable1DNode.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXMODEL_DEFORMABLE1DNODE_H
18 #define AGXMODEL_DEFORMABLE1DNODE_H
19 
22 #include <agxModel/Tree.h>
23 
24 namespace agxModel
25 {
26  class Deformable1DGeometryFactory;
27 
29 
31 
32 
37  {
38  public:
43  {
52  };
53 
54  public:
60 
68 
75 
80 
87 
94 
101 
106 
112 
117 
122 
127 
133 
139 
145 
150 
158 
159  public:
164  virtual agx::Real getLength( const agxCollide::Geometry* geometry ) const override;
165 
169  virtual agxCollide::Shape* splitShape( agxCollide::Shape* shapeInBranch, agx::Real shapePosition, agxModel::Tree::Branch* newBranch, agx::Real& newBelowLength, agx::Real& newAboveLength ) override;
170 
175 
179  virtual agxModel::Tree::Branch* clone() override;
180 
185  virtual void removeNotification( agxSDK::Assembly* assembly, agxSDK::Simulation* simulation );
186 
187 
189 
193  virtual void storeLightData( agxStream::StorageStream& str ) const override;
194 
198  virtual void restoreLightData( agxStream::StorageStream& str ) override;
199 
200 
201  protected:
206 
210  virtual ~Deformable1DNode();
211 
212  friend class Deformable1DRoute;
217  void setLength( agx::Real length );
218 
224  agx::Bool getCurrentConstraintForce( agx::Vec3& translational, agx::Vec3& rotational ) const;
225 
226  protected:
228 
229  protected:
234  };
235 }
236 
237 #endif // AGXMODEL_DEFORMABLE1DNODE_H
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
#define AGXMODEL_EXPORT
The geometry representation used by the collision detection engine.
Definition: Geometry.h:93
Base class for a shape.
Definition: Shape.h:54
Geometry factory is an object that spawns geometries for a Deformable1D object.
Special node implementation of segments in e.g., a Deformable1D object.
virtual void restoreLightData(agxStream::StorageStream &str) override
Restore structural independent data from stream.
Deformable1DNode()
A node has to have a transform, hidden default constructor.
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.
virtual void removeNotification(agxSDK::Assembly *assembly, agxSDK::Simulation *simulation)
Remove notification from an assembly (typically the agxModel::Deformable1D object) and the simulation...
const agxModel::Deformable1DNode::DeformationData & updateDeformationData()
Updates deformation data (current constraint forces and relative rotations) given current state.
const agxModel::Deformable1DNode::DeformationData & getDeformationData() const
virtual void storeLightData(agxStream::StorageStream &str) const override
Store structural independent data to stream.
virtual agxModel::Tree::Branch * clone() override
agxModel::Deformable1DNode * getParent() const
agx::Real getLength() const
void setLength(agx::Real length)
Assign the length of this node.
agx::Vector< NodeAttachmentRef > AttachmentContainer
agx::Bool add(agxModel::NodeAttachmentRef attachment)
Add an external attachment to this node.
DeformationData m_deformationData
agxModel::NodeAttachment * getAttachment(const agx::String &name) const
Find attachment given name name.
virtual agx::Real getLength(const agxCollide::Geometry *geometry) const override
Internal method that calculates/estimate the length of geometry.
agx::Vec3 getPosition() const
Position of this node is defined to be at the start of this node given this node has an extent.
agxModel::Segment * getSegment()
const agxModel::Segment * getSegment() const
agx::Vec3 calculateAreaMomentOfInertia(const agxModel::Deformable1DGeometryFactory *geometryFactory) const
Calculates the moment of area given a geometry factory containing values such as width and height.
Deformable1DNode(const agx::AffineMatrix4x4 &transform, agxModel::NodeAttachment *attachment)
Construct given full transform of the rigid body in this node and an external attachment.
virtual agx::ConstraintRef createConstraintWithParent() const override
Internal method that creates the constraint between this node and its parent.
agx::Bool hasChildren() const
agxModel::Deformable1DNode * getChild(agx::UInt i=0) const
virtual ~Deformable1DNode()
Reference counted object, protected destructor.
Deformable1DNode(const agx::AffineMatrix4x4 &transform)
Construct given full transform of the rigid body in this node.
AttachmentContainer m_attachments
agx::UInt getNumChildren() const
agxModel::NodeAttachment * getAttachment(agx::UInt index) const
Finds attachment given index index.
agx::Bool getCurrentConstraintForce(agx::Vec3 &translational, agx::Vec3 &rotational) const
agx::UInt getNumAttachments() const
Base class for routing algorithms holding all nodes and resolution.
Base class for attachments to Deformable1D nodes.
A Deformable1D segment is the segment between two nodes, or if this is the last segment,...
Branch is a part of the Tree, with a body and a constraint to its parent.
Definition: agxModel/Tree.h:55
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
Definition: Assembly.h:67
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:52
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:57
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:45
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:30
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:37
agx::Vector< Deformable1DNodeRef > Deformable1DNodeRefContainer
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
Definition: InputArchive.h:400
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive.
bool Bool
Definition: Integer.h:48
uint32_t UInt
Definition: Integer.h:34
double Real
Definition: Real.h:42
Structure containing relevant data for elasto-plastic deformation.
agx::Vec3 rotationalForce
Current rotational force in the constraint.
agx::Vec3 translationalForce
Current translational force in the constraint.
agx::Quat relativeRotation
Current relative rotation.
void restoreLightData(agxStream::StorageStream &str)
void storeLightData(agxStream::StorageStream &str) const
void store(agxStream::OutputArchive &out) const
void restore(agxStream::InputArchive &in)