AGXDynamics  2.35.0.3
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  {
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:
234  };
235 }
236 
237 #endif // AGXMODEL_DEFORMABLE1DNODE_H
agx::Real
double Real
Definition: Real.h:42
Deformable1DAttachment.h
agxModel
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:36
agxData::transform
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
agxModel::Deformable1DNode::m_deformationData
DeformationData m_deformationData
Definition: Deformable1DNode.h:232
agx::Vector< Deformable1DNodeRef >
agxStream::out
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.
Definition: OutputArchive.h:412
agxStream::Serializable
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
agx::AffineMatrix4x4T< Real >
agxStream::StorageStream
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:48
agxModel::Deformable1DNode::m_attachments
AttachmentContainer m_attachments
Definition: Deformable1DNode.h:231
agxModel::Deformable1DNode::AttachmentContainer
agx::Vector< NodeAttachmentRef > AttachmentContainer
Definition: Deformable1DNode.h:227
AGXSTREAM_DECLARE_SERIALIZABLE
#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
agxModel::Deformable1DNode::m_segment
Segment m_segment
Definition: Deformable1DNode.h:233
agxStream::in
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
agxSDK::Assembly
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
Definition: Assembly.h:66
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
agxCollide::Shape
Base class for a shape.
Definition: Shape.h:53
agxModel::NodeAttachment
Base class for attachments to Deformable1D nodes.
Definition: Deformable1DAttachment.h:36
agxModel::Deformable1DNode::DeformationData::translationalForce
agx::Vec3 translationalForce
Current translational force in the constraint.
Definition: Deformable1DNode.h:44
agxModel::Deformable1DNode::DeformationData
Structure containing relevant data for elasto-plastic deformation.
Definition: Deformable1DNode.h:42
agxCollide::Geometry
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
agxModel::Deformable1DNode::DeformationData::rotationalForce
agx::Vec3 rotationalForce
Current rotational force in the constraint.
Definition: Deformable1DNode.h:45
agxStream::OutputArchive
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:56
agx::QuatT< Real >
agxModel::Deformable1DNodeRefContainer
agx::Vector< Deformable1DNodeRef > Deformable1DNodeRefContainer
Definition: Deformable1DNode.h:30
agxModel::Deformable1DRoute
Base class for routing algorithms holding all nodes and resolution.
Definition: Deformable1DRoute.h:101
agxStream::InputArchive
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:51
agxModel::Deformable1DNode::DeformationData::relativeRotation
agx::Quat relativeRotation
Current relative rotation.
Definition: Deformable1DNode.h:46
agxModel::Segment
A Deformable1D segment is the segment between two nodes, or if this is the last segment,...
Definition: Deformable1DSegment.h:42
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
agx::UInt
uint32_t UInt
Definition: Integer.h:34
agxModel::Tree::Branch
Branch is a part of the Tree, with a body and a constraint to its parent.
Definition: agxModel/Tree.h:54
agx::Bool
bool Bool
Definition: Integer.h:48
agxModel::Deformable1DGeometryFactory
Geometry factory is an object that spawns geometries for a Deformable1D object.
Definition: Deformable1DGeometryFactory.h:40
agxModel::Deformable1DNode::m_length
agx::Real m_length
Definition: Deformable1DNode.h:230
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition: agxModel/export.h:42
agx::AgXString< std::string >
agx::Vec3T< Real >
agxModel::Deformable1DNode
Special node implementation of segments in e.g., a Deformable1D object.
Definition: Deformable1DNode.h:36
Deformable1DSegment.h
Tree.h