File indexing completed on 2025-01-18 10:04:38
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 public:
0044
0045 inline Iterator ()
0046 : myFirst (0L),
0047 myCurrent (0L)
0048 {}
0049
0050 inline Iterator (const Poly_CoherentTriPtr& thePtr)
0051 : myFirst (&thePtr),
0052 myCurrent (&thePtr)
0053 {}
0054
0055 inline const Poly_CoherentTriangle * First () const
0056 { return myFirst ? &myFirst->GetTriangle() : 0L; }
0057
0058 inline Standard_Boolean More () const
0059 { return myCurrent != 0L; }
0060
0061 Standard_EXPORT void Next ();
0062
0063 inline const Poly_CoherentTriangle& Value () const
0064 { return myCurrent->GetTriangle(); }
0065
0066 inline Poly_CoherentTriangle& ChangeValue () const
0067 { return const_cast<Poly_CoherentTriangle&>(myCurrent->GetTriangle()); }
0068
0069 inline const Poly_CoherentTriPtr& PtrValue() const
0070 { return * myCurrent; }
0071 private:
0072 const Poly_CoherentTriPtr * myFirst;
0073 const Poly_CoherentTriPtr * myCurrent;
0074 };
0075
0076
0077
0078
0079
0080
0081
0082 inline Poly_CoherentTriPtr (const Poly_CoherentTriangle& theTri)
0083 : mypTriangle (&theTri),
0084 myNext (this),
0085 myPrevious (this)
0086 {}
0087
0088
0089
0090
0091 DEFINE_NCOLLECTION_ALLOC
0092
0093
0094
0095
0096 inline const Poly_CoherentTriangle&
0097 GetTriangle () const
0098 { return * mypTriangle; }
0099
0100
0101
0102
0103 inline void SetTriangle (const Poly_CoherentTriangle * pTri)
0104 { mypTriangle = pTri; }
0105
0106
0107
0108
0109 inline Poly_CoherentTriPtr&
0110 Next () const
0111 { return * myNext; }
0112
0113
0114
0115
0116 inline Poly_CoherentTriPtr&
0117 Previous () const
0118 { return * myPrevious; }
0119
0120
0121
0122
0123
0124
0125
0126
0127 Standard_EXPORT void Append (const Poly_CoherentTriangle * pTri,
0128 const Handle(NCollection_BaseAllocator)& theA);
0129
0130
0131
0132
0133
0134
0135
0136
0137 Standard_EXPORT void Prepend (const Poly_CoherentTriangle * pTri,
0138 const Handle(NCollection_BaseAllocator)& theA);
0139
0140
0141
0142
0143
0144
0145
0146
0147 Standard_EXPORT static void
0148 Remove (Poly_CoherentTriPtr * thePtr,
0149 const Handle(NCollection_BaseAllocator)& theA);
0150
0151
0152
0153
0154 Standard_EXPORT static void
0155 RemoveList (Poly_CoherentTriPtr * thePtr,
0156 const Handle(NCollection_BaseAllocator)&);
0157
0158 protected:
0159
0160
0161
0162
0163
0164 inline Poly_CoherentTriPtr (const Poly_CoherentTriangle * pTri)
0165 : mypTriangle (pTri),
0166 myNext (this),
0167 myPrevious (this)
0168 {}
0169
0170 private:
0171
0172
0173 const Poly_CoherentTriangle * mypTriangle;
0174 Poly_CoherentTriPtr * myNext;
0175 Poly_CoherentTriPtr * myPrevious;
0176
0177 friend class Iterator;
0178 };
0179
0180 #ifdef _MSC_VER
0181 #pragma warning (pop)
0182 #endif
0183
0184 #endif