summaryrefslogtreecommitdiff
path: root/inc/gce_MakeDir2d.hxx
blob: 6b565c7ade06095475fb28a1a2a954b92f0b0c9f (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
// 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 _gce_MakeDir2d_HeaderFile
#define _gce_MakeDir2d_HeaderFile

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

#ifndef _gp_Dir2d_HeaderFile
#include <gp_Dir2d.hxx>
#endif
#ifndef _gce_Root_HeaderFile
#include <gce_Root.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
class StdFail_NotDone;
class gp_Vec2d;
class gp_XY;
class gp_Pnt2d;
class gp_Dir2d;


//! This class implements the following algorithms used <br>
//!           to create a Dir2d from gp. <br>
//!           * Create a Dir2d with 2 points. <br>
//!           * Create a Dir2d with a Vec2d. <br>
//!           * Create a Dir2d with a XY from gp. <br>
//!           * Create a Dir2d with a 2 Reals (Coordinates). <br>
class gce_MakeDir2d  : public gce_Root {
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); 
  }

  //! Normalizes the vector V and creates a direction. <br>
//!            Status is "NullVector" if V.Magnitude() <= Resolution. <br>
  Standard_EXPORT   gce_MakeDir2d(const gp_Vec2d& V);
  //! Creates a direction from a triplet of coordinates. <br>
//!            Status is "NullVector" if Coord.Modulus() <= <br>
//!            Resolution from gp. <br>
  Standard_EXPORT   gce_MakeDir2d(const gp_XY& Coord);
  //! Creates a direction with its 3 cartesian coordinates. <br>
//!            Status is "NullVector" if Sqrt(Xv*Xv + Yv*Yv ) <br>
//!            <= Resolution <br>
  Standard_EXPORT   gce_MakeDir2d(const Standard_Real Xv,const Standard_Real Yv);
  //! Make a Dir2d from gp <TheDir> passing through 2 <br>
//!           Pnt <P1>,<P2>. <br>
//!           Status is "ConfusedPoints" if <P1> and <P2> are confused. <br>
//! Warning <br>
//! If an error occurs (that is, when IsDone returns <br>
//! false), the Status function returns: <br>
//! -   gce_ConfusedPoints if points P1 and P2 are coincident, or <br>
//! -   gce_NullVector if one of the following is less <br>
//!   than or equal to gp::Resolution(): <br>
//!   -   the magnitude of vector V, <br>
//!   -   the modulus of Coord, <br>
//!   -   Sqrt(Xv*Xv + Yv*Yv). <br>
  Standard_EXPORT   gce_MakeDir2d(const gp_Pnt2d& P1,const gp_Pnt2d& P2);
  //! Returns the constructed unit vector. <br>
//! Exceptions StdFail_NotDone if no unit vector is constructed. <br>
  Standard_EXPORT    const gp_Dir2d& Value() const;
  
  Standard_EXPORT    const gp_Dir2d& Operator() const;
Standard_EXPORT operator gp_Dir2d() const;





protected:





private:



gp_Dir2d TheDir2d;


};





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


#endif