Overture  Version 25
mogl.h
Go to the documentation of this file.
1 #ifndef MOGL_H
2 #define MOGL_H
3 
4 #include "DialogData.h"
5 
7 
8 #define MAX_WINDOWS 3
9 #define MAX_BUTTONS 15
10 #define TRUE 1
11 #define FALSE 0
12 #define OK 1
13 #define ERROR 0
14 
15 enum
16 {
18 };
19 
21 {
25 };
26 
28 {
30 
32  int *axesOriginOption_; // indicates where to place the axes origin
33 
35  char backGroundName[100], foreGroundName[100];
36 
37  // here are default values for lights
38  int *lighting_;
39  int *lightIsOn; // which lights are on
44  GLfloat *globalAmbient;
45 
46  // default material properties, these values are used for surfaces in 3D when we give them
47  // different colours
48  GLfloat *materialAmbient;
49  GLfloat *materialDiffuse;
50  GLfloat *materialSpecular;
53 
56 };
57 
59 {
60 public:
61 // constructor
65 // data
74 bool showCommandHistory; // echo command history
75 bool showPrompt; // echo command prompt
76 
77 };
78 
79 
80 // Display the screen again immediately
81 // (see also moglPostDisplay)
82 void
83 moglDisplay(int win=0);
84 
85 void
86 moglGetWindowSize(int & width, int & height, int win=0 );
87 
88 void
89 moglOpenFileSB(char *pattern = NULL);
90 
91 void
93 
94 void
96 
97 void
98 moglBuildUserButtons(const aString buttonCommand[], const aString buttonLabel[], int win_number);
99 
100 void
101 moglBuildUserMenu(const aString menuName[], const aString menuTitle, int win_number);
102 
103 void
104 moglSetSensitive(int win_number, int trueOrFalse);
105 
106 void
107 moglSetButtonSensitive(int win_number, int btn, int trueOrFalse);
108 
109 void
110 moglBuildPopup(const aString menu[]);
111 
112 void
113 moglInit(int & argc,
114  char *argv[],
115  const aString &windowTitle,
116  aString fileMenuItems[],
117  aString helpMenuItems[],
118  WindowProperties &wProp);
119 
120 int
121 moglGetAnswer( aString &answer, const aString prompt = "",
122  PickInfo *pick_ =NULL, int blocking = 1 );
123 
124 
125 int
126 moglGetMenuItem(const aString menu[], aString &answer, const aString prompt="",
127  real *pickBox=0, int win_number=0 );
128 
129 // Display the screen the next time the event loop is entered
130 void
131 moglPostDisplay(int win=0);
132 
133 //kkc xltypedef void MOGL_DISPLAY_FUNCTION(GL_GraphicsInterface *giPointer=NULL, const int & win_number=0);
134 //kkc xltypedef void MOGL_RESIZE_FUNCTION(GL_GraphicsInterface *giPointer=NULL, const int & win_number=0);
135 typedef void MOGL_DISPLAY_FUNCTION(GL_GraphicsInterface *giPointer, const int & win_number);
136 typedef void MOGL_RESIZE_FUNCTION(GL_GraphicsInterface *giPointer, const int & win_number);
137 // Define the functions that will display and resize the screen
138 // (same function for all windows)
139 void
141  MOGL_DISPLAY_FUNCTION displayFunc,
142  MOGL_RESIZE_FUNCTION resizeFunc );
143 // set the prompt in the command window
144 void
145 moglSetPrompt(const aString &prompt);
146 
147 void
148 moglAppendCommandHistory(const aString &item);
149 
150 typedef void MOGL_VIEW_FUNCTION(GL_GraphicsInterface *giPointer,
151  const int & win,
152  const real & dx,
153  const real & dy,
154  const real & dz,
155  const real & dThetaX,
156  const real & dThetaY,
157  const real & dThetaZ,
158  const real & magnify );
159 // define the function that will be called when the rubber-band box
160 // is used to zoom in
161 void
163 int
164 makeGraphicsWindow(const aString &windowTitle,
165  aString fileMenuItems[],
166  aString helpMenuItems[],
167  ClippingPlaneInfo & clippingPlaneInfo,
168  ViewCharacteristics & viewChar,
169  DialogData & hardCopyDialog,
170  PullDownMenu &optionMenu,
171  WindowProperties &wProp,
172  int directRendering = 1 );
173 int
174 destroyGraphicsWindow(int win_number);
175 int
176 moglMakeCurrent(int win);
177 int
179 int
181 int
182 moglSetTitle(int win_number, const aString &windowTitle);
183 void
185 void
186 moglPrintRotPnt(real x, real y, real z, int win_number);
187 void
188 moglPrintLineWidth(real lw, int win_number);
189 void
190 moglPrintFractionOfScreen(real fraction, int win_number);
191 bool
192 moglRotationKeysPressed(int win_number);
193 
194 
195 // ----------- VIEWPORT interface -------------------------- **pf
196 
197 void graphics_setFrustum ( GLdouble left, GLdouble right,
198  GLdouble bottom, GLdouble top,
199  GLdouble near, GLdouble far);
200 
201 void graphics_setOrtho ( GLdouble left, GLdouble right,
202  GLdouble bottom, GLdouble top,
203  GLdouble near, GLdouble far);
204 
205 void graphics_setOrthoKeepAspectRatio( GLdouble aspectRatio, GLdouble magFactor,
206  GLdouble left, GLdouble right,
207  GLdouble bottom, GLdouble top,
208  GLdouble near, GLdouble far);
209 
210 void graphics_setPerspective ( GLdouble fovy, GLdouble aspect,
211  GLdouble near, GLdouble far);
212 
213 //void graphics_setLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ,
214 // GLdouble centerX, GLdouble centerY, GLdouble centerZ,//
215 // GLdouble upX, GLdouble upY, GLdouble upZ);
216 
217 #endif