00001 /*************************************************************************** 00002 *cr 00003 *cr (C) Copyright 1995-2019 The Board of Trustees of the 00004 *cr University of Illinois 00005 *cr All Rights Reserved 00006 *cr 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * RCS INFORMATION: 00011 * 00012 * $RCSfile: GeometryAtom.C,v $ 00013 * $Author: johns $ $Locker: $ $State: Exp $ 00014 * $Revision: 1.29 $ $Date: 2019/01/17 21:20:59 $ 00015 * 00016 *************************************************************************** 00017 * DESCRIPTION: 00018 * 00019 * Draws a marker for a specified atom into the display list for a Displayable 00020 * 00021 ***************************************************************************/ 00022 00023 #include "GeometryAtom.h" 00024 #include "MoleculeList.h" 00025 #include "Molecule.h" 00026 00027 00029 GeometryAtom::GeometryAtom(int m, int a, const int *cell, MoleculeList *mlist, 00030 CommandQueue *cq, Displayable *d) 00031 : GeometryMol(1, &m, &a, cell, mlist, cq, d) { 00032 00033 // indicate this object does not have a value 00034 hasValue = FALSE; 00035 } 00036 00037 00038 00040 00041 // draw the geometry marker in the given Displayable's drawing list 00042 void GeometryAtom::create_cmd_list() { 00043 00044 reset_disp_list(); 00045 // get the molecule pointer and atom position 00046 Molecule *mol = transformed_atom_coord(0, valuePos); 00047 00048 // do not draw if illegal molecule, or atom is not on 00049 if(!mol) 00050 return; 00051 00052 append(DMATERIALOFF); 00053 DispCmdColorIndex cmdColor; 00054 cmdColor.putdata(my_color,cmdList); 00055 // everything is OK, draw text at atom position 00056 JString str; 00057 atom_formatted_name(str, mol, comIndex[0]); 00058 display_string((const char *)str, cmdList); 00059 } 00060 00061 void GeometryAtom::set_pick(void) { 00062 // and set the Tcl variable "pick_selection" to the selection 00063 set_pick_selection(objIndex[0], 1, comIndex); 00064 } 00065 00066