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

virtual void Impala::Visualization::Plot::Markers::OnMouse ( double  x,
double  y,
int  msg,
int  but,
int  state 
) [inline, virtual]

Reimplemented from Impala::Visualization::Plot::Plottable.

Definition at line 96 of file Markers.h.

References mData, and mSelection.

00097     {
00098         if(mData.size()==0)
00099             return;
00100         if((msg == oglMouseMove || msg == oglMouseDown) && (state & oglLeftButton))
00101         {
00102             int best = 0;
00103             double d, dx, dy, dist;
00104             dx = x-mData[0];
00105             dy = y-mData[1];
00106             dist = dx*dx + dy*dy;
00107             for(int i=7 ; i<mData.size() ; i+=7)
00108             {
00109                 dx = x-mData[i+0];
00110                 dy = y-mData[i+1];
00111                 d = dx*dx + dy*dy;
00112                 if(d < dist)
00113                 {
00114                     best = i/7;
00115                     dist = d;
00116                 }
00117             }
00118 //            if(dist < treshold)
00119             mSelection = best;
00120         }
00121     }


Generated on Thu Jan 13 09:25:41 2011 for ImpalaSrc by  doxygen 1.5.1