Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Mantid::PythonInterface::Converters::PyObjectToV3D Struct Reference

Takes a Python object and if it supports indexing and is of length 3 then it will attempt to convert a Kernel::V3D object from it. More...

#include <PyObjectToV3D.h>

Public Member Functions

Kernel::V3D operator() ()
 Produces a V3D object from the given PyObject. More...
 
 PyObjectToV3D (const boost::python::object &p)
 Construct the converter object with the given Python object. More...
 

Private Attributes

bool m_alreadyV3D
 Is the object a wrapped instance of V3D. More...
 
const boost::python::object & m_obj
 A reference to the object. More...
 

Detailed Description

Takes a Python object and if it supports indexing and is of length 3 then it will attempt to convert a Kernel::V3D object from it.

Definition at line 22 of file PyObjectToV3D.h.

Constructor & Destructor Documentation

◆ PyObjectToV3D()

Mantid::PythonInterface::Converters::PyObjectToV3D::PyObjectToV3D ( const boost::python::object &  p)

Construct the converter object with the given Python object.

Parameters
p:: A boost::python object that should support the getitem and len protocol or be a wrapped V3D object. Throws std::invalid_argument if not if that is not the case.

Definition at line 32 of file PyObjectToV3D.cpp.

References m_alreadyV3D.

Member Function Documentation

◆ operator()()

Kernel::V3D Mantid::PythonInterface::Converters::PyObjectToV3D::operator() ( )

Produces a V3D object from the given PyObject.

Returns a V3D object from the Python object given to the converter.

Returns
A newly constructed V3D object converted from the PyObject.

Definition at line 59 of file PyObjectToV3D.cpp.

References m_alreadyV3D, m_obj, and obj.

Member Data Documentation

◆ m_alreadyV3D

bool Mantid::PythonInterface::Converters::PyObjectToV3D::m_alreadyV3D
private

Is the object a wrapped instance of V3D.

Definition at line 31 of file PyObjectToV3D.h.

Referenced by operator()(), and PyObjectToV3D().

◆ m_obj

const boost::python::object& Mantid::PythonInterface::Converters::PyObjectToV3D::m_obj
private

A reference to the object.

Definition at line 29 of file PyObjectToV3D.h.

Referenced by operator()().


The documentation for this struct was generated from the following files: