A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/seq__text__pane_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/widgets/seq_text/seq_text_pane.cpp Source File

71

m_BackColor(1.0

f

, 1.0

f

, 1.0

f

),

73

m_BottomRuler(

true

),

74

m_SubjectGraph(

NULL

),

75

m_SequenceTickGraph(

NULL

),

80

m_Config->SetShowFeatAsLower(

true

);

85

AddListener(parent, ePool_Parent);

91

m_SequencePane.EnableOffset(

true

);

93

m_pSeqFont = x_ChooseFontForSize(m_Config->GetFontSize());

96

m_SubjectGraph->SetFont(m_pSeqFont);

97

m_SubjectGraph->SetConfig (m_Config);

98

m_SubjectGraph->SetHost(&m_SelHandler);

102

m_SequenceTickGraph->SetFont(m_pSeqFont);

103

m_SequenceTickGraph->SetGeometry(

static_cast<ISeqTextGeometry

*

>

(

this

));

104

m_SequenceTickGraph->ShowAbsolutePosition (m_Config->GetShowAbsolutePosition());

110

m_TooltipHandler.SetHost(

this

);

111

x_RegisterHandler(&m_TooltipHandler, fAllAreas, &m_SequencePane);

114

x_ConfigureBottomRuler();

146

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

171  string

s_label, q_label;

203

source_selection.

clear

();

206  bool

from_in_source =

false

;

207  bool

to_in_source =

false

;

208  TSeqPos

sel_start = iter->GetFrom();

209  TSeqPos

sel_end = iter->GetTo();

211  if

