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

MoleculeGraphics Class Reference

Displayable subclass to generate graphics directly from scripts and plugins. More...

#include <MoleculeGraphics.h>

Inheritance diagram for MoleculeGraphics:

Displayable Pickable List of all members.

Public Types

enum  Shapes {
  NONE, POINT, PICKPOINT, TRIANGLE,
  TRINORM, TRICOLOR, LINE, CYLINDER,
  CONE, SPHERE, TEXT, SPHERETUBE,
  COLOR, MATERIALS, MATERIAL
}
 enumeration list of all supported geometric entitities. More...


Public Methods

 MoleculeGraphics (DrawMolecule *d)
virtual ~MoleculeGraphics (void)
virtual void prepare ()
 specific preparations, called by draw_prepare, supplied by derived class. More...

virtual void cov (float &x, float &y, float &z)
 center of volume, and scaling factor. More...

virtual float scale_factor (void)
int add_point (const float *x)
int add_pickpoint (const float *x)
int add_triangle (const float *x1, const float *x2, const float *x3)
int add_trinorm (const float *x1, const float *x2, const float *x3, const float *nx1, const float *nx2, const float *nx3)
int add_tricolor (const float *x1, const float *x2, const float *x3, const float *nx1, const float *nx2, const float *nx3, int c1, int c2, int c3)
int add_line (const float *x, const float *y, int line_style, int width)
int add_cylinder (const float *x, const float *y, float radius, int res, int filled)
int add_cone (const float *x, const float *y, float radius, float radius2, int res)
int add_sphere (const float *x, float r, int res)
int add_text (const float *x, const char *text, float size, float thickness)
int add_spheretube (const int numcoords, const float *xyz3fv, const int numradii, const float *radii1fv, const int numcolors, const float *rgb3fv, const int *colorids, int drawtubes, int res)
int use_materials (int yes_no)
int use_color (int index)
int use_material (const Material *)
void delete_id (int id)
 delete an entry. More...

void delete_all (void)
 delete everything. More...

int replace_id (int id)
 same as delete, but next addition goes here. More...

int index_id (int id)
 returns -1 if doesn't exist, else the index. More...

int num_elements (void)
int element_id (int index)
const char * info_id (int id)
 return the command string required to re-make the shape; class-internal string storage is set when called and returned to the caller, and will remain valid until the next such call. returns NULL if doesn't exist or is NONE. More...

virtual void pick_start (PickMode *pm, DisplayDevice *d, int btn, int tag, const int *cell, int, const float *)
 For 2D version: x & y are 0 ... 1, represent 'relative, scaled' coords. For 3D version: x,y,z are transformed position of pointer. More...


Detailed Description

Displayable subclass to generate graphics directly from scripts and plugins.

Definition at line 33 of file MoleculeGraphics.h.


Member Enumeration Documentation

enum MoleculeGraphics::Shapes
 

enumeration list of all supported geometric entitities.

Enumeration values:
NONE 
POINT 
PICKPOINT 
TRIANGLE 
TRINORM 
TRICOLOR 
LINE 
CYLINDER 
CONE 
SPHERE 
TEXT 
SPHERETUBE 
COLOR 
MATERIALS 
MATERIAL 

Definition at line 36 of file MoleculeGraphics.h.


Constructor & Destructor Documentation

MoleculeGraphics::MoleculeGraphics DrawMolecule   d [inline]
 

Definition at line 87 of file MoleculeGraphics.h.

References NULL.

virtual MoleculeGraphics::~MoleculeGraphics void    [inline, virtual]
 

Definition at line 98 of file MoleculeGraphics.h.


Member Function Documentation

int MoleculeGraphics::add_cone const float *    x,
const float *    y,
float    radius,
float    radius2,
int    res
 

Definition at line 445 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::append, CONE, data, n, num_elements, and vec_copy.

Referenced by py_cone, MolFilePlugin::read_rawgraphics, and tcl_graphics_cone.

int MoleculeGraphics::add_cylinder const float *    x,
const float *    y,
float    radius,
int    res,
int    filled
 

Definition at line 426 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::append, CYLINDER, data, n, num_elements, and vec_copy.

Referenced by py_cylinder, MolFilePlugin::read_rawgraphics, and tcl_graphics_cylinder.

int MoleculeGraphics::add_line const float *    x,
const float *    y,
int    line_style,
int    width
 

Definition at line 411 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::append, data, num_elements, and vec_copy.

Referenced by py_line, MolFilePlugin::read_rawgraphics, and tcl_graphics_line.

int MoleculeGraphics::add_pickpoint const float *    x
 

Definition at line 397 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::append, data, num_elements, PICKPOINT, and vec_copy.

Referenced by tcl_graphics_pickpoint.

int MoleculeGraphics::add_point const float *    x
 

Definition at line 384 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::append, data, num_elements, POINT, and vec_copy.

Referenced by py_point, MolFilePlugin::read_rawgraphics, and tcl_graphics_point.

int MoleculeGraphics::add_sphere const float *    x,
float    r,
int    res
 

Definition at line 464 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::append, data, n, num_elements, SPHERE, and vec_copy.

Referenced by py_sphere, MolFilePlugin::read_rawgraphics, and tcl_graphics_sphere.

int MoleculeGraphics::add_spheretube const int    numcoords,
const float *    xyz3fv,
const int    numradii,
const float *    radii1fv,
const int    numcolors,
const float *    rgb3fv,
const int *    colorids,
int    drawtubes,
int    res
 

Definition at line 497 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::append, clamp_int, Scene::color_value, data, MAXCOLORS, NULL, num_elements, Displayable::scene, SPHERETUBE, and vec_copy.

Referenced by tcl_graphics_spheretube.

