AGX Dynamics  2.37.3.2
Route.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 #ifndef AGXCABLE_ROUTE_H
18 #define AGXCABLE_ROUTE_H
19 
20 #include <agx/Referenced.h>
21 
22 #include <agxStream/Serializable.h>
23 
24 #include <agxCable/Node.h>
25 #include <agxCable/CableSegment.h>
27 
28 
29 // Deformable1D classes are used solely for reading old serializations.
31 
32 namespace agxCable
33 {
35 
41  {
42  public:
43  bool add(agxCable::RoutingNode* node);
44 
45  void setMaxAllowedError(agx::Real error);
46  agx::Real getMaxAllowedError() const;
47 
48  agx::Real getResolution() const;
49 
50  const agxCable::RoutingNodeRefVector& getRouteNodes() const;
51  const agxCable::CableSegmentRefVector& getSegments() const;
52 
53  virtual agxCable::RouteInitializationReport initialize() = 0;
54  virtual agxCable::RouteInitializationReport tryInitialize() = 0;
55 
57  virtual void store(agxStream::OutputArchive& out) const override;
58  virtual void restore(agxStream::InputArchive& in) override;
59 
60  protected:
62  HomogeneousSegmentsRoute(agx::Real resolution, agx::Real maxAllowedError);
63  HomogeneousSegmentsRoute(agx::Real resolution, agx::Real originalResolution, agx::Real maxAllowedError,
64  agxCable::RoutingNodeRefVector&& routingNodes,
66 
67  virtual ~HomogeneousSegmentsRoute();
68 
69  protected:
72 
76  };
77 
78 
80 
86  {
87  public:
88  explicit IdentityRoute(agx::Real resolution);
89  virtual agxCable::RouteInitializationReport initialize() override;
90  virtual agxCable::RouteInitializationReport tryInitialize() override;
91 
93 
94  protected:
95  IdentityRoute();
96  ~IdentityRoute();
97  };
98 
99 
101 
108  {
109  public:
113  explicit SegmentingRoute(agx::Real startingResolution);
114 
115  virtual agxCable::RouteInitializationReport initialize() override;
116  virtual agxCable::RouteInitializationReport tryInitialize() override;
117 
118  public:
119  SegmentingRoute(agx::Real resolution, agx::Real originalResolution, agx::Real maxAllowedError,
120  agxCable::RoutingNodeRefVector&& routingNodes,
124 
125  protected:
126  SegmentingRoute();
127  ~SegmentingRoute();
128  };
129 
130 
137  {
138  public:
139  explicit PathRoute(agx::Real targetResolution);
140  virtual agxCable::RouteInitializationReport initialize() override;
141  virtual agxCable::RouteInitializationReport tryInitialize() override;
142 
143  public:
146 
147  protected:
148  PathRoute();
149  ~PathRoute();
150 
151  private:
152  agx::Real m_targetResolution;
153  };
154 
159  {
160  public:
165  explicit Route(agx::Real resolutionPerUnitLength);
166 
167  public:
169 
170  protected:
171  Route();
172  virtual ~Route();
173  };
174 }
175 
176 #endif
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
Definition: InputArchive.h:400
agxCable::CableSegmentRefVector m_segments
Definition: Route.h:71
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive...
agxCable::RoutingNodeRefVector m_routingNodes
Definition: Route.h:70
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
An ordered collection of agxCable::Node objects that has been added to a particular cable...
Definition: Route.h:40
A route that finds a segment length that divides the route legs as evenly as possible.
Definition: Route.h:107
Base class providing referencing counted objects.
Definition: Referenced.h:119
A route that creates a path roughly following the routing nodes.
Definition: Route.h:136
Contain classes for 6 DOF lumped element cables/wires/ropes.
Base class for route nodes that defines the path and some behavior of a cable.
Definition: agxCable/Node.h:36
agx::Real m_originalResolution
The resolution supplied to the constructor. Resolution search always start here.
Definition: Route.h:74
A route that creates segments directly from the routing nodes.
Definition: Route.h:85
agx::Real m_resolution
The current resolution, updated by running the segmentation algorithm.
Definition: Route.h:73
Legacy route type that exist solely for the purpose of restoring old serializations.
Definition: Route.h:158
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:51
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:56
virtual void restore(agxStream::InputArchive &in) override
Routing implementation where the user add &#39;points&#39;, i.e., orientation is neglected.
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
Definition: Serializable.h:221
double Real
Definition: Real.h:42
#define AGXCABLE_EXPORT