: m_Orientation(orient),
62m_bResizeCursor(
false),
64m_ShowCoordinates(
true),
66m_SelColor(0.5
f, 0.5
f, 0.5
f, 0.25
f),
67m_BorderColor(0.25
f, 0.25
f, 0.25
f, 0.5
f),
68m_PassiveSelColor(0.6
f, 0.6
f, 0.6
f, 0.25
f),
69m_SymbolColor(1.0
f, 0.0
f, 0.0
f, 1.0
f),
168wxPoint ms_pos =
event.GetPosition();
175 for( k=
'A'; k<=
'Z'; ++k) {
176 if(wxGetKeyState((wxKeyCode)k))
180 if(wxGetKeyState(WXK_ALT)) {
216wxPoint ms_pos =
event.GetPosition();
226 boolhandled =
false;
227wxPoint ms_pos =
event.GetPosition();
229 if(event.Dragging()) {
248 boolb_hit_start =
false;
363 boolb_hit_start =
false;
388wxStockCursor cur_id = wxCURSOR_ARROW;
392wxCursor cursor(cur_id);
431 boolb_min_start =
false;
439 int D=
abs(z - from_Z);
441 if(min_D < 0 || min_D >
D) {
449b_min_start =
false;
455b_hit_start = b_min_start;
457range = *p_min_range;
474pos =
max(pos, min_pos);
475pos =
min(pos, max_pos);
500 if(
type== GL_LINE) {
501gl.
Begin(GL_LINE_STRIP);
511gl.
Rectd(rc.
Left() - offset_x, rc.
Top() - offset_y,
512rc.
Right() - offset_x, rc.
Bottom() - offset_y);
525gl.
Enable(GL_LINE_SMOOTH);
541gl.
Begin(GL_QUADS);
543gl.
Vertex2d(x - half_w_x, y + lw_y);
544gl.
Vertex2d(x + lw_x + half_w_x, y + lw_y);
545gl.
Vertex2d(x + lw_x + half_w_x, y);
550gl.
Vertex2d(x + lw_x, y - half_w_y);
553gl.
Vertex2d(x, y + lw_y + half_w_y);
554gl.
Vertex2d(x + lw_x, y + lw_y + half_w_y);
560gl.
Begin(GL_QUADS);
563gl.
Vertex2d(x - half_w_x, y + lw_y);
564gl.
Vertex2d(x + lw_x + half_w_x, y + lw_y);
565gl.
Vertex2d(x + lw_x + half_w_x, y);
568gl.
Vertex2d(x + lw_x, y - half_w_y);
569gl.
Vertex2d(x + lw_x, y + lw_y + half_w_y);
570gl.
Vertex2d(x, y + lw_y + half_w_y);
585 CGlAttrGuardAttrGuard(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_HINT_BIT);
606rc.
SetHorz(
r.GetFrom(),
r.GetToOpen());
609rc.
SetVert(
r.GetFrom(),
r.GetToOpen());
612 RenderRect(rc, offset_x, offset_y, fill_color, GL_FILL);
631 RenderRect(rc_curr, offset_x, offset_y, fill_color, GL_FILL);
634 RenderRect(rc_curr, offset_x, offset_y, border_c, GL_LINE);
659(rc_curr.
Bottom() + rc_curr.
Top()) / 2 - offset_y);
661pos_world = pane.
UnProject(pos_screen.
X(), pos_screen.
Y());
665symbol_w, 4.0, scale_x, scale_y,
m_OpType, b_horz);
668symbol_w, 2.0, scale_x, scale_y,
m_OpType, b_horz);
681 TModelUnitx_s = 0.0, y_s = 0.0, x_e = 0.0, y_e = 0.0;
685 TModelUnitscale = b_horz ? scale_x : scale_y;
696 if(space >
fabs(text_w_s)) {
702 if(space >
fabs(text_w_e)) {
709 TModelUnith_s = 0.0, w_s = 0.0, h_e = 0.0, w_e = 0.0;
711x_s = text_pos_s - offset_x;
712y_s = (rc_curr.
Bottom() + rc_curr.
Top() - text_h) * 0.5 - offset_y;
713x_e = text_pos_e - offset_x;
716y_off = 2.0 * scale_y;
721x_s = (rc_curr.
Left() + rc_curr.
Right() + text_h) * 0.5 - offset_x;
722y_s = text_pos_s - offset_y;
724y_e = text_pos_e - offset_y;
725x_off = -2.0 * scale_x;
736gl.
Rectd(x_s - x_off , y_s - y_off, x_s + w_s + x_off, y_s + h_s + y_off);
737gl.
Rectd(x_e - x_off , y_e - y_off, x_e + w_e + x_off, y_e + h_e + y_off);
743 floatrotation = 0.0f;
748gl.
WriteText(x_s, y_s, pos_str_s.c_str(), rotation);
749gl.
WriteText(x_e, y_e, pos_str_e.c_str(), rotation);
static EGUIState wxGetSelectState(const wxMouseEvent &event)
CGlAttrGuard - guard class for restoring OpenGL attributes.
Class CLinearSelHandler represents in GUI a one-dimnesional multi-segment selection.
void x_AddToSelection(const TSeqRange &Range)
void OnLeftUp(wxMouseEvent &event)
TModelUnit x_MouseToSeqPos(const wxPoint &ms_pos)
void Render(CGlPane &Pane, ERenderingOption option=eActiveState)
void SetSelection(const TRangeColl &C, bool bRedraw)
void ResetSelection(bool bRedraw)
const TRangeColl & GetSelection() const
EOrientation m_Orientation
void SetColor(EColorType type, const CRgbaColor &color)
TSeqRange GetSelectionLimits() const
void x_RemoveFromSelection(const TSeqRange &Range)
TSeqRange m_CurrRange
range being modified
void x_OnStartSel(const wxPoint &ms_pos, CGUIEvent::EGUIState state)
Signal handlers.
void OnLeftDoubleClick(wxMouseEvent &event)
void OnMotion(wxMouseEvent &event)
void SetShowRangeCoords(bool flag)
void x_OnChangeSelRange(const wxPoint &ms_pos)
IGenericHandlerHost * GetGenericHost()
void OnMouseCaptureLost(wxMouseCaptureLostEvent &evt)
EOpType m_OpType
operation type
void OnLeftDown(wxMouseEvent &event)
EExtState m_ExtState
current range extension state
TModelUnit x_ClipPosByRange(TModelUnit Pos)
void SetHost(ISelHandlerHost *host)
bool m_ShowCoordinates
Flag indicating to show range coordinates during selection.
EOpType x_GetOpTypeByState(CGUIEvent::EGUIState state) const
helper functions
virtual void SetPane(CGlPane *pane)
void SetOrientation(EOrientation orient)
virtual wxEvtHandler * GetEvtHandler()
CRgbaColor m_PassiveSelColor
void x_HitTest(const wxPoint &ms_pos, TSeqRange &Range, bool &bHitStart)
virtual ~CLinearSelHandler()
void x_OnSelectCursor(const wxPoint &ms_pos)
TThisType & CombineWith(const TRange &r)
TThisType & Subtract(const TRange &r)
class CRgbaColor provides a simple abstraction for managing colors.
virtual void GHH_ReleaseMouse()=0
releases captured mouse
virtual void GHH_Redraw()=0
redraws the Host and the handler
virtual void GHH_CaptureMouse()=0
captures mouse events in the hosting window for D&D
virtual void GHH_SetCursor(const wxCursor &cursor)=0
changes the cursor in the hosting window
virtual TModelUnit SHH_GetModelByWindow(int z, EOrientation orient)=0
virtual void SHH_OnChanged()=0
virtual TVPUnit SHH_GetWindowByModel(TModelUnit z, EOrientation orient)=0
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
virtual void Enable(GLenum glstate)=0
virtual void Begin(GLenum mode)=0
Start rendering.
TModelPoint UnProject(TVPUnit m_x, TVPUnit m_y) const
IRender & GetGl()
convenience function for getting current render manager
void Vertex2d(GLdouble x, GLdouble y)
virtual void BeginText(const CGlTextureFont *font, const CRgbaColor &color)=0
Text is drawn is pixel coordinates.
TModelUnit GetOffsetY() const
virtual void EndText()=0
Pops matrices and attributes after writing text.
TModelRect & GetModelLimitsRect(void)
virtual void End()=0
Finish rendering (create buffer and send to renderer)
virtual void PolygonMode(GLenum face, GLenum mode)=0
Set the polygon rasterization mode.
void SetVert(T bottom, T top)
virtual void WriteText(TModelUnit x, TModelUnit y, const char *text, TModelUnit rotate_degrees=0.0)=0
Write text at specified model coords.
virtual TModelUnit TextWidth(const char *text) const
Compute and return font metrics.
virtual TModelUnit TextHeight(void) const
TModelRect & GetVisibleRect(void)
virtual void LineWidth(GLfloat w)=0
Set line width for drawing: glLineWidth()
TModelUnit GetScaleX(void) const
TModelUnit GetScaleY(void) const
TModelUnit GetOffsetX() const
void SetHorz(T left, T right)
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)
TVPPoint Project(TModelUnit m_x, TModelUnit m_y) const
position_type GetLength(void) const
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.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
@ fWithCommas
Use commas as thousands separator.
void SetFrom(TFrom value)
Assign a value to From data member.
TFrom GetFrom(void) const
Get the From member data.
static void s_RenderSymbol(TModelUnit x, TModelUnit y, TModelUnit w, TModelUnit line_w, TModelUnit scale_x, TModelUnit scale_y, CLinearSelHandler::EOpType type, bool b_horz)
void RenderRect(const TModelRect &rc, TModelUnit offset_x, TModelUnit offset_y, CRgbaColor &color, GLenum type)
static const int kSymbolBorder
static int kDragThreshold
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
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