int MoleculeGraphics::add_text const float *    x,
const char *    text,
float    size,
float    thickness
 

Definition at line 480 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::append, ResizeArray< char * >::append, data, ResizeArray< char * >::num, num_elements, size, stringdup, TEXT, and vec_copy.

Referenced by py_text, MolFilePlugin::read_rawgraphics, and tcl_graphics_text.

int MoleculeGraphics::add_triangle const float *    x1,
const float *    x2,
const float *    x3
 

Definition at line 311 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::append, data, num_elements, and vec_copy.

Referenced by py_triangle, MolFilePlugin::read_rawgraphics, and tcl_graphics_triangle.

int MoleculeGraphics::add_tricolor const float *    x1,
const float *    x2,
const float *    x3,
const float *    nx1,
const float *    nx2,
const float *    nx3,
int    c1,
int    c2,
int    c3
 

Definition at line 354 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::append, data, num_elements, TRICOLOR, vec_copy, and vec_normalize.

Referenced by MolFilePlugin::read_rawgraphics, and tcl_graphics_tricolor.

int MoleculeGraphics::add_trinorm const float *    x1,
const float *    x2,
const float *    x3,
const float *    nx1,
const float *    nx2,
const float *    nx3
 

Definition at line 328 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::append, data, num_elements, TRINORM, vec_copy, and vec_normalize.

Referenced by py_trinorm, MolFilePlugin::read_rawgraphics, and tcl_graphics_trinorm.

virtual void MoleculeGraphics::cov float &    x,
float &    y,
float &    z
[inline, virtual]
 

center of volume, and scaling factor.

Definition at line 106 of file MoleculeGraphics.h.

References z.

Referenced by DrawMolecule::cov.

void MoleculeGraphics::delete_all void   
 

delete everything.

Definition at line 627 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::clear.

Referenced by py_delete, and tcl_graphics_delete.

void MoleculeGraphics::delete_id int    id
 

delete an entry.

Definition at line 639 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::clear, index_id, n, NONE, num_elements, and ResizeArray< ShapeClass >::remove.

Referenced by py_delete, and tcl_graphics_delete.

int MoleculeGraphics::element_id int    index [inline]
 

Definition at line 143 of file MoleculeGraphics.h.

References NONE.

Referenced by py_listall, and tcl_graphics.

int MoleculeGraphics::index_id int    id
 

returns -1 if doesn't exist, else the index.

Definition at line 598 of file MoleculeGraphics.C.

References NONE, and num_elements.

Referenced by delete_id, info_id, py_info, replace_id, and tcl_graphics_exists.

const char * MoleculeGraphics::info_id int    id
 

return the command string required to re-make the shape; class-internal string storage is set when called and returned to the caller, and will remain valid until the next such call. returns NULL if doesn't exist or is NONE.

Definition at line 691 of file MoleculeGraphics.C.

References COLOR, CONE, CYLINDER, ResizeArray< char * >::data, index_id, MATERIAL, MATERIALS, NONE, NULL, PICKPOINT, POINT, SPHERE, SPHERETUBE, TEXT, TRICOLOR, and TRINORM.

Referenced by py_info, and tcl_graphics_info.

int MoleculeGraphics::num_elements void    [inline]
 

Definition at line 142 of file MoleculeGraphics.h.

References ResizeArray::num.

Referenced by add_cone, add_cylinder, add_line, add_pickpoint, add_point, add_sphere, add_spheretube, add_text, add_triangle, add_tricolor, add_trinorm, DrawMolecule::cov, delete_id, index_id, py_listall, DrawMolecule::scale_factor, tcl_graphics, use_color, use_material, and use_materials.

virtual void MoleculeGraphics::pick_start PickMode   pm,
DisplayDevice   d,
int    btn,
int    tag,
const int *    cell,
int   ,
const float *   
[inline, virtual]
 

For 2D version: x & y are 0 ... 1, represent 'relative, scaled' coords. For 3D version: x,y,z are transformed position of pointer.

Reimplemented from Pickable.

Definition at line 151 of file MoleculeGraphics.h.

References PickMode::pick_graphics.

virtual void MoleculeGraphics::prepare   [inline, virtual]
 

specific preparations, called by draw_prepare, supplied by derived class.

Reimplemented from Displayable.

Definition at line 101 of file MoleculeGraphics.h.

Referenced by DrawMolecule::change_ts.

int MoleculeGraphics::replace_id int    id
 

same as delete, but next addition goes here.

Definition at line 675 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::clear, and index_id.

Referenced by py_replace, and tcl_graphics_replace.

virtual float MoleculeGraphics::scale_factor void    [inline, virtual]
 

Definition at line 109 of file MoleculeGraphics.h.

Referenced by DrawMolecule::scale_factor.

int MoleculeGraphics::use_color int    index
 

Definition at line 583 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::append, COLOR, data, and num_elements.

Referenced by py_color, MolFilePlugin::read_rawgraphics, and tcl_graphics_color.

int MoleculeGraphics::use_material const Material  
 

Definition at line 560 of file MoleculeGraphics.C.

References Material::ambient, ResizeArray< ShapeClass >::append, data, Material::diffuse, Material::ind, mat, MATERIAL, Material::mirror, num_elements, Material::opacity, Material::outline, Material::outlinewidth, Material::shininess, Material::specular, and Material::transmode.

Referenced by py_material, and tcl_graphics_material.

int MoleculeGraphics::use_materials int    yes_no
 

Definition at line 548 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::append, data, MATERIALS, and num_elements.

Referenced by py_materials, and tcl_graphics_materials.


The documentation for this class was generated from the following files:
Generated on Thu Mar 28 02:45:48 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002