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

virtual void OglGui::ViewSphere::KeyboardFunc ( INT  c,
INT  state 
) [inline, virtual]

Definition at line 179 of file ViewSphere.h.

References InitAnimation(), OglGui::Window::KeyboardFunc(), mAdjustViewDims, mAnimCnt, mAnimSteps, mAutoRotateRing, mDblRing, mHorRingNr, mKeyInfo, OglGui::OglWindow::mOglWnd, mRadius, mRotRingDelta, mShowCentralView, mShowText, mSphereRotDx, mSphereRotDy, mSphereRotDz, mSphereRotX, mSphereRotY, mSphereRotZ, mStdStickOut, mStdVertRing, mVertRingNr, NCOL, NROW, and SPHERE_TAG.

00180         {
00181                 INT                     shiftDown = state & oglShift;
00182                 FLOAT           add = shiftDown ? 0.01f : -0.01f;
00183 
00184                 if( c=='c' ){
00185                         mVertRingNr += 1;
00186                         if( mVertRingNr == NCOL )
00187                                 mVertRingNr = 0;
00188                 }
00189                 else if( c=='C' ){
00190                         mHorRingNr += 1;
00191                         if( mHorRingNr == NROW )
00192                                 mHorRingNr = 0;
00193                 }
00194         else if (c=='s' || c=='S')
00195             mRotRingDelta += (c=='S') ? 0.05f : -0.05f;
00196                 else if( c == 'R' || c == 'r' ) // Radius of sphere
00197                         mRadius += (c=='R') ? 0.2f : -0.2f;
00198                 else if( !(c==oglCTRL('x')) && !(c==oglCTRL('y')) && !(c==oglCTRL('z')) )
00199                         Window::KeyboardFunc( c, state );
00200 
00201         if( c == 'i' )
00202             mKeyInfo = !mKeyInfo;
00203 
00204         if (c==oglCTRL('s'))
00205                         mSphereRotDx = mSphereRotDy = mSphereRotDz = 0.0f;
00206 
00207                 if( c == oglESC ) { // Reset: Set rotation and rotation speed to zero
00208                         mSphereRotDx = mSphereRotDy = mSphereRotDz = 0.0f;
00209                         mSphereRotX = mSphereRotY = mSphereRotZ = 0.0f;
00210                 }
00211 
00212         if( c == oglFUNC(9) )
00213             c = oglFUNC(0);
00214         if( c >= oglFUNC(0) && c <= oglFUNC(8) ) // Change all viewer object3D shape
00215             view3DSys.Object3DTagged( mOglWnd, visibleTag, 1, c - oglFUNC(0) );
00216 
00217         // CTRL x,y,z adds rotation speed over X,Y,Z axis
00218 
00219                 if( c == oglCTRL('x') && (mSphereRotDx += add) ) oglSys.SetAlwaysDraw( mOglWnd, 1 );
00220                 if( c == oglCTRL('y') && (mSphereRotDy += add) ) oglSys.SetAlwaysDraw( mOglWnd, 1 );
00221                 if( c == oglCTRL('z') && (mSphereRotDz += add) ) oglSys.SetAlwaysDraw( mOglWnd, 1 );
00222 
00223                 if( c == '#' ) // Pauze/continue
00224             oglSys.SetAlwaysDraw( mOglWnd, !oglSys.GetAlwaysDraw(mOglWnd) );
00225 
00226                 if( c == 'e' || c == 'E' ) // Extrusion of ring
00227                         mStdStickOut += (c == 'E') ? 0.05f : -0.05f;
00228                 if( c == '9' ) // Rotate 90 deg over Z axis
00229                         mSphereRotZ += 90;
00230                 if( c == 'f' ) // Fill / hide central view
00231                         mShowCentralView = !mShowCentralView;
00232 
00233                 if( c == 'F' && !(mAdjustViewDims = !mAdjustViewDims) ) // Toggle Fixed/adjusted viewed dimensions
00234             view3DSys.SizeTagged( mOglWnd, SPHERE_TAG, 1, 1.96f, 1.4f, 1.f, 0 );
00235 
00236                 if( c == 't' ) // Show/Hide
00237                         mShowText = !mShowText;
00238                 if( c == 'v' ) // Vertical/horizontal ring when not double ring
00239                         mStdVertRing = !mStdVertRing;
00240                 if( c == '=' ) // Toggle between double ring and single ring
00241                         mDblRing = !mDblRing;
00242 
00243         // Auto rotate ring(s)
00244                 if( c == 'a' && (mAutoRotateRing = !mAutoRotateRing) )
00245                         oglSys.SetAlwaysDraw( mOglWnd, 1 );
00246 
00247         // Animate viewers swirling in
00248                 if( c == 'A' && !mAnimCnt )
00249                         InitAnimation();
00250         if( c == oglCTRL('a') ){
00251             mAnimSteps += (state & oglShift) ? 50 : -50;
00252             if( mAnimSteps < 100 ) mAnimSteps = 100;
00253         }
00254 
00255                 oglSys.UpdateSceneFlag( mOglWnd, 1 );
00256         }

Here is the call graph for this function:


Generated on Thu Jan 13 09:27:20 2011 for ImpalaSrc by  doxygen 1.5.1