AGX Dynamics  2.37.2.0
MultiGear.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 
19 #include <agxPowerLine/Connector.h>
20 
21 #include <agxDriveTrain/Gear.h>
22 #include <agxDriveTrain/Shaft.h>
23 
24 #include <agx/Vector.h>
25 
26 #include <agxModel/export.h>
27 
28 
29 namespace agxDriveTrain
30 {
32 
41  {
42  public:
43  MultiGear();
44 
53  bool connect(agxPowerLine::Unit* unit, agx::Real gearRatio);
54 
62  virtual bool connect(agxPowerLine::Unit* unit) override;
63 
64  virtual bool connect(agxPowerLine::Side mySide, agxPowerLine::Side otherSide, agxPowerLine::Unit* otherUnit) override;
65 
72  virtual bool disconnect(agxPowerLine::Unit* unit) override;
73 
74 
83  bool setGearRatio(agxPowerLine::Unit* unit, agx::Real gearRatio);
84 
93  agx::Real getGearRatio(const agxPowerLine::Unit* unit) const;
94 
95 
99  agxDriveTrain::Shaft* getInternalShaft();
100  const agxDriveTrain::Shaft* getInternalShaft() const;
101 
102 
103  public: // Methods called by the rest of the PowerLine framework.
105 
108 
113  bool connect(
114  agxPowerLine::Side mySide,
115  agxPowerLine::Side unitSide,
116  agxPowerLine::Unit* unit,
117  agx::Real gearRatio);
118 
119 #if !defined(SWIG) || defined(SWIGPYTHON)
120  virtual agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation* createConstraint() override;
121 #endif
123  virtual bool store(agxStream::StorageStream& out) const override;
124  virtual bool restore(agxStream::StorageStream& in) override;
125 
127  private:
129  agxDriveTrain::ShaftRef m_internalShaft;
130  };
131 }
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
Links two connections together.
Definition: Connector.h:53
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...
Constraint implementation for constraining a number of physical dimensions of the same type...
Pure virtual class.
Definition: Unit.h:72
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
A Shaft is the most basic PowerLine Unit.
Definition: Shaft.h:34
A library of agxPowerLine components designed to model the various parts of a vehicle drive train...
virtual bool disconnect()
Templated vector class.
Definition: Vector.h:52
virtual bool connect(agxPowerLine::Unit *unit)
Connect a unit to this Connector.
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
#define AGXMODEL_EXPORT
double Real
Definition: Real.h:42
A MultiGear is a type of gear connector that can have multiple connected shafts, each with its own ge...
Definition: MultiGear.h:40
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97