AGX Dynamics  2.37.3.2
SpoolValve.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 
18 #ifndef AGXHYDRAULICS_SPOOL_VALVE_CONNECTOR_H
19 #define AGXHYDRAULICS_SPOOL_VALVE_CONNECTOR_H
20 
22 #include <agxHydraulics/FlowUnit.h>
23 
25 
26 
27 namespace agxHydraulics
28 {
30 
31 
45  {
46  public:
47  SpoolValve();
48 
59  bool link(agxHydraulics::FlowUnit* input, agxHydraulics::FlowUnit* output);
60 
70  bool unlink(agxHydraulics::FlowUnit* flowUnit);
71 
72  bool unlinkAll();
73 
78  bool doesLinkExist(agxHydraulics::FlowUnit* input, agxHydraulics::FlowUnit* output) const;
79 
83  size_t getNumLinks() const;
84 
85 
100  virtual bool connect(
101  agxPowerLine::Side mySide,
102  agxPowerLine::Side unitSide,
103  agxPowerLine::Unit* unit) override;
104 
105  using Connector::connect;
106 
107  virtual bool disconnect(agxPowerLine::Unit* unit) override;
108 
109  virtual bool disconnect() override;
110 
111 
112 
113  // Methods called by the rest of the PowerLine/Hydraulics frame work.
114  public:
116  virtual agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation* createConstraint() override;
117 
118 #ifndef SWIG
119 
121  virtual bool removeNotification(
122  agxUtil::ConstraintHolder* constraintHolder,
123  agxSDK::Simulation* simulation) override;
124 
125 
129  virtual bool store(agxStream::StorageStream& str) const override;
130 
134  virtual bool restore(agxStream::StorageStream& str) override;
135 
137 #endif
139 
140  typedef agx::HashVector<agxHydraulics::FlowUnit*, detail::SpoolValveConnectionInfo> UnitPtrSpoolValveInfoTable;
141 
142  protected:
143  virtual ~SpoolValve();
144 
145  private:
146  void removeInternalFlowConnector(agxHydraulics::FlowConnector* connector);
147  void removeInternalFlowUnit(agxHydraulics::FlowUnit* unit);
148 
149  private:
150  UnitPtrSpoolValveInfoTable m_connectionInfo;
151  };
152 }
153 
154 
155 #endif
Links two connections together.
Definition: Connector.h:53
A FlowConnector is a junction of a set of FlowUnits.
Definition: FlowConnector.h:39
Utility class to hold custom implementations of constraints.
Definition: agxUtil.h:463
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
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
#define AGXHYDRAULICS_EXPORT
Spool valves are used to dynamically redirect flow during a simulation.
Definition: SpoolValve.h:44
The agxHydraulics namespace contains classes for modeling hydraulic circuits within the power line fr...
Definition: Accumulator.h:27
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
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97
FlowUnit is the base class for Units that contains a FlowDimension.
Definition: FlowUnit.h:66