1 // Created on: 1992-09-02
2 // Created by: Remi GILET
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <gce_MakeDir.hxx>
24 #include <StdFail_NotDone.hxx>
26 //=========================================================================
27 // Creation d une direction 3d (Dir) de gp a partir de 2 Pnt de gp. +
28 //=========================================================================
29 gce_MakeDir::gce_MakeDir(const gp_Pnt& P1,
32 if (P1.Distance(P2) <= gp::Resolution()) { TheError = gce_ConfusedPoints; }
34 TheDir = gp_Dir(P2.XYZ()-P1.XYZ());
39 gce_MakeDir::gce_MakeDir(const gp_XYZ& Coord)
41 if (Coord.Modulus() <= gp::Resolution()) { TheError = gce_NullVector; }
43 TheDir = gp_Dir(Coord);
48 gce_MakeDir::gce_MakeDir(const gp_Vec& V)
50 if (V.Magnitude() <= gp::Resolution()) { TheError = gce_NullVector; }
57 gce_MakeDir::gce_MakeDir(const Standard_Real Xv,
58 const Standard_Real Yv,
59 const Standard_Real Zv)
61 if (Xv*Xv+Yv*Yv+Zv*Zv <= gp::Resolution()) { TheError = gce_NullVector; }
63 TheDir = gp_Dir(Xv,Yv,Zv);
68 const gp_Dir& gce_MakeDir::Value() const
70 StdFail_NotDone_Raise_if (TheError != gce_Done,
71 "gce_MakeDir::Value() - no result");
75 const gp_Dir& gce_MakeDir::Operator() const
80 gce_MakeDir::operator gp_Dir() const