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

DrawMolItem Class Reference

Displayable subclass for creating geometric representations of molecules. More...

#include <DrawMolItem.h>

Inheritance diagram for DrawMolItem:

Displayable Pickable List of all members.

Public Types

enum  RegenChoices {
  NO_REGEN = 0, MOL_REGEN = 1, SEL_REGEN = 2, REP_REGEN = 4,
  COL_REGEN = 8
}
 Keep track of whether and why we have to regenerate rendering lists In particular, MOL_REGEN means molecular data has changed, whereas if all we did was change from one timestep to another, and nothing in the timestep has changed, then the update_ts flag is changed instead. The idea is that when we implement cached geometry for multiple frames, or a draw all frames option, we don't want to recreate the geometry unnecessarily. More...


Public Methods

 DrawMolItem (const char *, DrawMolecule *, AtomColor *, AtomRep *, AtomSel *)
virtual ~DrawMolItem (void)
int change_color (AtomColor *)
 change coloring method. More...

int change_rep (AtomRep *)
 change representation method. More...

int change_sel (const char *)
 change atom selection. More...

void force_recalc (int)
 force a recalculation of everything. More...

int atom_displayed (int)
 if Nth atom is displayed in ANY rep. More...

int representation_index (void)
 which representation this is. More...

int set_smoothing (int n)
int get_smoothing () const
void set_drawframes (const char *frames)
 Controls for drawing a subset of the molecule's frames. Pass a list of frames to be drawn, or "now" to draw just the current frame (the default). Always succeeds, invalid or out of range frames are ignored. More...

const char * get_drawframes () const
void set_pbc (int)
 Controls for display of periodic boundary conditions. Uses the PBC_x defines in VMDDisplayList. More...

int get_pbc () const
void set_pbc_images (int)
 Set the number of of periodic image replicas. Must be 1 or higher. More...

int get_pbc_images () const
void change_pbc ()
 the pbc parameters in Timestep have changed; update the transformation matrices accordingly (but no need to regenerate display lists). More...

void set_instances (int)
 Controls for display of molecule instances Uses the INSTANCE_x defines in VMDDisplayList. More...

int get_instances () const
void change_instances ()
 the instance parameters have changed; update the transformation matrices accordingly (but no need to regenerate display lists). More...

void change_ss ()
 the secondary structure for the molecule has changed. More...

void change_ts ()
 the currently displayed timestep has changed. More...

void change_traj ()
 timesteps have been added or removed from the parent molecule. More...

virtual void prepare ()
 prepare for drawing, do updates. More...

virtual int pickable_on ()
 override pickable_on so that it returns true only when both the rep and the molecule are on. More...

virtual void pick_start (PickMode *p, DisplayDevice *d, int btn, int tag, const int *cell, int dim, const float *pos)
 When picked, pass my parent molecule to the pick mode. More...

virtual void pick_move (PickMode *p, DisplayDevice *d, int tag, int dim, const float *pos)
 When picked, pass my parent molecule to the pick mode. More...

virtual void pick_end (PickMode *p, DisplayDevice *d)
 When picked, pass my parent molecule to the pick mode. More...


Public Attributes

AtomColoratomColor
 atom coloring method to use. More...

AtomRepatomRep
 atom representation to use. More...

AtomSelatomSel
 atom selection to use. More...

int repNumber
 current representation ID. More...

char commentBuffer [1024]
 buffer for comments. More...

char * name
 name of rep, used to identify uniquely. More...


Protected Methods

virtual void do_color_changed (int)
virtual void do_color_rgb_changed (int)
virtual void do_color_scale_changed ()

Protected Attributes

float spline_basis [4][4]
 spline basis used for ribbons/tubes. More...


Detailed Description

Displayable subclass for creating geometric representations of molecules.

Definition at line 55 of file DrawMolItem.h.


Member Enumeration Documentation

enum DrawMolItem::RegenChoices
 

