summaryrefslogtreecommitdiff
path: root/inc/Geom2d_VectorWithMagnitude.hxx
blob: 3c24ff3240b0289b567d4b66fec8c9bb8e2ff51a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _Geom2d_VectorWithMagnitude_HeaderFile
#define _Geom2d_VectorWithMagnitude_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_Geom2d_VectorWithMagnitude_HeaderFile
#include <Handle_Geom2d_VectorWithMagnitude.hxx>
#endif

#ifndef _Geom2d_Vector_HeaderFile
#include <Geom2d_Vector.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Handle_Geom2d_Vector_HeaderFile
#include <Handle_Geom2d_Vector.hxx>
#endif
#ifndef _Handle_Geom2d_Geometry_HeaderFile
#include <Handle_Geom2d_Geometry.hxx>
#endif
class Standard_ConstructionError;
class gp_Vec2d;
class gp_Pnt2d;
class Geom2d_Vector;
class gp_Trsf2d;
class Geom2d_Geometry;



//!  Defines a vector with magnitude. <br>
//!  A vector with magnitude can have a zero length. <br>
class Geom2d_VectorWithMagnitude : public Geom2d_Vector {

public:

  //! Creates a persistent copy of V. <br>
  Standard_EXPORT   Geom2d_VectorWithMagnitude(const gp_Vec2d& V);
  //! Creates a vector with two cartesian coordinates. <br>
  Standard_EXPORT   Geom2d_VectorWithMagnitude(const Standard_Real X,const Standard_Real Y);
  
//!  Creates a vector from the point P1 to the point P2. <br>
//!  The magnitude of the vector is the distance between P1 and P2 <br>
  Standard_EXPORT   Geom2d_VectorWithMagnitude(const gp_Pnt2d& P1,const gp_Pnt2d& P2);
  //!  Set <me> to X, Y coordinates. <br>
  Standard_EXPORT     void SetCoord(const Standard_Real X,const Standard_Real Y) ;
  
  Standard_EXPORT     void SetVec2d(const gp_Vec2d& V) ;
  //! Changes the X coordinate of <me>. <br>
  Standard_EXPORT     void SetX(const Standard_Real X) ;
  //!  Changes the Y coordinate of <me> <br>
  Standard_EXPORT     void SetY(const Standard_Real Y) ;
  //! Returns the magnitude of <me>. <br>
  Standard_EXPORT     Standard_Real Magnitude() const;
  //! Returns the square magnitude of <me>. <br>
  Standard_EXPORT     Standard_Real SquareMagnitude() const;
  
//!  Adds the Vector Other to <me>. <br>
  Standard_EXPORT     void Add(const Handle(Geom2d_Vector)& Other) ;
    void operator +=(const Handle(Geom2d_Vector)& Other) 
{
  Add(Other);
}
  
//!  Adds the vector Other to <me>. <br>
  Standard_EXPORT     Handle_Geom2d_VectorWithMagnitude Added(const Handle(Geom2d_Vector)& Other) const;
    Handle_Geom2d_VectorWithMagnitude operator +(const Handle(Geom2d_Vector)& Other) const
{
  return Added(Other);
}
  
//!  Computes the cross product  between <me> and Other <br>
//!  <me> ^ Other. A new vector is returned. <br>
  Standard_EXPORT     Standard_Real Crossed(const Handle(Geom2d_Vector)& Other) const;
    Standard_Real operator ^(const Handle(Geom2d_Vector)& Other) const
{
  return Crossed(Other);
}
  //! Divides <me> by a scalar. <br>
  Standard_EXPORT     void Divide(const Standard_Real Scalar) ;
    void operator /=(const Standard_Real Scalar) 
{
  Divide(Scalar);
}
  
//!  Divides <me> by a scalar. A new vector is returned. <br>
  Standard_EXPORT     Handle_Geom2d_VectorWithMagnitude Divided(const Standard_Real Scalar) const;
    Handle_Geom2d_VectorWithMagnitude operator /(const Standard_Real Scalar) const
{
  return Divided(Scalar);
}
  
//!  Computes the product of the vector <me> by a scalar. <br>
//!  A new vector is returned. <br>
//! <br>
//!  -C++: alias operator * <br>
//!  Collision with same operator defined for the class Vector! <br>
  Standard_EXPORT     Handle_Geom2d_VectorWithMagnitude Multiplied(const Standard_Real Scalar) const;
  
//!  Computes the product of the vector <me> by a scalar. <br>
  Standard_EXPORT     void Multiply(const Standard_Real Scalar) ;
    void operator *=(const Standard_Real Scalar) 
{
  Multiply(Scalar);
}
  //! Normalizes <me>. <br>
//!  Raised if the magnitude of the vector is lower or equal to <br>
//!  Resolution from package gp. <br>
  Standard_EXPORT     void Normalize() ;
  //! Returns a copy of <me> Normalized. <br>
//!  Raised if the magnitude of the vector is lower or equal to <br>
//!  Resolution from package gp. <br>
  Standard_EXPORT     Handle_Geom2d_VectorWithMagnitude Normalized() const;
  //! Subtracts the Vector Other to <me>. <br>
  Standard_EXPORT     void Subtract(const Handle(Geom2d_Vector)& Other) ;
    void operator -=(const Handle(Geom2d_Vector)& Other) 
{
  Subtract(Other);
}
  
//!  Subtracts the vector Other to <me>. A new vector is returned. <br>
  Standard_EXPORT     Handle_Geom2d_VectorWithMagnitude Subtracted(const Handle(Geom2d_Vector)& Other) const;
    Handle_Geom2d_VectorWithMagnitude operator -(const Handle(Geom2d_Vector)& Other) const
{
  return Subtracted(Other);
}
  //! Applies the transformation T to this vector. <br>
  Standard_EXPORT     void Transform(const gp_Trsf2d& T) ;
  //! Creates a new object which is a copy of this vector. <br>
  Standard_EXPORT     Handle_Geom2d_Geometry Copy() const;




  DEFINE_STANDARD_RTTI(Geom2d_VectorWithMagnitude)

protected:




private: 




};





// other Inline functions and methods (like "C++: function call" methods)


#endif