Warning, file /include/opencascade/Contap_TheIWLineOfTheIWalking.hxx was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Contap_TheIWLineOfTheIWalking_HeaderFile
0018 #define _Contap_TheIWLineOfTheIWalking_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022
0023 #include <IntSurf_Couple.hxx>
0024 #include <NCollection_Sequence.hxx>
0025 #include <Standard_Boolean.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <IntSurf_PathPoint.hxx>
0028 #include <gp_Vec.hxx>
0029 #include <Standard_Transient.hxx>
0030 #include <IntSurf_Allocator.hxx>
0031 #include <IntSurf_LineOn2S.hxx>
0032 class Standard_OutOfRange;
0033 class Standard_DomainError;
0034 class IntSurf_PathPoint;
0035 class IntSurf_PntOn2S;
0036 class gp_Vec;
0037
0038 class Contap_TheIWLineOfTheIWalking : public Standard_Transient
0039 {
0040
0041 public:
0042 Standard_EXPORT Contap_TheIWLineOfTheIWalking(const IntSurf_Allocator& theAllocator = nullptr);
0043
0044
0045 Standard_EXPORT void Reverse();
0046
0047
0048 void Cut(const int Index);
0049
0050
0051 void AddPoint(const IntSurf_PntOn2S& P);
0052
0053 void AddStatusFirst(const bool Closed, const bool HasFirst);
0054
0055 void AddStatusFirst(const bool Closed,
0056 const bool HasLast,
0057 const int Index,
0058 const IntSurf_PathPoint& P);
0059
0060 void AddStatusFirstLast(const bool Closed, const bool HasFirst, const bool HasLast);
0061
0062 void AddStatusLast(const bool HasLast);
0063
0064 void AddStatusLast(const bool HasLast, const int Index, const IntSurf_PathPoint& P);
0065
0066
0067
0068 void AddIndexPassing(const int Index);
0069
0070 void SetTangentVector(const gp_Vec& V, const int Index);
0071
0072 void SetTangencyAtBegining(const bool IsTangent);
0073
0074 void SetTangencyAtEnd(const bool IsTangent);
0075
0076
0077
0078 int NbPoints() const;
0079
0080
0081
0082 const IntSurf_PntOn2S& Value(const int Index) const;
0083
0084
0085 const occ::handle<IntSurf_LineOn2S>& Line() const;
0086
0087
0088 bool IsClosed() const;
0089
0090
0091
0092
0093
0094 bool HasFirstPoint() const;
0095
0096
0097
0098
0099
0100
0101 bool HasLastPoint() const;
0102
0103
0104
0105
0106 const IntSurf_PathPoint& FirstPoint() const;
0107
0108
0109
0110
0111
0112 int FirstPointIndex() const;
0113
0114
0115
0116
0117 const IntSurf_PathPoint& LastPoint() const;
0118
0119
0120
0121
0122
0123 int LastPointIndex() const;
0124
0125
0126
0127 int NbPassingPoint() const;
0128
0129
0130
0131
0132 void PassingPoint(const int Index, int& IndexLine, int& IndexPnts) const;
0133
0134 const gp_Vec& TangentVector(int& Index) const;
0135
0136 bool IsTangentAtBegining() const;
0137
0138 bool IsTangentAtEnd() const;
0139
0140 DEFINE_STANDARD_RTTI_INLINE(Contap_TheIWLineOfTheIWalking, Standard_Transient)
0141
0142 private:
0143 occ::handle<IntSurf_LineOn2S> line;
0144 NCollection_Sequence<IntSurf_Couple> couple;
0145 bool closed;
0146 bool hasFirst;
0147 bool hasLast;
0148 int firstIndex;
0149 int lastIndex;
0150 IntSurf_PathPoint theFirstPoint;
0151 IntSurf_PathPoint theLastPoint;
0152 int indextg;
0153 gp_Vec vcttg;
0154 bool istgtbeg;
0155 bool istgtend;
0156 };
0157
0158
0159
0160
0161
0162 inline void Contap_TheIWLineOfTheIWalking::Cut(const int Index)
0163 {
0164 occ::handle<IntSurf_LineOn2S> lost = line->Split(Index);
0165 }
0166
0167 inline void Contap_TheIWLineOfTheIWalking::AddPoint(const IntSurf_PntOn2S& P)
0168 {
0169 line->Add(P);
0170 }
0171
0172 inline void Contap_TheIWLineOfTheIWalking::AddStatusFirst(const bool Closed, const bool HasFirst)
0173 {
0174 closed = Closed;
0175 hasFirst = HasFirst;
0176 }
0177
0178 inline void Contap_TheIWLineOfTheIWalking::AddStatusLast(const bool HasLast)
0179 {
0180 hasLast = HasLast;
0181 }
0182
0183 inline void Contap_TheIWLineOfTheIWalking::AddStatusFirst(const bool Closed,
0184 const bool HasFirst,
0185 const int Index,
0186 const IntSurf_PathPoint& P)
0187 {
0188 closed = Closed;
0189 hasFirst = HasFirst;
0190 firstIndex = Index;
0191 theFirstPoint = P;
0192 }
0193
0194 inline void Contap_TheIWLineOfTheIWalking::AddStatusLast(const bool HasLast,
0195 const int Index,
0196 const IntSurf_PathPoint& P)
0197 {
0198 hasLast = HasLast;
0199 lastIndex = Index;
0200 theLastPoint = P;
0201 }
0202
0203 inline void Contap_TheIWLineOfTheIWalking::AddStatusFirstLast(const bool Closed,
0204 const bool HasFirst,
0205 const bool HasLast)
0206 {
0207 closed = Closed;
0208 hasFirst = HasFirst;
0209 hasLast = HasLast;
0210 }
0211
0212 inline void Contap_TheIWLineOfTheIWalking::AddIndexPassing(const int Index)
0213 {
0214 couple.Append(IntSurf_Couple(line->NbPoints() + 1, Index));
0215 }
0216
0217 inline int Contap_TheIWLineOfTheIWalking::NbPoints() const
0218 {
0219 return line->NbPoints();
0220 }
0221
0222 inline const IntSurf_PntOn2S& Contap_TheIWLineOfTheIWalking::Value(const int Index) const
0223 {
0224 return line->Value(Index);
0225 }
0226
0227 inline const occ::handle<IntSurf_LineOn2S>& Contap_TheIWLineOfTheIWalking::Line() const
0228 {
0229 return line;
0230 }
0231
0232 inline bool Contap_TheIWLineOfTheIWalking::IsClosed() const
0233 {
0234 return closed;
0235 }
0236
0237 inline bool Contap_TheIWLineOfTheIWalking::HasFirstPoint() const
0238 {
0239 return hasFirst;
0240 }
0241
0242 inline int Contap_TheIWLineOfTheIWalking::FirstPointIndex() const
0243 {
0244 if (!hasFirst)
0245 throw Standard_DomainError();
0246 return firstIndex;
0247 }
0248
0249 inline const IntSurf_PathPoint& Contap_TheIWLineOfTheIWalking::FirstPoint() const
0250 {
0251 if (!hasFirst)
0252 throw Standard_DomainError();
0253 return theFirstPoint;
0254 }
0255
0256 inline bool Contap_TheIWLineOfTheIWalking::HasLastPoint() const
0257 {
0258 return hasLast;
0259 }
0260
0261 inline const IntSurf_PathPoint& Contap_TheIWLineOfTheIWalking::LastPoint() const
0262 {
0263 if (!hasLast)
0264 throw Standard_DomainError();
0265 return theLastPoint;
0266 }
0267
0268 inline int Contap_TheIWLineOfTheIWalking::LastPointIndex() const
0269 {
0270 if (!hasLast)
0271 throw Standard_DomainError();
0272 return lastIndex;
0273 }
0274
0275 inline int Contap_TheIWLineOfTheIWalking::NbPassingPoint() const
0276 {
0277 return couple.Length();
0278 }
0279
0280 inline void Contap_TheIWLineOfTheIWalking::PassingPoint(const int Index,
0281 int& IndexLine,
0282 int& IndexPnts) const
0283 {
0284 IndexLine = couple(Index).First();
0285 IndexPnts = couple(Index).Second();
0286 }
0287
0288 inline void Contap_TheIWLineOfTheIWalking::SetTangentVector(const gp_Vec& V, const int Index)
0289 {
0290 indextg = Index;
0291 vcttg = V;
0292 }
0293
0294 inline void Contap_TheIWLineOfTheIWalking::SetTangencyAtBegining(const bool IsTangent)
0295 {
0296 istgtend = IsTangent;
0297 }
0298
0299 inline void Contap_TheIWLineOfTheIWalking::SetTangencyAtEnd(const bool IsTangent)
0300 {
0301 istgtend = IsTangent;
0302 }
0303
0304 inline const gp_Vec& Contap_TheIWLineOfTheIWalking::TangentVector(int& Index) const
0305 {
0306 Index = indextg;
0307 return vcttg;
0308 }
0309
0310 inline bool Contap_TheIWLineOfTheIWalking::IsTangentAtBegining() const
0311 {
0312 return istgtbeg;
0313 }
0314
0315 inline bool Contap_TheIWLineOfTheIWalking::IsTangentAtEnd() const
0316 {
0317 return istgtend;
0318 }
0319
0320 #endif