Keep track of whether and why we have to regenerate rendering lists In particular, MOL_REGEN means molecular data has changed, whereas if all we did was change from one timestep to another, and nothing in the timestep has changed, then the update_ts flag is changed instead. The idea is that when we implement cached geometry for multiple frames, or a draw all frames option, we don't want to recreate the geometry unnecessarily.

Enumeration values:
NO_REGEN 
MOL_REGEN 
SEL_REGEN 
REP_REGEN 
COL_REGEN 

Definition at line 328 of file DrawMolItem.h.


Constructor & Destructor Documentation

DrawMolItem::DrawMolItem const char *   ,
DrawMolecule  ,
AtomColor  ,
AtomRep  ,
AtomSel  
 

Definition at line 53 of file DrawMolItem.C.

References atomColor, atomRep, atomSel, COL_REGEN, create_modified_CR_spline_basis, Displayable::isOn, MAXCOLORS, MOL_REGEN, name, BaseMolecule::nAtoms, NULL, SEL_REGEN, spline_basis, and stringdup.

DrawMolItem::~DrawMolItem void    [virtual]
 

Definition at line 101 of file DrawMolItem.C.

References atomColor, atomRep, atomSel, name, NULL, and ResizeArray< TubeIndexList * >::num.


Member Function Documentation

int DrawMolItem::atom_displayed int   
 

if Nth atom is displayed in ANY rep.

Definition at line 1102 of file DrawMolItem.C.

References atomSel, n, BaseMolecule::nAtoms, NULL, and AtomSel::on.

int DrawMolItem::change_color AtomColor  
 

change coloring method.

Definition at line 901 of file DrawMolItem.C.

References atomColor, and COL_REGEN.

Referenced by DrawMolecule::change_rep, do_color_changed, and do_color_rgb_changed.

void DrawMolItem::change_instances   [inline]
 

the instance parameters have changed; update the transformation matrices accordingly (but no need to regenerate display lists).

Definition at line 395 of file DrawMolItem.h.

Referenced by set_instances.

void DrawMolItem::change_pbc   [inline]
 

the pbc parameters in Timestep have changed; update the transformation matrices accordingly (but no need to regenerate display lists).

Definition at line 385 of file DrawMolItem.h.

Referenced by DrawMolecule::change_pbc, and set_pbc.

int DrawMolItem::change_rep AtomRep  
 

change representation method.

Definition at line 1032 of file DrawMolItem.C.

References atomRep, Surf::clear, MSMSInterface::clear, AtomRep::method, AtomRep::MSMS, NULL, ResizeArray< TubeIndexList * >::num, AtomRep::ORBITAL, REP_REGEN, AtomRep::STRUCTURE, AtomRep::SURF, and AtomRep::TUBE.

Referenced by DrawMolecule::change_rep.

int DrawMolItem::change_sel const char *   
 

change atom selection.

Definition at line 1086 of file DrawMolItem.C.

References atomSel, AtomSel::change, AtomSel::NO_PARSE, DrawMolecule::notify, and SEL_REGEN.

Referenced by DrawMolecule::change_rep.

void DrawMolItem::change_ss   [inline]
 

the secondary structure for the molecule has changed.

Definition at line 399 of file DrawMolItem.h.

Referenced by DrawMolecule::recalc_ss.

void DrawMolItem::change_traj   [inline]
 

timesteps have been added or removed from the parent molecule.

Definition at line 405 of file DrawMolItem.h.

void DrawMolItem::change_ts   [inline]
 

the currently displayed timestep has changed.

Definition at line 402 of file DrawMolItem.h.

Referenced by DrawMolecule::change_ts.

void DrawMolItem::do_color_changed int    [protected, virtual]
 

Reimplemented from Displayable.

Definition at line 849 of file DrawMolItem.C.

References atomColor, Scene::category_index, change_color, COL_REGEN, AtomColor::current_color_use, and Displayable::scene.

void DrawMolItem::do_color_rgb_changed int    [protected, virtual]
 

Reimplemented from Displayable.

Definition at line 863 of file DrawMolItem.C.

References atomColor, Scene::category_index, Scene::category_item_value, change_color, COL_REGEN, AtomColor::color, BaseMolecule::nAtoms, and Displayable::scene.

