AGXDynamics  2.35.0.3
WireTensionData.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 #pragma once
18 
19 #include <agxWire/Node.h>
20 
21 namespace agxWire
22 {
27  {
29  WireSegmentTensionData( agx::Real rawTension, agx::Real smoothedTension );
30  explicit WireSegmentTensionData( const agxWire::Node::Tension* tension );
31 
34  };
35 
41  {
46 
50  WireNodeTensionData( const agxWire::Node::Tension* currNodeTension, const agxWire::Node::Tension* nextNodeTension );
51 
55  agx::Real getAverageRaw() const;
56 
60  agx::Real getAverageSmoothed() const;
61 
65  agx::Real getRaw() const;
66 
70  agx::Real getSmoothed() const;
71 
74  };
75 
77 
78 
80  : raw( agx::Real( 0 ) ), smoothed( agx::Real( 0 ) )
81  {
82  }
83 
84  inline WireSegmentTensionData::WireSegmentTensionData( agx::Real rawTension, agx::Real smoothedTension )
85  : raw( rawTension ), smoothed( smoothedTension )
86  {
87  }
88 
89  inline WireSegmentTensionData::WireSegmentTensionData( const Node::Tension* tension )
90  : raw( tension != nullptr ? tension->raw : agx::Real( 0 ) ), smoothed( tension != nullptr ? tension->smoothed : agx::Real( 0 ) )
91  {
92  }
93 
95  : prev(), next()
96  {
97  }
98 
99  inline WireNodeTensionData::WireNodeTensionData( const Node::Tension* currNodeTension, const Node::Tension* nextNodeTension )
100  : prev( currNodeTension ), next( nextNodeTension )
101  {
102  }
103 
105  {
106  return agx::Real( 0.5 ) * ( prev.raw + next.raw );
107  }
108 
110  {
111  return agx::Real( 0.5 ) * ( prev.smoothed + next.smoothed );
112  }
113 
115  {
116  return prev.raw;
117  }
118 
120  {
121  return prev.smoothed;
122  }
123 
125 
126 }
127 
agx::Real
double Real
Definition: Real.h:42
agxWire::WireSegmentTensionData::WireSegmentTensionData
WireSegmentTensionData()
agxWire::WireNodeTensionData
Structure containing relevant tension data for a node.
Definition: WireTensionData.h:40
agxWire::WireNodeTensionData::getAverageRaw
agx::Real getAverageRaw() const
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
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
Node.h
agxWire
Implements a Wire model with adaptive resolution.
Definition: MergedBody.h:39
agxWire::WireNodeTensionData::prev
WireSegmentTensionData prev
Segment before node (this node is end node to that segment) tension data.
Definition: WireTensionData.h:72
agxWire::WireNodeTensionData::getSmoothed
agx::Real getSmoothed() const
agxWire::WireNodeTensionData::getRaw
agx::Real getRaw() const
agxWire::WireSegmentTensionData
Structure containing relevant tension data for a wire element/segment.
Definition: WireTensionData.h:26
agxWire::WireNodeTensionData::next
WireSegmentTensionData next
Segment after node (this node is begin node to that segment) tension data.
Definition: WireTensionData.h:73
agxWire::WireNodeTensionData::WireNodeTensionData
WireNodeTensionData()
Default constructor - all values default.
agxWire::WireSegmentTensionData::smoothed
agx::Real smoothed
Smoothed tension value given the current smoothing filter.
Definition: WireTensionData.h:33
agxWire::WireSegmentTensionData::raw
agx::Real raw
Raw tension value.
Definition: WireTensionData.h:32
agxWire::WireNodeTensionData::getAverageSmoothed
agx::Real getAverageSmoothed() const