File indexing completed on 2026-09-28 09:19:47
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 class ChFiDS_CommonPoint
0035 {
0036 public:
0037 DEFINE_STANDARD_ALLOC
0038
0039
0040 Standard_EXPORT ChFiDS_CommonPoint();
0041
0042
0043 Standard_EXPORT void Reset();
0044
0045
0046
0047
0048 void SetVertex(const TopoDS_Vertex& theVertex)
0049 {
0050 isvtx = true;
0051 vtx = theVertex;
0052 }
0053
0054
0055
0056 Standard_EXPORT void SetArc(const double Tol,
0057 const TopoDS_Edge& A,
0058 const double Param,
0059 const TopAbs_Orientation TArc);
0060
0061
0062 Standard_EXPORT void SetParameter(const double 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 = true;
0072 vector = theVector;
0073 }
0074
0075
0076 void SetTolerance(const double Tol)
0077 {
0078 if (Tol > tol)
0079 {
0080 tol = Tol;
0081 }
0082 }
0083
0084
0085 double Tolerance() const { return tol; }
0086
0087
0088
0089 bool IsVertex() const { return isvtx; }
0090
0091
0092
0093
0094
0095 const TopoDS_Vertex& Vertex() const
0096 {
0097 if (!isvtx)
0098 {
0099 throw Standard_DomainError();
0100 }
0101 return vtx;
0102 }
0103
0104
0105
0106 bool IsOnArc() const { return isonarc; }
0107
0108
0109
0110 Standard_EXPORT const TopoDS_Edge& Arc() const;
0111
0112
0113
0114 Standard_EXPORT TopAbs_Orientation TransitionOnArc() const;
0115
0116
0117
0118 Standard_EXPORT double ParameterOnArc() const;
0119
0120
0121 Standard_EXPORT double Parameter() const;
0122
0123
0124 const gp_Pnt& Point() const { return point; }
0125
0126
0127 bool HasVector() const { return hasvector; }
0128
0129
0130 const gp_Vec& Vector() const
0131 {
0132 if (!hasvector)
0133 {
0134 throw Standard_DomainError("ChFiDS_CommonPoint::Vector");
0135 }
0136 return vector;
0137 }
0138
0139 private:
0140 TopoDS_Edge arc;
0141 TopoDS_Vertex vtx;
0142 gp_Pnt point;
0143 gp_Vec vector;
0144 double tol;
0145 double prmarc;
0146 double prmtg;
0147 TopAbs_Orientation traarc;
0148 bool isonarc;
0149 bool isvtx;
0150 bool hasvector;
0151 };
0152
0153 #endif