File indexing completed on 2026-09-14 09:14:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _IMeshData_Edge_HeaderFile
0017 #define _IMeshData_Edge_HeaderFile
0018
0019 #include <TopoDS_Edge.hxx>
0020 #include <IMeshData_Curve.hxx>
0021 #include <IMeshData_PCurve.hxx>
0022 #include <IMeshData_Types.hxx>
0023 #include <BRep_Tool.hxx>
0024
0025
0026 class IMeshData_Edge : public IMeshData_TessellatedShape, public IMeshData_StatusOwner
0027 {
0028 public:
0029
0030 ~IMeshData_Edge() override = default;
0031
0032
0033 const TopoDS_Edge& GetEdge() const { return TopoDS::Edge(GetShape()); }
0034
0035
0036 Standard_EXPORT virtual int PCurvesNb() const = 0;
0037
0038
0039 Standard_EXPORT virtual const IMeshData::IPCurveHandle& AddPCurve(
0040 const IMeshData::IFacePtr& theDFace,
0041 const TopAbs_Orientation theOrientation) = 0;
0042
0043
0044 Standard_EXPORT virtual const IMeshData::IPCurveHandle& GetPCurve(
0045 const IMeshData::IFacePtr& theDFace,
0046 const TopAbs_Orientation theOrientation) const = 0;
0047
0048
0049 Standard_EXPORT virtual const IMeshData::IPCurveHandle& GetPCurve(const int theIndex) const = 0;
0050
0051
0052 Standard_EXPORT virtual const IMeshData::ListOfInteger& GetPCurves(
0053 const IMeshData::IFacePtr& theDFace) const = 0;
0054
0055
0056 void Clear(const bool isKeepEndPoints)
0057 {
0058 myCurve->Clear(isKeepEndPoints);
0059 for (int aPCurveIt = 0; aPCurveIt < PCurvesNb(); ++aPCurveIt)
0060 {
0061 GetPCurve(aPCurveIt)->Clear(isKeepEndPoints);
0062 }
0063 }
0064
0065
0066 bool IsFree() const { return (PCurvesNb() == 0); }
0067
0068
0069 void SetCurve(const IMeshData::ICurveHandle& theCurve) { myCurve = theCurve; }
0070
0071
0072 const IMeshData::ICurveHandle& GetCurve() const { return myCurve; }
0073
0074
0075 double GetAngularDeflection() const { return myAngDeflection; }
0076
0077
0078 void SetAngularDeflection(const double theValue) { myAngDeflection = theValue; }
0079
0080
0081
0082 bool GetSameParam() const { return mySameParam; }
0083
0084
0085 void SetSameParam(const bool theValue) { mySameParam = theValue; }
0086
0087
0088
0089 bool GetSameRange() const { return mySameRange; }
0090
0091
0092 void SetSameRange(const bool theValue) { mySameRange = theValue; }
0093
0094
0095
0096 bool GetDegenerated() const { return myDegenerated; }
0097
0098
0099 void SetDegenerated(const bool theValue) { myDegenerated = theValue; }
0100
0101 DEFINE_STANDARD_RTTIEXT(IMeshData_Edge, IMeshData_TessellatedShape)
0102
0103 protected:
0104
0105
0106 IMeshData_Edge(const TopoDS_Edge& theEdge)
0107 : IMeshData_TessellatedShape(theEdge),
0108 mySameParam(BRep_Tool::SameParameter(theEdge)),
0109 mySameRange(BRep_Tool::SameRange(theEdge)),
0110 myDegenerated(BRep_Tool::Degenerated(theEdge)),
0111 myAngDeflection(RealLast())
0112 {
0113 }
0114
0115 private:
0116 bool mySameParam;
0117 bool mySameRange;
0118 bool myDegenerated;
0119 double myAngDeflection;
0120 IMeshData::ICurveHandle myCurve;
0121 };
0122
0123 #endif