Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:32

0001 // Created on: 1992-08-26
0002 // Created by: Remi GILET
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _gce_MakeHypr_HeaderFile
0018 #define _gce_MakeHypr_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <gp_Hypr.hxx>
0025 #include <gce_Root.hxx>
0026 class gp_Ax2;
0027 class gp_Pnt;
0028 
0029 
0030 //! This class implements the following algorithms used to
0031 //! create Hyperbola from gp.
0032 //! * Create an Hyperbola from its center, and two points:
0033 //! one on its axis of symmetry giving the major radius, the
0034 //! other giving the value of the small radius.
0035 //! The three points give the plane of the hyperbola.
0036 //! * Create an hyperbola from its axisplacement and its
0037 //! MajorRadius and its MinorRadius.
0038 //!
0039 //! ^YAxis
0040 //! |
0041 //! FirstConjugateBranch
0042 //! |
0043 //! Other            |                Main
0044 //! --------------------- C ------------------------------>XAxis
0045 //! Branch           |                Branch
0046 //! |
0047 //! |
0048 //! SecondConjugateBranch
0049 //! |
0050 //!
0051 //! The local cartesian coordinate system of the ellipse is an
0052 //! axis placement (two axis).
0053 //!
0054 //! The "XDirection" and the "YDirection" of the axis placement
0055 //! define the plane of the hyperbola.
0056 //!
0057 //! The "Direction" of the axis placement defines the normal axis
0058 //! to the hyperbola's plane.
0059 //!
0060 //! The "XAxis" of the hyperbola ("Location", "XDirection") is the
0061 //! major axis  and the  "YAxis" of the hyperbola ("Location",
0062 //! "YDirection") is the minor axis.
0063 //!
0064 //! Warnings :
0065 //! The major radius (on the major axis) can be lower than the
0066 //! minor radius (on the minor axis).
0067 class gce_MakeHypr  : public gce_Root
0068 {
0069 public:
0070 
0071   DEFINE_STANDARD_ALLOC
0072 
0073   
0074 
0075   //! A2 is the local coordinate system of the hyperbola.
0076   //! In the local coordinates system A2 the equation of the
0077   //! hyperbola is :
0078   //! X*X / MajorRadius*MajorRadius - Y*Y / MinorRadius*MinorRadius = 1.0
0079   //! It is not forbidden to create an Hyperbola with MajorRadius =
0080   //! MinorRadius.
0081   //! For the hyperbola the MajorRadius can be lower than the
0082   //! MinorRadius.
0083   //! The status is "NegativeRadius" if MajorRadius < 0.0 and
0084   //! "InvertRadius" if MinorRadius > MajorRadius.
0085   Standard_EXPORT gce_MakeHypr(const gp_Ax2& A2, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
0086   
0087   //! Constructs a hyperbola
0088   //! -   centered on the point Center, where:
0089   //! -   the plane of the hyperbola is defined by Center, S1 and S2,
0090   //! -   its major axis is defined by Center and S1,
0091   //! -   its major radius is the distance between Center and S1, and
0092   //! -   its minor radius is the distance between S2 and the major axis.
0093   //! Warning
0094   //! If an error occurs (that is, when IsDone returns
0095   //! false), the Status function returns:
0096   //! -   gce_NegativeRadius if MajorRadius is less than 0.0;
0097   //! -   gce_InvertRadius if:
0098   //! -   the major radius (computed with Center, S1) is
0099   //! less than the minor radius (computed with Center, S1 and S2), or
0100   //! -   MajorRadius is less than MinorRadius; or
0101   //! -   gce_ColinearPoints if S1, S2 and Center are collinear.
0102   Standard_EXPORT gce_MakeHypr(const gp_Pnt& S1, const gp_Pnt& S2, const gp_Pnt& Center);
0103   
0104   //! Returns the constructed hyperbola.
0105   //! Exceptions StdFail_NotDone if no hyperbola is constructed.
0106   Standard_EXPORT const gp_Hypr& Value() const;
0107   
0108   Standard_EXPORT const gp_Hypr& Operator() const;
0109 Standard_EXPORT operator gp_Hypr() const;
0110 
0111 
0112 
0113 
0114 protected:
0115 
0116 
0117 
0118 
0119 
0120 private:
0121 
0122 
0123 
0124   gp_Hypr TheHypr;
0125 
0126 
0127 };
0128 
0129 
0130 
0131 
0132 
0133 
0134 
0135 #endif // _gce_MakeHypr_HeaderFile