AGX Dynamics  2.37.2.0
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 #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);
46  const ActuatorBodyUnit* getActuatorBodyUnit() const;
47 
48  virtual agxPowerLine::detail::AbstractDimensionState3Dof* getDimensionState() = 0;
49  virtual agx::RigidBody* getBody() = 0;
50 
51  bool store(agxStream::StorageStream& str) const;
52  bool restore(agxStream::StorageStream& str);
53 
54  void store(agxStream::OutputArchive& out) const;
55  void restore(agxStream::InputArchive& in);
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 
73  virtual agxPowerLine::detail::AbstractDimensionState3Dof* getDimensionState() override;
74  agxPowerLine::detail::Translational3DofState* getTranslationalDimensionState();
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 
108  virtual agxPowerLine::detail::AbstractDimensionState3Dof* getDimensionState() override;
109  agxPowerLine::detail::Rotational3DofState* getRotationalDimensionState();
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:
126  virtual ~ActuatorRotationalDimension();
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
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
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...
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
Definition: observer_ptr.h:60
Pure virtual class.
Definition: Unit.h:72
agx::ref_ptr< ActuatorBodyUnit > ActuatorBodyUnitRef
Definition: ActuatorUnit.h:192
The base class for a constraint.
Definition: Constraint.h:88
agxPowerLine contains a collection of connected components that transport power across a system...
Definition: MotorUnit.h:23
Templated three dimensional dimension state.
The rotational has one rotational degree of freedom.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::observer_ptr< ActuatorBodyUnit > m_actuatorBodyUnit
Definition: ActuatorUnit.h:62
agx::ref_ptr< ActuatorTranslationalDimension > m_translationalDimension
Definition: ActuatorUnit.h:188
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
An ActuatorBodyUnit forms a connection between the power line world and the rest of the simulation...
Definition: ActuatorUnit.h:143
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:51
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:48
#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
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:56
agx::observer_ptr< Actuator > m_actuator
Definition: ActuatorUnit.h:189
#define AGXMODEL_EXPORT
agx::ref_ptr< ActuatorRotationalDimension > m_rotationalDimension
Definition: ActuatorUnit.h:187
Base class for the two three dimensional dimension state classes.