AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
Deformable1DIterator.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. 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#ifndef AGXMODEL_DEFORMABLE1DITERATOR_H
18#define AGXMODEL_DEFORMABLE1DITERATOR_H
19
21
22namespace agxModel
23{
25 {
26 public:
30
32 const agxModel::Deformable1DNodeRef& operator* () const;
33 const agxModel::Deformable1DNodeRef* operator-> () const;
34
35 agx::Bool operator== ( const agxModel::Deformable1DIterator& other ) const;
36 agx::Bool operator!= ( const agxModel::Deformable1DIterator& other ) const;
37
38 agxModel::Deformable1DIterator& operator++ ();
39 agxModel::Deformable1DIterator& operator-- ();
40 agxModel::Deformable1DIterator operator++ ( int );
41 agxModel::Deformable1DIterator operator-- ( int );
42
47
51 agx::Bool isEnd() const;
52
56 agx::Bool equal( const agxModel::Deformable1DIterator& other ) const;
57
63
69
74
79
83 agxModel::Deformable1DNode* get() const;
84
88 const agxModel::Segment* getSegment() const;
89
90 private:
92 };
93
95 {
96 m_node = other.m_node;
97 return *this;
98 }
99
101 {
102 return m_node;
103 }
104
106 {
107 return &m_node;
108 }
109
111 {
112 return m_node == other.m_node;
113 }
114
116 {
117 return !( *this == other );
118 }
119
121 {
122 return inc();
123 }
124
126 {
127 return dec();
128 }
129
131 {
132 Deformable1DIterator ret = *this;
133 ++(*this);
134 return ret;
135 }
136
138 {
139 Deformable1DIterator ret = *this;
140 --(*this);
141 return ret;
142 }
143
145 {
146 return m_node == nullptr;
147 }
148
150 {
151 return *this == other;
152 }
153
155 {
156 if ( m_node == nullptr )
157 return *this;
158
159 m_node = m_node->getNumBranches() > 0 ? static_cast< Deformable1DNode* >(m_node->getBranch(0)) : nullptr;
160
161 return *this;
162 }
163
165 {
166 if ( m_node == nullptr )
167 return *this;
168
169 m_node = static_cast< Deformable1DNode* >(m_node->getParent());
170
171 return *this;
172 }
173
175 {
176 return Deformable1DIterator(m_node != nullptr && m_node->getNumBranches() > 0 ? static_cast< Deformable1DNode* >(m_node->getBranch(0)) : nullptr);
177 }
178
180 {
181 return Deformable1DIterator(m_node != nullptr ? static_cast< Deformable1DNode* >(m_node->getParent()) : nullptr);
182 }
183
185 {
186 return m_node;
187 }
188
190 {
191 return m_node != nullptr ? m_node->getSegment() : nullptr;
192 }
193}
194
195#endif // AGXMODEL_DEFORMABLE1DITERATOR_H
#define AGXMODEL_EXPORT
agxModel::Deformable1DIterator & inc()
Increment this by one.
agx::Bool equal(const agxModel::Deformable1DIterator &other) const
Same as == to be used with exports to languages with not complete support for operator overloading.
agxModel::Deformable1DIterator prev() const
const agxModel::Deformable1DNodeRef & operator*() const
agxModel::Deformable1DIterator & operator--()
agx::Bool operator==(const agxModel::Deformable1DIterator &other) const
agxModel::Deformable1DIterator & operator=(const agxModel::Deformable1DIterator &other)
agx::Bool operator!=(const agxModel::Deformable1DIterator &other) const
agxModel::Deformable1DNode * get() const
agxModel::Deformable1DIterator & dec()
Decrement this by one.
const agxModel::Segment * getSegment() const
agxModel::Deformable1DIterator & operator++()
agxModel::Deformable1DIterator next() const
const agxModel::Deformable1DNodeRef * operator->() const
Deformable1DIterator(agxModel::Deformable1DNodeRef node)
Deformable1DIterator(const agxModel::Deformable1DIterator &other)
Special node implementation of segments in e.g., a Deformable1D object.
A Deformable1D segment is the segment between two nodes, or if this is the last segment,...
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition FlowUnit.h:37
bool Bool
Definition Integer.h:40