AGXDynamics  2.35.0.2
WireContactController.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 
20 #include <agx/Referenced.h>
21 #include <agx/Vec3.h>
22 #include <agxWire/Node.h>
24 #include <agxWire/WireUtils.h>
25 
27 
28 namespace agxSDK
29 {
30  class SimulationProxy;
31 }
32 
33 namespace agxCollide
34 {
35  class Shape;
36  class GeometryContactPtr;
37  class Geometry;
38 }
39 
40 namespace agxWire
41 {
42  class Wire;
43  class WireGeometryController;
44 
46  typedef agx::HashVector< Node*, GeometryContactVector > NodePtrGeometryContactVectorTable;
47  typedef agx::Vector< std::pair< ShapeContactNode*, agx::Real> > ShapeContactRealPairVector;
48  typedef agx::HashVector<ShapeContactNodeRef, ShapeContactNodeRef> NodeMergePairHashVector;
49 
50  typedef agx::HashSet<agxCollide::Shape*> ShapeSet;
51  typedef agx::HashTable<ShapeContactNode*, ShapeSet > NodeShapeSetVector;
52 
53  class AGXPHYSICS_EXPORT WireContactController : public agx::Referenced
54  {
55  public:
56  WireContactController( Wire* wire );
57 
58  virtual agx::Bool handleGeometryContact(agxCollide::GeometryContact* geometryContact, agxCollide::Geometry* otherGeometry) = 0;
59 
60  agx::Vec3 calculateContactNodeShapeEdgeOffset(ContactNode* cln, agxCollide::Shape* shape, const agx::Real& wireRadius) const;
61 
62  virtual void preCollideUpdate() = 0;
63  virtual void preUpdate() = 0;
64  virtual void postUpdate() = 0;
65 
66  static Node* changeToContact(Node* node, Wire* wire, agxCollide::Shape* shape, const agx::Vec3& cPoint,
67  const agx::Vec3& cNormal, const agx::Real& cDepth, const agx::Bool removeNode);
68 
69  const agxSDK::SimulationProxy* getSimulationProxy() const;
70  agxWire::WireGeometryController* getGeometryController();
71  const agxWire::WireGeometryController* getGeometryController() const;
72  agxWire::WireDistanceCompositeConstraint* getWireDistanceCompositeConstraint();
73  const agxWire::WireDistanceCompositeConstraint* getWireDistanceCompositeConstraint() const;
74 
75  protected:
76 
77  void clearTempData();
78 
79  virtual ~WireContactController();
80 
81 
82  protected:
83  Wire* m_wire;
84  };
85 
86  typedef agx::ref_ptr< WireContactController > WireContactControllerRef;
87 }
88 
Referenced.h
agx::Real
double Real
Definition: Real.h:42
ShapeContactNode.h
agx::Vector
Templated vector class.
Definition: Vector.h:52
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
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
Node.h
Vec3.h
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
agxCollide::Shape
Base class for a shape.
Definition: Shape.h:53
agxWire
Implements a Wire model with adaptive resolution.
Definition: MergedBody.h:39
agx::LinearProbingHashTable
Inheritance with partial specialization due to bug with ref_ptr containers.
Definition: LinearProbingHashTable.h:871
agxCollide::Geometry
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
agxCollide::GeometryContactVector
agx::Vector< GeometryContact > GeometryContactVector
Definition: agxcollide_vector_types.h:41
agx::HashSet
Inheritance with partial specialization due to bug with ref_ptr containers.
Definition: HashSet.h:665
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:113
agxCollide
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Definition: ContactForceFilterParticipant.h:22
agx::Bool
bool Bool
Definition: Integer.h:48
agxCollide::GeometryContact
A contact between two geometries.
Definition: Contacts.h:269
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
agx::Vec3T< Real >
WireUtils.h
agx::HashVector
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition: HashVector.h:40
agxSDK::SimulationProxy
Interface class used by internal objects running in parallel.
Definition: SimulationProxy.h:49