AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
WireAttachmentController.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
21
22#include <agx/Referenced.h>
23#include <agx/Vector.h>
24
25
27
28// Forward declarations
29namespace agx
30{
31 class Constraint;
32}
33
34namespace 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
#define AGXPHYSICS_EXPORT
The base class for a constraint.
Definition Constraint.h:89
Base class providing referencing counted objects.
Definition Referenced.h:120
The rigid body class, combining a geometric model and a frame of reference.
Definition RigidBody.h:52
Templated vector class.
Definition agx/Vector.h:53
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition macros.h:96
Implements a Wire model with adaptive resolution.
Definition MergedBody.h:40
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition Real.h:42