AGX Dynamics  2.35.0.1
Route.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 #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:
44 
47 
49 
52 
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 
68 
69  protected:
72 
76  };
77 
78 
80 
86  {
87  public:
88  explicit IdentityRoute(agx::Real resolution);
91 
93 
94  protected:
97  };
98 
99 
101 
108  {
109  public:
113  explicit SegmentingRoute(agx::Real startingResolution);
114 
117 
118  public:
119  SegmentingRoute(agx::Real resolution, agx::Real originalResolution, agx::Real maxAllowedError,
120  agxCable::RoutingNodeRefVector&& routingNodes,
124 
125  protected:
128  };
129 
130 
137  {
138  public:
139  explicit PathRoute(agx::Real targetResolution);
142 
143  public:
146 
147  protected:
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
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#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
#define AGXCABLE_EXPORT
An ordered collection of agxCable::Node objects that has been added to a particular cable.
Definition: Route.h:41
virtual void restore(agxStream::InputArchive &in) override
virtual agxCable::RouteInitializationReport initialize()=0
HomogeneousSegmentsRoute(agx::Real resolution, agx::Real maxAllowedError)
const agxCable::CableSegmentRefVector & getSegments() const
HomogeneousSegmentsRoute(agx::Real resolution, agx::Real originalResolution, agx::Real maxAllowedError, agxCable::RoutingNodeRefVector &&routingNodes, agxCable::CableSegmentRefVector &&segments)
agx::Real m_originalResolution
The resolution supplied to the constructor. Resolution search always start here.
Definition: Route.h:74
void setMaxAllowedError(agx::Real error)
virtual void store(agxStream::OutputArchive &out) const override
agxCable::CableSegmentRefVector m_segments
Definition: Route.h:71
agx::Real getMaxAllowedError() const
agxCable::RoutingNodeRefVector m_routingNodes
Definition: Route.h:70
agx::Real m_resolution
The current resolution, updated by running the segmentation algorithm.
Definition: Route.h:73
bool add(agxCable::RoutingNode *node)
virtual agxCable::RouteInitializationReport tryInitialize()=0
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(agxCable::Route)
const agxCable::RoutingNodeRefVector & getRouteNodes() const
A route that creates segments directly from the routing nodes.
Definition: Route.h:86
virtual agxCable::RouteInitializationReport initialize() override
virtual agxCable::RouteInitializationReport tryInitialize() override
IdentityRoute(agx::Real resolution)
A route that creates a path roughly following the routing nodes.
Definition: Route.h:137
virtual agxCable::RouteInitializationReport initialize() override
PathRoute(agx::Real targetResolution)
virtual agxCable::RouteInitializationReport tryInitialize() override
Legacy route type that exist solely for the purpose of restoring old serializations.
Definition: Route.h:159
virtual ~Route()
Route(agx::Real resolutionPerUnitLength)
Create a new empty cable route with the given peferred resolution.
Base class for route nodes that defines the path and some behavior of a cable.
Definition: agxCable/Node.h:37
A route that finds a segment length that divides the route legs as evenly as possible.
Definition: Route.h:108
SegmentingRoute(agx::Real resolution, agx::Real originalResolution, agx::Real maxAllowedError, agxCable::RoutingNodeRefVector &&routingNodes, agxCable::CableSegmentRefVector &&segments)
SegmentingRoute(agx::Real startingResolution)
virtual agxCable::RouteInitializationReport initialize() override
virtual agxCable::RouteInitializationReport tryInitialize() override
Routing implementation where the user add 'points', i.e., orientation is neglected.
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:52
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:57
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:45
Base class providing referencing counted objects.
Definition: Referenced.h:114
Contain classes for 6 DOF lumped element cables/wires/ropes.
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
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.
double Real
Definition: Real.h:42