File indexing completed on 2025-01-18 10:04:05
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
0027 class IMeshData_Edge : public IMeshData_TessellatedShape, public IMeshData_StatusOwner
0028 {
0029 public:
0030
0031
0032 virtual ~IMeshData_Edge()
0033 {
0034 }
0035
0036
0037 const TopoDS_Edge& GetEdge () const
0038 {
0039 return TopoDS::Edge (GetShape ());
0040 }
0041
0042
0043 Standard_EXPORT virtual Standard_Integer PCurvesNb () const = 0;
0044
0045
0046 Standard_EXPORT virtual const IMeshData::IPCurveHandle& AddPCurve (
0047 const IMeshData::IFacePtr& theDFace,
0048 const TopAbs_Orientation theOrientation) = 0;
0049
0050
0051 Standard_EXPORT virtual const IMeshData::IPCurveHandle& GetPCurve (
0052 const IMeshData::IFacePtr& theDFace,
0053 const TopAbs_Orientation theOrientation) const = 0;
0054
0055
0056 Standard_EXPORT virtual const IMeshData::IPCurveHandle& GetPCurve (
0057 const Standard_Integer theIndex) const = 0;
0058
0059
0060 void Clear(const Standard_Boolean isKeepEndPoints)
0061 {
0062 myCurve->Clear(isKeepEndPoints);
0063 for (Standard_Integer aPCurveIt = 0; aPCurveIt < PCurvesNb(); ++aPCurveIt)
0064 {
0065 GetPCurve(aPCurveIt)->Clear(isKeepEndPoints);
0066 }
0067 }
0068
0069
0070 Standard_Boolean IsFree () const
0071 {
0072 return (PCurvesNb () == 0);
0073 }
0074
0075
0076 void SetCurve (const IMeshData::ICurveHandle& theCurve)
0077 {
0078 myCurve = theCurve;
0079 }
0080
0081
0082 const IMeshData::ICurveHandle& GetCurve () const
0083 {
0084 return myCurve;
0085 }
0086
0087
0088 Standard_Real GetAngularDeflection () const
0089 {
0090 return myAngDeflection;
0091 }
0092
0093
0094 void SetAngularDeflection (const Standard_Real theValue)
0095 {
0096 myAngDeflection = theValue;
0097 }
0098
0099
0100
0101 Standard_Boolean GetSameParam () const
0102 {
0103 return mySameParam;
0104 }
0105
0106
0107 void SetSameParam (const Standard_Boolean theValue)
0108 {
0109 mySameParam = theValue;
0110 }
0111
0112
0113
0114 Standard_Boolean GetSameRange () const
0115 {
0116 return mySameRange;
0117 }
0118
0119
0120 void SetSameRange (const Standard_Boolean theValue)
0121 {
0122 mySameRange = theValue;
0123 }
0124
0125
0126
0127 Standard_Boolean GetDegenerated () const
0128 {
0129 return myDegenerated;
0130 }
0131
0132
0133 void SetDegenerated (const Standard_Boolean theValue)
0134 {
0135 myDegenerated = theValue;
0136 }
0137
0138 DEFINE_STANDARD_RTTIEXT(IMeshData_Edge, IMeshData_TessellatedShape)
0139
0140 protected:
0141
0142
0143
0144 IMeshData_Edge (const TopoDS_Edge& theEdge)
0145 : IMeshData_TessellatedShape(theEdge),
0146 mySameParam (BRep_Tool::SameParameter(theEdge)),
0147 mySameRange (BRep_Tool::SameRange (theEdge)),
0148 myDegenerated(BRep_Tool::Degenerated (theEdge)),
0149 myAngDeflection(RealLast())
0150 {
0151 }
0152
0153 private:
0154
0155 Standard_Boolean mySameParam;
0156 Standard_Boolean mySameRange;
0157 Standard_Boolean myDegenerated;
0158 Standard_Real myAngDeflection;
0159 IMeshData::ICurveHandle myCurve;
0160 };
0161
0162 #endif