Salome HOME
Supporting all types of objects (planes, lines, and points) as attributes of the...
[modules/shaper.git] / src / GeomAPI / GeomAPI_Lin.cpp
index 27bd3e0e297fdee97d63db8ed18e4d9ed2661d41..8b64190ba21c78a21df5824d9c4d04d5161122e9 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <GeomAPI_Lin.h>
 #include <GeomAPI_Pnt.h>
+#include <GeomAPI_Dir.h>
 
 #include <gp_Dir.hxx>
 #include <gp_Lin.hxx>
@@ -42,6 +43,18 @@ GeomAPI_Lin::GeomAPI_Lin(const std::shared_ptr<GeomAPI_Pnt>& theStart,
 {
 }
 
+std::shared_ptr<GeomAPI_Pnt> GeomAPI_Lin::location()
+{
+  gp_Pnt aLoc = impl<gp_Lin>().Location();
+  return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aLoc.X(), aLoc.Y(), aLoc.Z()));
+}
+
+std::shared_ptr<GeomAPI_Dir> GeomAPI_Lin::direction()
+{
+  const gp_Dir& aDir = impl<gp_Lin>().Direction();
+  return std::shared_ptr<GeomAPI_Dir>(new GeomAPI_Dir(aDir.X(), aDir.Y(), aDir.Z()));
+}
+
 double GeomAPI_Lin::distance(const std::shared_ptr<GeomAPI_Pnt>& thePoint) const
 {
   return MY_LIN->Distance(thePoint->impl<gp_Pnt>());