void DrawMolItem::do_color_scale_changed   [protected, virtual]
 

Reimplemented from Displayable.

Definition at line 891 of file DrawMolItem.C.

References atomColor, COL_REGEN, AtomColor::find, and AtomColor::uses_colorscale.

void DrawMolItem::force_recalc int   
 

force a recalculation of everything.

Definition at line 1097 of file DrawMolItem.C.

Referenced by DrawMolecule::force_recalc, VMDApp::molrep_reset_scaleminmax, VMDApp::molrep_set_colorupdate, VMDApp::molrep_set_scaleminmax, and VMDApp::molrep_set_smoothing.

const char* DrawMolItem::get_drawframes   const [inline]
 

Definition at line 372 of file DrawMolItem.h.

Referenced by VMDApp::molrep_get_drawframes, and GraphicsFltkMenu::update_rep.

int DrawMolItem::get_instances   const
 

Definition at line 184 of file DrawMolItem.C.

References Displayable::cmdList, and VMDDisplayList::instanceset.

Referenced by VMDApp::molrep_get_instances.

int DrawMolItem::get_pbc   const
 

Definition at line 159 of file DrawMolItem.C.

References Displayable::cmdList, and VMDDisplayList::pbc.

Referenced by VMDApp::molrep_get_pbc, and GraphicsFltkMenu::update_pbc.

int DrawMolItem::get_pbc_images   const
 

Definition at line 169 of file DrawMolItem.C.

References Displayable::cmdList, and VMDDisplayList::npbc.

Referenced by VMDApp::molrep_get_pbc_images, and GraphicsFltkMenu::update_pbc.

int DrawMolItem::get_smoothing   const [inline]
 

Definition at line 364 of file DrawMolItem.h.

Referenced by VMDApp::molrep_get_smoothing, VMDApp::molrep_set_smoothing, and GraphicsFltkMenu::update_rep.

virtual void DrawMolItem::pick_end PickMode   p,
DisplayDevice   d
[inline, virtual]
 

When picked, pass my parent molecule to the pick mode.

Reimplemented from Pickable.

Definition at line 429 of file DrawMolItem.h.

References PickMode::pick_molecule_end.

virtual void DrawMolItem::pick_move PickMode   p,
DisplayDevice   d,
int    tag,
int    dim,
const float *    pos
[inline, virtual]
 

When picked, pass my parent molecule to the pick mode.

Reimplemented from Pickable.

Definition at line 424 of file DrawMolItem.h.

References PickMode::pick_molecule_move.

virtual void DrawMolItem::pick_start PickMode   p,
DisplayDevice   d,
int    btn,
int    tag,
const int *    cell,
int    dim,
const float *    pos
[inline, virtual]
 

When picked, pass my parent molecule to the pick mode.

Reimplemented from Pickable.

Definition at line 418 of file DrawMolItem.h.

References PickMode::pick_molecule_start.

int DrawMolItem::pickable_on   [virtual]
 

override pickable_on so that it returns true only when both the rep and the molecule are on.

Reimplemented from Displayable.

Definition at line 3281 of file DrawMolItem.C.

References Displayable::displayed.

void DrawMolItem::prepare   [virtual]
 

prepare for drawing, do updates.

Reimplemented from Displayable.

Definition at line 922 of file DrawMolItem.C.

References atomColor, atomRep, Displayable::cmdList, COL_REGEN, Displayable::displayed, Molecule::file_in_progress, VMDDisplayList::instanceset, AtomRep::method, AtomColor::method, MOL_REGEN, Displayable::need_matrix_recalc, AtomRep::NEWCARTOON, VMDDisplayList::pbc, AtomColor::PHYSICALTIME, AtomColor::STRUCTURE, AtomRep::STRUCTURE, AtomColor::THROB, AtomColor::TIMESTEP, AtomColor::USER, AtomColor::USER2, AtomColor::USER3, AtomColor::USER4, and AtomColor::VELOCITY.

int DrawMolItem::representation_index void   
 

which representation this is.

