1 // Created on: 1992-10-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.
17 #include <GC_MakePlane.ixx>
18 #include <gce_MakePln.hxx>
21 #include <TColgp_Array1OfPnt.hxx>
22 #include <StdFail_NotDone.hxx>
23 #include <Standard_NotImplemented.hxx>
26 GC_MakePlane::GC_MakePlane(const gp_Ax2& ) //A2)
28 Standard_NotImplemented::Raise("GC_MakePlane");
31 GC_MakePlane::GC_MakePlane(const gp_Pln& Pl)
34 ThePlane = new Geom_Plane(Pl);
37 GC_MakePlane::GC_MakePlane(const gp_Pnt& P,
41 ThePlane = new Geom_Plane(P,V);
44 GC_MakePlane::GC_MakePlane(const Standard_Real A,
45 const Standard_Real B,
46 const Standard_Real C,
47 const Standard_Real D)
49 if (Sqrt(A*A + B*B +C*C) <= gp::Resolution()) {
50 TheError = gce_BadEquation;
54 ThePlane = new Geom_Plane(gp_Pln(A,B,C,D));
58 //=========================================================================
59 // Creation d un Geom_Plane passant par trois points. +
60 //=========================================================================
62 GC_MakePlane::GC_MakePlane(const gp_Pnt& P1 ,
65 gce_MakePln Pl(P1,P2,P3);
66 TheError = Pl.Status();
67 if (TheError == gce_Done) {
68 ThePlane = new Geom_Plane(Pl.Value());
72 //=========================================================================
73 // Creation d un Geom_Plane parallele a un pln a une distance donnee. +
74 //=========================================================================
76 GC_MakePlane::GC_MakePlane(const gp_Pln& Pl ,
77 const Standard_Real Dist ) {
78 gp_Pln Pln = gce_MakePln(Pl,Dist);
80 ThePlane = new Geom_Plane(Pln);
83 //=========================================================================
84 // Creation d un Geom_Plane parallele a un pln passant par un point +
86 //=========================================================================
88 GC_MakePlane::GC_MakePlane(const gp_Pln& Pl ,
89 const gp_Pnt& Point ) {
90 gp_Pln Pln= gce_MakePln(Pl,Point);
92 ThePlane = new Geom_Plane(Pln);
95 //=========================================================================
96 // Creation d un Geom_Plane a partir d un Ax1 (Point + Normale). +
97 //=========================================================================
99 GC_MakePlane::GC_MakePlane(const gp_Ax1& Axis ) {
100 gp_Pln Pln = gce_MakePln(Axis);
102 ThePlane = new Geom_Plane(Pln);
105 //=========================================================================
106 // Creation d un Geom_Plane par un tableau de points. +
107 //=========================================================================
109 /*GC_MakePlane::GC_MakePlane(const TColgp_Array1OfPnt& Pts ,
110 Standard_Real ErrMax ,
111 Standard_Real ErrMean ) {
112 GC_MakePln Pln(Pts,ErrMax,ErrMean);
113 TheError = Pln.Status();
114 if (TheError == GC_Done) {
115 ThePlane = new Geom_Plane(Pln.Value());
120 const Handle(Geom_Plane)& GC_MakePlane::Value() const
122 StdFail_NotDone_Raise_if(TheError != gce_Done,"");
126 const Handle(Geom_Plane)& GC_MakePlane::Operator() const
131 GC_MakePlane::operator Handle(Geom_Plane) () const