Commit | Line | Data |
---|---|---|

42cf5bc1 | 1 | // Created on: 1992-08-26 |

2 | // Created by: Remi GILET | |

3 | // Copyright (c) 1992-1999 Matra Datavision | |

4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS | |

5 | // | |

6 | // This file is part of Open CASCADE Technology software library. | |

7 | // | |

8 | // This library is free software; you can redistribute it and/or modify it under | |

9 | // the terms of the GNU Lesser General Public License version 2.1 as published | |

10 | // by the Free Software Foundation, with special exception defined in the file | |

11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT | |

12 | // distribution for complete text of the license and disclaimer of any warranty. | |

13 | // | |

14 | // Alternatively, this file may be used under the terms of Open CASCADE | |

15 | // commercial license or contractual agreement. | |

16 | ||

17 | #ifndef _gce_MakeParab2d_HeaderFile | |

18 | #define _gce_MakeParab2d_HeaderFile | |

19 | ||

20 | #include <Standard.hxx> | |

21 | #include <Standard_DefineAlloc.hxx> | |

22 | #include <Standard_Handle.hxx> | |

23 | ||

24 | #include <gp_Parab2d.hxx> | |

25 | #include <gce_Root.hxx> | |

26 | #include <Standard_Real.hxx> | |

27 | #include <Standard_Boolean.hxx> | |

28 | class StdFail_NotDone; | |

29 | class gp_Ax2d; | |

30 | class gp_Ax22d; | |

31 | class gp_Pnt2d; | |

32 | class gp_Parab2d; | |

33 | ||

34 | ||

35 | //! This class implements the following algorithms used to | |

36 | //! create Parab2d from gp. | |

37 | //! Defines an infinite parabola. | |

38 | //! An axis placement one axis defines the local cartesian | |

39 | //! coordinate system ("XAxis") of the parabola. | |

40 | //! The vertex of the parabola is the "Location" point of the | |

41 | //! local coordinate system of the parabola. | |

42 | //! The "XAxis" of the parabola is its axis of symmetry. | |

43 | //! The "XAxis" is oriented from the vertex of the parabola to the | |

44 | //! Focus of the parabola. | |

45 | //! The "YAxis" is parallel to the directrix of the parabola and | |

46 | //! its "Location" point is the vertex of the parabola. | |

47 | //! The equation of the parabola in the local coordinate system is | |

48 | //! Y**2 = (2*P) * X | |

49 | //! P is the distance between the focus and the directrix of the | |

50 | //! parabola called Parameter). | |

51 | //! The focal length F = P/2 is the distance between the vertex | |

52 | //! and the focus of the parabola. | |

53 | //! | |

54 | //! * Create a Parab2d from one apex and the center. | |

55 | //! * Create a Parab2d with the directrix and the focus point. | |

56 | //! * Create a Parab2d with its vertex point and its axis | |

57 | //! of symetry and its focus length. | |

58 | class gce_MakeParab2d : public gce_Root | |

59 | { | |

60 | public: | |

61 | ||

62 | DEFINE_STANDARD_ALLOC | |

63 | ||

64 | ||

65 | ||

66 | //! Creates a parabola with its axis of symmetry ("MirrorAxis") | |

67 | //! and its focal length. | |

68 | //! Warnings : It is possible to have Focal = 0. | |

69 | //! The status is "NullFocalLength" Raised if Focal < 0.0 | |

70 | Standard_EXPORT gce_MakeParab2d(const gp_Ax2d& MirrorAxis, const Standard_Real Focal, const Standard_Boolean Sense = Standard_True); | |

71 | ||

72 | ||

73 | //! Creates a parabola with its local coordinate system <A> | |

74 | //! and its focal length. | |

75 | //! Warnings : It is possible to have Focal = 0. | |

76 | //! The status is "NullFocalLength" Raised if Focal < 0.0 | |

77 | Standard_EXPORT gce_MakeParab2d(const gp_Ax22d& A, const Standard_Real Focal); | |

78 | ||

79 | ||

80 | //! Creates a parabola with the directrix and the focus point. | |

81 | //! The sense of parametrization is given by Sense. | |

82 | Standard_EXPORT gce_MakeParab2d(const gp_Ax2d& D, const gp_Pnt2d& F, const Standard_Boolean Sense = Standard_True); | |

83 | ||

84 | ||

42cf5bc1 | 85 | //! Make an Parab2d with S1 as the Focal point and Center |

86 | //! as the apex of the parabola | |

87 | //! Warning | |

88 | //! The MakeParab2d class does not prevent the | |

89 | //! construction of a parabola with a null focal distance. | |

90 | //! If an error occurs (that is, when IsDone returns | |

91 | //! false), the Status function returns: | |

92 | //! - gce_NullFocusLength if Focal is less than 0.0, or | |

93 | //! - gce_NullAxis if S1 and Center are coincident. | |

94 | Standard_EXPORT gce_MakeParab2d(const gp_Pnt2d& S1, const gp_Pnt2d& Center, const Standard_Boolean Sense = Standard_True); | |

95 | ||

96 | //! Returns the constructed parabola. | |

97 | //! Exceptions StdFail_NotDone if no parabola is constructed. | |

98 | Standard_EXPORT const gp_Parab2d& Value() const; | |

99 | ||

100 | Standard_EXPORT const gp_Parab2d& Operator() const; | |

101 | Standard_EXPORT operator gp_Parab2d() const; | |

102 | ||

103 | ||

104 | ||

105 | ||

106 | protected: | |

107 | ||

108 | ||

109 | ||

110 | ||

111 | ||

112 | private: | |

113 | ||

114 | ||

115 | ||

116 | gp_Parab2d TheParab2d; | |

117 | ||

118 | ||

119 | }; | |

120 | ||

121 | ||

122 | ||

123 | ||

124 | ||

125 | ||

126 | ||

127 | #endif // _gce_MakeParab2d_HeaderFile |