AGX Dynamics  2.37.2.0
WireAttachmentController.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 #pragma once
18 
19 #include <agx/agxPhysics_export.h>
21 
22 #include <agx/Referenced.h>
23 #include <agx/Vector.h>
24 
25 
27 
28 // Forward declarations
29 namespace agx
30 {
31  class Constraint;
32 }
33 
34 namespace agxWire
35 {
36  // Forward declarations
37  class WireParameterController;
38 
42  class AGXPHYSICS_EXPORT WireAttachmentController : public virtual agx::Referenced
43  {
44  public:
48  WireAttachmentController();
49 
56  virtual void update( Node* controlledNode, Node* lumpedNode, bool begin );
57 
66  virtual bool owns( const Node* node ) const;
67 
72  virtual Node* getReferenceNode() { return nullptr; }
73 
78  virtual bool getForceGeometryListEmpty( bool begin ) const;
79 
83  virtual agx::Real getReferenceCurrentLength( bool begin ) const;
84 
89  inline agx::Constraint* getConstraint() const;
90 
94  inline ConstraintRenderer* getRenderer() const;
95 
96  protected:
97  virtual ~WireAttachmentController();
98 
103  void setConstraint( agx::Constraint* constraint );
104 
105  friend class WireInitializationController;
106 
111  virtual void initialize( bool begin, WireParameterController* parameters );
112 
118  void setWire( WireDistanceCompositeConstraint* wire );
119 
123  WireDistanceCompositeConstraint* getWire() const;
124 
129  BodyFixedNode* getLumpedNode( bool begin ) const;
130 
134  agx::Constraint* createConstraint( agx::RigidBody* rb1, agx::RigidBody* rb2 ) const;
135 
139  void deleteConstraint();
140 
141  private:
142  agx::ConstraintRef m_constraint;
144  ConstraintRendererRef m_renderer;
145  };
146 
147  typedef agx::ref_ptr< WireAttachmentController > WireAttachmentControllerRef;
148  typedef agx::Vector< WireAttachmentControllerRef > WireAttachmentControllerRefVector;
149 
150  // Inline methods ************************************************************************
151 
152  inline agx::Constraint* WireAttachmentController::getConstraint() const
153  {
154  return m_constraint;
155  }
156 
157  inline ConstraintRenderer* WireAttachmentController::getRenderer() const
158  {
159  return m_renderer;
160  }
161 
162  inline WireDistanceCompositeConstraint* WireAttachmentController::getWire() const
163  {
164  return m_wire;
165  }
166 
167  // ***************************************************************************************
168 }
169 
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
Definition: observer_ptr.h:60
#define AGXPHYSICS_EXPORT
The base class for a constraint.
Definition: Constraint.h:88
Base class providing referencing counted objects.
Definition: Referenced.h:119
Templated vector class.
Definition: Vector.h:52
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Implements a Wire model with adaptive resolution.
Definition: MergedBody.h:39
LinearProbingHashSetImplementation< KeyT, HashT >::iterator begin(LinearProbingHashSetImplementation< KeyT, HashT > &set)
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
double Real
Definition: Real.h:42
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97