AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
MultiGear.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
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
29namespace agxDriveTrain
30{
32
41 {
42 public:
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
84
94
95
101
102
103 public: // Methods called by the rest of the PowerLine framework.
105
106 using agxPowerLine::Connector::connect;
107 using agxPowerLine::Connector::disconnect;
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:
128 agx::Vector<agxDriveTrain::GearRef> m_connections;
129 agxDriveTrain::ShaftRef m_internalShaft;
130 };
131}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#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
A MultiGear is a type of gear connector that can have multiple connected shafts, each with its own ge...
Definition: MultiGear.h:41
virtual bool disconnect(agxPowerLine::Unit *unit) override
Disconnect the give unit from this MultiGear.
virtual bool connect(agxPowerLine::Side mySide, agxPowerLine::Side otherSide, agxPowerLine::Unit *otherUnit) override
const agxDriveTrain::Shaft * getInternalShaft() const
virtual bool connect(agxPowerLine::Unit *unit) override
Connect the given unit with a gear ratio of 1.
bool connect(agxPowerLine::Unit *unit, agx::Real gearRatio)
Connect the given unit to this MultiGear.
bool setGearRatio(agxPowerLine::Unit *unit, agx::Real gearRatio)
Change the gear ratio for the given unit.
agxDriveTrain::Shaft * getInternalShaft()
agx::Real getGearRatio(const agxPowerLine::Unit *unit) const
Returns the gear ratio with which the given unit is connected to this MultiGear.
A Shaft is the most basic PowerLine Unit.
Definition: Shaft.h:35
Links two connections together.
Definition: Connector.h:53
Constraint implementation for constraining a number of physical dimensions of the same type.
Pure virtual class.
Definition: Unit.h:72
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
A library of agxPowerLine components designed to model the various parts of a vehicle drive train.
agxPowerLine contains a collection of connected components that transport power across a system.
Definition: MotorUnit.h:24
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition: Real.h:41