AGXDynamics
2.35.0.2
Beam.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
#pragma once
18
19
#include <
agxModel/BeamModel.h
>
20
#include <
agxModel/BeamSegment.h
>
21
#include <
agxModel/BeamSegmentIterator.h
>
22
23
#include <
agxSDK/LinkedStructure.h
>
24
25
namespace
agxModel
26
{
27
AGX_DECLARE_POINTER_TYPES
(
Beam
);
28
AGX_DECLARE_VECTOR_TYPES
(
Beam
);
29
41
class
AGXMODEL_EXPORT
Beam
:
public
agxSDK::LinkedStructure
42
{
43
public
:
65
static
BeamRef
create(
agx::Vec3
startPosition,
66
agx::Vec3
endPosition,
67
BeamModel
* model,
68
agx::UInt
resolution,
69
agx::Vec3
worldUpAxis =
agx::Vec3::Z_AXIS
() );
70
79
static
agx::AffineMatrix4x4
calculateTransform(
agx::Vec3
startPosition,
80
agx::Vec3
forward,
81
agx::Vec3
worldUpAxis =
agx::Vec3::Z_AXIS
() );
82
90
static
agx::Quat
calculateRotation(
agx::Vec3
forward,
91
agx::Vec3
worldUpAxis =
agx::Vec3::Z_AXIS
() );
92
103
static
BeamRef
restore(
agxModel::BeamModel
* model,
agxStream::StorageStream
& str );
104
109
static
Beam
* get(
agx::RigidBody
* rb );
110
115
static
const
Beam
* get(
const
agx::RigidBody
* rb );
116
123
static
Beam
* find(
agxSDK::Simulation
* simulation,
const
agx::Name
& name );
124
131
static
Beam
* find(
agxSDK::Simulation
* simulation,
const
agx::Uuid
& uuid );
132
138
static
agxModel::BeamPtrVector
findAll(
const
agxSDK::Simulation
* simulation );
139
146
static
agxModel::BeamPtrVector
findAll(
const
agxSDK::Simulation
* simulation,
const
agx::Name
& name );
147
148
public
:
156
Beam
(
BeamModel
* model,
agx::UInt
resolution,
agx::Real
length );
157
161
BeamModel
*
getModel
()
const
;
162
169
agx::Vec3
getBeginPosition()
const
;
170
177
agx::Vec3
getEndPosition()
const
;
178
182
BeamSegmentRange
getSegments()
const
;
183
187
agx::UInt
getNumSegments()
const
;
188
197
BeamSegment
* getSegment(
agx::Real
restLengthFromStart )
const
;
198
204
BeamSegmentRange
getConstrainedSegments()
const
;
205
209
agx::Bool
isInitialized
()
const
;
210
219
agx::Bool
initialize();
220
226
void
updateProperties();
227
240
agx::LockJointRef
attach(
BeamSegment
* segment,
241
agx::Vec3
localSegmentPosition,
242
agx::RigidBody
* otherRb =
nullptr
,
243
agx::Bool
adoptModelProperties =
false
)
const
;
244
257
agx::LockJointRef
attach(
BeamSegment
* segment,
258
agx::Bool
atSegmentBegin,
259
agx::RigidBody
* otherRb =
nullptr
,
260
agx::Bool
adoptModelProperties =
false
)
const
;
261
272
agx::LockJointRef
attachBegin(
agx::RigidBody
* otherRb =
nullptr
,
agx::Bool
adoptModelProperties =
false
)
const
;
273
284
agx::LockJointRef
attachEnd(
agx::RigidBody
* otherRb =
nullptr
,
agx::Bool
adoptModelProperties =
false
)
const
;
285
291
BeamStiffnessDamping
calculateSegmentStiffnessDamping()
const
;
292
293
public
:
297
virtual
agx::Real
getRestLength()
const override
;
298
299
public
:
300
DOXYGEN_START_INTERNAL_BLOCK
()
301
302
AGXSTREAM_DECLARE_SERIALIZABLE
(
agxModel::Beam
);
303
304
virtual
void
storeLightData(
agxStream::StorageStream
& str )
const override
;
305
virtual
void
restoreLightData(
agxStream::StorageStream
& str )
override
;
306
307
protected
:
308
Beam
();
309
virtual
~
Beam
();
310
311
virtual
void
onAddNotification(
agxSDK::Simulation
* simulation )
override
;
312
virtual
void
onRemoveNotification(
agxSDK::Simulation
* simulation )
override
;
313
314
virtual
void
onPreStep()
override
;
315
316
private
:
317
enum
StateEnum :
agx::UInt32
318
{
319
INITIALIZED = 1 << 0,
320
};
321
using
State
= agx::BitState<StateEnum, agx::UInt32>;
322
323
private
:
324
agx::Bool
validateMembersAndWarn(
agx::String
context )
const
;
325
void
restoreLightData(
agxStream::StorageStream
& str,
agx::Bool
& valid );
326
327
DOXYGEN_END_INTERNAL_BLOCK
()
328
329
private
:
330
BeamModelRef
m_model;
331
agx::UInt
m_resolution;
332
agx::Real
m_length;
333
State
m_state;
334
};
335
336
inline
Beam
*
Beam::get
(
agx::RigidBody
* rb )
337
{
338
return
LinkedStructure::getT<Beam>( rb );
339
}
340
341
inline
const
Beam
*
Beam::get
(
const
agx::RigidBody
* rb )
342
{
343
return
LinkedStructure::getT<Beam>( rb );
344
}
345
}
LinkedStructure.h
agx::Real
double Real
Definition:
Real.h:42
agxModel
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition:
FlowUnit.h:36
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition:
RigidBody.h:54
agxModel::Beam::get
static Beam * get(agx::RigidBody *rb)
Definition:
Beam.h:336
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition:
macros.h:97
agx::AffineMatrix4x4T< Real >
DOXYGEN_START_INTERNAL_BLOCK
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition:
macros.h:96
agx::Vec3T< Real >::Z_AXIS
static Vec3T Z_AXIS()
Definition:
Vec3Template.h:789
agxStream::StorageStream
Abstract base class for storing/restoring a line/drums with version control.
Definition:
StorageStream.h:48
BeamSegment.h
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
agx::VectorPOD
Vector containing 'raw' data.
Definition:
Vector.h:245
AGX_DECLARE_VECTOR_TYPES
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition:
Vector.h:34
agxModel::BeamSegment
Beam segment in an agxModel::Beam containing a rigid body, a constraint and is of fixed length.
Definition:
BeamSegment.h:36
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
agxSDK::LinkedStructure
Basic implementation of any structure where bodies are linked/constrained together in a well defined ...
Definition:
LinkedStructure.h:35
agxModel::BeamModel
Beam model interface requiring moment of inertia (area moment in x, y and polar moment in z),...
Definition:
BeamModel.h:64
agx::Name
Representation of a name string.
Definition:
Name.h:32
agx::QuatT< Real >
agx::GraphNode::State
State
Definition:
GraphNode.h:39
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition:
Referenced.h:248
agx::UInt
uint32_t UInt
Definition:
Integer.h:34
agx::Bool
bool Bool
Definition:
Integer.h:48
agxBrick::isInitialized
AGXBRICK_EXPORT bool isInitialized()
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition:
agxModel/export.h:42
BeamSegmentIterator.h
agx::AgXString< std::string >
agxModel::Beam
Beam is a segmented, lumped element structure of a given length and resolution.
Definition:
Beam.h:41
agx::Vec3T< Real >
agxSDK::LinkedSegmentRange
Segment range object for linked structure.
Definition:
LinkedSegmentRange.h:27
agx::Uuid
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
Definition:
Uuid.h:41
agxModel::BeamStiffnessDamping
Stiffness and damping data for constraints related to beam models.
Definition:
BeamStiffnessDamping.h:29
agx::UInt32
uint32_t UInt32
Definition:
Integer.h:40
BeamModel.h
agx::getModel
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())
Definition:
Object.h:364
include
agxModel
Beam.h
Generated on Mon Jan 30 2023 15:44:10 for AGXDynamics by
1.8.17