summaryrefslogtreecommitdiff
path: root/inc/gp_Pnt2d.hxx
blob: 7b99af17129cbd041d7d695a092d772fd77725f7 (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
166
167
168
169
170
171
172
// 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 _gp_Pnt2d_HeaderFile
#define _gp_Pnt2d_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _gp_XY_HeaderFile
#include <gp_XY.hxx>
#endif
#ifndef _Standard_Storable_HeaderFile
#include <Standard_Storable.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_PrimitiveTypes_HeaderFile
#include <Standard_PrimitiveTypes.hxx>
#endif
class Standard_OutOfRange;
class gp_XY;
class gp_Ax2d;
class gp_Trsf2d;
class gp_Vec2d;


Standard_EXPORT const Handle(Standard_Type)& STANDARD_TYPE(gp_Pnt2d);

//!  Defines  a non-persistent 2D cartesian point. <br>
class gp_Pnt2d  {

public:
  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  //! Creates a point with zero coordinates. <br>
      gp_Pnt2d();
  //! Creates a point with a doublet of coordinates. <br>
      gp_Pnt2d(const gp_XY& Coord);
  
//!  Creates a  point with its 2 cartesian's coordinates : Xp, Yp. <br>
      gp_Pnt2d(const Standard_Real Xp,const Standard_Real Yp);
  
//!  Assigns the value Xi to the coordinate that corresponds to Index: <br>
//!  Index = 1 => X is modified <br>
//!  Index = 2 => Y is modified <br>
//! Raises OutOfRange if Index != {1, 2}. <br>
        void SetCoord(const Standard_Integer Index,const Standard_Real Xi) ;
  //! For this point, assigns the values Xp and Yp to its two coordinates <br>
        void SetCoord(const Standard_Real Xp,const Standard_Real Yp) ;
  //! Assigns the given value to the X  coordinate of this point. <br>
        void SetX(const Standard_Real X) ;
  //! Assigns the given value to the Y  coordinate of this point. <br>
        void SetY(const Standard_Real Y) ;
  //! Assigns the two coordinates of Coord to this point. <br>
        void SetXY(const gp_XY& Coord) ;
  
//!  Returns the coordinate of range Index : <br>
//!  Index = 1 => X is returned <br>
//!  Index = 2 => Y is returned <br>
//! Raises OutOfRange if Index != {1, 2}. <br>
  Standard_EXPORT     Standard_Real Coord(const Standard_Integer Index) const;
  //! For this point returns its two coordinates as a number pair. <br>
        void Coord(Standard_Real& Xp,Standard_Real& Yp) const;
  //! For this point, returns its X  coordinate. <br>
        Standard_Real X() const;
  //! For this point, returns its Y coordinate. <br>
        Standard_Real Y() const;
  //! For this point, returns its two coordinates as a number pair. <br>
       const gp_XY& XY() const;
  //! For this point, returns its two coordinates as a number pair. <br>
       const gp_XY& Coord() const;
  
//! Returns the coordinates of this point. <br>
//! Note: This syntax allows direct modification of the returned value. <br>
        gp_XY& ChangeCoord() ;
  //! Comparison <br>
//!  Returns True if the distance between the two <br>
//!  points is lower or equal to LinearTolerance. <br>
        Standard_Boolean IsEqual(const gp_Pnt2d& Other,const Standard_Real LinearTolerance) const;
  //! Computes the distance between two points. <br>
        Standard_Real Distance(const gp_Pnt2d& Other) const;
  //! Computes the square distance between two points. <br>
        Standard_Real SquareDistance(const gp_Pnt2d& Other) const;
  
//!  Performs the symmetrical transformation of a point <br>
//!  with respect to the point P which is the center of <br>
//!  the  symmetry. <br>
  Standard_EXPORT     void Mirror(const gp_Pnt2d& P) ;
  
//!  Performs the symmetrical transformation of a point <br>
//!  with respect to an axis placement which is the axis <br>
  Standard_EXPORT     gp_Pnt2d Mirrored(const gp_Pnt2d& P) const;
  
  Standard_EXPORT     void Mirror(const gp_Ax2d& A) ;
  
//!  Rotates a point. A1 is the axis of the rotation. <br>
//!  Ang is the angular value of the rotation in radians. <br>
  Standard_EXPORT     gp_Pnt2d Mirrored(const gp_Ax2d& A) const;
  
        void Rotate(const gp_Pnt2d& P,const Standard_Real Ang) ;
  //! Scales a point. S is the scaling value. <br>
        gp_Pnt2d Rotated(const gp_Pnt2d& P,const Standard_Real Ang) const;
  
        void Scale(const gp_Pnt2d& P,const Standard_Real S) ;
  //! Transforms a point with the transformation T. <br>
        gp_Pnt2d Scaled(const gp_Pnt2d& P,const Standard_Real S) const;
  
  Standard_EXPORT     void Transform(const gp_Trsf2d& T) ;
  
//!  Translates a point in the direction of the vector V. <br>
//!  The magnitude of the translation is the vector's magnitude. <br>
        gp_Pnt2d Transformed(const gp_Trsf2d& T) const;
  
        void Translate(const gp_Vec2d& V) ;
  
//!  Translates a point from the point P1 to the point P2. <br>
        gp_Pnt2d Translated(const gp_Vec2d& V) const;
  
        void Translate(const gp_Pnt2d& P1,const gp_Pnt2d& P2) ;
  
        gp_Pnt2d Translated(const gp_Pnt2d& P1,const gp_Pnt2d& P2) const;
    const gp_XY& _CSFDB_Getgp_Pnt2dcoord() const { return coord; }



protected:




private: 


gp_XY coord;


};


#include <gp_Pnt2d.lxx>



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


#endif