File indexing completed on 2026-10-02 09:13:36
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef Poly_CoherentTriPtr_HeaderFile
0017 #define Poly_CoherentTriPtr_HeaderFile
0018
0019 #include <NCollection_BaseAllocator.hxx>
0020 #include <NCollection_DefineAlloc.hxx>
0021
0022 class Poly_CoherentTriangle;
0023
0024 #ifdef _MSC_VER
0025 #pragma warning(push)
0026 #pragma warning(disable : 4355)
0027 #endif
0028
0029
0030
0031
0032
0033
0034 class Poly_CoherentTriPtr
0035 {
0036 public:
0037
0038
0039
0040
0041
0042 class Iterator
0043 {
0044 public:
0045
0046 inline Iterator()
0047 : myFirst(nullptr),
0048 myCurrent(nullptr)
0049 {
0050 }
0051
0052
0053 inline Iterator(const Poly_CoherentTriPtr& thePtr)
0054 : myFirst(&thePtr),
0055 myCurrent(&thePtr)
0056 {
0057 }
0058
0059
0060 inline const Poly_CoherentTriangle* First() const
0061 {
0062 return myFirst ? &myFirst->GetTriangle() : nullptr;
0063 }
0064
0065
0066 inline bool More() const { return myCurrent != nullptr; }
0067
0068
0069 Standard_EXPORT void Next();
0070
0071
0072 inline const Poly_CoherentTriangle& Value() const { return myCurrent->GetTriangle(); }
0073
0074
0075 inline Poly_CoherentTriangle& ChangeValue() const
0076 {
0077 return const_cast<Poly_CoherentTriangle&>(myCurrent->GetTriangle());
0078 }
0079
0080
0081 inline const Poly_CoherentTriPtr& PtrValue() const { return *myCurrent; }
0082
0083 private:
0084 const Poly_CoherentTriPtr* myFirst;
0085 const Poly_CoherentTriPtr* myCurrent;
0086 };
0087
0088
0089
0090
0091
0092
0093 inline Poly_CoherentTriPtr(const Poly_CoherentTriangle& theTri)
0094 : mypTriangle(&theTri),
0095 myNext(this),
0096 myPrevious(this)
0097 {
0098 }
0099
0100
0101
0102
0103 DEFINE_NCOLLECTION_ALLOC
0104
0105
0106
0107
0108 inline const Poly_CoherentTriangle& GetTriangle() const { return *mypTriangle; }
0109
0110
0111
0112
0113 inline void SetTriangle(const Poly_CoherentTriangle* pTri) { mypTriangle = pTri; }
0114
0115
0116
0117
0118 inline Poly_CoherentTriPtr& Next() const { return *myNext; }
0119
0120
0121
0122
0123 inline Poly_CoherentTriPtr& Previous() const { return *myPrevious; }
0124
0125
0126
0127
0128
0129
0130
0131
0132 Standard_EXPORT void Append(const Poly_CoherentTriangle* pTri,
0133 const occ::handle<NCollection_BaseAllocator>& theA);
0134
0135
0136
0137
0138
0139
0140
0141
0142 Standard_EXPORT void Prepend(const Poly_CoherentTriangle* pTri,
0143 const occ::handle<NCollection_BaseAllocator>& theA);
0144
0145
0146
0147
0148
0149
0150
0151
0152 Standard_EXPORT static void Remove(Poly_CoherentTriPtr* thePtr,
0153 const occ::handle<NCollection_BaseAllocator>& theA);
0154
0155
0156
0157
0158 Standard_EXPORT static void RemoveList(Poly_CoherentTriPtr* thePtr,
0159 const occ::handle<NCollection_BaseAllocator>&);
0160
0161 protected:
0162
0163
0164
0165
0166
0167 inline Poly_CoherentTriPtr(const Poly_CoherentTriangle* pTri)
0168 : mypTriangle(pTri),
0169 myNext(this),
0170 myPrevious(this)
0171 {
0172 }
0173
0174 private:
0175
0176
0177 const Poly_CoherentTriangle* mypTriangle;
0178 Poly_CoherentTriPtr* myNext;
0179 Poly_CoherentTriPtr* myPrevious;
0180
0181 friend class Iterator;
0182 };
0183
0184 #ifdef _MSC_VER
0185 #pragma warning(pop)
0186 #endif
0187
0188 #endif