1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef GeomAPI_Pln_H_
22 #define GeomAPI_Pln_H_
25 #include <GeomAPI_Interface.h>
34 * \brief 3D point defined by three coordinates
37 class GeomAPI_Pln : public GeomAPI_Interface
40 /// Creation of plane by the axis placement
42 GeomAPI_Pln(const std::shared_ptr<GeomAPI_Ax3>& theAxis);
44 /// Creation of plane by the point and normal
46 GeomAPI_Pln(const std::shared_ptr<GeomAPI_Pnt>& thePoint,
47 const std::shared_ptr<GeomAPI_Dir>& theNormal);
49 /// Creation of plane by coefficients (Ax+By+Cz+D=0)
51 GeomAPI_Pln(const double theA, const double theB, const double theC, const double theD);
53 /// Returns a point of this plane
55 std::shared_ptr<GeomAPI_Pnt> location() const;
57 /// Returns a plane normal
59 std::shared_ptr<GeomAPI_Dir> direction() const;
61 /// Returns a plane x direction
63 std::shared_ptr<GeomAPI_Dir> xDirection() const;
65 /// Returns the plane coefficients (Ax+By+Cz+D=0)
67 void coefficients(double& theA, double& theB, double& theC, double& theD);
69 /// Returns true if planes are coincident.
71 bool isCoincident(const std::shared_ptr<GeomAPI_Pln> thePlane, const double theTolerance = 1.e-7);
73 /// Returns intersection point or empty if no intersections
75 std::shared_ptr<GeomAPI_Pnt> intersect(const std::shared_ptr<GeomAPI_Lin>& theLine) const;
77 /// Returns projection of the given point onto the plane
79 std::shared_ptr<GeomAPI_Pnt> project(const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
81 /// \return distance between planes.
83 double distance(const std::shared_ptr<GeomAPI_Pln> thePlane) const;
85 /// Translates the plane along direction theDir on distance theDist
87 void translate(const std::shared_ptr<GeomAPI_Dir> theDir, const double theDist);
89 /// \return intersection line of two planes. Empty if they are parallel.
91 std::shared_ptr<GeomAPI_Lin> intersect(const std::shared_ptr<GeomAPI_Pln> thePlane) const;
94 //! Pointer on the object
95 typedef std::shared_ptr<GeomAPI_Pln> GeomPlanePtr;