/opencascade-6.5.1/ros/inc/gp_Hypr.hxx

https://github.com/jehc/MondocosmOS · C++ Header · 299 lines · 103 code · 59 blank · 137 comment · 1 complexity · 6dcdb154a0f19495508735785e4c45bf MD5 · raw file

  1. // This file is generated by WOK (CPPExt).
  2. // Please do not edit this file; modify original file instead.
  3. // The copyright and license terms as defined for the original file apply to
  4. // this header file considered to be the "object code" form of the original source.
  5. #ifndef _gp_Hypr_HeaderFile
  6. #define _gp_Hypr_HeaderFile
  7. #ifndef _Standard_HeaderFile
  8. #include <Standard.hxx>
  9. #endif
  10. #ifndef _Standard_Macro_HeaderFile
  11. #include <Standard_Macro.hxx>
  12. #endif
  13. #ifndef _gp_Ax2_HeaderFile
  14. #include <gp_Ax2.hxx>
  15. #endif
  16. #ifndef _Standard_Real_HeaderFile
  17. #include <Standard_Real.hxx>
  18. #endif
  19. #ifndef _Standard_Storable_HeaderFile
  20. #include <Standard_Storable.hxx>
  21. #endif
  22. #ifndef _gp_Ax1_HeaderFile
  23. #include <gp_Ax1.hxx>
  24. #endif
  25. #ifndef _gp_Pnt_HeaderFile
  26. #include <gp_Pnt.hxx>
  27. #endif
  28. #ifndef _Standard_PrimitiveTypes_HeaderFile
  29. #include <Standard_PrimitiveTypes.hxx>
  30. #endif
  31. class Standard_ConstructionError;
  32. class Standard_DomainError;
  33. class gp_Ax2;
  34. class gp_Ax1;
  35. class gp_Pnt;
  36. class gp_Trsf;
  37. class gp_Vec;
  38. Standard_EXPORT const Handle(Standard_Type)& STANDARD_TYPE(gp_Hypr);
  39. //! Describes a branch of a hyperbola in 3D space. <br>
  40. //! A hyperbola is defined by its major and minor radii and <br>
  41. //! positioned in space with a coordinate system (a gp_Ax2 <br>
  42. //! object) of which: <br>
  43. //! - the origin is the center of the hyperbola, <br>
  44. //! - the "X Direction" defines the major axis of the <br>
  45. //! hyperbola, and <br>
  46. //! - the "Y Direction" defines the minor axis of the hyperbola. <br>
  47. //! The origin, "X Direction" and "Y Direction" of this <br>
  48. //! coordinate system together define the plane of the <br>
  49. //! hyperbola. This coordinate system is the "local <br>
  50. //! coordinate system" of the hyperbola. In this coordinate <br>
  51. //! system, the equation of the hyperbola is: <br>
  52. //! X*X/(MajorRadius**2)-Y*Y/(MinorRadius**2) = 1.0 <br>
  53. //! The branch of the hyperbola described is the one located <br>
  54. //! on the positive side of the major axis. <br>
  55. //! The "main Direction" of the local coordinate system is a <br>
  56. //! normal vector to the plane of the hyperbola. This vector <br>
  57. //! gives an implicit orientation to the hyperbola. We refer to <br>
  58. //! the "main Axis" of the local coordinate system as the <br>
  59. //! "Axis" of the hyperbola. <br>
  60. //! The following schema shows the plane of the hyperbola, <br>
  61. //! and in it, the respective positions of the three branches of <br>
  62. //! hyperbolas constructed with the functions OtherBranch, <br>
  63. //! ConjugateBranch1, and ConjugateBranch2: <br>
  64. class gp_Hypr {
  65. public:
  66. void* operator new(size_t,void* anAddress)
  67. {
  68. return anAddress;
  69. }
  70. void* operator new(size_t size)
  71. {
  72. return Standard::Allocate(size);
  73. }
  74. void operator delete(void *anAddress)
  75. {
  76. if (anAddress) Standard::Free((Standard_Address&)anAddress);
  77. }
  78. //! Creates of an indefinite hyperbola. <br>
  79. gp_Hypr();
  80. //! Creates a hyperbola with radii MajorRadius and <br>
  81. //! MinorRadius, positioned in the space by the <br>
  82. //! coordinate system A2 such that: <br>
  83. //! - the origin of A2 is the center of the hyperbola, <br>
  84. //! - the "X Direction" of A2 defines the major axis of <br>
  85. //! the hyperbola, that is, the major radius <br>
  86. //! MajorRadius is measured along this axis, and <br>
  87. //! - the "Y Direction" of A2 defines the minor axis of <br>
  88. //! the hyperbola, that is, the minor radius <br>
  89. //! MinorRadius is measured along this axis. <br>
  90. //! Note: This class does not prevent the creation of a <br>
  91. //! hyperbola where: <br>
  92. //! - MajorAxis is equal to MinorAxis, or <br>
  93. //! - MajorAxis is less than MinorAxis. <br>
  94. //! Exceptions <br>
  95. //! Standard_ConstructionError if MajorAxis or MinorAxis is negative. <br>
  96. //! Raises ConstructionError if MajorRadius < 0.0 or MinorRadius < 0.0 <br>//! Raised if MajorRadius < 0.0 or MinorRadius < 0.0 <br>
  97. gp_Hypr(const gp_Ax2& A2,const Standard_Real MajorRadius,const Standard_Real MinorRadius);
  98. //! Modifies this hyperbola, by redefining its local coordinate <br>
  99. //! system so that: <br>
  100. //! - its origin and "main Direction" become those of the <br>
  101. //! axis A1 (the "X Direction" and "Y Direction" are then <br>
  102. //! recomputed in the same way as for any gp_Ax2). <br>
  103. //! Raises ConstructionError if the direction of A1 is parallel to the direction of <br>
  104. //! the "XAxis" of the hyperbola. <br>
  105. void SetAxis(const gp_Ax1& A1) ;
  106. //! Modifies this hyperbola, by redefining its local coordinate <br>
  107. //! system so that its origin becomes P. <br>
  108. void SetLocation(const gp_Pnt& P) ;
  109. //! Modifies the major radius of this hyperbola. <br>
  110. //! Exceptions <br>
  111. //! Standard_ConstructionError if MajorRadius is negative. <br>
  112. void SetMajorRadius(const Standard_Real MajorRadius) ;
  113. //! Modifies the minor radius of this hyperbola. <br>
  114. //! Exceptions <br>
  115. //! Standard_ConstructionError if MinorRadius is negative. <br>
  116. void SetMinorRadius(const Standard_Real MinorRadius) ;
  117. //! Modifies this hyperbola, by redefining its local coordinate <br>
  118. //! system so that it becomes A2. <br>
  119. void SetPosition(const gp_Ax2& A2) ;
  120. //! In the local coordinate system of the hyperbola the equation of <br>
  121. //! the hyperbola is (X*X)/(A*A) - (Y*Y)/(B*B) = 1.0 and the <br>
  122. //! equation of the first asymptote is Y = (B/A)*X <br>
  123. //! where A is the major radius and B is the minor radius. Raises ConstructionError if MajorRadius = 0.0 <br>
  124. gp_Ax1 Asymptote1() const;
  125. //! In the local coordinate system of the hyperbola the equation of <br>
  126. //! the hyperbola is (X*X)/(A*A) - (Y*Y)/(B*B) = 1.0 and the <br>
  127. //! equation of the first asymptote is Y = -(B/A)*X. <br>
  128. //! where A is the major radius and B is the minor radius. Raises ConstructionError if MajorRadius = 0.0 <br>
  129. gp_Ax1 Asymptote2() const;
  130. //! Returns the axis passing through the center, <br>
  131. //! and normal to the plane of this hyperbola. <br>
  132. const gp_Ax1& Axis() const;
  133. //! Computes the branch of hyperbola which is on the positive side of the <br>
  134. //! "YAxis" of <me>. <br>
  135. gp_Hypr ConjugateBranch1() const;
  136. //! Computes the branch of hyperbola which is on the negative side of the <br>
  137. //! "YAxis" of <me>. <br>
  138. gp_Hypr ConjugateBranch2() const;
  139. //! This directrix is the line normal to the XAxis of the hyperbola <br>
  140. //! in the local plane (Z = 0) at a distance d = MajorRadius / e <br>
  141. //! from the center of the hyperbola, where e is the eccentricity of <br>
  142. //! the hyperbola. <br>
  143. //! This line is parallel to the "YAxis". The intersection point <br>
  144. //! between the directrix1 and the "XAxis" is the "Location" point <br>
  145. //! of the directrix1. This point is on the positive side of the <br>
  146. //! "XAxis". <br>
  147. gp_Ax1 Directrix1() const;
  148. //! This line is obtained by the symmetrical transformation <br>
  149. //! of "Directrix1" with respect to the "YAxis" of the hyperbola. <br>
  150. gp_Ax1 Directrix2() const;
  151. //! Returns the excentricity of the hyperbola (e > 1). <br>
  152. //! If f is the distance between the location of the hyperbola <br>
  153. //! and the Focus1 then the eccentricity e = f / MajorRadius. Raises DomainError if MajorRadius = 0.0 <br>
  154. Standard_Real Eccentricity() const;
  155. //! Computes the focal distance. It is the distance between the <br>
  156. //! the two focus of the hyperbola. <br>
  157. Standard_Real Focal() const;
  158. //! Returns the first focus of the hyperbola. This focus is on the <br>
  159. //! positive side of the "XAxis" of the hyperbola. <br>
  160. gp_Pnt Focus1() const;
  161. //! Returns the second focus of the hyperbola. This focus is on the <br>
  162. //! negative side of the "XAxis" of the hyperbola. <br>
  163. gp_Pnt Focus2() const;
  164. //! Returns the location point of the hyperbola. It is the <br>
  165. //! intersection point between the "XAxis" and the "YAxis". <br>
  166. const gp_Pnt& Location() const;
  167. //! Returns the major radius of the hyperbola. It is the radius <br>
  168. //! on the "XAxis" of the hyperbola. <br>
  169. Standard_Real MajorRadius() const;
  170. //! Returns the minor radius of the hyperbola. It is the radius <br>
  171. //! on the "YAxis" of the hyperbola. <br>
  172. Standard_Real MinorRadius() const;
  173. //! Returns the branch of hyperbola obtained by doing the <br>
  174. //! symmetrical transformation of <me> with respect to the <br>
  175. //! "YAxis" of <me>. <br>
  176. gp_Hypr OtherBranch() const;
  177. //! Returns p = (e * e - 1) * MajorRadius where e is the <br>
  178. //! eccentricity of the hyperbola. <br>
  179. //! Raises DomainError if MajorRadius = 0.0 <br>
  180. Standard_Real Parameter() const;
  181. //! Returns the coordinate system of the hyperbola. <br>
  182. const gp_Ax2& Position() const;
  183. //! Computes an axis, whose <br>
  184. //! - the origin is the center of this hyperbola, and <br>
  185. //! - the unit vector is the "X Direction" <br>
  186. //! of the local coordinate system of this hyperbola. <br>
  187. //! These axes are, the major axis (the "X <br>
  188. //! Axis") and of this hyperboReturns the "XAxis" of the hyperbola. <br>
  189. gp_Ax1 XAxis() const;
  190. //! Computes an axis, whose <br>
  191. //! - the origin is the center of this hyperbola, and <br>
  192. //! - the unit vector is the "Y Direction" <br>
  193. //! of the local coordinate system of this hyperbola. <br>
  194. //! These axes are the minor axis (the "Y Axis") of this hyperbola <br>
  195. gp_Ax1 YAxis() const;
  196. Standard_EXPORT void Mirror(const gp_Pnt& P) ;
  197. //! Performs the symmetrical transformation of an hyperbola with <br>
  198. //! respect to the point P which is the center of the symmetry. <br>
  199. Standard_EXPORT gp_Hypr Mirrored(const gp_Pnt& P) const;
  200. Standard_EXPORT void Mirror(const gp_Ax1& A1) ;
  201. //! Performs the symmetrical transformation of an hyperbola with <br>
  202. //! respect to an axis placement which is the axis of the symmetry. <br>
  203. Standard_EXPORT gp_Hypr Mirrored(const gp_Ax1& A1) const;
  204. Standard_EXPORT void Mirror(const gp_Ax2& A2) ;
  205. //! Performs the symmetrical transformation of an hyperbola with <br>
  206. //! respect to a plane. The axis placement A2 locates the plane <br>
  207. //! of the symmetry (Location, XDirection, YDirection). <br>
  208. Standard_EXPORT gp_Hypr Mirrored(const gp_Ax2& A2) const;
  209. void Rotate(const gp_Ax1& A1,const Standard_Real Ang) ;
  210. //! Rotates an hyperbola. A1 is the axis of the rotation. <br>
  211. //! Ang is the angular value of the rotation in radians. <br>
  212. gp_Hypr Rotated(const gp_Ax1& A1,const Standard_Real Ang) const;
  213. void Scale(const gp_Pnt& P,const Standard_Real S) ;
  214. //! Scales an hyperbola. S is the scaling value. <br>
  215. gp_Hypr Scaled(const gp_Pnt& P,const Standard_Real S) const;
  216. void Transform(const gp_Trsf& T) ;
  217. //! Transforms an hyperbola with the transformation T from <br>
  218. //! class Trsf. <br>
  219. gp_Hypr Transformed(const gp_Trsf& T) const;
  220. void Translate(const gp_Vec& V) ;
  221. //! Translates an hyperbola in the direction of the vector V. <br>
  222. //! The magnitude of the translation is the vector's magnitude. <br>
  223. gp_Hypr Translated(const gp_Vec& V) const;
  224. void Translate(const gp_Pnt& P1,const gp_Pnt& P2) ;
  225. //! Translates an hyperbola from the point P1 to the point P2. <br>
  226. gp_Hypr Translated(const gp_Pnt& P1,const gp_Pnt& P2) const;
  227. const gp_Ax2& _CSFDB_Getgp_Hyprpos() const { return pos; }
  228. Standard_Real _CSFDB_Getgp_HyprmajorRadius() const { return majorRadius; }
  229. void _CSFDB_Setgp_HyprmajorRadius(const Standard_Real p) { majorRadius = p; }
  230. Standard_Real _CSFDB_Getgp_HyprminorRadius() const { return minorRadius; }
  231. void _CSFDB_Setgp_HyprminorRadius(const Standard_Real p) { minorRadius = p; }
  232. protected:
  233. private:
  234. gp_Ax2 pos;
  235. Standard_Real majorRadius;
  236. Standard_Real minorRadius;
  237. };
  238. #include <gp_Hypr.lxx>
  239. // other Inline functions and methods (like "C++: function call" methods)
  240. #endif