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:

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
)

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

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

int MoleculeGraphics::add_pickpoint ( const float * x )

int MoleculeGraphics::add_point ( const float * x )

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

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
)

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

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

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
)

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

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]

virtual void MoleculeGraphics::pick_start ( PickMode * pm,
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 )

int MoleculeGraphics::use_material ( const 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 Mon Nov 17 02:48:48 2025 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002

AltStyle によって変換されたページ (->オリジナル) /