AGX Dynamics  2.35.0.1
StopValve.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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 AGXHYDRAULIC_STOP_VALVE_H
19 #define AGXHYDRAULIC_STOP_VALVE_H
20 
21 
23 
24 namespace agxHydraulics
25 {
26 
28 
36  {
37  public:
41  enum State
42  {
45 
50  };
51 
59  StopValve(agx::Real length, agx::Real area, agx::Real density, State state = CLOSED);
60 
65  void setState(State state);
66 
70  State getState() const;
71 
72 
73 
75  // Methods called by the rest of the PowerLine framework.
76  public:
77 #ifndef SWIG
79  virtual bool addNotification(agxSDK::Simulation* simulation) override;
80 
82  virtual bool removeNotification(agxUtil::ConstraintHolder* constraintHolder, agxSDK::Simulation* simulation) override;
83 
85  virtual bool preUpdate(agx::Real timeStep) override;
86 
88  virtual bool store(agxStream::StorageStream& str) const override;
90  virtual bool postStore(agxStream::StorageStream& str) const override;
91 
93  virtual bool restore(agxStream::StorageStream& str) override;
95  virtual bool postRestore(agxStream::StorageStream& str) override;
96 
98 #endif
100 
101 
102  void setAllowedDirection(State state);
103 
105  State getAllowedDirection() const;
106 
108  const agxHydraulics::FlowBlockConstraint* getFlowBlockConstraint() const;
109 
110  protected:
112  virtual ~StopValve() {}
114 
115  private:
116  agxHydraulics::FlowBlockConstraintRef m_flowBlockConstraint;
117  State m_state;
118  };
119 }
120 
121 
122 
123 #endif
#define AGXHYDRAULICS_FLOWDIRECTION_NONE
Definition: FlowDirection.h:22
#define AGXHYDRAULICS_FLOWDIRECTION_BOTH
Definition: FlowDirection.h:25
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#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 AGXHYDRAULICS_EXPORT
FlowUnit is the base class for Units that contains a FlowDimension.
Definition: FlowUnit.h:67
A stop valve is either completely open or completely closed.
Definition: StopValve.h:36
void setState(State state)
Open or close the StopValve.
StopValve(agx::Real length, agx::Real area, agx::Real density, State state=CLOSED)
Create a new StopValve with the given geometry and fluid density.
State
The two states that a StopValve can be in.
Definition: StopValve.h:42
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
Utility class to hold custom implementations of constraints.
Definition: agxUtil.h:464
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
The agxHydraulics namespace contains classes for modeling hydraulic circuits within the power line fr...
Definition: Accumulator.h:28
double Real
Definition: Real.h:42