AGX Dynamics
2.37.3.2
RotationalDimension.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 AGXPOWERLINE_ROTATIONAL_DIMENSION_H
18
#define AGXPOWERLINE_ROTATIONAL_DIMENSION_H
19
20
#include <
agxModel/export.h
>
21
#include <
agxPowerLine/PhysicalDimension.h
>
22
#include <
agxPowerLine/Connector.h
>
23
#include <
agxPowerLine/DirectionReference.h
>
24
25
#include <
agxSDK/StepEventListener.h
>
26
27
#include <
agxUtil/agxUtil.h
>
28
29
#include <
agx/RigidBody.h
>
30
#include <
agx/ElementaryConstraint.h
>
31
#include <
agx/Attachment.h
>
32
33
namespace
agxPowerLine
34
{
35
#define DEFAULT_ROTATIONAL_DIRECTION agx::Vec3(0,1,0)
36
37
class
RotationalUnit;
45
class
AGXMODEL_EXPORT
RotationalDimension
:
public
agxPowerLine::PhysicalDimension
46
{
47
public
:
51
RotationalDimension
(
Unit
*unit);
52
56
RotationalDimension
(
57
agxPowerLine::Unit
* unit,
58
agx::RigidBody
* body,
59
agx::UInt8
slot);
60
64
RotationalDimension
(
65
agxPowerLine::Unit
* unit,
66
agx::RigidBody
* body,
67
const
agx::Vec3
& direction,
68
agxPowerLine::DirectionReference
directionReference,
69
bool
externalBody =
false
);
70
71
75
virtual
void
renderDebug()
override
;
76
77
void
setAngularVelocity(
agx::Real
);
78
agx::Real
getAngularVelocity()
const
;
79
83
virtual
agx::Real
getOutputLoad()
const override
;
84
agx::Real
getOutputTorque()
const
;
85
agx::Real
getInputTorque()
const
;
86
87
91
virtual
agx::Real
getPowerIn()
const override
;
92
virtual
agx::Real
getPowerOut()
const override
;
93
97
virtual
agx::Real
getMassProperty()
const override
;
98
agx::Real
getInertia()
const
;
99
104
virtual
bool
setInertia(
agx::Real
value );
105
109
virtual
void
setAngularVelocityDamping(
agx::Real
damping );
110
114
virtual
bool
store(
agxStream::StorageStream
&
out
)
const override
;
115
119
virtual
bool
restore(
agxStream::StorageStream
&
in
)
override
;
120
121
AGXSTREAM_DECLARE_SERIALIZABLE
(
agxPowerLine::RotationalDimension
);
122
126
virtual
std::string getTypeName()
const override
;
127
133
static
std::string getStaticTypeName();
134
135
static
agxPowerLine::PhysicalDimension::Type
getStaticType();
136
137
138
139
protected
:
140
friend
class
RotationalUnit
;
141
void
postUpdate(
agx::Real
timeStep);
142
143
protected
:
144
RotationalDimension
();
145
virtual
~
RotationalDimension
();
146
};
147
148
typedef
agx::ref_ptr<RotationalDimension>
RotationalDimensionRef
;
149
150
151
155
class
AGXMODEL_EXPORT
RotationalConnector
:
public
agxPowerLine::Connector
156
{
157
public
:
161
RotationalConnector
();
162
166
virtual
PhysicalDimensionMultiBodyConstraintImplementation
* createConstraint()
override
;
167
171
virtual
agx::RegularizationParameters::VariableType
calculateComplianceAndDamping(
const
agx::Real
timeStep,
agx::Real
& compliance,
agx::Real
& damping)
override
;
172
176
virtual
bool
store(
agxStream::StorageStream
& str)
const override
;
177
181
virtual
bool
restore(
agxStream::StorageStream
& str)
override
;
182
183
AGXSTREAM_DECLARE_SERIALIZABLE
(
agxPowerLine::RotationalConnector
);
184
185
protected
:
186
virtual
~
RotationalConnector
();
187
188
};
189
190
typedef
agx::ref_ptr<RotationalConnector>
RotationalConnectorRef
;
191
192
193
194
198
class
AGXMODEL_EXPORT
TorqueGenerator
:
public
agxPowerLine::PowerGenerator
199
{
200
public
:
205
TorqueGenerator
(
agxPowerLine::RotationalDimension
* dimension);
206
210
virtual
agx::Real
variableLookupFunction( )
const override
;
211
215
virtual
agx::Real
resultScalerFunction( )
const override
;
216
220
virtual
bool
store(
agxStream::StorageStream
& str)
const override
;
221
225
virtual
bool
restore(
agxStream::StorageStream
& str)
override
;
226
227
AGXSTREAM_DECLARE_SERIALIZABLE
(
agxPowerLine::TorqueGenerator
);
228
229
protected
:
230
TorqueGenerator
();
231
virtual
~
TorqueGenerator
();
232
virtual
void
applyPower()
override
;
233
agx::observer_ptr<RotationalDimension>
m_rotationalDimension
;
234
235
};
236
237
}
238
239
#endif // AGXMODEL_ROTATIONAL_DIMENSION_H
ElementaryConstraint.h
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
agxPowerLine::Connector
Links two connections together.
Definition:
Connector.h:53
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
agxPowerLine::RotationalUnit
A rotational unit has one degree of freedom.
Definition:
RotationalUnit.h:29
agx::observer_ptr
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
Definition:
observer_ptr.h:60
agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation
Constraint implementation for constraining a number of physical dimensions of the same type...
Definition:
PowerLineConstraints.h:150
agxPowerLine::Unit
Pure virtual class.
Definition:
Unit.h:72
agx::UInt8
uint8_t UInt8
Definition:
Integer.h:38
agxPowerLine::PhysicalDimension
Pure virtual class.
Definition:
PhysicalDimension.h:93
DirectionReference.h
agxPowerLine::RotationalDimensionRef
agx::ref_ptr< RotationalDimension > RotationalDimensionRef
Definition:
MotorUnit.h:26
agxPowerLine::TorqueGenerator::m_rotationalDimension
agx::observer_ptr< RotationalDimension > m_rotationalDimension
Definition:
RotationalDimension.h:233
agxPowerLine
agxPowerLine contains a collection of connected components that transport power across a system...
Definition:
MotorUnit.h:23
StepEventListener.h
Connector.h
agxPowerLine::PhysicalDimension::Type
int Type
Definition:
PhysicalDimension.h:96
agxPowerLine::RotationalDimension
The rotational has one rotational degree of freedom.
Definition:
RotationalDimension.h:45
agxPowerLine::RotationalConnector
Defines a stiff gear constraint between two rotational dimensions.
Definition:
RotationalDimension.h:155
Attachment.h
agx::ref_ptr< RotationalDimension >
agx::RegularizationParameters::VariableType
VariableType
Definition:
RegularizationParameters.h:32
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition:
RigidBody.h:54
export.h
agx::Vec3T< Real >
RigidBody.h
agxStream::StorageStream
Abstract base class for storing/restoring a line/drums with version control.
Definition:
StorageStream.h:48
agxPowerLine::DirectionReference
DirectionReference
The DirectionReference specifies what the direction attribute of a DimensionState is relative to...
Definition:
DirectionReference.h:27
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_EXPORT
#define AGXMODEL_EXPORT
Definition:
agxModel/export.h:42
PhysicalDimension.h
agx::Real
double Real
Definition:
Real.h:42
agxPowerLine::TorqueGenerator
A torque generator adds torque to the body of a rotational dimension.
Definition:
RotationalDimension.h:198
agxUtil.h
agxPowerLine::RotationalConnectorRef
agx::ref_ptr< RotationalConnector > RotationalConnectorRef
Definition:
RotationalDimension.h:190
agxPowerLine::PowerGenerator
Will generate power by adding a load to a physical dimension.
Definition:
PowerLineUtils.h:187
include
agxPowerLine
RotationalDimension.h
Generated on Fri Apr 12 2024 12:40:26 for AGX Dynamics by
1.8.13