Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

py_graphics.C File Reference

#include "py_commands.h"
#include "Molecule.h"
#include "MoleculeList.h"
#include "MaterialList.h"
#include "VMDApp.h"
#include "Scene.h"
#include "MoleculeGraphics.h"

Go to the source code of this file.

Functions

MoleculeGraphicsmol_from_id (int id)
PyObject * py_triangle (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * py_trinorm (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * py_cylinder (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * py_point (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * py_line (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * py_materials (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * py_material (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * py_color (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * py_cone (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * py_sphere (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * py_text (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * py_delete (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * py_replace (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * py_info (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * py_listall (PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * initgraphics (void)

Variables

char triangle_doc []
char trinorm_doc []
char cylinder_doc []
char point_doc []
char line_doc []
char mats_doc []
char mat_doc []
char color_doc []
char cone_doc []
char sphere_doc []
char text_doc []
char delete_doc []
char replace_doc []
char info_doc []
char list_doc []
PyMethodDef GraphicsMethods []
const char graphics_moddoc []


Function Documentation

PyObject* initgraphics void   
 

Definition at line 656 of file py_graphics.C.

References graphics_moddoc, and GraphicsMethods.

MoleculeGraphics* mol_from_id int    id [static]
 

Definition at line 38 of file py_graphics.C.

References get_vmdapp, MoleculeList::mol_from_id, DrawMolecule::moleculeGraphics, VMDApp::moleculeList, and NULL.

Referenced by find_molecule, py_color, py_cone, py_cylinder, py_delete, py_info, py_line, py_listall, py_material, py_materials, py_point, py_replace, py_sphere, py_text, py_triangle, and py_trinorm.

PyObject* py_color PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 309 of file py_graphics.C.

References as_constcharptr, as_int, VMDApp::color_index, get_vmdapp, is_pyint, is_pystring, MAXCOLORS, mol_from_id, NULL, and MoleculeGraphics::use_color.

PyObject* py_cone PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 369 of file py_graphics.C.

References MoleculeGraphics::add_cone, as_pyint, mol_from_id, NULL, and py_array_from_obj.

PyObject* py_cylinder PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 143 of file py_graphics.C.

References MoleculeGraphics::add_cylinder, as_pyint, mol_from_id, NULL, and py_array_from_obj.

PyObject* py_delete PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 482 of file py_graphics.C.

References as_constcharptr, as_int, MoleculeGraphics::delete_all, MoleculeGraphics::delete_id, is_pyint, is_pystring, mol_from_id, and NULL.

PyObject* py_info PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 557 of file py_graphics.C.

References as_pystring, MoleculeGraphics::index_id, MoleculeGraphics::info_id, mol_from_id, and NULL.

PyObject* py_line PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 207 of file py_graphics.C.

References MoleculeGraphics::add_line, as_pyint, mol_from_id, NULL, and py_array_from_obj.

PyObject* py_listall PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 585 of file py_graphics.C.

References as_pyint, MoleculeGraphics::element_id, mol_from_id, NULL, and MoleculeGraphics::num_elements.

PyObject* py_material PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 277 of file py_graphics.C.

References get_vmdapp, MaterialList::material, MaterialList::material_index, VMDApp::materialList, mol_from_id, NULL, and MoleculeGraphics::use_material.

PyObject* py_materials PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 253 of file py_graphics.C.

References mol_from_id, NULL, and MoleculeGraphics::use_materials.

PyObject* py_point PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 176 of file py_graphics.C.

References MoleculeGraphics::add_point, as_pyint, mol_from_id, NULL, and py_array_from_obj.

PyObject* py_replace PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 528 of file py_graphics.C.

References mol_from_id, NULL, and MoleculeGraphics::replace_id.

PyObject* py_sphere PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 407 of file py_graphics.C.

References MoleculeGraphics::add_sphere, as_pyint, mol_from_id, NULL, and py_array_from_obj.

PyObject* py_text PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 448 of file py_graphics.C.

References MoleculeGraphics::add_text, as_pyint, mol_from_id, NULL, py_array_from_obj, and size.

PyObject* py_triangle PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 70 of file py_graphics.C.

References MoleculeGraphics::add_triangle, as_pyint, mol_from_id, NULL, and py_array_from_obj.

PyObject* py_trinorm PyObject *    self,
PyObject *    args,
PyObject *    kwargs
[static]
 

Definition at line 105 of file py_graphics.C.

References MoleculeGraphics::add_trinorm, as_pyint, mol_from_id, NULL, and py_array_from_obj.


Variable Documentation

char color_doc[] [static]
 

Initial value:

"Set color for subsequent graphics primitives in this molecule.\n\n"
"Args:\n"
"    molid (int): Molecule ID to affect\n"
"    color (int, 3-tuple of float, or str): Color, either as color ID,\n"
"        or name."

Definition at line 303 of file py_graphics.C.

char cone_doc[] [static]
 

Initial value:

"Draws a cone. Base of cone is always filled\n\n"
"Args:\n"
"    molid (int): Molecule ID to draw on \n"
"    v1 (3-tuple of float): (x,y,z) coordinates of first vertex\n"
"    v2 (3-tuple of float): (x,y,z) coordinates of second vertex\n"
"    radius (float): Cone radius at base, defaults to 1.0\n"
"    radius2 (float): Cone radius at end. Defaults to 0.0 for pointy cone.\n"
"      If nonzero, end will not appear as filled."
"    resolution (int): Number of sides of cone , defaults to 6\n"
"Returns:\n"
"    (int): ID of drawn cone"

Definition at line 357 of file py_graphics.C.

char cylinder_doc[] [static]
 

Initial value:

"Draws a cylinder\n\n"
"Args:\n"
"    molid (int): Molecule ID to draw on \n"
"    v1 (3-tuple of float): (x,y,z) coordinates of first vertex\n"
"    v2 (3-tuple of float): (x,y,z) coordinates of second vertex\n"
"    radius (float): Cylinder radius, defaults to 1.0\n"
"    resolution (int): Number of sides of cylinder, defaults to 6\n"
"    filled (bool): If cylinder ends should be capped\n"
"Returns:\n"
"    (int): ID of drawn cylinder"

Definition at line 132 of file py_graphics.C.

char delete_doc[] [static]
 

Initial value:

"Deletes a specified graphics object, or all graphics at a given molid\n\n"
"Args:\n"
"    molid (int): Molecule ID to delete graphics from\n"
"    which (int or str): Graphics ID to delete, or 'all' for all objects.\n"

Definition at line 477 of file py_graphics.C.

const char graphics_moddoc[] [static]
 

Initial value:

"Methods for drawing graphics primitives in the render window"

Definition at line 641 of file py_graphics.C.

Referenced by initgraphics.

PyMethodDef GraphicsMethods[] [static]
 

Initial value:

 {
  {"cone", (PyCFunction)py_cone,METH_VARARGS | METH_KEYWORDS, cone_doc},
  {"sphere", (PyCFunction)py_sphere, METH_VARARGS | METH_KEYWORDS, sphere_doc},
  {"triangle",(PyCFunction)py_triangle, METH_VARARGS | METH_KEYWORDS, triangle_doc},
  {"trinorm",(PyCFunction)py_trinorm, METH_VARARGS | METH_KEYWORDS, trinorm_doc},
  {"point",(PyCFunction)py_point, METH_VARARGS | METH_KEYWORDS, point_doc},
  {"line", (PyCFunction)py_line,METH_VARARGS | METH_KEYWORDS, line_doc},
  {"cylinder", (PyCFunction)py_cylinder, METH_VARARGS | METH_KEYWORDS, cylinder_doc},
  {"materials",(PyCFunction)py_materials, METH_VARARGS | METH_KEYWORDS, mats_doc},
  {"material",(PyCFunction)py_material, METH_VARARGS | METH_KEYWORDS, mat_doc},
  {"color",(PyCFunction)py_color, METH_VARARGS | METH_KEYWORDS, color_doc},
  {"text", (PyCFunction)py_text,METH_VARARGS | METH_KEYWORDS, text_doc},
  {"delete",(PyCFunction)py_delete, METH_VARARGS | METH_KEYWORDS, delete_doc},
  {"replace",(PyCFunction)py_replace, METH_VARARGS | METH_KEYWORDS, replace_doc},
  {"info",(PyCFunction)py_info, METH_VARARGS | METH_KEYWORDS, info_doc},
  {"listall",(PyCFunction)py_listall, METH_VARARGS | METH_KEYWORDS, list_doc},
  {NULL, NULL}
}

Definition at line 621 of file py_graphics.C.

Referenced by initgraphics.

char info_doc[] [static]
 

Initial value:

"Describe a graphics object with given index\n\n"
"Args:\n"
"    molid (int): Molecule ID containing graphics object\n"
"    graphic (int): Graphics object ID to describe\n"
"Returns:\n"
"    (str): Description of graphics object\n"
"Raises:\n"
"    IndexError: If object does not exist\n"

Definition at line 548 of file py_graphics.C.

char line_doc[] [static]
 

Initial value:

"Draw a line between the given vertices\n\n"
"Args:\n"
"    molid (int): Molecule ID to draw on\n"
"    v1 (3-tuple of float): (x,y,z) coordinates of first vertex\n"
"    v2 (3-tuple of float): (x,y,z) coordinates of second vertex\n"
"    style (str): Either 'solid' or 'dashed'. Defaults to solid line\n"
"    width (int): Width of line. Defaults to 1\n"
"Returns:\n"
"    (int): ID of drawn line"

Definition at line 197 of file py_graphics.C.

char list_doc[] [static]
 

Initial value:

"List all drawn graphics objects on a given molecule\n\n"
"Args:\n"
"    molid (int): Molecule ID to query\n"
"Returns:\n"
"    (list of int): Graphics object IDs present in molecule"

Definition at line 579 of file py_graphics.C.

char mat_doc[] [static]
 

Initial value:

"Set material for all graphics in this molecule\n\n"
"Args:\n"
"    molid (int): Molecule ID to affect\n"
"    name (str): Material name. Must be one returned by `material.listall()`"

Definition at line 272 of file py_graphics.C.

char mats_doc[] [static]
 

Initial value:

"Turns materials on or off for subsequent graphics primitives. Already drawn\n"
"graphics objects are not affected.\n\n"
"Args:\n"
"    molid (int): Molecule ID to affect\n"
"    on (bool): If materials should be on"

Definition at line 247 of file py_graphics.C.

char point_doc[] [static]
 

Initial value:

"Draw a point at the given vertex\n\n"
"Args:\n"
"    molid (int): Molecule ID to draw on\n"
"    v1 (3-tuple of float): (x,y,z) coordinates of point\n"
"Returns:\n"
"    (int): ID of drawn point"

Definition at line 169 of file py_graphics.C.

char replace_doc[] [static]
 

Initial value:

"Delete a graphics object and have the next element replace this one.\n\n"
"Args:\n"
"    molid (int): Molecule ID containing graphics object\n"
"    graphic (int): Graphics object ID to delete\n"

Definition at line 523 of file py_graphics.C.

char sphere_doc[] [static]
 

Initial value:

"Draws a sphere\n\n"
"Args:\n"
"    molid (int): Molecule ID to draw on \n"
"    center (3-tuple of float): (x,y,z) coordinates to center sphere.\n"
"        Defaults to the origin.\n"
"    radius (float): Sphere radius. Defaults to 1.0\n"
"    resolution (int): Sphere resolution. Defaults to 6\n"
"Returns:\n"
"    (int): ID of drawn sphere"

Definition at line 397 of file py_graphics.C.

char text_doc[] [static]
 

Initial value:

"Draw text\n\n"
"Args:\n"
"    molid (int): Molecule ID to draw on\n"
"    position (3-tuple of float): (x,y,z) coordinates to center text on\n"
"    text (str): Text to display\n"
"    size (float): Text size. Defaults to 1.0\n"
"    width (float): Text width. Defaults to 1.0\n"
"Returns:\n"
"    (int): ID of drawn text\n"

Definition at line 438 of file py_graphics.C.

char triangle_doc[] [static]
 

Initial value:

"Draws a triangle\n\n"
"Args:\n"
"    molid (int): Molecule ID to draw on\n"
"    v1 (3-tuple of float): (x,y,z) coordinates of first vertex\n"
"    v2 (3-tuple of float): (x,y,z) coordinates of second vertex\n"
"    v3 (3-tuple of float): (x,y,z) coordinates of third vertex\n"
"Returns:\n"
"    (int): ID of drawn triangle"

Definition at line 61 of file py_graphics.C.

char trinorm_doc[] [static]
 

Initial value:

"Draws a triangle with given vertices and vertex normals\n\n"
"Args:\n"
"    molid (int): Molecule ID to draw on\n"
"    v1 (3-tuple of float): (x,y,z) coordinates of first vertex\n"
"    v2 (3-tuple of float): (x,y,z) coordinates of second vertex\n"
"    v3 (3-tuple of float): (x,y,z) coordinates of third vertex\n"
"    n1 (3-tuple of float): (x,y,z) normal of first vertex\n"
"    n2 (3-tuple of float): (x,y,z) normal of second vertex\n"
"    n3 (3-tuple of float): (x,y,z) normal of third vertex\n"
"Returns:\n"
"    (int): ID of drawn triangle"

Definition at line 93 of file py_graphics.C.


Generated on Fri Apr 19 02:45:57 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002