Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Stage.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr                                                                       
00003  *cr            (C) Copyright 1995-2011 The Board of Trustees of the           
00004  *cr                        University of Illinois                       
00005  *cr                         All Rights Reserved                        
00006  *cr                                                                   
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  * RCS INFORMATION:
00011  *
00012  *      $RCSfile: Stage.h,v $
00013  *      $Author: johns $        $Locker:  $             $State: Exp $
00014  *      $Revision: 1.38 $       $Date: 2011/02/17 23:17:19 $
00015  *
00016  ***************************************************************************
00017  * DESCRIPTION:
00018  *   A Stage is a displayable object that acts as floor for other objects.
00019  * It is intended to be a point of reference.
00020  *
00021  ***************************************************************************/
00022 #ifndef STAGE_H
00023 #define STAGE_H
00024 
00025 #include "Displayable.h"
00026 #include "DispCmds.h"
00027 
00029 class Stage : public Displayable {
00030 public:
00032   enum StagePos { NO_STAGE = 0, STAGE_ORIGIN, STAGE_LOWER, STAGE_UPPER,
00033         STAGE_LEFT, STAGE_RIGHT, STAGE_BEHIND, STAGEPOS_TOTAL };
00034 
00035 private:
00036   // corners defining the stage
00037   float corner1[3], corner2[3], corner3[3], corner4[3];
00038   int usecolors[2];           
00039   int Panels;                 
00040   float Size;                 
00041   float inc;                  
00042   int stagePos;               
00043   int need_update;            
00044   DispCmdColorIndex cmdColor; 
00045   DispCmdSquare cmdSquare;    
00046   DispCmdPickPoint pickPoint; 
00047   int colorCat;               
00048   int movedStage;             
00049 
00051   void create_cmdlist(void);
00052 
00053 protected:
00054   virtual void do_color_changed(int);
00055 
00056 public:
00058   Stage(Displayable *);
00059 
00061   int location(int);
00062 
00064   int location(void) { return stagePos; }
00065 
00067   char *loc_description(int);
00068 
00070   int locations(void) { return STAGEPOS_TOTAL; }
00071 
00073   int panels(void) { return Panels; }
00074 
00076   int panels(int newp) {
00077     if (newp == Panels) return TRUE;
00078     if (newp >= 1 && newp <= 30) {
00079       Panels = newp;
00080       inc = (Size * 2.0f) / (float) Panels;
00081       need_update = TRUE;
00082       return TRUE; // success
00083     }
00084     return FALSE; // failed
00085   }
00086 
00087 
00089   float size(void) { return Size; }
00090 
00092   float size(float newsize) {
00093     Size = newsize;
00094     inc = (Size * 2.0f) / (float) Panels;
00095     need_update = TRUE;
00096     return TRUE; // success
00097   }
00098 
00099   //
00100   // public virtual routines
00101   //
00102   
00104   virtual void prepare();
00105 
00112   virtual void pick_move(PickMode *, DisplayDevice *, int, int, const float *);
00113 
00114 };
00115 
00116 #endif
00117 

Generated on Tue May 22 01:48:12 2012 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002