SHAPER  9.12.0
GeomAPI_Pln.h
1 // Copyright (C) 2014-2023 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 
26 class GeomAPI_Ax3;
27 class GeomAPI_Pnt;
28 class GeomAPI_Dir;
29 class GeomAPI_Lin;
30 
37 {
38  public:
40  GEOMAPI_EXPORT
41  GeomAPI_Pln(const std::shared_ptr<GeomAPI_Ax3>& theAxis);
42 
44  GEOMAPI_EXPORT
45  GeomAPI_Pln(const std::shared_ptr<GeomAPI_Pnt>& thePoint,
46  const std::shared_ptr<GeomAPI_Dir>& theNormal);
47 
49  GEOMAPI_EXPORT
50  GeomAPI_Pln(const double theA, const double theB, const double theC, const double theD);
51 
53  GEOMAPI_EXPORT
54  std::shared_ptr<GeomAPI_Pnt> location() const;
55 
57  GEOMAPI_EXPORT
58  std::shared_ptr<GeomAPI_Dir> direction() const;
59 
61  GEOMAPI_EXPORT
62  std::shared_ptr<GeomAPI_Dir> xDirection() const;
63 
65  GEOMAPI_EXPORT
66  void coefficients(double& theA, double& theB, double& theC, double& theD);
67 
69  GEOMAPI_EXPORT
70  bool isCoincident(const std::shared_ptr<GeomAPI_Pln> thePlane, const double theTolerance = 1.e-7);
71 
73  GEOMAPI_EXPORT
74  std::shared_ptr<GeomAPI_Pnt> intersect(const std::shared_ptr<GeomAPI_Lin>& theLine) const;
75 
77  GEOMAPI_EXPORT
78  std::shared_ptr<GeomAPI_Pnt> project(const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
79 
81  GEOMAPI_EXPORT
82  double distance(const std::shared_ptr<GeomAPI_Pln> thePlane) const;
83 
85  GEOMAPI_EXPORT
86  double distance(const std::shared_ptr<GeomAPI_Pnt> thePoint) const;
87 
89  GEOMAPI_EXPORT
90  void translate(const std::shared_ptr<GeomAPI_Dir> theDir, const double theDist);
91 
93  GEOMAPI_EXPORT
94  std::shared_ptr<GeomAPI_Lin> intersect(const std::shared_ptr<GeomAPI_Pln> thePlane) const;
95 };
96 
98 typedef std::shared_ptr<GeomAPI_Pln> GeomPlanePtr;
99 
100 #endif
101 
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
3D point defined by three coordinates
Definition: GeomAPI_Pln.h:37
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 GeomAPI_Pln(const std::shared_ptr< GeomAPI_Ax3 > &theAxis)
Creation of plane by the axis placement.
Definition: GeomAPI_Pln.cpp:31
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