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

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

#include <PyObjectToVMD.h>

Public Member Functions

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

Private Attributes

bool m_alreadyVMD
 Is the object a wrapped instance of VMD. 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::VMD object from it.

Definition at line 22 of file PyObjectToVMD.h.

Constructor & Destructor Documentation

◆ PyObjectToVMD()

Mantid::PythonInterface::Converters::PyObjectToVMD::PyObjectToVMD ( 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 VMD object. Throws std::invalid_argument if not if that is not the case.

Definition at line 34 of file PyObjectToVMD.cpp.

References m_alreadyVMD.

Member Function Documentation

◆ operator()()

Kernel::VMD Mantid::PythonInterface::Converters::PyObjectToVMD::operator() ( )

Produces a VMD object from the given PyObject.

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

Returns
A newly constructed VMD object converted from the PyObject.

Definition at line 62 of file PyObjectToVMD.cpp.

References m_alreadyVMD, and m_obj.

Member Data Documentation

◆ m_alreadyVMD

bool Mantid::PythonInterface::Converters::PyObjectToVMD::m_alreadyVMD
private

Is the object a wrapped instance of VMD.

Definition at line 31 of file PyObjectToVMD.h.

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

◆ m_obj

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

A reference to the object.

Definition at line 29 of file PyObjectToVMD.h.

Referenced by operator()().


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