AGXDynamics  2.35.0.2
ActuatorUnit.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 AGXPOWERLINE_ACTUATOR_UNIT_H
18 #define AGXPOWERLINE_ACTUATOR_UNIT_H
19 
23 #include <agxPowerLine/Unit.h>
24 
25 namespace agx
26 {
27  class RigidBody;
28  class Constraint;
29 }
30 
31 namespace agxPowerLine
32 {
33  class Actuator;
34  class RotationalUnit;
35  class ActuatorBodyUnit;
36 }
37 
38 namespace agxPowerLine
39 {
41  {
42  public:
43  ActuatorDimension(ActuatorBodyUnit* actuatorBodyUnit);
44 
45  void setActuatorBodyUnit(ActuatorBodyUnit* actuatorBodyUnit);
47 
49  virtual agx::RigidBody* getBody() = 0;
50 
51  bool store(agxStream::StorageStream& str) const;
53 
54  void store(agxStream::OutputArchive& out) const;
56 
57  protected:
59  virtual ~ActuatorDimension() = 0;
60 
61  protected:
63  };
64 
65 
66 
67 
68  class ActuatorTranslationalDimension : public agxPowerLine::TranslationalDimension, public ActuatorDimension
69  {
70  public:
71  ActuatorTranslationalDimension(ActuatorBodyUnit* actuatorBodyUnit, agx::RigidBody* body, bool externalBody);
72 
75 
76  virtual agx::RigidBody* getBody() override;
77 
81  virtual bool store(agxStream::StorageStream& str) const override;
82 
86  virtual bool restore(agxStream::StorageStream& str) override;
87 
89 
90  protected:
92 
93  private:
95 
96  private:
98  };
99 
100 
101 
102 
104  {
105  public:
106  ActuatorRotationalDimension(ActuatorBodyUnit* actuatorBodyUnit, agx::RigidBody* body, bool externalBody);
107 
110 
111  agx::RigidBody* getBody() override;
112 
116  virtual bool store(agxStream::StorageStream& str) const override;
117 
121  virtual bool restore(agxStream::StorageStream& str) override;
122 
124 
125  protected:
127 
128  private:
130 
131  private:
133  };
134 
135 
136 
137 
144  {
145  public:
149  ActuatorBodyUnit(Actuator* actuator, agx::Constraint* constraint, agxPowerLine::Side actuatorSide);
150 
151  const Actuator* getActuator() const;
152  Actuator* getActuator();
153 
154  bool isInputAndOutput() const;
155 
156  const agx::RigidBody* getRigidBody() const;
157 
161  agxPowerLine::ActuatorRotationalDimension* getRotationalDimension();
162 
166  agxPowerLine::ActuatorTranslationalDimension* getTranslationalDimension();
167 
168 
172  virtual bool store(agxStream::StorageStream& str) const override;
173 
177  virtual bool restore(agxStream::StorageStream& str) override;
178 
180 
182 
183  protected:
184 
185  virtual ~ActuatorBodyUnit();
186 
190  };
191 
193 
194 }
195 
196 #endif // AGXMODEL_ACTUATOR_UNIT_H
agxPowerLine::ActuatorTranslationalDimension::restore
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
agxPowerLine::ActuatorRotationalDimension::getDimensionState
virtual agxPowerLine::detail::AbstractDimensionState3Dof * getDimensionState() override
agxPowerLine::Actuator
Definition: Actuator.h:49
DimensionState.h
agxPowerLine::ActuatorBodyUnitRef
agx::ref_ptr< ActuatorBodyUnit > ActuatorBodyUnitRef
Definition: ActuatorUnit.h:192
agxPowerLine::Side
Side
Definition: Sides.h:30
agxPowerLine::ActuatorTranslationalDimension::~ActuatorTranslationalDimension
virtual ~ActuatorTranslationalDimension()
agxPowerLine::ActuatorDimension::ActuatorDimension
ActuatorDimension()
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
Unit.h
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
agxPowerLine::ActuatorBodyUnit
An ActuatorBodyUnit forms a connection between the power line world and the rest of the simulation.
Definition: ActuatorUnit.h:143
TranslationalDimension.h
agxStream::StorageStream
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:48
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
agxPowerLine::ActuatorDimension::store
bool store(agxStream::StorageStream &str) const
agxPowerLine::ActuatorBodyUnit::m_rotationalDimension
agx::ref_ptr< ActuatorRotationalDimension > m_rotationalDimension
Definition: ActuatorUnit.h:187
agx::observer_ptr
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
Definition: observer_ptr.h:60
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
agxPowerLine::ActuatorRotationalDimension::getRotationalDimensionState
agxPowerLine::detail::Rotational3DofState * getRotationalDimensionState()
agxPowerLine::ActuatorRotationalDimension::getBody
agx::RigidBody * getBody() override
agxPowerLine::ActuatorBodyUnit::m_translationalDimension
agx::ref_ptr< ActuatorTranslationalDimension > m_translationalDimension
Definition: ActuatorUnit.h:188
agxPowerLine::ActuatorDimension::restore
bool restore(agxStream::StorageStream &str)
agxPowerLine::ActuatorDimension::~ActuatorDimension
virtual ~ActuatorDimension()=0
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::Unit
Pure virtual class.
Definition: Unit.h:72
agxPowerLine::ActuatorDimension::setActuatorBodyUnit
void setActuatorBodyUnit(ActuatorBodyUnit *actuatorBodyUnit)
agxPowerLine::ActuatorTranslationalDimension::store
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
agxPowerLine::ActuatorDimension::getActuatorBodyUnit
const ActuatorBodyUnit * getActuatorBodyUnit() const
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
agxPowerLine::ActuatorDimension
Definition: ActuatorUnit.h:40
agxStream::OutputArchive
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:56
agxPowerLine::RotationalDimension
The rotational has one rotational degree of freedom.
Definition: RotationalDimension.h:45
agxStream::InputArchive
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:51
agxPowerLine::ActuatorRotationalDimension::store
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
agxPowerLine::ActuatorTranslationalDimension::getDimensionState
virtual agxPowerLine::detail::AbstractDimensionState3Dof * getDimensionState() override
agxPowerLine
agxPowerLine contains a collection of connected components that transport power across a system.
Definition: MotorUnit.h:23
agx::Constraint
The base class for a constraint.
Definition: Constraint.h:88
agxPowerLine::ActuatorDimension::getBody
virtual agx::RigidBody * getBody()=0
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition: agxModel/export.h:42
agxPowerLine::detail::DimensionState3Dof
Templated three dimensional dimension state.
Definition: DimensionState.h:354
agxPowerLine::detail::AbstractDimensionState3Dof
Base class for the two three dimensional dimension state classes.
Definition: DimensionState.h:336
RotationalDimension.h
agxPowerLine::ActuatorDimension::m_actuatorBodyUnit
agx::observer_ptr< ActuatorBodyUnit > m_actuatorBodyUnit
Definition: ActuatorUnit.h:62
agxPowerLine::ActuatorRotationalDimension
Definition: ActuatorUnit.h:103
agxPowerLine::ActuatorDimension::getDimensionState
virtual agxPowerLine::detail::AbstractDimensionState3Dof * getDimensionState()=0
agxPowerLine::ActuatorTranslationalDimension::getBody
virtual agx::RigidBody * getBody() override
agxPowerLine::ActuatorRotationalDimension::restore
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
agxPowerLine::ActuatorTranslationalDimension::getTranslationalDimensionState
agxPowerLine::detail::Translational3DofState * getTranslationalDimensionState()
agxPowerLine::ActuatorTranslationalDimension
Definition: ActuatorUnit.h:68
agxPowerLine::ActuatorRotationalDimension::~ActuatorRotationalDimension
virtual ~ActuatorRotationalDimension()
agxPowerLine::ActuatorBodyUnit::m_actuator
agx::observer_ptr< Actuator > m_actuator
Definition: ActuatorUnit.h:189