AGXDynamics  2.35.0.3
RenderIterator.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 #include <agxWire/Node.h>
20 
21 namespace agxWire
22 {
27  {
28  public:
31  ~RenderIterator();
32 
33  agxWire::RenderIterator& operator= ( const agxWire::RenderIterator& other );
34  const agxWire::NodeRef& operator* () const;
35  const agxWire::NodeRef* operator-> () const;
36 
37  bool operator== ( const agxWire::RenderIterator& other ) const;
38  bool operator!= ( const agxWire::RenderIterator& other ) const;
39  agxWire::RenderIterator& operator++ ();
40  agxWire::RenderIterator& operator-- ();
41  agxWire::RenderIterator operator++ (int);
42  agxWire::RenderIterator operator-- (int);
43 
45  bool equal ( const agxWire::RenderIterator& other ) const;
46 
52 
58 
62  agxWire::RenderIterator next() const;
63 
67  agxWire::RenderIterator prev() const;
68 
72  agxWire::NodeConstIterator getIterator() const;
73 
77  agxWire::Node* get() const;
78 
79  private:
80  RenderIterator() {} // Not defined.
81 
82  private:
83  NodeConstIterator m_it;
84  };
85 
86  AGX_FORCE_INLINE RenderIterator::RenderIterator( agxWire::NodeConstIterator it )
87  : m_it( it )
88  {
89  }
90 
91  AGX_FORCE_INLINE RenderIterator::RenderIterator( const RenderIterator& other )
92  : m_it( other.m_it )
93  {
94  }
95 
97  {
98  }
99 
101  {
102  m_it = other.m_it;
103  return *this;
104  }
105 
107  {
108  return *m_it;
109  }
110 
112  {
113  return &(*m_it);
114  }
115 
117  {
118  return m_it == other.m_it;
119  }
120 
122  {
123  return m_it == other.m_it;
124  }
125 
127  {
128  return !(*this == other);
129  }
130 
132  {
133  return inc();
134  }
135 
137  {
138  return dec();
139  }
140 
142  {
143  return RenderIterator( m_it++ );
144  }
145 
147  {
148  return RenderIterator( m_it-- );
149  }
150 
152  {
153  ++m_it;
154  return *this;
155  }
156 
158  {
159  --m_it;
160  return *this;
161  }
162 
164  {
165  NodeConstIterator it = m_it;
166  return RenderIterator( ++it );
167  }
168 
170  {
171  NodeConstIterator it = m_it;
172  return RenderIterator( --it );
173  }
174 
176  {
177  return m_it;
178  }
179 
181  {
182  return *m_it;
183  }
184 }
185 
agxWire::RenderIterator::operator--
agxWire::RenderIterator & operator--()
Definition: RenderIterator.h:136
agxWire::RenderIterator::get
agxWire::Node * get() const
Definition: RenderIterator.h:180
agxWire::RenderIterator::operator->
const agxWire::NodeRef * operator->() const
Definition: RenderIterator.h:111
agxWire::RenderIterator::next
agxWire::RenderIterator next() const
Definition: RenderIterator.h:163
agx::operator*
Vec3T< T > operator*(const Vec3T< T > &v, const AffineMatrix4x4T< T > &m)
Definition: AffineMatrix4x4.h:864
agxWire::RenderIterator::operator==
bool operator==(const agxWire::RenderIterator &other) const
Definition: RenderIterator.h:121
agxWire::RenderIterator
Proxy class for wire iterators.
Definition: RenderIterator.h:26
agxWire::RenderIterator::~RenderIterator
~RenderIterator()
Definition: RenderIterator.h:96
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
Node.h
agxWire::RenderIterator::operator=
agxWire::RenderIterator & operator=(const agxWire::RenderIterator &other)
Definition: RenderIterator.h:100
agxWire::RenderIterator::operator++
agxWire::RenderIterator & operator++()
Definition: RenderIterator.h:131
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
agxWire
Implements a Wire model with adaptive resolution.
Definition: MergedBody.h:39
agx::operator!=
bool operator!=(T val, InvalidIndexStruct)
Definition: agx.h:196
agx::List::const_iterator
Definition: List.h:122
agxWire::RenderIterator::prev
agxWire::RenderIterator prev() const
Definition: RenderIterator.h:169
agxWire::RenderIterator::operator*
const agxWire::NodeRef & operator*() const
Definition: RenderIterator.h:106
agx::operator==
bool operator==(T val, InvalidIndexStruct)
Definition: agx.h:190
agxWire::RenderIterator::dec
agxWire::RenderIterator & dec()
Decrement this by one.
Definition: RenderIterator.h:157
agxWire::RenderIterator::getIterator
agxWire::NodeConstIterator getIterator() const
Definition: RenderIterator.h:175
agxWire::RenderIterator::operator!=
bool operator!=(const agxWire::RenderIterator &other) const
Definition: RenderIterator.h:126
agxWire::Node
Class defining a node that is part of a wire.
Definition: agxWire/Node.h:511
agxWire::RenderIterator::inc
agxWire::RenderIterator & inc()
Increment this by one.
Definition: RenderIterator.h:151
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition: macros.h:58
agxWire::RenderIterator::equal
bool equal(const agxWire::RenderIterator &other) const
same as ==, for SWIG
Definition: RenderIterator.h:116