AGX Dynamics  2.37.3.2
GeometryAttributeAccessors.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 #ifndef AGXFMI2_GEOMETRYATTRIBUTEACCESSORS_H
18 #define AGXFMI2_GEOMETRYATTRIBUTEACCESSORS_H
19 
22 #include <agx/Solver.h>
23 #include <agxData/Attribute.h>
24 
25 extern "C"
26 {
27  #include <FMI2/fmi2Functions.h>
28 }
29 
30 namespace agxCollide {
31  class Geometry;
32 }
33 
34 namespace agxFMI2
35 {
36  namespace Export
37  {
39  // INPUT VARIABLES
41 
42  // Generic agx::Vec3 attribute
43  class AGXFMI_EXPORT GeometryVec3AttributeInputVariable : public InputVariable_Real
44  {
45  public:
47 
48  public:
49  GeometryVec3AttributeInputVariable(agxCollide::Geometry *geometry, AttributeT *attribute, agx::UInt component, bool causalityName = false);
50  virtual fmi2Status set(agx::Real value) override;
51 
52  void setDirectionalDerivativeInput(agx::MobilitySolver *solver, agx::Real value);
53 
54  protected:
56 
57  private:
58  using InputVariable_Real::get;
59  agx::Real get();
60 
61  private:
62  agx::Physics::GeometryRef m_geometry;
63  agx::ref_ptr<AttributeT> m_attribute;
64  agx::UInt m_component;
65  };
66 
67 
68  // Surface Velocity
70  {
71  public:
72  GeometrySurfaceVelocityInputVariable(agxCollide::Geometry *geometry, agx::UInt component, bool causalityName = false) : GeometryVec3AttributeInputVariable(geometry, agx::Physics::GeometryModel::surfaceVelocityAttribute, component, causalityName) {}
73 
74  protected:
76  };
77 
79  // OUTPUT VARIABLES
81 
82  // Generic agx::Vec3 attribute
83 
84  class AGXFMI_EXPORT GeometryVec3AttributeOutputVariable : public OutputVariable_Real
85  {
86  public:
88 
89  public:
90  GeometryVec3AttributeOutputVariable(agxCollide::Geometry* geometry, AttributeT *attribute, agx::UInt component, bool causalityName = false);
91  virtual fmi2Status get(agx::Real& value) override;
92  agx::Real getDirectionalDerivativeOutput(agx::MobilitySolver *solver, agx::MobilitySolver *referenceSolver);
93 
94  protected:
96 
97  private:
98  agx::Real get(agx::MobilitySolver *solver);
99 
100  private:
101  agx::Physics::GeometryRef m_geometry;
102  agx::ref_ptr<AttributeT> m_attribute;
103  agx::UInt m_component;
104  };
105 
107  {
108  public:
109  GeometrySurfaceVelocityOutputVariable(agxCollide::Geometry *geometry, agx::UInt component, bool causalityName = false) : GeometryVec3AttributeOutputVariable(geometry, agx::Physics::GeometryModel::surfaceVelocityAttribute, component, causalityName) {}
110 
111  protected:
113  };
114  }
115 }
116 
117 #endif /* AGXFMI2_GEOMETRYATTRIBUTEACCESSORS_H */
This namespace consists of a set of classes for handling geometric intersection tests including boole...
#define AGXFMI_EXPORT
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
uint32_t UInt
Definition: Integer.h:34
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
GeometrySurfaceVelocityOutputVariable(agxCollide::Geometry *geometry, agx::UInt component, bool causalityName=false)
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
GeometrySurfaceVelocityInputVariable(agxCollide::Geometry *geometry, agx::UInt component, bool causalityName=false)
This namespace contains functionality for using AGX together with version 2 of the Functional Mockup ...
double Real
Definition: Real.h:42