File indexing completed on 2025-01-18 10:03:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _ChFiDS_CommonPoint_HeaderFile
0018 #define _ChFiDS_CommonPoint_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023
0024 #include <TopoDS_Edge.hxx>
0025 #include <TopoDS_Vertex.hxx>
0026 #include <gp_Pnt.hxx>
0027 #include <gp_Vec.hxx>
0028 #include <Standard_Boolean.hxx>
0029 #include <TopAbs_Orientation.hxx>
0030
0031
0032
0033
0034
0035 class ChFiDS_CommonPoint
0036 {
0037 public:
0038
0039 DEFINE_STANDARD_ALLOC
0040
0041
0042
0043 Standard_EXPORT ChFiDS_CommonPoint();
0044
0045
0046 Standard_EXPORT void Reset();
0047
0048
0049
0050
0051 void SetVertex (const TopoDS_Vertex& theVertex)
0052 {
0053 isvtx = Standard_True;
0054 vtx = theVertex;
0055 }
0056
0057
0058
0059 Standard_EXPORT void SetArc (const Standard_Real Tol, const TopoDS_Edge& A, const Standard_Real Param, const TopAbs_Orientation TArc);
0060
0061
0062 Standard_EXPORT void SetParameter (const Standard_Real Param);
0063
0064
0065
0066 void SetPoint (const gp_Pnt& thePoint) { point = thePoint; }
0067
0068
0069 void SetVector (const gp_Vec& theVector)
0070 {
0071 hasvector = Standard_True;
0072 vector = theVector;
0073 }
0074
0075
0076 void SetTolerance (const Standard_Real Tol)
0077 {
0078 if (Tol > tol)
0079 {
0080 tol = Tol;
0081 }
0082 }
0083
0084
0085 Standard_Real Tolerance() const { return tol; }
0086
0087
0088
0089 Standard_Boolean IsVertex() const { return isvtx; }
0090
0091
0092
0093
0094
0095 const TopoDS_Vertex& Vertex() const
0096 {
0097 if (!isvtx) { throw Standard_DomainError(); }
0098 return vtx;
0099 }
0100
0101
0102
0103 Standard_Boolean IsOnArc() const { return isonarc; }
0104
0105
0106
0107 Standard_EXPORT const TopoDS_Edge& Arc() const;
0108
0109
0110
0111 Standard_EXPORT TopAbs_Orientation TransitionOnArc() const;
0112
0113
0114
0115 Standard_EXPORT Standard_Real ParameterOnArc() const;
0116
0117
0118 Standard_EXPORT Standard_Real Parameter() const;
0119
0120
0121 const gp_Pnt& Point() const { return point; }
0122
0123
0124 Standard_Boolean HasVector() const { return hasvector; }
0125
0126
0127 const gp_Vec& Vector() const
0128 {
0129 if (!hasvector) { throw Standard_DomainError ("ChFiDS_CommonPoint::Vector"); }
0130 return vector;
0131 }
0132
0133 private:
0134
0135 TopoDS_Edge arc;
0136 TopoDS_Vertex vtx;
0137 gp_Pnt point;
0138 gp_Vec vector;
0139 Standard_Real tol;
0140 Standard_Real prmarc;
0141 Standard_Real prmtg;
0142 TopAbs_Orientation traarc;
0143 Standard_Boolean isonarc;
0144 Standard_Boolean isvtx;
0145 Standard_Boolean hasvector;
0146
0147 };
0148
0149 #endif