cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
osaGLUT.h
Go to the documentation of this file.
1 /*
2 
3  Author(s): Simon Leonard
4  Created on: Nov 11 2009
5 
6  (C) Copyright 2009-2011 Johns Hopkins University (JHU), All Rights Reserved.
7 
8 --- begin cisst license - do not edit ---
9 
10 This software is provided "as is" under an open source license, with
11 no warranty. The complete license can be found in license.txt and
12 http://www.cisst.org/cisst/license.txt.
13 
14 --- end cisst license ---
15 */
16 
17 #ifndef _osaGLUT_h
18 #define _osaGLUT_h
19 
20 #include <stdlib.h>
21 #include <vector>
23 
25 
26 class osaGeometry;
27 
29 
30  private:
31 
32  int x, y; // X, Y positions (top left corner)
33  int width, height; // width and heiht
34 
35  double azimuth; // rotation about the Z axis
36  double elevation; // elevation from the X-Y plane
37  double distance; // distance from the origin
38  float perspective; // camera FOV
39 
40  double sleepPeriod; // to save CPU
41 
42  void DrawXYZ(); // draw the X-Y-Z axis
43  void DrawGrid(double width, int subdivisions); // draw the floor
44 
45  // compute the camera XYZ coordinates
46  vct3 CameraPosition() const;
47 
48  std::vector<const osaGeometry*> geoms; // the geometries
49 
50  public:
51 
52  static osaGLUT* glut;
53 
55  osaGLUT( int argc, char** argv);
56 
58  static void Register( const osaGeometry* geom );
59 
61  static void StartMainLoop(void);
62 
64  void Draw();
65 
67  void Keyboard( int k, int x, int y );
68 
69  osaGeometry* LoadOBJ( const std::string& filename );
70 
72  void SetSleepPeriod( const double sleepPeriodInSec ) {
73  sleepPeriod = sleepPeriodInSec;
74  }
75 
76  static void Refresh();
77 };
78 
79 #endif
Definition: osaGLUT.h:28
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
void SetSleepPeriod(const double sleepPeriodInSec)
Setter.
Definition: osaGLUT.h:72
Typedef for fixed size vectors.
static osaGLUT * glut
Definition: osaGLUT.h:52