home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.3 Development Libraries / SGI IRIX 6.3 Development Libraries.iso / dist6.3 / ViewKit_dev.idb / usr / share / src / ViewKit / Applications / GLX / Box.h.z / Box.h
Encoding:
C/C++ Source or Header  |  1996-09-20  |  2.4 KB  |  63 lines

  1. ////////////////////////////////////////////////////////////////////////////////
  2. ///////   Copyright 1992, Silicon Graphics, Inc.  All Rights Reserved.   ///////
  3. //                                                                            //
  4. // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;     //
  5. // the contents of this file may not be disclosed to third parties, copied    //
  6. // or duplicated in any form, in whole or in part, without the prior written  //
  7. // permission of Silicon Graphics, Inc.                                       //
  8. //                                                                            //
  9. // RESTRICTED RIGHTS LEGEND:                                                  //
  10. // Use,duplication or disclosure by the Government is subject to restrictions //
  11. // as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data     //
  12. // and Computer Software clause at DFARS 252.227-7013, and/or in similar or   //
  13. // successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -    //
  14. // rights reserved under the Copyright Laws of the United States.             //
  15. //                                                                            //
  16. ////////////////////////////////////////////////////////////////////////////////
  17. ///////////////////////////////////////////////////////////////////////////
  18. // Box.h
  19. //////////////////////////////////////////////////////////////////////////
  20. #ifndef BOX_H
  21. #define BOX_H
  22.  
  23. #include "VkGLX.h"
  24.  
  25. class Box;
  26.  
  27. typedef struct {
  28.     Box *obj;
  29.     char axis;
  30.     XtIntervalId id;
  31. } RotateInfo;
  32.  
  33. class Box : public VkGLX {
  34.  
  35.   public:
  36.      Box(const char *name, Widget parent);
  37.      ~Box();
  38.  
  39.   protected:
  40.     
  41.      virtual void ginit(GlxDrawCallbackStruct *cb);
  42.      virtual void expose(GlxDrawCallbackStruct *cb);
  43.      virtual void resize(GlxDrawCallbackStruct *cb);
  44.      virtual void input(GlxDrawCallbackStruct *cb);
  45.  
  46.      void initialize_gl();
  47.      void viewcube(char axis);
  48.      void updatemat(char axis);
  49.      float norm_dot(Coord passpoly[][3]);
  50.      void transform(long n, Coord passpoly[][3], Coord postrans[][3]);
  51.      void resetAction();
  52.      void translateAction(char axis, float amount);
  53.      void rotateAction(char axis, int amount);
  54.  
  55.      static void rotateCallback(XtPointer clientData, XtIntervalId *id);
  56.  
  57.      Coord _x, _y, _z;
  58.      Angle _rx, _ry, _rz;
  59.      RotateInfo _rotX, _rotY, _rotZ;
  60. };
  61.  
  62. #endif
  63.