1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 // Created: 29 May 2014
5 // Author: Artem ZHIDKOV
10 #include <GeomAPI_Interface.h>
21 class GeomAPI_Lin : public GeomAPI_Interface
24 /// Creation of line defined by cordinates of start and end points
26 GeomAPI_Lin(const double theStartX, const double theStartY, const double theStartZ,
27 const double theEndX, const double theEndY, const double theEndZ);
28 /// Creation of line defined by start and end points
30 GeomAPI_Lin(const std::shared_ptr<GeomAPI_Pnt>& theStart,
31 const std::shared_ptr<GeomAPI_Pnt>& theEnd);
32 /// Creation of line defined by origin and direction
34 GeomAPI_Lin(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
35 const std::shared_ptr<GeomAPI_Dir>& theDirection);
37 /// Returns point on the line (first point)
39 std::shared_ptr<GeomAPI_Pnt> location();
41 /// Returns a line direction
43 std::shared_ptr<GeomAPI_Dir> direction();
45 /// Distance between two points
47 double distance(const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
48 /// Intersection of two lines
50 const std::shared_ptr<GeomAPI_Pnt> intersect(
51 const std::shared_ptr<GeomAPI_Lin>& theLine) const;
52 /// Project point on line
54 const std::shared_ptr<GeomAPI_Pnt> project(
55 const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
57 /// \return true if this line contains thePoint, that is, if the distance between thePoint and this line
58 /// is less than or equal to theLinearTolerance.
60 bool contains(const std::shared_ptr<GeomAPI_Pnt> thePoint, const double theLinearTolerance = 1.e-7) const;
62 /// \return true if lines are parallel.
64 bool isParallel(const std::shared_ptr<GeomAPI_Lin> theLin) const;
66 /// \return true if lines are coplanar.
68 bool isCoplanar(const std::shared_ptr<GeomAPI_Lin> theLin) const;