Rosetta
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget Class Reference

#include <SimplePoseDrawOpenGLWidget.h>

Inheritance diagram for ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget:
Inheritance graph
[legend]

Public Types

enum class  ColorMode {
  none , selection , input_domain , total_energy ,
  score_term , list = score_term
}
 Enum for the different ways that the pose could be coloured. More...
 
enum class  DragMode { rotate_and_zoom_viewport , list = rotate_and_zoom_viewport }
 

Public Member Functions

 SimplePoseDrawOpenGLWidget (QWidget *parent=nullptr)
 Constructor. More...
 
void set_pose (core::pose::PoseCOP pose)
 Set the pose that we'll be drawing. More...
 
core::pose::PoseCOP pose () const
 Get currently assigned pose object. More...
 
void set_residue_selector (core::select::residue_selector::ResidueSelectorCOP selector_in)
 Set the residue selector that we'll use for colouring the pose. More...
 
void set_color_mode (ColorMode mode)
 Set the colour mode that we'll use for colouring the pose. More...
 
void set_energy_range (core::Real const &lower, core::Real const &upper)
 Set the lower and upper ends of the energy range in the gradient of colour values used. More...
 
void set_score_type (core::scoring::ScoreType scoretype_in)
 Set the score term to use if we're colouring by a single score type. More...
 
void update_pose_draw ()
 The pose has changed; redraw it. More...
 
void set_drag_mode (DragMode mode)
 Set what happens when the user drags in the viewport. More...
 

Protected Member Functions

void initializeGL () override
 Initialize the OpenGL rendering environment. More...
 
void resizeGL (int width, int height) override
 What to do when the window has been resized. More...
 
void paintGL () override
 How to actually draw a pose. More...
 
void mousePressEvent (QMouseEvent *event) override
 What to do when the user clicks. More...
 
void mouseMoveEvent (QMouseEvent *event) override
 What do do when the user drags. More...
 
GLfloat const & rotx () const
 Read the x-rotation value. More...
 
GLfloat const & roty () const
 Read the y-rotation value. More...
 
GLfloat const & rotz () const
 Read the z-rotation value. More...
 
QPoint const & lastpos () const
 The start of a mouse click-and-drag event. More...
 
void set_lastpos (QPoint const &point_in)
 Set the value of lastpos. More...
 

Private Attributes

core::pose::PoseCOP pose_
 Const owning pointer to the pose that we'll be drawing. More...
 
core::select::residue_selector::ResidueSelectorCOP residue_selector_
 Const owning pointer to the residue selector that we'll use for colouring the pose. More...
 
GLfloat rotx_
 Rotation of the scene about the x-axis. More...
 
GLfloat roty_
 Rotation of the scene about the y-axis. More...
 
GLfloat rotz_
 Rotation of the scene about the z-axis. More...
 
GLfloat forward_back_
 How far have I moved backwards or forwards? More...
 
QPoint lastpos_
 The start of a mouse click-and-drag event. More...
 
ColorMode color_mode_ = ColorMode::none
 The way in which we're currently colouring the pose. More...
 
core::Real energy_range_max_
 The energy value at the far upper end of the energy colour gradient. More...
 
core::Real energy_range_min_
 The energy value at the far lower end of the energy colour gradient. More...
 
core::scoring::ScoreType score_type_
 The score term to use if we're colouring by a single score type. More...
 
DragMode drag_mode_ = DragMode::rotate_and_zoom_viewport
 The behaviour of the viewport when the user clicks and drags. More...
 

Member Enumeration Documentation

◆ ColorMode

Enum for the different ways that the pose could be coloured.

Enumerator
none 
selection 
input_domain 
total_energy 
score_term 
list 

◆ DragMode

Enumerator
rotate_and_zoom_viewport 
list 

Constructor & Destructor Documentation

◆ SimplePoseDrawOpenGLWidget()

ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::SimplePoseDrawOpenGLWidget ( QWidget parent = nullptr)

Constructor.

Member Function Documentation

◆ initializeGL()

void ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::initializeGL ( )
overrideprotected

Initialize the OpenGL rendering environment.

◆ lastpos()

QPoint const& ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::lastpos ( ) const
inlineprotected

The start of a mouse click-and-drag event.

References lastpos_.

Referenced by ui::ui_protocols::helical_bundle::HelicalBundlePoseDrawOpenGLWidget::mouseMoveEvent().

◆ mouseMoveEvent()

void ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected

◆ mousePressEvent()

void ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::mousePressEvent ( QMouseEvent *  event)
overrideprotected

What to do when the user clicks.

References lastpos_.

◆ paintGL()

void ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::paintGL ( )
overrideprotected

◆ pose()

core::pose::PoseCOP ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::pose ( ) const
inline

