#include <Displayable.h>
Inheritance diagram for Displayable:
Public Methods | |
void * | operator new (size_t) |
Everything in this class can be accessed by the draw function, so all data must be allocated in Scene address space. These allocators handled specially in the CAVE and FreeVR subclasses. More... | |
void | operator delete (void *, size_t) |
int | needUpdate (void) |
are all child Displayables current? More... | |
Displayable (Displayable *) | |
constructor: specify the parent Displayable, which may NOT be NULL. More... | |
Displayable (Scene *) | |
alternative constructor for root Displayable; no parent. More... | |
virtual | ~Displayable (void) |
destructor: delete all children as well. More... | |
void | reset_disp_list (void) |
reset the display command list; remove all current commands. More... | |
void | need_matrix_recalc (void) |
signal that a reset of the trans matrix is needed next 'prepare' cycle. More... | |
virtual VMDDisplayList * | pick_cmd_list (void) |
return our list of draw commands with picking draw commands in them. More... | |
virtual int | pickable_on (void) |
return whether the pickable object is being displayed. More... | |
void | color_changed (int cat) |
Recompute color indices if you're using the given color category. More... | |
void | color_rgb_changed (int color) |
A color's rgb value has been redefined. More... | |
void | color_scale_changed () |
The color scale has been redefined. More... | |
Displayable * | child (int N) const |
return the Nth child displayable pointer. More... | |
int | child_index (Displayable *d) |
return the index of the given child displayable pointer, or (-1) if none. More... | |
void | add_child (Displayable *) |
add the given Displayable as a child (assuming it is one). More... | |
int | remove_child (Displayable *) |
remove specified child displayable, does not delete it. return success. More... | |
int | remove_child (int N) |
remove specified child displayable, does not delete it. return success. More... | |
int | displayed (void) const |
void | off (void) |
turn displayable off. More... | |
void | on (void) |
turn displayable on. More... | |
int | fixed (void) const |
void | fix (void) |
void | unfix (void) |
int | draw_prepare () |
update geometry before drawing, called by Scene to prepare all objects. More... | |
virtual void | prepare () |
specific preparations, called by draw_prepare, supplied by derived class. More... | |
void | draw (DisplayDevice *) const |
call DisplayDevice::render() on the list, then draw children recursively. More... | |
void | scale_on (void) |
void | scale_off (void) |
int | scaling (void) const |
void | rot_on (void) |
void | rot_off (void) |
int | rotating (void) const |
void | cent_trans_on (void) |
void | cent_trans_off (void) |
int | cent_translating (void) const |
void | glob_trans_on (void) |
void | glob_trans_off (void) |
int | glob_translating (void) const |
virtual void | reset_transformation (void) |
reset to identity matrix, virtual so resets affect other factors as well. More... | |
void | set_scale (float s) |
set the scale factor. More... | |
void | mult_scale (float s) |
multiply the existing scale factor. More... | |
void | add_rot (float x, char axis) |
add a rotation to the specified axis. More... | |
void | add_rot (const Matrix4 &) |
concatenate in a new rotation. More... | |
void | set_rot (float x, char axis) |
set the rotation on a given axis. More... | |
void | set_rot (const Matrix4 &) |
set the rotation matrix. More... | |
void | set_glob_trans (float, float, float) |
set the global translation. More... | |
void | add_glob_trans (float, float, float) |
add to the global translation. More... | |
void | set_cent_trans (float, float, float) |
set the centering transform. More... | |
void | add_cent_trans (float, float, float) |
add to the centering transform. More... | |
void | change_center (float x, float y, float z) |
change centt and globt so (x,y,z) is in the center and tm(old) * (x,y,z) = tm(new) * (x,y,z);. More... | |
void | cacheskip (int onoff) |
whether to skip display list caching. More... | |
void | change_material (const Material *) |
int | curr_material () const |
void | update_material (const Material *mat) |
void | delete_material (int n, const MaterialList *) |
const VMDClipPlane * | clipplane (int i) |
int | set_clip_center (int i, const float *center) |
int | set_clip_normal (int i, const float *normal) |
int | set_clip_color (int i, const float *color) |
int | set_clip_status (int i, int mode) |
Public Attributes | |
Matrix4 | rotm |
Rotation matrix (R). More... | |
float | globt [3] |
Global Translation (GT). More... | |
float | centt [3] |
Centering translation (CT). More... | |
float | scale |
Scaling (S). More... | |
Matrix4 | tm |
concatenated transformation matrix (GT * S * R * CT). More... | |
Protected Methods | |
void | append (int d) |
append a DispCmd code with no data to the cmdList. More... | |
void | recalc_mat (void) |
recalculate the transformation matrix, and replace matrix in cmdList. More... | |
virtual void | do_color_changed (int cat) |
virtual void | do_color_rgb_changed (int color) |
virtual void | do_color_scale_changed () |
Protected Attributes | |
VMDDisplayList * | cmdList |
The list of display commands. More... | |
Scene * | scene |
The Scene object where color data can be accessed. More... | |
int | doCent |
which of the following operations will this object listen to. More... | |
int | doRot |
which of the following operations will this object listen to. More... | |
int | doGlob |
which of the following operations will this object listen to. More... | |
int | doScale |
which of the following operations will this object listen to. More... | |
int | isFixed |
is the object free to be affected by rotations/translations/etc? More... | |
int | isOn |
is the object to be drawn or not? More... | |
Displayable * | parent |
our parent Displayable; if NULL, this is a parent Displayable. More... | |
Displayable ** | children |
list of all children Displayable's. More... | |
int | num_children |
int | max_children |
Definition at line 39 of file Displayable.h.
|
constructor: specify the parent Displayable, which may NOT be NULL.
Definition at line 96 of file Displayable.C. References add_child, VMDDisplayList::ambient, VMDDisplayList::cacheskip, centt, cmdList, VMDDisplayList::diffuse, displayed, doCent, doGlob, doRot, doScale, globt, isOn, VMDDisplayList::materialtag, VMDDisplayList::mirror, VMDDisplayList::opacity, VMDDisplayList::outline, VMDDisplayList::outlinewidth, parent, rotm, scale, VMDDisplayList::shininess, VMDDisplayList::specular, tm, VMDDisplayList::transmode, and vec_copy. |
|
alternative constructor for root Displayable; no parent.
Definition at line 83 of file Displayable.C. References centt, doCent, doGlob, doRot, doScale, globt, isOn, NULL, parent, and scale. |
|
destructor: delete all children as well.
Definition at line 166 of file Displayable.C. References child, children, cmdList, num_children, parent, remove_child, VMDDisplayList::reset_and_free, and vmd_dealloc. |
|
add to the centering transform.
Definition at line 431 of file Displayable.C. References cent_translating, centt, child, num_children, recalc_mat, and z. Referenced by MoleculeList::center_all_molecules, and MoleculeList::center_top_molecule. |
|
add the given Displayable as a child (assuming it is one).
Definition at line 222 of file Displayable.C. References children, max_children, num_children, vmd_alloc, and vmd_dealloc. Referenced by Displayable. |
|
add to the global translation.
Definition at line 405 of file Displayable.C. References child, fixed, glob_translating, globt, need_matrix_recalc, num_children, and z. Referenced by VMDApp::scene_translate_by. |
|
concatenate in a new rotation.
Definition at line 365 of file Displayable.C. References add_rot, child, fixed, mat, Matrix4::multmatrix, need_matrix_recalc, num_children, rotating, and rotm. |
|
add a rotation to the specified axis.
Definition at line 334 of file Displayable.C. References child, fixed, mat, Matrix4::multmatrix, need_matrix_recalc, num_children, Matrix4::rot, rotating, and rotm. Referenced by add_rot, Stage::prepare, DisplayRocker::prepare, and VMDApp::scene_rotate_by. |
|
append a DispCmd code with no data to the cmdList.
Definition at line 75 of file Displayable.h. References VMDDisplayList::append. Referenced by GeometryBond::create_cmd_list, GeometryAtom::create_cmd_list, DrawTool::DrawTool, and FPS::prepare. |
|
whether to skip display list caching.
Definition at line 497 of file Displayable.C. References VMDDisplayList::cacheskip, and cmdList. |
|
Definition at line 196 of file Displayable.h. References doCent. Referenced by Axes::Axes, DrawTool::DrawTool, FPS::FPS, GeometryList::GeometryList, Stage::Stage, and VMDTitle::VMDTitle. |
|
Definition at line 195 of file Displayable.h. References doCent. |
|
Definition at line 197 of file Displayable.h. References doCent. Referenced by add_cent_trans, reset_transformation, and set_cent_trans. |
|
change centt and globt so (x,y,z) is in the center and tm(old) * (x,y,z) = tm(new) * (x,y,z);.
Definition at line 443 of file Displayable.C. References Matrix4::multpoint4d, rotm, scale, Matrix4::scale, set_cent_trans, set_glob_trans, tm, and z. Referenced by molinfo_set, and PickModeCenter::pick_molecule_end. |
|
|
return the Nth child displayable pointer.
Definition at line 141 of file Displayable.h. Referenced by add_cent_trans, add_glob_trans, add_rot, child_index, color_changed, color_rgb_changed, color_scale_changed, draw, draw_prepare, mult_scale, recalc_mat, remove_child, reset_transformation, set_cent_trans, set_glob_trans, set_rot, set_scale, and ~Displayable. |
|
return the index of the given child displayable pointer, or (-1) if none.
Definition at line 144 of file Displayable.h. References child, and num_children. Referenced by remove_child. |
|
Definition at line 242 of file Displayable.h. References VMDDisplayList::clipplane. Referenced by VMDApp::molrep_get_clipplane. |
|
Recompute color indices if you're using the given color category.
Definition at line 531 of file Displayable.C. References child, do_color_changed, and num_children. Referenced by VMDApp::color_set_restype, and Scene::set_category_item. |
|
A color's rgb value has been redefined.
Definition at line 536 of file Displayable.C. References child, do_color_rgb_changed, and num_children. Referenced by Scene::set_color_value. |
|
The color scale has been redefined.
Definition at line 541 of file Displayable.C. References child, do_color_scale_changed, and num_children. |
|
Definition at line 501 of file Displayable.C. References cmdList, and VMDDisplayList::materialtag. Referenced by GraphicsFltkMenu::act_on_command, delete_material, molinfo_get, VMDApp::molrep_get_material, update_material, and GraphicsFltkMenu::update_rep. |
|
Definition at line 510 of file Displayable.C. References change_material, children, curr_material, MaterialList::material, n, and num_children. Referenced by MaterialList::delete_material. |
|
Definition at line 159 of file Displayable.h. References isOn. Referenced by GeometryList::add_geometry, add_rep_to_browser, DrawMolecule::atom_displayed, Displayable, MoleculeList::displayed, geom2dict, molinfo_get, VMDApp::molrep_is_shown, DrawMolItem::pickable_on, pickable_on, FPS::prepare, DrawMolItem::prepare, py_is_shown, and text_cmd_display. |
|
Reimplemented in Axes. Definition at line 97 of file Displayable.h. Referenced by color_changed. |
|
Reimplemented in DrawMolItem. Definition at line 98 of file Displayable.h. Referenced by color_rgb_changed. |
|
Reimplemented in DrawMolItem. Definition at line 99 of file Displayable.h. Referenced by color_scale_changed. |
|
call DisplayDevice::render() on the list, then draw children recursively.
Definition at line 282 of file Displayable.C. References child, cmdList, num_children, and DisplayDevice::render. Referenced by Scene::draw, and Scene::filedraw. |
|
update geometry before drawing, called by Scene to prepare all objects.
Definition at line 260 of file Displayable.C. References child, NULL, num_children, parent, prepare, and recalc_mat. Referenced by Scene::prepare. |
|
Definition at line 167 of file Displayable.h. References isFixed. Referenced by Tool::dograb, and MoleculeList::fix. |
|
Definition at line 166 of file Displayable.h. References isFixed. Referenced by add_glob_trans, add_rot, MoleculeList::fixed, glob_translating, molinfo_get, mult_scale, py_is_fixed, rotating, scaling, set_glob_trans, set_rot, and set_scale. |
|
Definition at line 200 of file Displayable.h. References doGlob. Referenced by Axes::Axes, Tool::check_event, DrawTool::DrawTool, FPS::FPS, GeometryList::GeometryList, Stage::pick_move, Axes::pick_move, VMDTitle::prepare, Stage::prepare, Axes::prepare, Stage::Stage, and VMDTitle::VMDTitle. |
|
Definition at line 199 of file Displayable.h. References doGlob. Referenced by Tool::check_event, Stage::pick_move, Axes::pick_move, VMDTitle::prepare, Stage::prepare, Axes::prepare, and VMDTitle::VMDTitle. |
|
Definition at line 201 of file Displayable.h. Referenced by add_glob_trans, reset_transformation, and set_glob_trans. |
|
multiply the existing scale factor.
Definition at line 322 of file Displayable.C. References child, fixed, need_matrix_recalc, num_children, scale, and scaling. Referenced by MoleculeList::center_all_molecules, MoleculeList::center_top_molecule, and VMDApp::scene_scale_by. |
|
signal that a reset of the trans matrix is needed next 'prepare' cycle.
Definition at line 115 of file Displayable.h. Referenced by add_glob_trans, add_rot, DrawMolecule::force_recalc, mult_scale, FPS::prepare, DrawMolItem::prepare, reset_transformation, set_cent_trans, set_glob_trans, DrawMolItem::set_pbc_images, set_rot, and set_scale. |
|
are all child Displayables current?
Definition at line 55 of file Displayable.h. Referenced by DrawMolecule::prepare, and DrawForce::prepare. |
|
turn displayable off.
Definition at line 211 of file Displayable.C. References isOn. Referenced by GeometryList::add_geometry, VMDApp::display_set_fps, MoleculeList::hide, Stage::location, Axes::location, GeometryList::show_geometry, DrawMolecule::show_rep, and VMDApp::VMDinit. |
|
turn displayable on.
Definition at line 216 of file Displayable.C. References isOn. Referenced by GeometryList::add_geometry, VMDApp::display_set_fps, Stage::location, Axes::location, MoleculeList::show, GeometryList::show_geometry, and DrawMolecule::show_rep. |
|
Definition at line 79 of file Displayable.C. References vmd_dealloc. |
|
Everything in this class can be accessed by the draw function, so all data must be allocated in Scene address space. These allocators handled specially in the CAVE and FreeVR subclasses.
Definition at line 75 of file Displayable.C. |
|
return our list of draw commands with picking draw commands in them.
Reimplemented from Pickable. Definition at line 522 of file Displayable.C. References cmdList. |
|
return whether the pickable object is being displayed.
Reimplemented from Pickable. Reimplemented in DrawMolItem. Definition at line 527 of file Displayable.C. References displayed. |
|
specific preparations, called by draw_prepare, supplied by derived class.
Reimplemented in Axes. Definition at line 257 of file Displayable.C. Referenced by draw_prepare. |
|
recalculate the transformation matrix, and replace matrix in cmdList.
Definition at line 189 of file Displayable.C. References centt, child, cmdList, globt, Matrix4::identity, VMDDisplayList::mat, Matrix4::multmatrix, num_children, rotm, scale, Matrix4::scale, tm, and Matrix4::translate. Referenced by add_cent_trans, and draw_prepare. |
|
remove specified child displayable, does not delete it. return success.
Definition at line 157 of file Displayable.h. References child, and remove_child. |
|
remove specified child displayable, does not delete it. return success.
Definition at line 237 of file Displayable.C. References child_index, children, n, and num_children. Referenced by remove_child, and ~Displayable. |
|
reset the display command list; remove all current commands.
Definition at line 157 of file Displayable.C. References cmdList, VMDApp::get_repserialnum, and VMDDisplayList::reset_and_free. Referenced by Molecule::addPersistentForce, GeometrySpring::create_cmd_list, GeometryDihedral::create_cmd_list, GeometryBond::create_cmd_list, GeometryAtom::create_cmd_list, GeometryAngle::create_cmd_list, and FPS::prepare. |
|
reset to identity matrix, virtual so resets affect other factors as well.
Definition at line 297 of file Displayable.C. References cent_translating, centt, child, glob_translating, globt, Matrix4::identity, need_matrix_recalc, num_children, rotating, rotm, scale, and scaling. Referenced by MoleculeList::center_all_molecules, MoleculeList::center_top_molecule, Stage::prepare, and VMDApp::scene_resetview. |
|
Definition at line 192 of file Displayable.h. References doRot. Referenced by Tool::check_event, DrawTool::DrawTool, FPS::FPS, GeometryList::GeometryList, VMDTitle::prepare, Stage::prepare, Stage::Stage, and VMDTitle::VMDTitle. |
|
Definition at line 191 of file Displayable.h. References doRot. Referenced by Axes::Axes, Tool::check_event, VMDTitle::prepare, and Stage::prepare. |
|
Definition at line 193 of file Displayable.h. Referenced by add_rot, reset_transformation, and set_rot. |
|
Definition at line 188 of file Displayable.h. References doScale. Referenced by Axes::Axes, DrawTool::DrawTool, FPS::FPS, GeometryList::GeometryList, VMDTitle::prepare, Stage::Stage, and VMDTitle::VMDTitle. |
|
Definition at line 187 of file Displayable.h. References doScale. Referenced by Axes::Axes, DrawTool::DrawTool, and VMDTitle::prepare. |
|
Definition at line 189 of file Displayable.h. References doScale, and fixed. Referenced by mult_scale, reset_transformation, and set_scale. |
|
set the centering transform.
Definition at line 419 of file Displayable.C. References cent_translating, centt, child, need_matrix_recalc, num_children, and z. Referenced by change_center, molinfo_set, and py_set_center. |
|
Definition at line 247 of file Displayable.h. References VMDDisplayList::get_clip_status, and VMDDisplayList::set_clip_center. Referenced by VMDApp::molrep_set_clipcenter. |
|
Definition at line 277 of file Displayable.h. References VMDDisplayList::get_clip_status, and VMDDisplayList::set_clip_color. Referenced by VMDApp::molrep_set_clipcolor. |
|
Definition at line 262 of file Displayable.h. References VMDDisplayList::get_clip_status, and VMDDisplayList::set_clip_normal. Referenced by VMDApp::molrep_set_clipnormal. |
|
Definition at line 292 of file Displayable.h. References VMDDisplayList::get_clip_status, and VMDDisplayList::set_clip_status. Referenced by VMDApp::molrep_set_clipstatus. |
|
set the global translation.
Definition at line 391 of file Displayable.C. References child, fixed, glob_translating, globt, need_matrix_recalc, num_children, and z. Referenced by change_center, Tool::check_event, molinfo_set, Stage::pick_move, Axes::pick_move, VMDTitle::prepare, Stage::prepare, Axes::prepare, py_set_trans, VMDApp::scene_translate_to, and VMDTitle::VMDTitle. |
|
set the rotation matrix.
Definition at line 379 of file Displayable.C. References child, fixed, need_matrix_recalc, num_children, rotating, rotm, and set_rot. |
|
set the rotation on a given axis.
Definition at line 351 of file Displayable.C. References child, fixed, Matrix4::identity, need_matrix_recalc, num_children, Matrix4::rot, rotating, and rotm. Referenced by Tool::check_event, molinfo_set, VMDTitle::prepare, py_set_rotation, VMDApp::scene_rotate_to, and set_rot. |
|
set the scale factor.
Definition at line 310 of file Displayable.C. References child, fixed, need_matrix_recalc, num_children, scale, and scaling. Referenced by Axes::Axes, DrawTool::DrawTool, molinfo_set, VMDTitle::prepare, py_set_scale, and VMDApp::scene_scale_to. |
|
Definition at line 168 of file Displayable.h. References isFixed. Referenced by Tool::dograb, MoleculeList::unfix, and Tool::ungrab. |
|
Definition at line 505 of file Displayable.C. References change_material, children, curr_material, Material::ind, mat, and num_children. Referenced by MaterialList::MaterialList, and MaterialList::notify. |
|
Centering translation (CT).
Definition at line 50 of file Displayable.h. Referenced by add_cent_trans, Displayable, molinfo_get, py_get_center, recalc_mat, reset_transformation, and set_cent_trans. |
|
list of all children Displayable's.
Definition at line 93 of file Displayable.h. Referenced by add_child, delete_material, remove_child, update_material, and ~Displayable. |
|
The list of display commands.
Definition at line 69 of file Displayable.h. Referenced by cacheskip, change_material, GeometrySpring::create_cmd_list, GeometryDihedral::create_cmd_list, GeometryBond::create_cmd_list, GeometryAtom::create_cmd_list, GeometryAngle::create_cmd_list, curr_material, Displayable, draw, DrawTool::DrawTool, DrawMolItem::get_instances, DrawMolItem::get_pbc, DrawMolItem::get_pbc_images, pick_cmd_list, FPS::prepare, DrawMolItem::prepare, recalc_mat, reset_disp_list, DrawMolItem::set_instances, DrawMolItem::set_pbc, DrawMolItem::set_pbc_images, and ~Displayable. |
|
which of the following operations will this object listen to.
Definition at line 78 of file Displayable.h. Referenced by cent_trans_off, cent_trans_on, cent_translating, and Displayable. |
|
which of the following operations will this object listen to.
Definition at line 78 of file Displayable.h. Referenced by Displayable, glob_trans_off, glob_trans_on, and glob_translating. |
|
which of the following operations will this object listen to.
Definition at line 78 of file Displayable.h. Referenced by Displayable, rot_off, rot_on, and rotating. |
|
which of the following operations will this object listen to.
Definition at line 78 of file Displayable.h. Referenced by Displayable, scale_off, scale_on, and scaling. |
|
Global Translation (GT).
Definition at line 49 of file Displayable.h. Referenced by add_glob_trans, Displayable, Tool::dograb, molinfo_get, py_get_trans, recalc_mat, reset_transformation, set_glob_trans, and Tool::target. |
|
is the object free to be affected by rotations/translations/etc?
Definition at line 81 of file Displayable.h. |
|
is the object to be drawn or not?
Definition at line 84 of file Displayable.h. Referenced by Displayable, displayed, DrawMolItem::DrawMolItem, off, and on. |
|
Definition at line 95 of file Displayable.h. Referenced by add_child. |
|
Definition at line 94 of file Displayable.h. Referenced by add_cent_trans, add_child, add_glob_trans, add_rot, child_index, color_changed, color_rgb_changed, color_scale_changed, delete_material, draw, draw_prepare, mult_scale, recalc_mat, remove_child, reset_transformation, set_cent_trans, set_glob_trans, set_rot, set_scale, update_material, and ~Displayable. |
|
our parent Displayable; if NULL, this is a parent Displayable.
Definition at line 90 of file Displayable.h. Referenced by Displayable, draw_prepare, DrawForce::prepare, DisplayRocker::prepare, and ~Displayable. |
|
Rotation matrix (R).
Definition at line 48 of file Displayable.h. Referenced by add_rot, change_center, Displayable, molinfo_get, PickModeMove::pick_molecule_move, py_get_rotation, recalc_mat, reset_transformation, set_rot, and Tool::tug. |
|
Scaling (S).
Definition at line 51 of file Displayable.h. Referenced by change_center, Displayable, SpringTool::do_event, TugTool::do_event, Tool::getTargetScale, molinfo_get, mult_scale, py_get_scale, recalc_mat, reset_transformation, and set_scale. |
|
The Scene object where color data can be accessed.
Definition at line 72 of file Displayable.h. Referenced by MoleculeGraphics::add_spheretube, Axes::Axes, DisplayColor::DisplayColor, Stage::do_color_changed, DisplayColor::do_color_changed, GeometryList::do_color_changed, FPS::do_color_changed, DrawMolItem::do_color_changed, Axes::do_color_changed, DrawMolItem::do_color_rgb_changed, FPS::FPS, GeometryList::GeometryList, and Stage::Stage. |
|
concatenated transformation matrix (GT * S * R * CT).
Definition at line 52 of file Displayable.h. Referenced by change_center, Displayable, PickModeForce::get_force, molinfo_get, PickModeMove::pick_molecule_move, Stage::pick_move, Axes::pick_move, recalc_mat, Tool::target, and GeometryMol::transformed_atom_coord. |