+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
// File: GeomAPI_Lin.cpp
// Created: 29 May 2014
// Author: Artem ZHIDKOV
#include <GeomAPI_Lin.h>
#include <GeomAPI_Pnt.h>
+#include <GeomAPI_Dir.h>
#include <gp_Dir.hxx>
#include <gp_Lin.hxx>
#include <Precision.hxx>
#include <ProjLib.hxx>
-#define MY_LIN static_cast<gp_Lin*>(myImpl)
+#define MY_LIN implPtr<gp_Lin>()
static gp_Lin* newLine(const double theStartX, const double theStartY, const double theStartZ,
const double theEndX, const double theEndY, const double theEndZ)
{
}
+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>());