File indexing completed on 2025-01-18 10:03:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Geom2d_VectorWithMagnitude_HeaderFile
0018 #define _Geom2d_VectorWithMagnitude_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022
0023 #include <Geom2d_Vector.hxx>
0024 class gp_Vec2d;
0025 class gp_Pnt2d;
0026 class gp_Trsf2d;
0027 class Geom2d_Geometry;
0028
0029
0030 class Geom2d_VectorWithMagnitude;
0031 DEFINE_STANDARD_HANDLE(Geom2d_VectorWithMagnitude, Geom2d_Vector)
0032
0033
0034
0035
0036 class Geom2d_VectorWithMagnitude : public Geom2d_Vector
0037 {
0038
0039 public:
0040
0041
0042
0043 Standard_EXPORT Geom2d_VectorWithMagnitude(const gp_Vec2d& V);
0044
0045
0046 Standard_EXPORT Geom2d_VectorWithMagnitude(const Standard_Real X, const Standard_Real Y);
0047
0048
0049
0050
0051 Standard_EXPORT Geom2d_VectorWithMagnitude(const gp_Pnt2d& P1, const gp_Pnt2d& P2);
0052
0053
0054 Standard_EXPORT void SetCoord (const Standard_Real X, const Standard_Real Y);
0055
0056 Standard_EXPORT void SetVec2d (const gp_Vec2d& V);
0057
0058
0059 Standard_EXPORT void SetX (const Standard_Real X);
0060
0061
0062 Standard_EXPORT void SetY (const Standard_Real Y);
0063
0064
0065 Standard_EXPORT Standard_Real Magnitude() const Standard_OVERRIDE;
0066
0067
0068 Standard_EXPORT Standard_Real SquareMagnitude() const Standard_OVERRIDE;
0069
0070
0071
0072 Standard_EXPORT void Add (const Handle(Geom2d_Vector)& Other);
0073 void operator += (const Handle(Geom2d_Vector)& Other)
0074 {
0075 Add(Other);
0076 }
0077
0078
0079
0080 Standard_NODISCARD Standard_EXPORT
0081 Handle(Geom2d_VectorWithMagnitude) Added (const Handle(Geom2d_Vector)& Other) const;
0082 Standard_NODISCARD Handle(Geom2d_VectorWithMagnitude) operator + (const Handle(Geom2d_Vector)& Other) const
0083 {
0084 return Added(Other);
0085 }
0086
0087
0088
0089
0090 Standard_EXPORT Standard_Real Crossed (const Handle(Geom2d_Vector)& Other) const Standard_OVERRIDE;
0091 Standard_Real operator ^ (const Handle(Geom2d_Vector)& Other) const
0092 {
0093 return Crossed(Other);
0094 }
0095
0096
0097 Standard_EXPORT void Divide (const Standard_Real Scalar);
0098 void operator /= (const Standard_Real Scalar)
0099 {
0100 Divide(Scalar);
0101 }
0102
0103
0104
0105 Standard_NODISCARD Standard_EXPORT Handle(Geom2d_VectorWithMagnitude) Divided (const Standard_Real Scalar) const;
0106 Standard_NODISCARD Handle(Geom2d_VectorWithMagnitude) operator / (const Standard_Real Scalar) const
0107 {
0108 return Divided(Scalar);
0109 }
0110
0111
0112
0113
0114
0115
0116
0117 Standard_NODISCARD Standard_EXPORT Handle(Geom2d_VectorWithMagnitude) Multiplied (const Standard_Real Scalar) const;
0118
0119
0120
0121 Standard_EXPORT void Multiply (const Standard_Real Scalar);
0122 void operator *= (const Standard_Real Scalar)
0123 {
0124 Multiply(Scalar);
0125 }
0126
0127
0128
0129
0130
0131 Standard_EXPORT void Normalize();
0132
0133
0134
0135
0136
0137 Standard_NODISCARD Standard_EXPORT Handle(Geom2d_VectorWithMagnitude) Normalized() const;
0138
0139
0140 Standard_EXPORT void Subtract (const Handle(Geom2d_Vector)& Other);
0141 void operator -= (const Handle(Geom2d_Vector)& Other)
0142 {
0143 Subtract(Other);
0144 }
0145
0146
0147
0148 Standard_NODISCARD Standard_EXPORT
0149 Handle(Geom2d_VectorWithMagnitude) Subtracted (const Handle(Geom2d_Vector)& Other) const;
0150 Standard_NODISCARD Handle(Geom2d_VectorWithMagnitude) operator - (const Handle(Geom2d_Vector)& Other) const
0151 {
0152 return Subtracted(Other);
0153 }
0154
0155
0156 Standard_EXPORT void Transform (const gp_Trsf2d& T) Standard_OVERRIDE;
0157
0158
0159 Standard_EXPORT Handle(Geom2d_Geometry) Copy() const Standard_OVERRIDE;
0160
0161
0162
0163
0164 DEFINE_STANDARD_RTTIEXT(Geom2d_VectorWithMagnitude,Geom2d_Vector)
0165
0166 protected:
0167
0168
0169
0170
0171 private:
0172
0173
0174
0175
0176 };
0177
0178
0179
0180
0181
0182
0183
0184 #endif