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_CoherentNode_HeaderFile
0017 #define Poly_CoherentNode_HeaderFile
0018
0019 #include <gp_XYZ.hxx>
0020 #include <Poly_CoherentTriPtr.hxx>
0021 #include <Precision.hxx>
0022
0023 class NCollection_BaseAllocator;
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 class Poly_CoherentNode : public gp_XYZ
0037 {
0038 public:
0039
0040
0041
0042
0043
0044
0045 inline Poly_CoherentNode ()
0046 : gp_XYZ (0., 0., 0.),
0047 myTriangles (0L),
0048 myIndex (-1)
0049 { myUV[0] = Precision::Infinite(); myUV[1] = Precision::Infinite(); }
0050
0051
0052
0053
0054 inline Poly_CoherentNode (const gp_XYZ& thePnt)
0055 : gp_XYZ (thePnt),
0056 myTriangles (0L),
0057 myIndex (-1)
0058 { myUV[0] = Precision::Infinite(); myUV[1] = Precision::Infinite(); myNormal[0] = 0.f; myNormal[1] = 0.f; myNormal[2] = 0.f; }
0059
0060
0061
0062
0063 inline void SetUV (const Standard_Real theU,
0064 const Standard_Real theV)
0065 { myUV[0] = theU; myUV[1] = theV; }
0066
0067
0068
0069
0070 inline Standard_Real GetU () const
0071 { return myUV[0]; }
0072
0073
0074
0075
0076 inline Standard_Real GetV () const
0077 { return myUV[1]; }
0078
0079
0080
0081
0082 Standard_EXPORT void SetNormal (const gp_XYZ& theVector);
0083
0084
0085
0086
0087 inline Standard_Boolean HasNormal () const
0088 { return ((myNormal[0]*myNormal[0] + myNormal[1]*myNormal[1] +
0089 myNormal[2]*myNormal[2]) > Precision::Confusion()); }
0090
0091
0092
0093
0094 inline gp_XYZ GetNormal () const
0095 { return gp_XYZ (myNormal[0], myNormal[1], myNormal[2]); }
0096
0097
0098
0099
0100 inline void SetIndex (const Standard_Integer theIndex)
0101 { myIndex = theIndex; }
0102
0103
0104
0105
0106 inline Standard_Integer GetIndex () const
0107 { return myIndex; }
0108
0109
0110
0111
0112
0113 inline Standard_Boolean IsFreeNode () const
0114 { return myTriangles == 0L; }
0115
0116
0117
0118
0119 Standard_EXPORT void Clear (const Handle(NCollection_BaseAllocator)&);
0120
0121
0122
0123
0124 Standard_EXPORT void AddTriangle
0125 (const Poly_CoherentTriangle& theTri,
0126 const Handle(NCollection_BaseAllocator)& theA);
0127
0128
0129
0130
0131 Standard_EXPORT Standard_Boolean
0132 RemoveTriangle
0133 (const Poly_CoherentTriangle& theTri,
0134 const Handle(NCollection_BaseAllocator)& theA);
0135
0136
0137
0138
0139 inline Poly_CoherentTriPtr::Iterator
0140 TriangleIterator () const
0141 { return * myTriangles; }
0142
0143 Standard_EXPORT void Dump (Standard_OStream& theStream) const;
0144
0145
0146
0147
0148
0149
0150
0151
0152 protected:
0153
0154
0155
0156
0157 private:
0158
0159
0160 Standard_Real myUV[2];
0161 Poly_CoherentTriPtr * myTriangles;
0162 Standard_Integer myIndex;
0163 Standard_ShortReal myNormal[3];
0164 };
0165
0166 #endif