NCBI C++ ToolKit
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
CPaintAlignment Class Reference

Search Toolkit Book for CPaintAlignment

#include <gui/widgets/edit/paint_alignment.hpp>

+ Inheritance diagram for CPaintAlignment:
+ Collaboration diagram for CPaintAlignment:

Public Member Functions

 CPaintAlignment ()
 
 CPaintAlignment (wxWindow *parent, CSeq_align_Handle ah, const vector< vector< vector< pair< TSeqPos, TSeqPos > > > > &feat_ranges, const vector< vector< pair< string, objects::CSeqFeatData::ESubtype > > > &feat_types, const vector< vector< objects::CBioseq_Handle::EVectorStrand > > &feat_strand, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
 
virtual ~CPaintAlignment ()
 
void OnKeyDown (wxKeyEvent &event)
 
void OnMouseDrag (wxMouseEvent &evt)
 
void OnMouseDown (wxMouseEvent &evt)
 
void SetPos (int pos)
 
void SetPosSeq (int pos)
 
void SetTarget (int row)
 
void EnableFeatures (bool enable)
 
void EnableSubstitute (bool enable)
 
bool IsSelection ()
 
pair< int, intGetSelection (int row)
 
int GetRow ()
 
int GetVisibleRow ()
 
pair< int, intGetAlignSelection (void)
 
int GetTarget ()
 
void SetAlign (CSeq_align_Handle ah)
 
void RefreshWithScroll ()
 
virtual void OnPaint (wxPaintEvent &event)
 Painting. More...
 
virtual void OnEraseBackground (wxEraseEvent &event)
 
virtual wxCoord OnGetRowHeight (size_t row) const
 
virtual void OnUpdate ()
 Notification for the derived class that moment is good for doing its update and drawing stuff. More...
 
void OnResize (wxSizeEvent &)
 
void UpdateFeatures (const vector< vector< vector< pair< TSeqPos, TSeqPos > > > > &feat_ranges, const vector< vector< pair< string, objects::CSeqFeatData::ESubtype > > > &feat_types, const vector< vector< objects::CBioseq_Handle::EVectorStrand > > &feat_strand)
 
string GetExportInter ()
 
string GetExportCont ()
 
int AlignPosToSeqPos (int pos, int row, bool left) const
 
size_t GetTotalLength () const
 

Static Public Member Functions

static string GetSeqTitle (CBioseq_Handle bsh)
 

Private Member Functions

void NormalizeCursorColRows ()
 
void ScrollWithCursor ()
 
void SeqPosToColRow ()
 
void ColRowToSeqPos ()
 
unsigned int PosToSegment ()
 
void ClearScreen (wxGraphicsContext *gc)
 
void CalculateFontWidthAndHeight (wxGraphicsContext *gc)
 
int CalculateNumCols ()
 
void DrawTextLine (const unsigned int start, int &y_label, int row, int align_row, wxGraphicsContext *gc, unsigned int &seq_pos)
 
void DrawTextCell (const unsigned int start, int col, int row, int align_row, unsigned int seq_pos, int x, int &y, const vector< unsigned int > &feats_in_row, const map< unsigned int, vector< unsigned int > > &feats_with_exons, wxGraphicsContext *gc) const
 
void DrawCursor (int col, int row, int x, int &y, wxGraphicsContext *gc) const
 
const wxPen * GetColorForFeature (objects::CSeqFeatData::ESubtype subtype) const
 
void DrawFeatures (int row, int align_row, unsigned int seq_pos, int x, int &y, const vector< unsigned int > &feats_in_row, const map< unsigned int, vector< unsigned int > > &feats_with_exons, wxGraphicsContext *gc) const
 
void DrawFeatureLabels (int row, int align_row, int x, int &y, const vector< unsigned int > &feats_in_row, const map< unsigned int, vector< unsigned int > > &feats_with_exons, wxGraphicsContext *gc) const
 
int LeftMarginWidth () const
 
void DrawLineNumber (int align_row, unsigned int seq_pos, int x, int &y, wxGraphicsContext *gc) const
 
bool MouseToSeqPos (wxPoint p, int &row, int &y_row)
 
int FindRowByCoord (int y, int &y_row)
 
int TopMarginHeight ()
 
void DrawLabelCell (unsigned int pos, int x, int &y, int row, int align_row, const vector< unsigned int > &feats_in_row, const map< unsigned int, vector< unsigned int > > &feats_with_exons, wxGraphicsContext *gc) const
 
vector< unsigned intGetFeaturesInRow (int row, int align_row) const
 
void GetFeatWholeRange ()
 
vector< unsigned intIsExonPresent (int i, int row, int align_row) const
 
map< unsigned int, vector< unsigned int > > GetFeatsWithExons (int row, int align_row, const vector< unsigned int > &feats_in_row) const
 
void GetSegments ()
 
void DrawTopLineNumbers (int align_row, unsigned int seq_pos, int col, int x, int &y, wxGraphicsContext *gc) const
 
int SeqPosToAlignPos (int pos, int row, bool left)
 

Private Attributes

CSeq_align_Handle m_Alignment
 
vector< stringm_Seqs
 
size_t m_TotalLength
 
size_t m_NumAlignRows
 
vector< stringm_Labels
 
vector< vector< vector< pair< TSeqPos, TSeqPos > > > > m_FeatRanges
 
vector< vector< pair< string, CSeqFeatData::ESubtype > > > m_FeatTypes
 
vector< vector< CBioseq_Handle::EVectorStrand > > m_FeatStrand
 
vector< vector< pair< TSeqPos, TSeqPos > > > m_FeatWholeRange
 
vector< vector< vector< TSeqPos > > > m_FeatLengthBefore
 
vector< vector< TSeqPos > > m_FeatTotalLength
 
wxFont m_Font
 
int m_FontHeight
 
int m_FontWidth
 
int m_NumRows
 
int m_NumCols
 
int m_CursorCol
 
int m_CursorRow
 
int m_LastRowLength
 
int m_CursorSeq
 
int m_CursorAlign
 
bool m_EnableFeatures
 
bool m_ContinueFeatures
 
bool m_EnableSubstitute
 
int m_DragMin
 
int m_DragMax
 
int m_SelAlignRow
 
CAlignmentAssistantm_Parent
 
vector< CDense_seg::TDimm_visible_to_row
 

Detailed Description

Definition at line 63 of file paint_alignment.hpp.

Constructor & Destructor Documentation

◆ CPaintAlignment() [1/2]

CPaintAlignment::CPaintAlignment ( )
inline

Definition at line 68 of file paint_alignment.hpp.

◆ CPaintAlignment() [2/2]

CPaintAlignment::CPaintAlignment ( wxWindow *  parent,
CSeq_align_Handle  ah,
const vector< vector< vector< pair< TSeqPos, TSeqPos > > > > &  feat_ranges,
const vector< vector< pair< string, objects::CSeqFeatData::ESubtype > > > &  feat_types,
const vector< vector< objects::CBioseq_Handle::EVectorStrand > > &  feat_strand,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize 
)

Definition at line 61 of file paint_alignment.cpp.

References NULL.

◆ ~CPaintAlignment()

CPaintAlignment::~CPaintAlignment ( )
virtual

Definition at line 363 of file paint_alignment.cpp.

Member Function Documentation

◆ AlignPosToSeqPos()

int CPaintAlignment::AlignPosToSeqPos ( int  pos,
int  row,
bool  left 
) const

◆ CalculateFontWidthAndHeight()

void CPaintAlignment::CalculateFontWidthAndHeight ( wxGraphicsContext *  gc)
private

Definition at line 754 of file paint_alignment.cpp.

References m_FontHeight, m_FontWidth, m_Seqs, and m_TotalLength.

◆ CalculateNumCols()

int CPaintAlignment::CalculateNumCols ( )
private

Definition at line 776 of file paint_alignment.cpp.

References int, LeftMarginWidth(), and m_FontWidth.

Referenced by OnPaint().

◆ ClearScreen()

void CPaintAlignment::ClearScreen ( wxGraphicsContext *  gc)
private

Definition at line 742 of file paint_alignment.cpp.

Referenced by OnPaint().

◆ ColRowToSeqPos()

void CPaintAlignment::ColRowToSeqPos ( )
private

Definition at line 613 of file paint_alignment.cpp.

References m_CursorAlign, m_CursorCol, m_CursorRow, m_CursorSeq, m_NumAlignRows, and m_NumCols.

Referenced by MouseToSeqPos(), and OnPaint().

◆ DrawCursor()

void CPaintAlignment::DrawCursor ( int  col,
int  row,
int  x,
int y,
wxGraphicsContext *  gc 
) const
private

Definition at line 884 of file paint_alignment.cpp.

References m_CursorCol, m_CursorRow, m_FontWidth, and row.

Referenced by DrawTextCell().

◆ DrawFeatureLabels()

void CPaintAlignment::DrawFeatureLabels ( int  row,
int  align_row,
int  x,
int y,
const vector< unsigned int > &  feats_in_row,
const map< unsigned int, vector< unsigned int > > &  feats_with_exons,
wxGraphicsContext *  gc 
) const
private

Definition at line 946 of file paint_alignment.cpp.

References i, label, m_EnableFeatures, m_FeatTypes, and m_FontHeight.

Referenced by DrawLabelCell().

◆ DrawFeatures()

void CPaintAlignment::DrawFeatures ( int  row,
int  align_row,
unsigned int  seq_pos,
int  x,
int y,
const vector< unsigned int > &  feats_in_row,
const map< unsigned int, vector< unsigned int > > &  feats_with_exons,
wxGraphicsContext *  gc 
) const
private

◆ DrawLabelCell()

void CPaintAlignment::DrawLabelCell ( unsigned int  pos,
int  x,
int y,
int  row,
int  align_row,
const vector< unsigned int > &  feats_in_row,
const map< unsigned int, vector< unsigned int > > &  feats_with_exons,
wxGraphicsContext *  gc 
) const
private

Definition at line 819 of file paint_alignment.cpp.

References DrawFeatureLabels(), DrawLineNumber(), DrawTopLineNumbers(), NULL, and row.

Referenced by DrawTextLine(), and OnGetRowHeight().

◆ DrawLineNumber()

void CPaintAlignment::DrawLineNumber ( int  align_row,
unsigned int  seq_pos,
int  x,
int y,
wxGraphicsContext *  gc 
) const
private

◆ DrawTextCell()

void CPaintAlignment::DrawTextCell ( const unsigned int  start,
int  col,
int  row,
int  align_row,
unsigned int  seq_pos,
int  x,
int y,
const vector< unsigned int > &  feats_in_row,
const map< unsigned int, vector< unsigned int > > &  feats_with_exons,
wxGraphicsContext *  gc 
) const
private

◆ DrawTextLine()

void CPaintAlignment::DrawTextLine ( const unsigned int  start,
int y_label,
int  row,
int  align_row,
wxGraphicsContext *  gc,
unsigned int seq_pos 
)
private

◆ DrawTopLineNumbers()

void CPaintAlignment::DrawTopLineNumbers ( int  align_row,
unsigned int  seq_pos,
int  col,
int  x,
int y,
wxGraphicsContext *  gc 
) const
private

Definition at line 827 of file paint_alignment.cpp.

References label, m_Font, m_FontHeight, and m_FontWidth.

Referenced by DrawLabelCell(), and DrawTextCell().

◆ EnableFeatures()

void CPaintAlignment::EnableFeatures ( bool  enable)

Definition at line 385 of file paint_alignment.cpp.

References m_EnableFeatures, and RefreshWithScroll().

Referenced by CAlignmentAssistant::OnFeatures().

◆ EnableSubstitute()

void CPaintAlignment::EnableSubstitute ( bool  enable)

Definition at line 391 of file paint_alignment.cpp.

References m_EnableSubstitute, and RefreshWithScroll().

Referenced by CAlignmentAssistant::OnSubstitute().

◆ FindRowByCoord()

int CPaintAlignment::FindRowByCoord ( int  y,
int y_row 
)
private

Definition at line 496 of file paint_alignment.cpp.

References OnGetRowHeight(), row, and TopMarginHeight().

Referenced by MouseToSeqPos().

◆ GetAlignSelection()

pair< int, int > CPaintAlignment::GetAlignSelection ( void  )

◆ GetColorForFeature()

const wxPen * CPaintAlignment::GetColorForFeature ( objects::CSeqFeatData::ESubtype  subtype) const
private

Definition at line 895 of file paint_alignment.cpp.

References CSeqFeatData::eSubtype_cdregion.

Referenced by DrawFeatures().

◆ GetExportCont()

string CPaintAlignment::GetExportCont ( )

◆ GetExportInter()

string CPaintAlignment::GetExportInter ( )

◆ GetFeatsWithExons()

map< unsigned int, vector< unsigned int > > CPaintAlignment::GetFeatsWithExons ( int  row,
int  align_row,
const vector< unsigned int > &  feats_in_row 
) const
private

Definition at line 1163 of file paint_alignment.cpp.

References i, IsExonPresent(), and row.

Referenced by DrawTextLine(), and OnGetRowHeight().

◆ GetFeaturesInRow()

vector< unsigned int > CPaintAlignment::GetFeaturesInRow ( int  row,
int  align_row 
) const
private

Definition at line 961 of file paint_alignment.cpp.

References i, m_FeatWholeRange, m_NumAlignRows, m_NumCols, and row.

Referenced by DrawTextLine(), and OnGetRowHeight().

◆ GetFeatWholeRange()

void CPaintAlignment::GetFeatWholeRange ( )
private

◆ GetRow()

int CPaintAlignment::GetRow ( )
inline

Definition at line 84 of file paint_alignment.hpp.

References m_SelAlignRow, and m_visible_to_row.

Referenced by CAlignmentAssistant::CreateFeature().

◆ GetSegments()

void CPaintAlignment::GetSegments ( void  )
private

◆ GetSelection()

pair< int, int > CPaintAlignment::GetSelection ( int  row)

◆ GetSeqTitle()

string CPaintAlignment::GetSeqTitle ( CBioseq_Handle  bsh)
static

◆ GetTarget()

int CPaintAlignment::GetTarget ( void  )
inline

◆ GetTotalLength()

size_t CPaintAlignment::GetTotalLength ( void  ) const
inline

Definition at line 104 of file paint_alignment.hpp.

References m_TotalLength.

Referenced by CAlignmentAssistant::DeleteSelection().

◆ GetVisibleRow()

int CPaintAlignment::GetVisibleRow ( )
inline

◆ IsExonPresent()

vector< unsigned int > CPaintAlignment::IsExonPresent ( int  i,
int  row,
int  align_row 
) const
private

Definition at line 1143 of file paint_alignment.cpp.

References i, m_FeatRanges, m_NumAlignRows, m_NumCols, and row.

Referenced by GetFeatsWithExons().

◆ IsSelection()

bool CPaintAlignment::IsSelection ( )

◆ LeftMarginWidth()

int CPaintAlignment::LeftMarginWidth ( ) const
private

Definition at line 491 of file paint_alignment.cpp.

References m_FontWidth.

Referenced by CalculateNumCols(), DrawLineNumber(), DrawTextLine(), and MouseToSeqPos().

◆ MouseToSeqPos()

bool CPaintAlignment::MouseToSeqPos ( wxPoint  p,
int row,
int y_row 
)
private

◆ NormalizeCursorColRows()

void CPaintAlignment::NormalizeCursorColRows ( )
private

◆ OnEraseBackground()

void CPaintAlignment::OnEraseBackground ( wxEraseEvent &  event)
virtual

Definition at line 724 of file paint_alignment.cpp.

◆ OnGetRowHeight()

wxCoord CPaintAlignment::OnGetRowHeight ( size_t  row) const
virtual

Definition at line 211 of file paint_alignment.cpp.

References DrawLabelCell(), GetFeatsWithExons(), GetFeaturesInRow(), m_NumAlignRows, NULL, r(), and row.

Referenced by FindRowByCoord().

◆ OnKeyDown()

void CPaintAlignment::OnKeyDown ( wxKeyEvent &  event)

◆ OnMouseDown()

void CPaintAlignment::OnMouseDown ( wxMouseEvent &  evt)

◆ OnMouseDrag()

void CPaintAlignment::OnMouseDrag ( wxMouseEvent &  evt)

◆ OnPaint()

void CPaintAlignment::OnPaint ( wxPaintEvent &  event)
virtual

◆ OnResize()

void CPaintAlignment::OnResize ( wxSizeEvent &  event)

Definition at line 737 of file paint_alignment.cpp.

◆ OnUpdate()

void CPaintAlignment::OnUpdate ( )
virtual

Notification for the derived class that moment is good for doing its update and drawing stuff.

Definition at line 732 of file paint_alignment.cpp.

◆ PosToSegment()

unsigned int CPaintAlignment::PosToSegment ( )
private

◆ RefreshWithScroll()

void CPaintAlignment::RefreshWithScroll ( )

◆ ScrollWithCursor()

void CPaintAlignment::ScrollWithCursor ( )
private

Definition at line 397 of file paint_alignment.cpp.

References m_CursorRow.

Referenced by OnKeyDown(), OnMouseDown(), RefreshWithScroll(), SetPos(), SetPosSeq(), and SetTarget().

◆ SeqPosToAlignPos()

int CPaintAlignment::SeqPosToAlignPos ( int  pos,
int  row,
bool  left 
)
private

◆ SeqPosToColRow()

void CPaintAlignment::SeqPosToColRow ( )
private

◆ SetAlign()

void CPaintAlignment::SetAlign ( CSeq_align_Handle  ah)

◆ SetPos()

void CPaintAlignment::SetPos ( int  pos)

◆ SetPosSeq()

void CPaintAlignment::SetPosSeq ( int  pos)

◆ SetTarget()

void CPaintAlignment::SetTarget ( int  row)

◆ TopMarginHeight()

int CPaintAlignment::TopMarginHeight ( )
inlineprivate

Definition at line 125 of file paint_alignment.hpp.

Referenced by FindRowByCoord(), and OnPaint().

◆ UpdateFeatures()

void CPaintAlignment::UpdateFeatures ( const vector< vector< vector< pair< TSeqPos, TSeqPos > > > > &  feat_ranges,
const vector< vector< pair< string, objects::CSeqFeatData::ESubtype > > > &  feat_types,
const vector< vector< objects::CBioseq_Handle::EVectorStrand > > &  feat_strand 
)

Member Data Documentation

◆ m_Alignment

CSeq_align_Handle CPaintAlignment::m_Alignment
private

Definition at line 135 of file paint_alignment.hpp.

Referenced by AlignPosToSeqPos(), GetSegments(), SeqPosToAlignPos(), and SetAlign().

◆ m_ContinueFeatures

bool CPaintAlignment::m_ContinueFeatures
private

Definition at line 152 of file paint_alignment.hpp.

Referenced by DrawFeatures(), and DrawTextLine().

◆ m_CursorAlign

int CPaintAlignment::m_CursorAlign
private

◆ m_CursorCol

int CPaintAlignment::m_CursorCol
private

◆ m_CursorRow

int CPaintAlignment::m_CursorRow
private

◆ m_CursorSeq

int CPaintAlignment::m_CursorSeq
private

◆ m_DragMax

int CPaintAlignment::m_DragMax
private

◆ m_DragMin

int CPaintAlignment::m_DragMin
private

◆ m_EnableFeatures

bool CPaintAlignment::m_EnableFeatures
private

Definition at line 152 of file paint_alignment.hpp.

Referenced by DrawFeatureLabels(), DrawFeatures(), and EnableFeatures().

◆ m_EnableSubstitute

bool CPaintAlignment::m_EnableSubstitute
private

Definition at line 153 of file paint_alignment.hpp.

Referenced by DrawTextCell(), and EnableSubstitute().

◆ m_FeatLengthBefore

vector<vector< vector<TSeqPos> > > CPaintAlignment::m_FeatLengthBefore
private

Definition at line 146 of file paint_alignment.hpp.

Referenced by GetFeatWholeRange().

◆ m_FeatRanges

vector<vector<vector<pair<TSeqPos,TSeqPos> > > > CPaintAlignment::m_FeatRanges
private

◆ m_FeatStrand

vector<vector<CBioseq_Handle::EVectorStrand> > CPaintAlignment::m_FeatStrand
private

Definition at line 143 of file paint_alignment.hpp.

Referenced by DrawFeatures(), and UpdateFeatures().

◆ m_FeatTotalLength

vector< vector<TSeqPos> > CPaintAlignment::m_FeatTotalLength
private

Definition at line 147 of file paint_alignment.hpp.

Referenced by GetFeatWholeRange().

◆ m_FeatTypes

vector<vector<pair<string,CSeqFeatData::ESubtype> > > CPaintAlignment::m_FeatTypes
private

Definition at line 142 of file paint_alignment.hpp.

Referenced by DrawFeatureLabels(), DrawFeatures(), and UpdateFeatures().

◆ m_FeatWholeRange

vector<vector<pair<TSeqPos,TSeqPos> > > CPaintAlignment::m_FeatWholeRange
private

Definition at line 145 of file paint_alignment.hpp.

Referenced by DrawFeatures(), GetFeaturesInRow(), and GetFeatWholeRange().

◆ m_Font

wxFont CPaintAlignment::m_Font
private

Definition at line 149 of file paint_alignment.hpp.

Referenced by DrawLineNumber(), DrawTextCell(), DrawTopLineNumbers(), and OnPaint().

◆ m_FontHeight

int CPaintAlignment::m_FontHeight
private

◆ m_FontWidth

int CPaintAlignment::m_FontWidth
private

◆ m_Labels

vector<string> CPaintAlignment::m_Labels
private

◆ m_LastRowLength

int CPaintAlignment::m_LastRowLength
private

Definition at line 151 of file paint_alignment.hpp.

Referenced by NormalizeCursorColRows(), and OnPaint().

◆ m_NumAlignRows

size_t CPaintAlignment::m_NumAlignRows
private

◆ m_NumCols

int CPaintAlignment::m_NumCols
private

◆ m_NumRows

int CPaintAlignment::m_NumRows
private

Definition at line 151 of file paint_alignment.hpp.

Referenced by NormalizeCursorColRows(), and OnPaint().

◆ m_Parent

CAlignmentAssistant* CPaintAlignment::m_Parent
private

Definition at line 155 of file paint_alignment.hpp.

Referenced by OnKeyDown(), and OnPaint().

◆ m_SelAlignRow

int CPaintAlignment::m_SelAlignRow
private

◆ m_Seqs

vector<string> CPaintAlignment::m_Seqs
private

◆ m_TotalLength

size_t CPaintAlignment::m_TotalLength
private

◆ m_visible_to_row

vector<CDense_seg::TDim> CPaintAlignment::m_visible_to_row
private

The documentation for this class was generated from the following files:
Modified on Fri Jun 14 16:49:29 2024 by modify_doxy.py rev. 669887