AGX Dynamics  2.37.2.0
WireSplitAlgorithm.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 
20 #include <agxWire/Node.h>
21 
23 
24 namespace agx
25 {
26  namespace Physics
27  {
28  class GraphNodeData;
29  }
30 }
31 
32 namespace agxWire
33 {
34  class Wire;
35 
37  class AGXPHYSICS_EXPORT WireSplitNode : public agx::SplitNode
38  {
39  public:
40  WireSplitNode( BodyFixedNode* node, size_t weight, agx::Index index );
41 
42  virtual void setChoosenToSplit(bool splittable) override;
46  static size_t singleNodeSolveCost() { return size_t(25); }
47  protected:
48  virtual ~WireSplitNode();
49 
50  private:
51  BodyFixedNode* m_bfn;
52  };
53  typedef agx::ref_ptr<WireSplitNode> WireSplitNodeRef;
54 
58  class AGXPHYSICS_EXPORT WireSplitAlgorithm : public agx::SolveIslandSplitAlgorithm
59  {
60  public:
61  WireSplitAlgorithm( agxWire::Wire* wire, size_t splitInfectedDistance = 1 );
62 
63  virtual void collectSplitInformation( agx::Physics::GraphNodeData* graphNode ) override;
64 
65  virtual bool getSplitEnabled( NodeConstIterator bfnIt ) const;
66 
67  virtual void clearSplitState() override;
68 
69  virtual void postSolveCleanup() override;
70 
71  protected:
72  virtual ~WireSplitAlgorithm() {}
73 
74  bool createSplitNode(NodeConstIterator it, size_t weight);
75  bool createSplitSeparatorNode( agx::Physics::GraphNodeData* graphNode, NodeConstIterator it);
76  bool updateSplitInfo( agx::Physics::GraphNodeData* graphNode, NodeConstIterator firstSplitNode, const size_t numAllowedConnections = 5 );
77 
78  NodeConstIterator findNextSplitNodeOrSeparator( agx::Physics::GraphNodeData* graphNode,
79  const NodeContainer& nodes,
80  const NodeConstIterator previousSplitnode,
81  const NodeConstIterator itEnd,
82  const size_t numAllowedConnections );
83 
84  NodeConstIterator findNextPossibleSplitNodeIterator( const agx::Physics::GraphNodeData* graphNode,
85  const NodeContainer& nodes,
87  const NodeConstIterator itEnd,
88  const size_t numAllowedConnections = 5);
89 
90  agxWire::Wire* m_wire;
91  };
92 
93 }
94 
NodeRefListA NodeContainer
Definition: agxWire/Node.h:53
#define AGXPHYSICS_EXPORT
The rigid body class, combining a geometric model and a frame of reference.
Interface and placeholder of controllers/helpers for wires.
Definition: Wire.h:61
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Implements a Wire model with adaptive resolution.
Definition: MergedBody.h:39
UInt32 Index
Definition: Integer.h:52
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
NodeContainer::const_iterator NodeConstIterator
Definition: agxWire/Node.h:57
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97