74 m_bResizeCursor(
false),
76 m_SelColor(0.5
f, 0.5
f, 0.5
f, 0.25
f),
77 m_BorderColor(0.25
f, 0.25
f, 0.25
f, 0.5
f),
78 m_PassiveSelColor(0.6
f, 0.6
f, 0.6
f, 0.25
f),
79 m_SymbolColor(0.0
f, 0.0
f, 1.0
f, 1.0
f),
180 if (event.ButtonDClick(1)) {
191 if (event.Dragging()) {
261 bool b_hit_start =
false;
389 bool b_hit_start =
false;
435 if (event.AltDown()) {
446 wxPoint pt =
event.GetPosition();
454 wxPoint pt =
event.GetPosition();
462 wxPoint pt =
event.GetPosition();
467 bool b_min_start =
false;
474 int D = (
int)
abs((
int)(z -
R.GetFrom()));
476 if(min_D < 0 || min_D > D) {
481 D = (
int)
abs((
int)(z -
R.GetToOpen()));
490 b_hit_start = b_min_start;
492 range = *p_min_range;
493 }
else range.SetLength(0);
501 TSeqPos chars_in_line, lines_in_seq;
505 pos =
min (pos, (
TSeqPos) (chars_in_line * lines_in_seq));
545 if (seq_start > vis_stop || seq_end < vis_start) {
550 TSeqPos chars_in_line, lines_in_seq;
553 seq_end =
min (seq_end, lines_in_seq * chars_in_line);
557 TSeqPos row_end = ((seq_start / chars_in_line) * chars_in_line) + chars_in_line - 1;
558 while (row_end < vis_start) {
559 TSeqPos next_row_start = row_end + 1;
560 row_end =
min (next_row_start + chars_in_line - 1, seq_end);
564 if (start_point.
m_Y == end_point.
m_Y) {
565 interim_point.
m_X = end_point.
m_X;
569 interim_point.
m_X + 1.0,
570 interim_point.
m_Y + 0.8);
577 while (row_end < vis_stop && row_end < seq_end)
579 TSeqPos next_row_start = row_end + 1;
581 row_end =
min (next_row_start + chars_in_line - 1, seq_end);
583 rc.
Init (start_point.
m_X, start_point.
m_Y - 0.2, interim_point.
m_X + 1.0, interim_point.
m_Y + 0.8);
623 if (seq_start > vis_stop || seq_end < vis_start) {
628 seq_start =
max (seq_start, vis_start);
629 seq_end =
min (seq_end, vis_stop);
648 if (objs.size() == 0)
677 CGlAttrGuard AttrGuard(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_HINT_BIT);
718 TSeqPos start_offset, stop_offset;
729 for (
i = 0;
i < stop_offset - start_offset + 2;
i++) {
736 if (objs.size() == 0) {
766 TSeqPos start_offset, stop_offset;
777 for (
i = 0;
i < stop_offset - start_offset + 2;
i++) {
CGUIEvent provides mapping of FLTK events to Semantic Events.
CGlAttrGuard - guard class for restoring OpenGL attributes.
void Clear(objects::CScope *scope)
bool Remove(const CObject &obj)
void GetObjects(TConstObjects &objects) const
void Add(ISelObjectHandle *obj_handle, CObject &obj)
TThisType & CombineWith(const TRange &r)
TThisType & Subtract(const TRange &r)
class CRgbaColor provides a simple abstraction for managing colors.
ESubtype GetSubtype(void) const
@ eSubtype_bad
These no longer need to match the FEATDEF values in the C toolkit's objfdef.h.
vector< int > TSubtypeVector
namespace ncbi::objects::
Base class for all serializable objects.
Class CTextSelHandler represents in GUI a two-dimnesional multi-segment selection.
void x_OnChangeSelRange(wxMouseEvent &event)
EOpType x_GetOpTypeByEvent(wxKeyEvent &event) const
helper functions
void OnMouseDrag(wxMouseEvent &event)
void SelectObject(const CObject *obj, bool b_redraw)
TSeqRange GetSelectionLimits() const
ISeqTextGeometry * m_pGeometry
void DeSelectObject(const CObject *obj, bool b_redraw)
void OnMouseRelease(wxMouseEvent &event)
void x_OnSelectCursor(wxMouseEvent &event)
CRgbaColor m_PassiveSelColor
void x_HitTest(TSeqRange &Range, bool &bHitStart, wxMouseEvent &event)
void OnKeyUp(wxKeyEvent &event)
void SetColor(EColorType type, const CRgbaColor &color)
void ResetObjectSelection(bool b_redraw)
CRef< objects::CSeq_loc_Mapper > m_Mapper
void x_RemoveFromSelection(const TSeqRange &Range)
virtual ~CTextSelHandler()
TSeqPos x_ClipPosByRange(TSeqPos Pos)
int x_OnMouseMove(CGUIEvent &event, CGlPane &Pane)
void x_SetHoverPos(TSeqPos pos)
TSeqPos x_MouseToSeqPos(wxMouseEvent &event)
void x_OnStartSel(wxMouseEvent &event)
Signal handlers.
void x_RenderRange(TSeqRange r, CRgbaColor &fill_color)
void x_AddToSelection(const TSeqRange &Range)
void OnKeyDown(wxKeyEvent &event)
void SetRangeSelection(const TRangeColl &C, bool bRedraw)
void SetHost(ISeqTextGeometry *pGeometry)
void STGH_GetMouseOverFeatureSubtypes(CSeqTextDefs::TSubtypeVector &subtypes)
const TRangeColl & GetSelection() const
void ResetSelection(bool bRedraw)
void x_OnOpChange(wxMouseEvent &event)
void x_RenderSelectedFeatures()
void ResetRangeSelection(bool bRedraw)
void OnMousePush(wxMouseEvent &event)
void x_RenderOpSymbol(TSeqRange r)
void Render(CGlPane &Pane, ERenderingOption option=eActiveState)
bool x_MouseInRightMargin(wxMouseEvent &event)
void STGH_GetSelectedFeatureSubtypes(CSeqTextDefs::TSubtypeVector &subtypes)
CObjectIndex m_SelectedObjects
virtual void STG_SetDefaultCursor()=0
virtual void STG_SetResizeCursor()=0
virtual void STG_ReportMouseOverPos(TSeqPos pos)=0
virtual const objects::CSeq_loc * STG_GetDataSourceLoc()=0
virtual void STG_RenderSelectedFeature(const objects::CSeq_feat &feat, const objects::CSeq_loc &mapped_loc)=0
virtual void STG_GetVisibleRange(TSeqPos &seq_start, TSeqPos &seq_stop)=0
virtual void STG_SetSubtypesForFeature(CSeqTextDefs::TSubtypeVector &subtypes, const objects::CSeq_loc &loc, int subtype, TSeqPos start_offset, TSeqPos stop_offset)=0
virtual void STG_Redraw()=0
virtual bool STG_IsPointInRightMargin(int x, int y)=0
virtual vector< CConstRef< objects::CSeq_feat > > STG_GetFeaturesAtPosition(TSeqPos pos)=0
virtual objects::CScope & STG_GetScope()=0
virtual TModelPoint STG_GetModelPointBySourcePos(TSeqPos z)=0
virtual void STG_RenderMouseOverFeature(const objects::CSeq_feat &feat)=0
virtual TSeqPos STG_GetSequenceByWindow(int x, int y)=0
virtual void STG_GetLineInfo(TSeqPos &chars_in_line, TSeqPos &lines_in_pane)=0
virtual void STG_OnChanged()=0
Include a standard set of the NCBI C++ Toolkit most basic headers.
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
IRender & GetGl()
convenience function for getting current render manager
virtual void PolygonMode(GLenum face, GLenum mode)=0
Set the polygon rasterization mode.
virtual void TextOut(const char *text) const
TextOut interface Write the specified text and set up state and transformation as needed.
TModelRect & GetVisibleRect(void)
virtual void LineWidth(GLfloat w)=0
Set line width for drawing: glLineWidth()
virtual void ColorC(const CRgbaColor &c)=0
Set current color (glColor{3,4}{f,d}{v,})
void Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
vector< CConstRef< CObject > > TConstObjects
virtual const CTypeInfo * GetThisTypeInfo(void) const =0
@ eSeqMap_Up
map from segments to the top level bioseq
void Reset(void)
Reset reference object.
bool NotEmpty(void) const
TThisType & SetToOpen(position_type toOpen)
position_type GetToOpen(void) const
TThisType & SetLength(position_type length)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
void SetFrom(TFrom value)
Assign a value to From data member.
TFrom GetFrom(void) const
Get the From member data.
const TLocation & GetLocation(void) const
Get the Location member data.
const TData & GetData(void) const
Get the Data member data.
unsigned int
A callback function used to compare two keys in a database.
range(_Ty, _Ty) -> range< _Ty >
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
double f(double x_, const double &y_)
void RenderRect(const TModelRect &rc, TModelUnit offset_x, TModelUnit offset_y, CRgbaColor &color, GLenum type)
static int kDragThreshold