Definition at line 911 of file DrawMolItem.C.

References DrawMolecule::component, and DrawMolecule::components.

void DrawMolItem::set_drawframes const char *    frames
 

Controls for drawing a subset of the molecule's frames. Pass a list of frames to be drawn, or "now" to draw just the current frame (the default). Always succeeds, invalid or out of range frames are ignored.

Definition at line 266 of file DrawMolItem.C.

References MOL_REGEN, and stringdup.

Referenced by VMDApp::molrep_set_drawframes.

void DrawMolItem::set_instances int   
 

Controls for display of molecule instances Uses the INSTANCE_x defines in VMDDisplayList.

Definition at line 174 of file DrawMolItem.C.

References change_instances, Displayable::cmdList, VMDDisplayList::instanceset, and DrawMolecule::notify.

Referenced by VMDApp::molrep_set_instances.

void DrawMolItem::set_pbc int   
 

Controls for display of periodic boundary conditions. Uses the PBC_x defines in VMDDisplayList.

Definition at line 149 of file DrawMolItem.C.

References change_pbc, Displayable::cmdList, DrawMolecule::notify, and VMDDisplayList::pbc.

Referenced by VMDApp::molrep_set_pbc.

void DrawMolItem::set_pbc_images int   
 

Set the number of of periodic image replicas. Must be 1 or higher.

Definition at line 163 of file DrawMolItem.C.

References Displayable::cmdList, n, Displayable::need_matrix_recalc, DrawMolecule::notify, and VMDDisplayList::npbc.

Referenced by VMDApp::molrep_set_pbc_images.

int DrawMolItem::set_smoothing int    n [inline]
 

Definition at line 357 of file DrawMolItem.h.

References n.

Referenced by VMDApp::molrep_set_smoothing.


Member Data Documentation

AtomColor* DrawMolItem::atomColor
 

atom coloring method to use.

Definition at line 57 of file DrawMolItem.h.

Referenced by add_rep_to_browser, change_color, do_color_changed, do_color_rgb_changed, do_color_scale_changed, DrawMolItem, molinfo_get, VMDApp::molrep_get_color, VMDApp::molrep_get_colorupdate, VMDApp::molrep_get_scaleminmax, VMDApp::molrep_reset_scaleminmax, VMDApp::molrep_set_colorupdate, VMDApp::molrep_set_scaleminmax, prepare, GraphicsFltkMenu::update_rep, and ~DrawMolItem.

AtomRep* DrawMolItem::atomRep
 

atom representation to use.

Definition at line 58 of file DrawMolItem.h.

Referenced by add_rep_to_browser, change_rep, DrawMolItem, molinfo_get, VMDApp::molrep_get_style, prepare, GraphicsFltkMenu::update_rep, and ~DrawMolItem.

AtomSel* DrawMolItem::atomSel
 

atom selection to use.

Definition at line 59 of file DrawMolItem.h.

Referenced by add_rep_to_browser, Tool::assign_rep, atom_displayed, change_sel, DrawMolItem, molinfo_get, VMDApp::molrep_get_selection, VMDApp::molrep_get_selupdate, VMDApp::molrep_numselected, VMDApp::molrep_set_selupdate, PickModeMoveRep::rotate, Tool::target, PickModeMoveRep::translate, Tool::tug, GraphicsFltkMenu::update_rep, and ~DrawMolItem.

char DrawMolItem::commentBuffer[1024]
 

buffer for comments.

Definition at line 61 of file DrawMolItem.h.

char* DrawMolItem::name
 

name of rep, used to identify uniquely.

Definition at line 63 of file DrawMolItem.h.

Referenced by Tool::assign_rep, DrawMolItem, DrawMolecule::get_component_name, and ~DrawMolItem.

int DrawMolItem::repNumber
 

current representation ID.

Definition at line 60 of file DrawMolItem.h.

float DrawMolItem::spline_basis[4][4] [protected]
 

spline basis used for ribbons/tubes.

Definition at line 435 of file DrawMolItem.h.

Referenced by DrawMolItem.


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