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_MakeHypr2d_HeaderFile 18 #define _gce_MakeHypr2d_HeaderFile 19 20 #include <Standard.hxx> 21 #include <Standard_DefineAlloc.hxx> 22 #include <Standard_Handle.hxx> 23 24 #include <gp_Hypr2d.hxx> 25 #include <gce_Root.hxx> 26 #include <Standard_Real.hxx> 27 #include <Standard_Boolean.hxx> 28 class StdFail_NotDone; 29 class gp_Pnt2d; 30 class gp_Ax2d; 31 class gp_Ax22d; 32 class gp_Hypr2d; 33 34 35 //! This class implements the following algorithms used to 36 //! create a 2d Hyperbola from gp. 37 //! * Create a 2d Hyperbola from its center and two points: 38 //! one on its axis of symmetry giving the major radius, the 39 //! other giving the value of the small radius. 40 //! * Create a 2d Hyperbola from its major axis and its major 41 //! radius and its minor radius. 42 //! 43 //! ^YAxis 44 //! | 45 //! FirstConjugateBranch 46 //! | 47 //! Other | Main 48 //! --------------------- C ------------------------------>XAxis 49 //! Branch | Branch 50 //! | 51 //! | 52 //! SecondConjugateBranch 53 //! | 54 //! 55 //! An axis placement (one axis) is associated with the hyperbola. 56 //! This axis is the "XAxis" or major axis of the hyperbola. It is 57 //! the symmetry axis of the main branch of hyperbola. 58 //! The "YAxis" is normal to this axis and pass through its location 59 //! point. It is the minor axis. 60 //! 61 //! The major radius is the distance between the Location point 62 //! of the hyperbola C and the vertex of the Main Branch (or the 63 //! Other branch). The minor radius is the distance between the 64 //! Location point of the hyperbola C and the vertex of the First 65 //! (or Second) Conjugate branch. 66 //! The major radius can be lower than the minor radius. 67 class gce_MakeHypr2d : public gce_Root 68 { 69 public: 70 71 DEFINE_STANDARD_ALLOC 72 73 74 //! Constructs a hyperbola 75 //! centered on the point Center, where: 76 //! - the major axis of the hyperbola is defined by Center and point S1, 77 //! - the major radius is the distance between Center and S1, and 78 //! - the minor radius is the distance between point S2 and the major axis. 79 Standard_EXPORT gce_MakeHypr2d(const gp_Pnt2d& S1, const gp_Pnt2d& S2, const gp_Pnt2d& Center); 80 81 //! Constructs a hyperbola with major and minor radii MajorRadius and 82 //! MinorRadius, where: 83 //! - the center of the hyperbola is the origin of the axis MajorAxis, and 84 //! - the major axis is defined by MajorAxis if Sense 85 //! is true, or the opposite axis to MajorAxis if Sense is false; or 86 //! - centered on the origin of the coordinate system 87 //! A, with major and minor radii MajorRadius and 88 //! MinorRadius, where its major axis is the "X Axis" 89 //! of A (A is the local coordinate system of the hyperbola). 90 Standard_EXPORT gce_MakeHypr2d(const gp_Ax2d& MajorAxis, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const Standard_Boolean Sense); 91 92 //! Creates a Hypr2d centered on the origin of the coordinate system 93 //! A, with major and minor radii MajorRadius and 94 //! MinorRadius, where its major axis is the "X Axis" 95 //! of A (A is the local coordinate system of the hyperbola). 96 Standard_EXPORT gce_MakeHypr2d(const gp_Ax22d& A, const Standard_Real MajorRadius, const Standard_Real MinorRadius); 97 98 //! Returns the constructed hyperbola. 99 //! Exceptions StdFail_NotDone if no hyperbola is constructed. 100 Standard_EXPORT const gp_Hypr2d& Value() const; 101 102 Standard_EXPORT const gp_Hypr2d& Operator() const; 103 Standard_EXPORT operator gp_Hypr2d() const; 104 105 106 107 108 protected: 109 110 111 112 113 114 private: 115 116 117 118 gp_Hypr2d TheHypr2d; 119 120 121 }; 122 123 124 125 126 127 128 129 #endif // _gce_MakeHypr2d_HeaderFile 130