AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
ConnectionIteratorTraits.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. 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
19#include <agxPowerLine/Sides.h>
22
23namespace agxPowerLine
24{
25
26 namespace detail
27 {
28
29 template<typename T>
31 {
32 public:
33 };
34
35 template<>
37 {
38 public:
42 typedef Side SideType;
43
45 {
46 return connection->getConnector();
47 }
48 };
49
50
51 template<>
53 {
54 public:
56 typedef const Connection* ConnectionPtr;
57 typedef const Connector* TargetPtr;
58 typedef Side SideType;
59
61 {
62 return connection->getConnector();
63 }
64 };
65
66 template<>
68 {
69 public:
73 typedef Side SideType;
74
76 {
77 return connection->getDimension();
78 }
79 };
80
81
82 template<>
84 {
85 public:
86 typedef const Connector* SourcePtr;
87 typedef const Connection* ConnectionPtr;
89 typedef Side SideType;
90
92 {
93 return connection->getDimension();
94 }
95 };
96
97
98
99
100 template<typename T>
102 {
103 public:
108
110 {
111 return source->getConnections((SideType)side);
112 }
113
114 static ConnectionPtr getConnection(SourcePtr source, Side side, size_t index)
115 {
116 return getConnections(source, side)[index];
117 }
118
120 {
121 return ConnectionIteratorTypes<T>::getTarget(connection);
122 }
123
124 static bool isConnectionValid(SourcePtr source, Side side, size_t index)
125 {
126 ConnectionPtr connection = getConnection(source, side, index);
127 return connection != 0 && getTarget(connection) != 0;
128 }
129 };
130
131 }
132}
const agxPowerLine::Connector * getConnector() const
const agxPowerLine::PhysicalDimension * getDimension() const
Links two connections together.
Definition: Connector.h:53
ConnectionIteratorTypes< T >::TargetPtr TargetPtr
static TargetPtr getTarget(ConnectionPtr connection)
static ConnectionPtr getConnection(SourcePtr source, Side side, size_t index)
ConnectionIteratorTypes< T >::ConnectionPtr ConnectionPtr
ConnectionIteratorTypes< T >::SourcePtr SourcePtr
static const ConnectionRefVector & getConnections(SourcePtr source, Side side)
static bool isConnectionValid(SourcePtr source, Side side, size_t index)
agxPowerLine contains a collection of connected components that transport power across a system.
Definition: MotorUnit.h:24