AGX Dynamics  2.37.2.0
ConstantFlowValve.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_CONSTANT_FLOW_VALVE_H
19 #define AGXHYDRAULICS_CONSTANT_FLOW_VALVE_H
20 
21 #include <agxHydraulics/FlowUnit.h>
23 
24 namespace agxHydraulics
25 {
27 
40  {
41  public:
52  agx::Real length, agx::Real area, agx::Real fluidDensity,
53  agx::Real targetFlowRate, bool allowPumping = false);
54 
58  agx::Real getTargetFlowRate() const;
59 
64  void setTargetFlowRate(agx::Real targetFlowRate);
65 
69  bool getAllowPumping() const;
70 
75  void setAllowPumping(bool allowPumping);
76 
77 
83  void setEnable(bool enable);
84 
88  bool getEnable() const;
89 
90 
94  agx::Constraint* getConstraint();
95  const agx::Constraint* getConstraint() const;
96 
97 
98 
99  // Methods called by the rest of the PowerLine/Hydraulics frame work.
100  public:
102 
103 
106  virtual bool preUpdate(agx::Real timeStep) override;
107 
112  virtual bool addNotification(agxSDK::Simulation* simulation) override;
113 
114 #ifndef SWIG
115 
119  virtual bool removeNotification(agxUtil::ConstraintHolder* constraintHolder, agxSDK::Simulation* simulation) override;
120 
121 
125  virtual bool store(agxStream::StorageStream& str) const override;
126 
130  virtual bool postStore(agxStream::StorageStream& str) const override;
131 
135  virtual bool restore(agxStream::StorageStream& str) override;
136 
140  virtual bool postRestore(agxStream::StorageStream& str) override;
141 
143 #endif
144 
146 
147  protected:
149  virtual ~ConstantFlowValve();
150 
151  void createFlowRateConstraint();
152  void destroyFlowRateConstraint();
153 
154  private:
155  agxHydraulics::detail::FlowRateConstraintData m_constraintData;
156  agxHydraulics::detail::FlowRateConstraintRef m_flowRateConstraint;
157  };
158 }
159 
160 
161 #endif
Utility class to hold custom implementations of constraints.
Definition: agxUtil.h:463
The base class for a constraint.
Definition: Constraint.h:88
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
A constant flow valve is a valve that acts to limit the flow rate through a pipe to some maximum valu...
#define AGXHYDRAULICS_EXPORT
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
double Real
Definition: Real.h:42
#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