Get currently assigned pose object.

References pose_.

Referenced by pyrosetta.bindings.pose.PoseScoreAccessor::__delitem__(), pyrosetta.bindings.scores.core.PoseCacheAccessor::__delitem__(), pyrosetta.bindings.scores.extra_scores.ExtraScoresAccessorBase::__delitem__(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessorBase::__delitem__(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricStringDataAccessor::__delitem__(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricRealDataAccessor::__delitem__(), pyrosetta.bindings.pose.PoseResidueAccessor::__getitem__(), pyrosetta.bindings.pose.PoseResidueLabelAccessor::__getitem__(), pyrosetta.bindings.pose.PoseResidueAccessor::__iadd__(), pyrosetta.bindings.pose.PoseResidueAccessor::__imul__(), pyrosetta.bindings.pose.PoseResidueAccessor::__iter__(), pyrosetta.bindings.pose.PoseResidueAccessor::__len__(), pyrosetta.bindings.pose.PoseResidueLabelAccessor::__len__(), pyrosetta.bindings.pose.PoseResidueLabelAccessor::__repr__(), pyrosetta.bindings.pose.PoseResidueAccessor::__reversed__(), pyrosetta.bindings.pose.PoseScoreAccessor::__setitem__(), pyrosetta.bindings.scores.extra_scores.ExtraScoresAccessorBase::__setitem__(), pyrosetta.bindings.scores.base.PoseCacheAccessorBase::_get_sm_data_dict(), pyrosetta.bindings.scores.base.PoseCacheAccessorBase::_has_reserved_custom_metric_keys(), pyrosetta.bindings.scores.base.PoseCacheAccessorBase::_maybe_delete_keys_from_sm_data(), pyrosetta.bindings.scores.base.PoseCacheAccessorBase::_maybe_delete_reserved_keys_from_sm_data(), pyrosetta.bindings.pose.PoseScoreAccessor::all(), pyrosetta.bindings.scores.energies.EnergiesAccessor::all(), pyrosetta.bindings.scores.extra_scores.ExtraFloatScoresDataAccessor::all(), pyrosetta.bindings.scores.extra_scores.ExtraStringScoresDataAccessor::all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricStringDataAccessor::all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricRealDataAccessor::all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricCompositeStringDataAccessor::all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricCompositeRealDataAccessor::all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricPerResidueStringDataAccessor::all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricPerResidueRealDataAccessor::all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricPerResidueProbabilitiesDataAccessor::all(), pyrosetta.bindings.scores.base.PoseCacheAccessorBase::apply(), pyrosetta.bindings.pose.PoseScoreAccessor::clear(), pyrosetta.bindings.scores.core.PoseCacheAccessor::clear(), pyrosetta.bindings.scores.energies.EnergiesAccessor::clear(), pyrosetta.bindings.scores.extra_scores.ExtraScoresAccessorBase::clear(), pyrosetta.bindings.scores.extra_scores.ExtraScoresAccessor::clear(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessor::clear(), pyrosetta.distributed.packed_pose.core.PackedPose::clone(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessor::composite_real(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessor::composite_string(), pyrosetta.distributed.packed_pose.core.PackedPose::empty(), pyrosetta.bindings.pose.PoseScoreAccessor::energies(), pyrosetta.bindings.scores.core.PoseCacheAccessor::energies(), pyrosetta.bindings.pose.PoseScoreAccessor::extra(), pyrosetta.bindings.scores.core.PoseCacheAccessor::extra(), pyrosetta.bindings.scores.core.PoseCacheAccessor::metrics(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessor::per_residue_probabilities(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessor::per_residue_real(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessor::per_residue_string(), pyrosetta.bindings.scores.extra_scores.ExtraScoresAccessor::real(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessor::real(), set_pose(), pyrosetta.bindings.scores.extra_scores.ExtraScoresAccessor::string(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessor::string(), test.T300_PyJobDistributor.TestPyJobDistributor::test_jd(), test.T300_PyJobDistributor.TestPyJobDistributor::test_jd_at(), test.T300_PyJobDistributor.TestPyJobDistributor::test_jd_serializable_scores(), test.T300_PyJobDistributor.TestPyJobDistributor::test_jd_unserializable_scores(), test.T010_LoadPDB.LoadPDBTest::test_pdbstring_io(), pyrosetta.tests.bindings.core.test_pose.TestPoseCacheAccessor::test_pose_cache(), test.T010_LoadPDB.LoadPDBTest::test_roundtrip_file(), test.T010_LoadPDB.LoadPDBTest::test_roundtrip_pdb(), test.T010_LoadPDB.LoadPDBTest::test_roundtrip_scored_pdb(), and pyrosetta.distributed.packed_pose.core.PackedPose::update_scores().

◆ resizeGL()

void ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::resizeGL ( int  width,
int  height 
)
overrideprotected

What to do when the window has been resized.

References tan, and basic::options::OptionKeys::mp::visualize::width.

◆ rotx()

GLfloat const& ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::rotx ( ) const
inlineprotected

◆ roty()

GLfloat const& ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::roty ( ) const
inlineprotected

Read the y-rotation value.

References roty_.

◆ rotz()

GLfloat const& ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::rotz ( ) const
inlineprotected

◆ set_color_mode()

void ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::set_color_mode ( ColorMode  mode)

Set the colour mode that we'll use for colouring the pose.

References color_mode_, and SmotifHasher::mode.

Referenced by MainWindow::MainWindow(), and MainWindow::on_radiobutton_colourby_totalscore_clicked().

◆ set_drag_mode()

void ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::set_drag_mode ( DragMode  mode)

Set what happens when the user drags in the viewport.

References drag_mode_, and SmotifHasher::mode.

Referenced by MainWindow::on_tool_rotate_zoom_view_clicked().

◆ set_energy_range()

void ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::set_energy_range ( core::Real const &  lower,
core::Real const &  upper 
)

Set the lower and upper ends of the energy range in the gradient of colour values used.

There is no check that upper > lower.

References energy_range_max_, energy_range_min_, test_terpenes::lower, and test_terpenes::upper.

◆ set_lastpos()

void ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::set_lastpos ( QPoint const &  point_in)
inlineprotected

◆ set_pose()

void ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::set_pose ( core::pose::PoseCOP  pose)

Set the pose that we'll be drawing.

References pose(), and pose_.

Referenced by MainWindow::MainWindow().

◆ set_residue_selector()

void ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::set_residue_selector ( core::select::residue_selector::ResidueSelectorCOP  selector_in)

Set the residue selector that we'll use for colouring the pose.

Only used if colour_mode_ == SPODGLW_colour_by_selection.

References residue_selector_.

Referenced by MainWindow::update_residue_selector().

◆ set_score_type()

void ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::set_score_type ( core::scoring::ScoreType  scoretype_in)

Set the score term to use if we're colouring by a single score type.

Only used if colour_mode_ == SPDOGLW_colour_by_score_term.

References score_type_.

◆ update_pose_draw()

void ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::update_pose_draw ( )

Member Data Documentation

◆ color_mode_

ColorMode ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::color_mode_ = ColorMode::none
private

The way in which we're currently colouring the pose.

Referenced by paintGL(), and set_color_mode().

◆ drag_mode_

DragMode ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::drag_mode_ = DragMode::rotate_and_zoom_viewport
private

The behaviour of the viewport when the user clicks and drags.

Referenced by set_drag_mode().

◆ energy_range_max_

core::Real ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::energy_range_max_
private

The energy value at the far upper end of the energy colour gradient.

Referenced by paintGL(), and set_energy_range().

◆ energy_range_min_

core::Real ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::energy_range_min_
private

The energy value at the far lower end of the energy colour gradient.

Referenced by paintGL(), and set_energy_range().

◆ forward_back_

GLfloat ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::forward_back_
private

How far have I moved backwards or forwards?

Referenced by mouseMoveEvent(), and paintGL().

◆ lastpos_

QPoint ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::lastpos_
private

The start of a mouse click-and-drag event.

Referenced by lastpos(), mouseMoveEvent(), mousePressEvent(), and set_lastpos().

◆ pose_

core::pose::PoseCOP ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::pose_
private

Const owning pointer to the pose that we'll be drawing.

Referenced by paintGL(), pose(), sidechain_cst_3.Residue::pose_num(), and set_pose().

◆ residue_selector_

core::select::residue_selector::ResidueSelectorCOP ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::residue_selector_
private

Const owning pointer to the residue selector that we'll use for colouring the pose.

Referenced by paintGL(), and set_residue_selector().

◆ rotx_

GLfloat ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::rotx_
private

Rotation of the scene about the x-axis.

Referenced by mouseMoveEvent(), paintGL(), and rotx().

◆ roty_

GLfloat ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::roty_
private

Rotation of the scene about the y-axis.

Referenced by paintGL(), and roty().

◆ rotz_

GLfloat ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::rotz_
private

Rotation of the scene about the z-axis.

Referenced by mouseMoveEvent(), paintGL(), and rotz().

◆ score_type_

core::scoring::ScoreType ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget::score_type_
private

The score term to use if we're colouring by a single score type.

Only used if colour_mode_ == SPDOGLW_colour_by_score_term.

Referenced by paintGL(), and set_score_type().


The documentation for this class was generated from the following files: