AGX Dynamics  2.38.0.2
TranslationalDimension.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 <agxModel/export.h>
21 #include <agxPowerLine/Connector.h>
23 
25 
26 #include <agxUtil/agxUtil.h>
27 
28 #include <agx/RigidBody.h>
30 
31 namespace agxPowerLine
32 {
33 
35 
36  #define DEFAULT_TRANSLATIONAL_DIRECTION agx::Vec3(0, 1, 0)
37 
38  class TranslationalUnit;
39 
46  class AGXMODEL_EXPORT TranslationalDimension : public agxPowerLine::PhysicalDimension
47  {
48  public:
54  TranslationalDimension(agxPowerLine::Unit* unit);
55 
61  TranslationalDimension(
62  agxPowerLine::Unit* unit,
63  agx::RigidBody* body,
64  const agx::Vec3& direction,
65  agxPowerLine::DirectionReference directionReference,
66  bool externalBody = false);
67 
72  static std::string getStaticTypeName();
73 
77  virtual std::string getTypeName() const override;
78 
82  virtual void renderDebug() override;
83 
84  void setVelocity(agx::Real velocity);
85  agx::Real getVelocity() const;
86 
90  virtual agx::Real getOutputLoad() const override;
91  virtual agx::Real getInputLoad() const override;
92  agx::Real getOutputForce() const;
93  agx::Real getInputForce() const;
94 
95 
99  virtual agx::Real getPowerIn() const override;
100  virtual agx::Real getPowerOut() const override;
101 
105  virtual agx::Vec3 getWorldDirection() const;
106 
114  static agxPowerLine::PhysicalDimension::Type getStaticType();
115 
119  virtual bool store(agxStream::StorageStream& out) const override;
120 
124  virtual bool restore(agxStream::StorageStream& in) override;
125 
126  AGXSTREAM_DECLARE_SERIALIZABLE(agxPowerLine::TranslationalDimension);
127 
128  protected:
129  TranslationalDimension();
130  virtual ~TranslationalDimension();
131  };
132 
133 
134  typedef agx::ref_ptr<TranslationalDimension> TranslationalDimensionRef;
135 
139  class AGXMODEL_EXPORT TranslationalConnector : public agxPowerLine::Connector
140  {
141  public:
142  TranslationalConnector();
143 
144  virtual PhysicalDimensionMultiBodyConstraintImplementation* createConstraint() override;
145  virtual agx::RegularizationParameters::VariableType calculateComplianceAndDamping( const agx::Real timeStep, agx::Real& compliance, agx::Real& damping) override;
146 
150  virtual bool store(agxStream::StorageStream& out) const override;
151 
155  virtual bool restore(agxStream::StorageStream& in) override;
156 
157  AGXSTREAM_DECLARE_SERIALIZABLE(agxPowerLine::TranslationalConnector);
158 
159  protected:
160  virtual ~TranslationalConnector() {}
161  };
162 
163  typedef agx::ref_ptr<TranslationalConnector> TranslationalConnectorRef;
164 
166 }
agx::Real
double Real
Definition: Real.h:42
agx::RegularizationParameters::VariableType
VariableType
Definition: RegularizationParameters.h:32
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
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:51
export.h
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
DOXYGEN_START_INTERNAL_BLOCK
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
agxStream::StorageStream
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:48
StepEventListener.h
agxPowerLine::PhysicalDimension
Pure virtual class.
Definition: PhysicalDimension.h:92
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::PhysicalDimension::Type
int Type
Definition: PhysicalDimension.h:95
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
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
Connector.h
RigidBody.h
agxPowerLine
agxPowerLine contains a collection of connected components that transport power across a system.
Definition: MotorUnit.h:23
ElementaryConstraint.h
agxPowerLine::Connector
Links two connections together.
Definition: Connector.h:52
DirectionReference.h
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition: agxModel/export.h:42
agxPowerLine::DirectionReference
DirectionReference
The DirectionReference specifies what the direction attribute of a DimensionState is relative to.
Definition: DirectionReference.h:25
agx::Vec3T< Real >
agxUtil.h
PhysicalDimension.h