AGX Dynamics  2.37.2.0
Deformable1DNode.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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  {
48  void store( agxStream::OutputArchive& out ) const;
49  void restore( agxStream::InputArchive& in );
50  void storeLightData( agxStream::StorageStream& str ) const;
51  void restoreLightData( agxStream::StorageStream& str );
52  };
53 
54  public:
60 
68 
74  agx::Vec3 getPosition() const;
75 
79  agx::Real getLength() const;
80 
86  agx::Bool add( agxModel::NodeAttachmentRef attachment );
87 
93  agxModel::NodeAttachment* getAttachment( agx::UInt index ) const;
94 
100  agxModel::NodeAttachment* getAttachment( const agx::String& name ) const;
101 
105  agx::UInt getNumAttachments() const;
106 
111  agxModel::Deformable1DNode* getChild( agx::UInt i = 0 ) const;
112 
116  agx::UInt getNumChildren() const;
117 
121  agx::Bool hasChildren() const;
122 
126  agxModel::Deformable1DNode* getParent() const;
127 
132  agxModel::Segment* getSegment();
133 
138  const agxModel::Segment* getSegment() const;
139 
144  const agxModel::Deformable1DNode::DeformationData& updateDeformationData();
145 
149  const agxModel::Deformable1DNode::DeformationData& getDeformationData() const;
150 
157  agx::Vec3 calculateAreaMomentOfInertia( const agxModel::Deformable1DGeometryFactory* geometryFactory ) const;
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 
174  virtual agx::ConstraintRef createConstraintWithParent() const override;
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:
231  AttachmentContainer m_attachments;
234  };
235 }
236 
237 #endif // AGXMODEL_DEFORMABLE1DNODE_H
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
Base class for a shape.
Definition: Shape.h:53
Branch is a part of the Tree, with a body and a constraint to its parent.
Definition: agxModel/Tree.h:55
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Base class for routing algorithms holding all nodes and resolution.
Base class for attachments to Deformable1D nodes.
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:36
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
agx::Vec3 rotationalForce
Current rotational force in the constraint.
AttachmentContainer m_attachments
uint32_t UInt
Definition: Integer.h:34
agx::Vector< NodeAttachmentRef > AttachmentContainer
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
A Deformable1D segment is the segment between two nodes, or if this is the last segment, only one node but still has a start- and an end position defined.
agx::Quat relativeRotation
Current relative rotation.
agx::Vector< Deformable1DNodeRef > Deformable1DNodeRefContainer
agx::Vec3 translationalForce
Current translational force in the constraint.
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:51
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:48
Structure containing relevant data for elasto-plastic deformation.
#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
DeformationData m_deformationData
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:56
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
#define AGXMODEL_EXPORT
double Real
Definition: Real.h:42
Geometry factory is an object that spawns geometries for a Deformable1D object.
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints, geometries.
Definition: Assembly.h:66
Special node implementation of segments in e.g., a Deformable1D object.