AGX Dynamics  2.35.0.1
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 
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;
153 
154  bool isInputAndOutput() const;
155 
156  const agx::RigidBody* getRigidBody() const;
157 
162 
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
#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
#define AGXMODEL_EXPORT
An ActuatorBodyUnit forms a connection between the power line world and the rest of the simulation.
Definition: ActuatorUnit.h:144
agx::ref_ptr< ActuatorRotationalDimension > m_rotationalDimension
Definition: ActuatorUnit.h:187
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
agx::ref_ptr< ActuatorTranslationalDimension > m_translationalDimension
Definition: ActuatorUnit.h:188
const agx::RigidBody * getRigidBody() const
agx::observer_ptr< Actuator > m_actuator
Definition: ActuatorUnit.h:189
ActuatorBodyUnit(Actuator *actuator, agx::Constraint *constraint, agxPowerLine::Side actuatorSide)
Create a rotational and translational unit.
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
const Actuator * getActuator() const
agxPowerLine::ActuatorTranslationalDimension * getTranslationalDimension()
returns a pointer to the rotational dimension
agxPowerLine::ActuatorRotationalDimension * getRotationalDimension()
returns a pointer to the rotational dimension
void setActuatorBodyUnit(ActuatorBodyUnit *actuatorBodyUnit)
agx::observer_ptr< ActuatorBodyUnit > m_actuatorBodyUnit
Definition: ActuatorUnit.h:62
void restore(agxStream::InputArchive &in)
void store(agxStream::OutputArchive &out) const
bool store(agxStream::StorageStream &str) const
virtual agxPowerLine::detail::AbstractDimensionState3Dof * getDimensionState()=0
virtual agx::RigidBody * getBody()=0
ActuatorDimension(ActuatorBodyUnit *actuatorBodyUnit)
bool restore(agxStream::StorageStream &str)
const ActuatorBodyUnit * getActuatorBodyUnit() const
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
virtual agxPowerLine::detail::AbstractDimensionState3Dof * getDimensionState() override
ActuatorRotationalDimension(ActuatorBodyUnit *actuatorBodyUnit, agx::RigidBody *body, bool externalBody)
agx::RigidBody * getBody() override
agxPowerLine::detail::Rotational3DofState * getRotationalDimensionState()
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
virtual agx::RigidBody * getBody() override
virtual agxPowerLine::detail::AbstractDimensionState3Dof * getDimensionState() override
agxPowerLine::detail::Translational3DofState * getTranslationalDimensionState()
ActuatorTranslationalDimension(ActuatorBodyUnit *actuatorBodyUnit, agx::RigidBody *body, bool externalBody)
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
The rotational has one rotational degree of freedom.
Pure virtual class.
Definition: Unit.h:73
Base class for the two three dimensional dimension state classes.
Templated three dimensional dimension state.
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:52
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:57
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
The base class for a constraint.
Definition: Constraint.h:89
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:55
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
Definition: observer_ptr.h:61
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:30
agxPowerLine contains a collection of connected components that transport power across a system.
Definition: MotorUnit.h:24
agx::ref_ptr< ActuatorBodyUnit > ActuatorBodyUnitRef
Definition: ActuatorUnit.h:192
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.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.