Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   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, 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)
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 data to make shape; static string space is always used return 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 32 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 
COLOR 
MATERIALS 
MATERIAL 

Definition at line 35 of file MoleculeGraphics.h.


Constructor & Destructor Documentation

MoleculeGraphics::MoleculeGraphics DrawMolecule   d [inline]
 

Definition at line 74 of file MoleculeGraphics.h.

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

Definition at line 83 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 324 of file MoleculeGraphics.C.

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

Referenced by graphics_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 305 of file MoleculeGraphics.C.

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

Referenced by graphics_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 290 of file MoleculeGraphics.C.

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

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

int MoleculeGraphics::add_pickpoint const float *    x
 

Definition at line 276 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 263 of file MoleculeGraphics.C.

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

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

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

Definition at line 343 of file MoleculeGraphics.C.

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

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

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

Definition at line 359 of file MoleculeGraphics.C.

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

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

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

Definition at line 190 of file MoleculeGraphics.C.

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

Referenced by graphics_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 233 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 207 of file MoleculeGraphics.C.

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

Referenced by graphics_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 91 of file MoleculeGraphics.h.

Referenced by DrawMolecule::cov.

void MoleculeGraphics::delete_all void   
 

delete everything.

Definition at line 447 of file MoleculeGraphics.C.

References ResizeArray< ShapeClass >::clear.

Referenced by graphics_delete, and tcl_graphics_delete.

void MoleculeGraphics::delete_id int    id
 

delete an entry.

Definition at line 459 of file MoleculeGraphics.C.

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

Referenced by graphics_delete, and tcl_graphics_delete.

int MoleculeGraphics::element_id int    index [inline]
 

Definition at line 124 of file MoleculeGraphics.h.

References NONE.

Referenced by graphics_listall, and tcl_graphics.

int MoleculeGraphics::index_id int    id
 

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

Definition at line 418 of file MoleculeGraphics.C.

References NONE, and num_elements.

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

const char * MoleculeGraphics::info_id int    id
 

return data to make shape; static string space is always used return NULL if doesn't exist or is NONE.

Definition at line 511 of file MoleculeGraphics.C.

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

Referenced by graphics_info, and tcl_graphics_info.

int MoleculeGraphics::num_elements void    [inline]
 

Definition at line 123 of file MoleculeGraphics.h.

References ResizeArray::num.

Referenced by add_cone, add_cylinder, add_line, add_pickpoint, add_point, add_sphere, add_text, add_triangle, add_tricolor, add_trinorm, DrawMolecule::cov, delete_id, graphics_listall, index_id, 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 130 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 86 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 495 of file MoleculeGraphics.C.

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

Referenced by graphics_replace, and tcl_graphics_replace.

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

Definition at line 94 of file MoleculeGraphics.h.

Referenced by DrawMolecule::scale_factor.

int MoleculeGraphics::use_color int    index
 

Definition at line 405 of file MoleculeGraphics.C.

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

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

int MoleculeGraphics::use_material const Material  
 

Definition at line 386 of file MoleculeGraphics.C.

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

Referenced by graphics_material, and tcl_graphics_material.

int MoleculeGraphics::use_materials int    yes_no
 

Definition at line 374 of file MoleculeGraphics.C.

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

Referenced by graphics_materials, and tcl_graphics_materials.


The documentation for this class was generated from the following files:
Generated on Sun Jul 6 01:28:33 2008 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002