Nektar++
Functions
Curve.cpp File Reference
#include <LibUtilities/Python/NekPyConfig.hpp>
#include <SpatialDomains/Curve.hpp>

Go to the source code of this file.

Functions

py::list Curve_GetPoints (CurveSharedPtr curve)
 
void Curve_SetPoints (CurveSharedPtr curve, py::list &pts)
 
void export_Curve ()
 

Function Documentation

◆ Curve_GetPoints()

py::list Curve_GetPoints ( CurveSharedPtr  curve)

Definition at line 41 of file Curve.cpp.

42{
43 py::list ret;
44 for (auto &pt : curve->m_points)
45 {
46 ret.append(pt);
47 }
48 return ret;
49}

Referenced by export_Curve().

◆ Curve_SetPoints()

void Curve_SetPoints ( CurveSharedPtr  curve,
py::list &  pts 
)

Definition at line 51 of file Curve.cpp.

52{
53 py::ssize_t n = py::len(pts);
54
55 for (py::ssize_t i = 0; i < n; ++i)
56 {
57 curve->m_points.push_back(py::extract<PointGeomSharedPtr>(pts[i]));
58 }
59}

Referenced by export_Curve().

◆ export_Curve()

void export_Curve ( )

Definition at line 61 of file Curve.cpp.

62{
63 py::class_<Curve, std::shared_ptr<Curve>>(
64 "Curve", py::init<int, LibUtilities::PointsType>())
65
66 .def_readwrite("curveID", &Curve::m_curveID)
67 .def_readwrite("ptype", &Curve::m_ptype)
68 .add_property("points", &Curve_GetPoints, &Curve_SetPoints);
69}
py::list Curve_GetPoints(CurveSharedPtr curve)
Definition: Curve.cpp:41
void Curve_SetPoints(CurveSharedPtr curve, py::list &pts)
Definition: Curve.cpp:51

References Curve_GetPoints(), and Curve_SetPoints().

Referenced by BOOST_PYTHON_MODULE().