CFx SDK Documentation  2020SP3
GiShellFaceIterator.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 
25 
26 #ifndef __ODGISHELLFACEITERATOR__
27 #define __ODGISHELLFACEITERATOR__
28 
29 #include "TD_PackPush.h"
30 
31 
37 {
38  const OdGePoint3d* _points;
39  const OdInt32* _faceList;
40 public:
42  : _points(0)
43  , _faceList(0)
44  {
45  }
46 
47  inline OdGiShellFaceIterator(const OdGePoint3d* points, const OdInt32* faceList)
48  {
49  set(points, faceList);
50  }
51 
52  inline void set(const OdGePoint3d* points, const OdInt32* faceList)
53  {
54  _points = points;
55  _faceList = faceList;
56  }
57 
58  inline const OdInt32* faceListPos() { return _faceList; }
59 
60  inline const OdGePoint3d& operator *() const
61  {
62  return _points[*_faceList];
63  }
64  inline operator const OdGePoint3d*() const
65  {
66  return _points + (*_faceList);
67  }
68  inline const OdGePoint3d* operator ->() const
69  {
70  return _points + *_faceList;
71  }
73  {
74  ++_faceList;
75  return *this;
76  }
78  {
79  OdGiShellFaceIterator res(*this);
80  ++_faceList;
81  return res;
82  }
84  {
85  --_faceList;
86  return *this;
87  }
89  {
90  OdGiShellFaceIterator res(*this);
91  --_faceList;
92  return res;
93  }
94  inline OdGiShellFaceIterator& operator += (const int n)
95  {
96  _faceList+=n;
97  return *this;
98  }
99  inline OdGiShellFaceIterator& operator -= (const int n)
100  {
101  _faceList-=n;
102  return *this;
103  }
104  inline OdGiShellFaceIterator operator + (const int n) const
105  {
106  OdGiShellFaceIterator res(*this);
107  res+=n;
108  return res;
109  }
110  inline OdGiShellFaceIterator operator - (const int n) const
111  {
112  OdGiShellFaceIterator res(*this);
113  res-=n;
114  return res;
115  }
116  inline bool operator < (const OdGiShellFaceIterator& op) const
117  {
118  return _faceList < op._faceList;
119  }
120  inline bool operator < (const OdInt32* op) const
121  {
122  return _faceList < op;
123  }
124 };
125 
126 #include "TD_PackPop.h"
127 
128 #endif // __ODGISHELLFACEITERATOR__
OdGiShellFaceIterator::operator-
OdGiShellFaceIterator operator-(const int n) const
Definition: GiShellFaceIterator.h:110
OdGiShellFaceIterator::faceListPos
const OdInt32 * faceListPos()
Definition: GiShellFaceIterator.h:58
OdGiShellFaceIterator::OdGiShellFaceIterator
OdGiShellFaceIterator()
Definition: GiShellFaceIterator.h:41
OdGiShellFaceIterator::operator--
OdGiShellFaceIterator & operator--()
Definition: GiShellFaceIterator.h:83
TD_PackPop.h
OdGiShellFaceIterator
Definition: GiShellFaceIterator.h:37
OdGiShellFaceIterator::operator<
bool operator<(const OdGiShellFaceIterator &op) const
Definition: GiShellFaceIterator.h:116
OdGiShellFaceIterator::operator+=
OdGiShellFaceIterator & operator+=(const int n)
Definition: GiShellFaceIterator.h:94
OdGiShellFaceIterator::OdGiShellFaceIterator
OdGiShellFaceIterator(const OdGePoint3d *points, const OdInt32 *faceList)
Definition: GiShellFaceIterator.h:47
OdGePoint3d
Definition: GePoint3d.h:55
OdInt32
int OdInt32
Definition: OdPlatformSettings.h:782
OdGiShellFaceIterator::set
void set(const OdGePoint3d *points, const OdInt32 *faceList)
Definition: GiShellFaceIterator.h:52
TD_PackPush.h
OdGiShellFaceIterator::operator*
const OdGePoint3d & operator*() const
Definition: GiShellFaceIterator.h:60
OdGiShellFaceIterator::operator->
const OdGePoint3d * operator->() const
Definition: GiShellFaceIterator.h:68
OdGiShellFaceIterator::operator++
OdGiShellFaceIterator & operator++()
Definition: GiShellFaceIterator.h:72
OdGiShellFaceIterator::operator-=
OdGiShellFaceIterator & operator-=(const int n)
Definition: GiShellFaceIterator.h:99
OdGiShellFaceIterator::operator+
OdGiShellFaceIterator operator+(const int n) const
Definition: GiShellFaceIterator.h:104