(sel_start > sel_end) {

220  while

((!from_in_source || !to_in_source) && sel_start < sel_end) {

221  if

(!from_in_source) {

230  if

((from_in_source || to_in_source) && source_start < source_end) {

231  TSeqRange

sel_range(source_start, source_end);

273  TVPPoint

sz_left_ruler, sz_bottom_ruler;

279  int

max_num_x = (

int

) ceil(rc_m.

Right

());

282

wxSize sz = GetClientSize();

285  int

mx_left = sz_left_ruler.

X

();

286  int

mx_bottom = sz_bottom_ruler.

Y

();

287  int

mx_right = sz.x - 2;

288  int

mx_top = sz.y - 2;

290  int

width =

abs

(mx_right - mx_left);

293  int

num_chars_per_line = (

int

) floor ((width) / character_size.

m_X

);

294

num_chars_per_line = (

int

) (floor (num_chars_per_line / 10.0) * 10.0);

295

mx_right = mx_left + (

int

)((num_chars_per_line + 1) * character_size.

m_X

);

296

width = mx_right - mx_left;

333

scale_y = 1.0 / character_size.

m_Y

;

334

scale_x = 1.0 / character_size.

m_X

;

371  TSeqPos

chars_in_line, lines_in_seq;

374

rc_VP.

SetRight

(rc_VP.

Left

() + (

int

)(chars_in_line / scale_x));

384  int

max_x = chars_in_line;

401  TSeqPos

chars_in_line, lines_in_seq;

404  if

(character_size.

m_Y

> 0) {

405  TSeqPos

lines_in_screen = (

TSeqPos

) floor(sequence_pane_height / character_size.

m_Y

);

407  if

(model_top >= lines_in_screen) {

472

gl.

BlendFunc

(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

491  bool

found_in_source;

546  unsigned int l

= 0,

r

=

static_cast<unsigned int>

(

m_OffsetList

.size() - 2);

570  return

(

TSeqPos

) scroll_line;

577  if

(row_k_sum >= scroll_line) {

613  TSeqPos

chars_in_line, lines_in_seq;

624  if

(seq_x >= chars_in_line) seq_x = chars_in_line - 1;

630  if

(seq_y >= lines_in_seq) seq_y = lines_in_seq - 1;

632  TSeqPos

seq_pos = (seq_y * chars_in_line) + seq_x;

634  if

(seq_pos > max_pos) {

643  TSeqPos

chars_in_line, lines_in_seq;

647  if

(seq_x >= chars_in_line) {

672  TSeqPos

chars_in_line, lines_in_pane;

678  int

num_lines_in_pane = (

int

) floor (rc_vis.

Top

() - rc_vis.

Bottom

());

681  if

(chars_in_line > 0 && scale_y > 0 && scale_x > 0) {

682  TSeqPos

row_y = z / chars_in_line;

684

window_pos.

m_Y

= num_lines_in_pane - (row_y - scrolled_lines + pos_skipped_lines) + top_blank - 1;

685

window_pos.

m_X

= ((

int

) z % chars_in_line);

707  int

num_lines_in_pane = 0;

708  if

(character_size.

m_Y

> 0) {

710

num_lines_in_pane = (

TSeqPos

) ceil(sequence_pane_height / character_size.

m_Y

);

712  return

num_lines_in_pane;

719  int

num_lines_in_pane = (

int

) floor (rc_model.

Top

() - rc_model.

Bottom

());

720  int

num_chars_per_row = (

int

) floor ((rc_model.

Right

() - rc_model.

Left

()) / 10.0) * 10;

732

seq_start = (

TSeqPos

) (num_chars_per_row * row_y);

735

seq_stop = (

TSeqPos

)(num_chars_per_row) * row_y;

774  for

(

i

= feat_start;

777  bool

pos_in_source =

false

;

779  if

(pos_in_source && k >= start_offset && k <= stop_offset)

782

subtypes[k - start_offset]);

784  else if

(k > stop_offset)

797  bool

found_in_source;

802  if

(found_in_source) {

806

gl.

Begin

(GL_LINES);

832  for

(

CSeq_loc_CI

seq_loc_it (loc); seq_loc_it; ++ seq_loc_it) {

839  while

(cds_stop > cds_start) {

845  while

(cds_start < cds_stop) {

850  offset

= cds_start - cds_stop;

880  if

(pDS ==

NULL

)

return

;

883  if

(pos > max_pos) pos = max_pos;

937  if

(seq_start > vis_stop || seq_end < vis_start) {

942  TSeqPos

chars_in_line, lines_in_seq;

947  TSeqPos

row_end = ((seq_start / chars_in_line) * chars_in_line) + chars_in_line - 1;

950  if

(start_point.

m_Y

== end_point.

m_Y

) {

951

interim_point.

m_X

= end_point.

m_X

;

957  while

(row_end < seq_end)

959  TSeqPos

next_row_start = row_end + 1;

961

row_end =

min

((

int

)next_row_start + chars_in_line - 1, seq_end);

979  if

(findLen == 0 || foundList.size() == 0)

return

;

985

gl.

Begin

(GL_LINES);

987  for

(

unsigned int i

= 0;

i

< foundList.size();

i

++) {

1026  if

(character_size.

m_X

> 0) {

1027

num_chars_per_line = floor (sequence_pane_width / character_size.

m_X

);

1028

num_chars_per_line = floor (num_chars_per_line / 10.0) * 10.0;

1029

chars_in_line = (

TSeqPos

) num_chars_per_line;

1031  if

(num_chars_per_line > 0 && character_size.

m_Y

> 0) {

1032

num_lines = ceil (pDS->

GetDataLen

() / num_chars_per_line) + 1.0;

1033

lines_in_seq = (

TSeqPos

) num_lines;

1047  TSeqPos

chars_in_line, lines_in_seq;

1050  if

(character_size.

m_Y

> 0 && lines_in_seq > 1) {

1052

(

int

)ceil(sequence_pane_height / character_size.

m_Y

);

1058  if

(lines_in_seq > num_lines_in_page - 1) {

1059

last_page_first_line = lines_in_seq - num_lines_in_page - 1;

1061

last_page_first_line = 0;

1063  TSeqPos

last_page_start = last_page_first_line * chars_in_line;

1066  if

(offset_list.size() > 0) {

1068  int i

=

static_cast<int>

(offset_list.size() - 1);

1069  while

(

i

> -1 && offset_list[

i

].m_StartRow > last_page_first_line + extra_lines) {

1071

extra_lines += offset_list[

i

].m_CumulativeExtraRows - offset_list[

i

- 1].m_CumulativeExtraRows;

1073

extra_lines += offset_list[

i

].m_CumulativeExtraRows;

1098  TSeqPos

chars_in_line, lines_in_seq;

1101  if

(character_size.

m_X

> 0) {

1102  size

.SetRight(sequence_pane_width / character_size.

m_X

);

1104  if

(character_size.

m_Y

> 0) {

1105  TSeqPos

lines_in_screen = (

TSeqPos

) floor(sequence_pane_height / character_size.

m_Y

);

1106  TModelUnit

top_blank = (sequence_pane_height / character_size.

m_Y

) - floor (sequence_pane_height / character_size.

m_Y

);

1108  if

(model_top < lines_in_screen) {

1109

model_top = lines_in_screen;

1111  size

.SetTop (model_top + top_blank);

1123  TSeqPos

chars_in_line, lines_in_seq;

1128

pos =

min

(pos, lines_in_seq * chars_in_line);

1133

scroll_y = floor ((

double

) pos / (

double

) chars_in_line);

1135

new_top = floor(rc_model.

Top

() - scroll_y);

1191  switch

(font_size) {

1226  if

(new_SeqFont ==

NULL

)

return

;

1270  TSeqPos

chars_in_line, lines_in_seq;

1273

offset_list.clear();

1275  if

(lines_in_seq < 1) {

1279  if

(variations.size() == 0) {

1284  for

(

i

= 0;

i

< variations.size() - 1;

i

++) {

1286

k < variations.size() && variations[k].GetFeatLeft() < variations[

i

].GetFeatLeft() + variations[

i

].GetDrawWidth();

1288

variations[k].SetDisplayLine(

max

(variations[

i

].GetDisplayLine() + 1, variations[k].GetDisplayLine()));

1293  for

(

i

= 0;

i

< variations.size();

i

++) {

1294  TSeqPos

start_pos = variations[

i

].GetFeatLeft();

1295  TSeqPos

stop_pos = variations[

i

].GetFeatRight();

1298  TSeqPos

start_row_y = start_pos / chars_in_line;

1299  TSeqPos

stop_row_y = stop_pos / chars_in_line;

1302  if

(offset_list.size() < 1) {

1305

k =

static_cast<unsigned int>

(offset_list.size() - 1);

1306  while

(k > 0 && offset_list[k].m_StartRow > start_row_y) {

1309  if

(offset_list[k].m_StartRow < start_row_y) {

1313  for

(row_index = start_row_y; row_index <= stop_row_y; row_index++) {

1314  if

(k >= offset_list.size()) {

1315

offset_list.push_back(

COffsetStart

(row_index, variations[

i

].GetDisplayLine()));

1317

offset_list[k].m_CumulativeExtraRows =

max

(offset_list[k].m_CumulativeExtraRows, variations[

i

].GetDisplayLine());

1324  for

(

i

= 1;

i

< offset_list.size();

i

++) {

1325

offset_list[

i

].m_CumulativeExtraRows += offset_list[

i

- 1].m_CumulativeExtraRows;

1340  TSeqPos

chars_in_line, lines_in_seq;

1364  if

(tip_text.empty()) {

1383  return "No data source!"

;

1413

SetCursor (wxCURSOR_ARROW);

1419

SetCursor (wxCURSOR_SIZEWE);

CEvent - generic event implementation TODO TODO - Attachments.

TThisType & CombineWith(const TRange &r)

class CRgbaColor provides a simple abstraction for managing colors.

void SetColor(EColorType type, const CRgbaColor &color)

void SetTextLabel(const string &label)

TVPPoint GetPreferredSize(int max_num=0) const

void SetLabelOrientation(CGlTextureFont::EFontRotateFlags rotate, int rotate_degrees)

void SetDisplayOptions(int options)

virtual void Render(CGlPane &pane)

void SetShowFeatAsLower(bool show_lower)

bool GetShowFeatAsLower()

void SetFontSize(int font_size)

void SetCaseFeature(objects::CSeqFeatData::ESubtype subtype)

objects::SAnnotSelector * GetCaseFeature()

CSeqTextPaneConfig::EFeatureDisplayType GetCodonDrawChoice()

bool GetShowAbsolutePosition()

int GetCaseFeatureSubtype()

void Reload()

uncache any cached data

CSeqTextDataSource implements Adapter design pattern.

void RenderFeatureExtras(ISeqTextGeometry *pParent, CGlPane &pane, TSeqPos seq_start, TSeqPos seq_stop)

void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer, objects::SAnnotSelector *feat_sel=NULL, bool showFeatAsLower=false)

const objects::CSeq_loc * GetLoc() const

static int ChooseBetterSubtype(int subtype1, int subtype2)

string GetToolTipForSourcePos(TSeqPos source_pos)

vector< CConstRef< objects::CSeq_feat > > GetFeaturesAtPosition(TSeqPos source_pos)

TSeqPos SequencePosToSourcePos(TSeqPos sequence_pos, bool *found_in_source=NULL)

objects::CScope & GetScope()

void GetVariations(TSeqPos start_offset, TSeqPos stop_offset, CSeqTextDefs::TVariationGraphVector &variations)

TSeqPos SourcePosToSequencePos(TSeqPos source_pos)

vector< CSeqTextVariationGraph > TVariationGraphVector

vector< int > TSubtypeVector

vector< TSeqPos > TSeqPosVector

const CSeqTextDefs::TSeqPosVector & GetFoundList() const

virtual void STG_ReportMouseOverPos(TSeqPos pos)

CSequenceTextGraph * m_SubjectGraph

CSequenceTickGraph * m_SequenceTickGraph

virtual void STG_GetVisibleRange(TSeqPos &seq_start, TSeqPos &seq_stop)

void OnMouseRelease(wxMouseEvent &event)

virtual bool STG_IsPointInRightMargin(int x, int y)

void ShowFeaturesInLowerCase()

unsigned int x_GetOffsetForVariations(TModelUnit y)

void x_OnShowPopup(wxMouseEvent &event)

virtual int x_GetAreaByVPPos(TVPUnit vp_x, TVPUnit vp_y)

void OnSize(wxSizeEvent &event)

virtual void STG_RenderSelectedFeature(const objects::CSeq_feat &feat, const objects::CSeq_loc &mapped_loc)

virtual int x_OnPaste(void)

virtual TVPPoint GetPortSize(void)

returns size of the master pane in screen coordinates

void SetFontSize(int font_size)

virtual const objects::CSeq_loc * STG_GetDataSourceLoc()

void x_RenderCodonTick(TSeqPos cds_start, objects::ENa_strand strand)

void ResetRangeSelection()

void x_RenderFeatureExtras(const objects::CSeq_feat &feat, const objects::CSeq_loc &mapped_loc)

void x_ConfigureBottomRuler()

TModelRect GetPreferredModelRect()

void x_RenderFoundLocations(CGlPane &pane)

CSeqTextWidget * x_GetParent()

CGlWidgetPane overridables.

virtual int STG_GetLinesInPane()

CSeqTextSearch m_SearchObj

TModelUnit GetBottomRulerModelAdjustmentHeight()

bool GetShowAbsolutePosition()

void OnMouseDrag(wxMouseEvent &event)

const TRangeColl & GetSelection()

vector< COffsetStart > TOffsetStart

void x_RenderCodons(const objects::CSeq_loc &loc, objects::CCdregion_Base::EFrame frame)

virtual void Update(void)

virtual TModelUnit STG_GetTextHeight()

void DeSelectObject(const CObject *obj)

void x_RenderSelHandler()

virtual objects::CScope & STG_GetScope()

virtual void STG_OnChanged()

virtual void STG_SetDefaultCursor()

virtual TModelPoint STG_GetModelPointBySequencePos(TSeqPos z, bool *found_in_source)

bool GetShowFeaturesInLowerCase()

virtual string TC_GetTooltip(const wxRect &rc)

Returns tooltip string and coordinates for area tootlip associated with.

virtual void STG_RenderFeatureExtras(const objects::CMappedFeat &feat)

void ShowFeaturesInUpperCase()

int GetCaseFeatureSubtype()

virtual void STG_SetResizeCursor()

CRef< CSeqTextConfig > m_Config

void SelectObject(const CObject *obj)

void ScrollToPosition(TSeqPos pos, bool notify=true)

void x_RecalculateOffsets(void)

virtual TSeqPos STG_GetSequenceByWindow(int x, int y)

virtual bool TC_NeedTooltip(const wxPoint &pt)

Returns "true" if client wants to dispaly a tooltip.

virtual TModelPoint CharacterSize()

void x_CalculateOffsetList(CSeqTextDefs::TVariationGraphVector &variations)

void x_RenderContent(void)

virtual void x_Render(void)

virtual TModelPoint STG_GetModelPointBySourcePos(TSeqPos z)

TSeqPos x_GetSequenceRowFromScrollLine(TModelUnit scroll_line)

virtual TSeqPos STG_GetSourcePosBySequencePos(TSeqPos z, bool *found_in_source)

virtual void STG_GetLineInfo(TSeqPos &chars_in_line, TSeqPos &lines_in_seq)

CRef< CGlTextureFont > m_pSeqFont

virtual vector< CConstRef< objects::CSeq_feat > > STG_GetFeaturesAtPosition(TSeqPos pos)

virtual bool Layout(void)

recalculates recatngles for all intrnal objects so that they are positioned correctly with regard to ...

virtual void STG_SetSubtypesForFeature(CSeqTextDefs::TSubtypeVector &subtypes, const objects::CSeq_loc &loc, int subtype, TSeqPos start_offset, TSeqPos stop_offset)

CGlTextureFont * x_ChooseFontForSize(int font_size)

void SetRangeSelection(const TRangeColl &C)

void x_RenderBottomRuler()

virtual void STG_RenderMouseOverFeature(const objects::CSeq_feat &feat)

TSeqPos GetScrollAdjustmentForLastLineVariations()

CTextSelHandler m_SelHandler

void OnMousePush(wxMouseEvent &event)

void x_AdjustBottomRuler(CGlPane &pane)

virtual void STG_Redraw()

ISeqTextGeometry implementation.

TOffsetStart m_OffsetList

void ResetObjectSelection()

void x_UnderlineInterval(TSeqPos start, TSeqPos stop)

void ChooseCaseFeature(objects::CSeqFeatData::ESubtype subtype)

void SetFontSize(int font_size)

virtual CGlPane & GetPort()

implement these 2 functions in derived classes

virtual CSeqTextDataSource * GetDS()

void AdjustModelForSequenceAndWindowSize()

void ReportMouseOverPos(TSeqPos pos)

namespace ncbi::objects::

Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.

virtual void Render(CGlPane &pane)

void SetFont(CGlTextureFont *seq_font)

virtual void SetDataSource(CSeqTextDataSource *p_ds)

TModelUnit GetTextOffset()

TModelUnit GetTextHeight()

void SetFont(CGlTextureFont *seq_font)

virtual void Render(CGlPane &pane)

virtual void SetDataSource(CSeqTextDataSource *p_ds)

void ShowAbsolutePosition(bool show_abs)

virtual TVPPoint PreferredSize()

static CSimpleClipboard & Instance()

void OnMouseDrag(wxMouseEvent &event)

void SelectObject(const CObject *obj, bool b_redraw)

void DeSelectObject(const CObject *obj, bool b_redraw)

void OnMouseRelease(wxMouseEvent &event)

void ResetObjectSelection(bool b_redraw)

void SetRangeSelection(const TRangeColl &C, bool bRedraw)

const TRangeColl & GetSelection() const

void ResetSelection(bool bRedraw)

void ResetRangeSelection(bool bRedraw)

void OnMousePush(wxMouseEvent &event)

void Render(CGlPane &Pane, ERenderingOption option=eActiveState)

@ eWidgetSelectionChanged

a view has been destroyed

unsigned int TSeqPos

Type for sequence locations and lengths.

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

void SetModelLimitsRect(const TModelRect &R)

void SetViewport(const TVPRect &R)

virtual void Enable(GLenum glstate)=0

virtual void Begin(GLenum mode)=0

Start rendering.

CGlPoint< TVPUnit > TVPPoint

virtual void BlendFunc(GLenum sfactor, GLenum dfactor)=0

Options to be used when GL_BLEND is enabled.

IRender & GetGl()

convenience function for getting current render manager

void Vertex2d(GLdouble x, GLdouble y)

TVPRect & GetViewport(void)

void SetScale(TModelUnit scale_x, TModelUnit scale_y, TModelPoint p_center)

TModelRect & GetModelLimitsRect(void)

bool PtInRect(T x, T y) const

virtual void End()=0

Finish rendering (create buffer and send to renderer)

void SetVert(T bottom, T top)

void SetVisibleRect(const TModelRect &R)

virtual TModelUnit GetMetric(EMetric metric, const char *text=NULL, int len=-1) const

TModelRect & GetVisibleRect(void)

virtual void Disable(GLenum glstate)=0

glDisable()

virtual void LineWidth(GLfloat w)=0

Set line width for drawing: glLineWidth()

TModelUnit GetScaleX(void) const

TModelUnit GetScaleY(void) const

void SetHorz(T left, T right)

virtual void ColorC(const CRgbaColor &c)=0

Set current color (glColor{3,4}{f,d}{v,})

void EnableOffset(bool b_en=true)

Offset is used as a workaround for OpenGL precision problems emerging when size of visible range is s...

@ fFontRotateBase

Rotate around lower-left corner of unrotated text box.

float GetBlue(void) const

float GetGreen(void) const

float GetAlpha(void) const

virtual bool Send(CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default)

Sends an event synchronously.

float GetRed(void) const

Get specific channels in floating point values.

@ eEvent_Message

message from one class to another

CConstRef< CSeq_feat > GetSeq_feat(void) const

Get current seq-feat.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

TTo GetTo(void) const

Get the To member data.

TFrom GetFrom(void) const

Get the From member data.

E_Choice Which(void) const

Which variant is currently selected.

const TLocation & GetLocation(void) const

Get the Location member data.

TFrame GetFrame(void) const

Get the Frame member data.

const TData & GetData(void) const

Get the Data member data.

const TCdregion & GetCdregion(void) const

Get the variant data.

bool CanGetFrame(void) const

Check if it is safe to call GetFrame method.

@ eFrame_three

reading frame

ENa_strand

strand of nucleic acid

unsigned int

A callback function used to compare two keys in a database.

static void text(MDB_val *v)

const struct ncbi::grid::netcache::search::fields::SIZE size

The NCBI C++/STL use hints.

Defines: CTimeFormat - storage class for time format.

double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)

static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4