File: SymOpPConv.cpp

package info (click to toggle)
pymol 2.5.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 42,288 kB
  • sloc: cpp: 476,472; python: 76,538; ansic: 29,510; javascript: 6,792; sh: 47; makefile: 24
file content (24 lines) | stat: -rw-r--r-- 455 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
 * @file Python serialization of SymOp
 *
 * (c) Schrodinger, Inc.
 */

#include "SymOpPConv.h"
#include "SymOp.h"

PyObject* PConvToPyObject(pymol::SymOp const& symop)
{
  std::string buffer;
  if (symop) {
    buffer = symop.to_string();
  }
  return PyString_FromString(buffer.c_str());
}

bool PConvFromPyObject(PyMOLGlobals*, PyObject* obj, pymol::SymOp& out)
{
  auto str = PyString_AsSomeString(obj);
  out.reset(str.c_str());
  return true;
}