SHAPER 9.16.0
GeomAPI_Pln.h
1// Copyright (C) 2014-2026 CEA, EDF
2//
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.
7//
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.
12//
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
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#ifndef GeomAPI_Pln_H_
21#define GeomAPI_Pln_H_
22
23#include <memory>
24#include <GeomAPI_Interface.h>
25
26class GeomAPI_Ax3;
27class GeomAPI_Pnt;
28class GeomAPI_Dir;
29class GeomAPI_Lin;
30class gp_Pln;
31
38{
39 public:
41 GEOMAPI_EXPORT
42 GeomAPI_Pln(const std::shared_ptr<GeomAPI_Ax3>& theAxes);
43
45 GEOMAPI_EXPORT
46 GeomAPI_Pln(const std::shared_ptr<GeomAPI_Pnt>& thePoint,
47 const std::shared_ptr<GeomAPI_Dir>& theNormal);
48
50 GEOMAPI_EXPORT
51 GeomAPI_Pln(const double theA, const double theB, const double theC, const double theD);
52
54 GEOMAPI_EXPORT
55 std::shared_ptr<GeomAPI_Pnt> location() const;
56
58 GEOMAPI_EXPORT
59 std::shared_ptr<GeomAPI_Dir> direction() const;
60
62 GEOMAPI_EXPORT
63 std::shared_ptr<GeomAPI_Dir> xDirection() const;
64
66 GEOMAPI_EXPORT
67 void coefficients(double& theA, double& theB, double& theC, double& theD);
68
70 GEOMAPI_EXPORT
71 bool isCoincident(const std::shared_ptr<GeomAPI_Pln> thePlane, const double theTolerance = 1.e-7);
72
74 GEOMAPI_EXPORT
75 std::shared_ptr<GeomAPI_Pnt> intersect(const std::shared_ptr<GeomAPI_Lin>& theLine) const;
76
78 GEOMAPI_EXPORT
79 std::shared_ptr<GeomAPI_Pnt> project(const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
80
82 GEOMAPI_EXPORT
83 double distance(const std::shared_ptr<GeomAPI_Pln> thePlane) const;
84
86 GEOMAPI_EXPORT
87 double distance(const std::shared_ptr<GeomAPI_Pnt> thePoint) const;
88
90 GEOMAPI_EXPORT
91 void translate(const std::shared_ptr<GeomAPI_Dir> theDir, const double theDist);
92
94 GEOMAPI_EXPORT
95 std::shared_ptr<GeomAPI_Lin> intersect(const std::shared_ptr<GeomAPI_Pln> thePlane) const;
96};
97
99typedef std::shared_ptr<GeomAPI_Pln> GeomPlanePtr;
100
101#endif
102
The class represents a coordinate plane which is 2d plane with X and Y directions and origin.
Definition: GeomAPI_Ax3.h:33
3D direction defined by three normalized coordinates
Definition: GeomAPI_Dir.h:34
General base class for all interfaces in this package.
Definition: GeomAPI_Interface.h:38
Line in 3D.
Definition: GeomAPI_Lin.h:35
\Plane in 3D place, defined by normal, center and x-direction.
Definition: GeomAPI_Pln.h:38
GEOMAPI_EXPORT GeomAPI_Pln(const std::shared_ptr< GeomAPI_Ax3 > &theAxes)
Creation of plane by the axis placement.
Definition: GeomAPI_Pln.cpp:31
GEOMAPI_EXPORT void coefficients(double &theA, double &theB, double &theC, double &theD)
Returns the plane coefficients (Ax+By+Cz+D=0)
Definition: GeomAPI_Pln.cpp:65
GEOMAPI_EXPORT std::shared_ptr< GeomAPI_Pnt > project(const std::shared_ptr< GeomAPI_Pnt > &thePoint) const
Returns projection of the given point onto the plane.
Definition: GeomAPI_Pln.cpp:102
GEOMAPI_EXPORT std::shared_ptr< GeomAPI_Dir > direction() const
Returns a plane normal.
Definition: GeomAPI_Pln.cpp:53
GEOMAPI_EXPORT void translate(const std::shared_ptr< GeomAPI_Dir > theDir, const double theDist)
Translates the plane along direction theDir on distance theDist.
Definition: GeomAPI_Pln.cpp:129
GEOMAPI_EXPORT bool isCoincident(const std::shared_ptr< GeomAPI_Pln > thePlane, const double theTolerance=1.e-7)
Returns true if planes are coincident.
Definition: GeomAPI_Pln.cpp:70
GEOMAPI_EXPORT std::shared_ptr< GeomAPI_Dir > xDirection() const
Returns a plane x direction.
Definition: GeomAPI_Pln.cpp:59
GEOMAPI_EXPORT double distance(const std::shared_ptr< GeomAPI_Pln > thePlane) const
Definition: GeomAPI_Pln.cpp:114
GEOMAPI_EXPORT std::shared_ptr< GeomAPI_Pnt > intersect(const std::shared_ptr< GeomAPI_Lin > &theLine) const
Returns intersection point or empty if no intersections.
Definition: GeomAPI_Pln.cpp:84
GEOMAPI_EXPORT std::shared_ptr< GeomAPI_Pnt > location() const
Returns a point of this plane.
Definition: GeomAPI_Pln.cpp:47
3D point defined by three coordinates
Definition: GeomAPI_Pnt.h:38