m_CursorId(wxCURSOR_ARROW),
69m_PanOnMouseDown(
false),
80m_HasCapture(
false),
82m_ScaleColor(0.0
f, 0.5
f, 0.0
f, 0.3
f),
83m_TickColor(1.0
f, 1.0
f, 1.0
f),
84m_RectColor(0.0
f, 0.5
f, 0.0
f, 0.1
f)
136 CGlAttrGuardAttrGuard(GL_LINE_BIT | GL_ENABLE_BIT | GL_POLYGON_BIT | GL_HINT_BIT);
183gl.
Begin(GL_LINE_STRIP);
201gl.
Begin(GL_LINES);
218 for(
int i= start_i;
i<= end_i;
i++ ) {
242x2 = rc_vp.
Right();
266gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
271gl.
Rectd(x1, y1, x2, y2);
278gl.
Enable(GL_LINE_STIPPLE);
280gl.
Begin(GL_LINES);
314gl.
Enable(GL_POLYGON_SMOOTH);
315glHint(GL_POLYGON_SMOOTH_HINT, GL_FASTEST);
322 doubled_x = x2 - x1;
323 doubled_y = y2 - y1;
324 doubleangle = 90.0 * atan2(d_y, d_x) / atan2(1.0, 0.0);
325 doublehyp = sqrt(d_x * d_x + d_y * d_y);
329gl.
Rotated(angle, 0.0, 0.0, 1.0);
331gl.
Begin(GL_QUADS);
350gl.
Rotated(-angle, 0.0, 0.0, 1.0);
364gl.
Begin(GL_TRIANGLE_STRIP);
365gl.
Vertex2d(x_c - half, y_c + half);
366gl.
Vertex2d(x_c - half, y_c - half);
373gl.
Begin(GL_LINE_STRIP);
376gl.
Vertex2d(x_c - half, y_c - half);
377gl.
Vertex2d(x_c - half, y_c + half);
409 if(wxGetKeyState(wxKeyCode(
'Z'))) {
411}
else if(wxGetKeyState(wxKeyCode(
'R'))) {
413}
else if(wxGetKeyState(wxKeyCode(
'P'))) {
426 for( k=
'A'; k<=
'Z'; ++k) {
427 if(wxGetKeyState((wxKeyCode)k))
430 for( k=
'0'; k<=
'9'; ++k) {
431 if(wxGetKeyState((wxKeyCode)k))
435 if(wxGetKeyState(WXK_SHIFT) ||
436wxGetKeyState(WXK_ALT) ||
437wxGetKeyState(WXK_CONTROL) ||
438wxGetKeyState(WXK_COMMAND))
456 switch(event.GetKeyCode()) {
496 if(ready_st !=
eIdle) {
518wxPoint ms_pos =
event.GetPosition();
544 if(!wxGetKeyState(wxKeyCode(
'P'))) {
563wxPoint pos =
event.GetPosition();
565 if(event.Dragging()) {
609wxPoint pos =
event.GetPosition();
693 if( ready_st !=
eIdle){
869 if(x2 != x1 || y2 != y1) {
871 intleft =
min(x1, x2);
872 intright =
max(x1, x2);
873 intbottom =
min(y1, y2);
874 inttop =
max(y1, y2);
959 doublesc = exp(norm);
CGlAttrGuard - guard class for restoring OpenGL attributes.
CMouseZoomHandler provides support for mouse-driven zoom and pan operations.
void x_OnChangeZoomRectPan(const wxPoint &pos)
void x_OnChangeScale(int d_y)
d_y is the absolute shift in pixels from the position where m_StartNorm have been initialized
void OnOtherMouseEvents(wxMouseEvent &event)
virtual void SetHost(IMouseZoomHandlerHost *pHost)
int x_NormToPixels(TModelUnit norm) const
void x_RenderZoomRect(CGlPane &pane)
EKeyState x_GetKeyState()
void OnMotion(wxMouseEvent &event)
void x_OnChangePan(const wxPoint &ms_pos)
void x_SwitchToReadyState(EState new_state, const wxPoint &ms_pos)
signal handlers - functions doing the real job
void x_DrawMarker(bool fill, int x_c, int y_c, int half)
void x_OnEndZoomRect(EState new_state)
TModelUnit x_ScaleToNorm(TModelUnit scale) const
helper functions
IMouseZoomHandlerHost * m_Host
void OnKeyUp(wxKeyEvent &event)
virtual wxEvtHandler * GetEvtHandler()
void x_OnSelectCursor(void)
void OnKeyDown(wxKeyEvent &event)
void OnMiddleUp(wxMouseEvent &event)
void OnLeftUp(wxMouseEvent &event)
virtual void SetMode(EMode mode)
void OnKillFocus(wxFocusEvent &event)
void OnMouseWheel(wxMouseEvent &event)
void x_RenderPan(CGlPane &pane)
void x_OnEndPan(EState new_state)
virtual IGenericHandlerHost * GetGenericHost()
void x_SwitchToActiveState(EState state, const wxPoint &ms_pos)
TModelUnit x_NormToScale(TModelUnit norm) const
void x_OnEndScale(EState new_state)
void x_RenderScale(CGlPane &pane)
void OnMiddleDown(wxMouseEvent &event)
virtual void SetPane(CGlPane *pane)
void OnMouseCaptureLost(wxMouseCaptureLostEvent &evt)
void x_DrawTicks(int center_x, int y, int tick_w)
void OnLeftDown(wxMouseEvent &event)
virtual void Render(CGlPane &Pane)
virtual ~CMouseZoomHandler()
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
Interface IMouseZoomHandlerHost represents a context in which CMouseZoomHandler functions.
virtual void MZHH_ZoomRect(const TModelRect &rc)=0
virtual void MZHH_SetScale(TModelUnit scale, const TModelPoint &point)=0
virtual TVPUnit MZHH_GetVPPosByY(int y) const =0
converts window coord to Viewport coord
virtual void MZHH_EndOp()=0
virtual TModelUnit MZHH_GetScale(EScaleType type)=0
virtual void MZHH_Scroll(TModelUnit d_x, TModelUnit d_y)=0
Include a standard set of the NCBI C++ Toolkit most basic headers.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
virtual void Translated(GLdouble x, GLdouble y, GLdouble z)=0
CGlRect & IntersectWith(const CGlRect &r)
virtual void Enable(GLenum glstate)=0
virtual void LineStipple(GLint factor, GLushort pattern)=0
Set line stipple pattern: glLineStipple(). Deprecated in gl 3.2+.
virtual void Begin(GLenum mode)=0
Start rendering.
virtual void BlendFunc(GLenum sfactor, GLenum dfactor)=0
Options to be used when GL_BLEND is enabled.
TModelPoint UnProject(TVPUnit m_x, TVPUnit m_y) const
IRender & GetGl()
convenience function for getting current render manager
void Vertex2d(GLdouble x, GLdouble y)
TVPRect & GetViewport(void)
TModelUnit UnProjectX(TVPUnit m_x) const
TModelRect & GetModelLimitsRect(void)
virtual void Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)=0
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.
TModelUnit UnProjectY(TVPUnit m_y) const
virtual void Disable(GLenum glstate)=0
glDisable()
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)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
unsigned int
A callback function used to compare two keys in a database.
static const int kArrowHeadW
static const int kArrowHeadL
static const int kArrowBodyW
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