Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

virtual void Impala::Visualization::RotorBrowser::RotorDoDView::OnMouse ( int  msg,
int  btn,
int  state,
float  x,
float  y 
) [inline, virtual]

Reimplemented from OglGui::View.

Definition at line 112 of file RotorDoDView.h.

References mDragHX, mDragHY, mDragLX, mDragLY, mIsDragging, mRotorView, OglGui::View::mView3D, OglGui::View::OnMouse(), and Impala::Visualization::RotorBrowser::RectangleListener::OnRectangleSelect().

00113     {
00114         OglGui::View::OnMouse(msg, btn, state, x, y);
00115         float h = mView3D->h;
00116         float w = mView3D->w;
00117 
00118         if (msg == oglMouseDown && btn == oglLeftButton)
00119         {
00120             if (mIsDragging)
00121             {
00122                 // execute if click within box, cancel if outside:
00123                 if (mDragLX<=x && x<=mDragHX && mDragLY<=y && y<=mDragHY)
00124                 {
00125                     float sx, sy, sw, sh;
00126                     sx = mDragLX/w;
00127                     sy = mDragLY/h;
00128                     sw = (mDragHX - mDragLX)/w;
00129                     sh = (mDragHY - mDragLY)/h;
00130                     if (mRotorView && sw > 1 && sh > 1)
00131                         mRotorView->OnRectangleSelect(sx,1.0-(sy+sh),sw,sh);
00132                 }
00133                 mIsDragging = false;
00134             }
00135             else
00136             {
00137                 mDragLX = mDragHX = x;
00138                 mDragLY = mDragHY = y;
00139                 mIsDragging = true;
00140             }
00141         }
00142         if (msg == oglMouseMove && mIsDragging)
00143         {
00144             if (x < mDragLX) mDragLX = x;
00145             if (x > mDragHX) mDragHX = x;
00146             if (y < mDragLY) mDragLY = y;
00147             if (y > mDragHY) mDragHY = y;
00148 
00149             if (mDragLX < -w/2) mDragLX = -w/2;
00150             if (mDragLY < -h/2) mDragLY = -h/2;
00151             if (mDragHX > w/2)  mDragHX = w/2;
00152             if (mDragHY > h/2)  mDragHY = h/2;
00153         }
00154     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:56:19 2010 for ImpalaSrc by  doxygen 1.5.1