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_MakeDir_HeaderFile
0018 #define _gce_MakeDir_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <gp_Dir.hxx>
0025 #include <gce_Root.hxx>
0026 class gp_Vec;
0027 class gp_XYZ;
0028 class gp_Pnt;
0029 
0030 
0031 //! This class implements the following algorithms used
0032 //! to create a Dir from gp.
0033 //! * Create a Dir parallel to another and passing
0034 //! through a point.
0035 //! * Create a Dir passing through 2 points.
0036 //! * Create a Dir from its axis (Ax1 from gp).
0037 //! * Create a Dir from a point and a direction.
0038 class gce_MakeDir  : public gce_Root
0039 {
0040 public:
0041 
0042   DEFINE_STANDARD_ALLOC
0043 
0044   
0045   //! Normalizes the vector V and creates a direction.
0046   //! Status is "NullVector" if V.Magnitude() <= Resolution.
0047   Standard_EXPORT gce_MakeDir(const gp_Vec& V);
0048   
0049   //! Creates a direction from a triplet of coordinates.
0050   //! Status is "NullVector" if Coord.Modulus() <=
0051   //! Resolution from gp.
0052   Standard_EXPORT gce_MakeDir(const gp_XYZ& Coord);
0053   
0054   //! Creates a direction with its 3 cartesian coordinates.
0055   //! Status is "NullVector" if Sqrt(Xv*Xv + Yv*Yv + Zv*Zv)
0056   //! <= Resolution
0057   Standard_EXPORT gce_MakeDir(const Standard_Real Xv, const Standard_Real Yv, const Standard_Real Zv);
0058   
0059   //! Make a Dir from gp <TheDir> passing through 2
0060   //! Pnt <P1>,<P2>.
0061   //! Status is "ConfusedPoints" if <p1> and <P2> are confused.
0062   //! Warning
0063   //! If an error occurs (that is, when IsDone returns
0064   //! false), the Status function returns:
0065   //! -   gce_ConfusedPoints if points P1 and P2 are coincident, or
0066   //! -   gce_NullVector if one of the following is less
0067   //! than or equal to gp::Resolution():
0068   //! -   the magnitude of vector V,
0069   //! -   the modulus of Coord,
0070   //! -   Sqrt(Xv*Xv + Yv*Yv + Zv*Zv).
0071   Standard_EXPORT gce_MakeDir(const gp_Pnt& P1, const gp_Pnt& P2);
0072   
0073   //! Returns the constructed unit vector.
0074   //! Exceptions StdFail_NotDone if no unit vector is constructed.
0075   Standard_EXPORT const gp_Dir& Value() const;
0076   
0077   Standard_EXPORT const gp_Dir& Operator() const;
0078 Standard_EXPORT operator gp_Dir() const;
0079 
0080 
0081 
0082 
0083 protected:
0084 
0085 
0086 
0087 
0088 
0089 private:
0090 
0091 
0092 
0093   gp_Dir TheDir;
0094 
0095 
0096 };
0097 
0098 
0099 
0100 
0101 
0102 
0103 
0104 #endif // _gce_MakeDir_HeaderFile