AGX Dynamics  2.38.0.2
ActuatorUnit.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 #pragma once
18 
22 #include <agxPowerLine/Unit.h>
23 
24 namespace agx
25 {
26  class RigidBody;
27  class Constraint;
28 }
29 
30 namespace agxPowerLine
31 {
32  class Actuator;
33  class RotationalUnit;
34  class ActuatorBodyUnit;
35 }
36 
37 namespace agxPowerLine
38 {
40  {
41  public:
42  ActuatorDimension(ActuatorBodyUnit* actuatorBodyUnit);
43 
44  void setActuatorBodyUnit(ActuatorBodyUnit* actuatorBodyUnit);
46 
48  virtual agx::RigidBody* getBody() = 0;
49 
50  bool store(agxStream::StorageStream& str) const;
52 
53  void store(agxStream::OutputArchive& out) const;
55 
56  protected:
58  virtual ~ActuatorDimension() = 0;
59 
60  protected:
62  };
63 
64 
65 
66 
67  class ActuatorTranslationalDimension : public agxPowerLine::TranslationalDimension, public ActuatorDimension
68  {
69  public:
70  ActuatorTranslationalDimension(ActuatorBodyUnit* actuatorBodyUnit, agx::RigidBody* body, bool externalBody);
71 
74 
75  virtual agx::RigidBody* getBody() override;
76 
80  virtual bool store(agxStream::StorageStream& str) const override;
81 
85  virtual bool restore(agxStream::StorageStream& str) override;
86 
88 
89  protected:
91 
92  private:
94 
95  private:
97  };
98 
99 
100 
101 
103  {
104  public:
105  ActuatorRotationalDimension(ActuatorBodyUnit* actuatorBodyUnit, agx::RigidBody* body, bool externalBody);
106 
109 
110  agx::RigidBody* getBody() override;
111 
115  virtual bool store(agxStream::StorageStream& str) const override;
116 
120  virtual bool restore(agxStream::StorageStream& str) override;
121 
123 
124  protected:
126 
127  private:
129 
130  private:
132  };
133 
134 
135 
136 
143  {
144  public:
148  ActuatorBodyUnit(Actuator* actuator, agx::Constraint* constraint, agxPowerLine::Side actuatorSide);
149 
150  const Actuator* getActuator() const;
151  Actuator* getActuator();
152 
153  bool isInputAndOutput() const;
154 
155  const agx::RigidBody* getRigidBody() const;
156 
160  agxPowerLine::ActuatorRotationalDimension* getRotationalDimension();
161 
165  agxPowerLine::ActuatorTranslationalDimension* getTranslationalDimension();
166 
167 
171  virtual bool store(agxStream::StorageStream& str) const override;
172 
176  virtual bool restore(agxStream::StorageStream& str) override;
177 
179 
181 
182  protected:
183 
184  virtual ~ActuatorBodyUnit();
185 
189  };
190 
192 
193 }
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:46
DimensionState.h
agxPowerLine::ActuatorBodyUnitRef
agx::ref_ptr< ActuatorBodyUnit > ActuatorBodyUnitRef
Definition: ActuatorUnit.h:191
agxPowerLine::Side
Side
Definition: Sides.h:28
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:51
agxPowerLine::ActuatorBodyUnit
An ActuatorBodyUnit forms a connection between the power line world and the rest of the simulation.
Definition: ActuatorUnit.h:142
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:186
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:187
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:399
agxPowerLine::Unit
Pure virtual class.
Definition: Unit.h:71
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:39
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:44
agxStream::InputArchive
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:50
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:61
agxPowerLine::ActuatorRotationalDimension
Definition: ActuatorUnit.h:102
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:67
agxPowerLine::ActuatorRotationalDimension::~ActuatorRotationalDimension
virtual ~ActuatorRotationalDimension()
agxPowerLine::ActuatorBodyUnit::m_actuator
agx::observer_ptr< Actuator > m_actuator
Definition: ActuatorUnit.h:188