Overture  Version 25
Classes | Macros | Typedefs | Functions | Variables
mogl.C File Reference
#include "GenericDataBase.h"
#include "wdhdefs.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <unistd.h>
#include <X11/StringDefs.h>
#include <X11/keysym.h>
#include <X11/IntrinsicP.h>
#include <X11/cursorfont.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glx.h>
#include <Xm/BulletinB.h>
#include <Xm/CascadeB.h>
#include <Xm/Command.h>
#include <Xm/DialogS.h>
#include <Xm/FileSB.h>
#include <Xm/Form.h>
#include <Xm/Frame.h>
#include <Xm/Label.h>
#include <Xm/LabelG.h>
#include <Xm/List.h>
#include <Xm/MainW.h>
#include <Xm/MessageB.h>
#include <Xm/RowColumn.h>
#include <Xm/PushB.h>
#include <Xm/PushBG.h>
#include <Xm/Scale.h>
#include <Xm/SelectioB.h>
#include <Xm/Separator.h>
#include <Xm/Text.h>
#include <Xm/TextF.h>
#include <Xm/ToggleB.h>
#include <Xm/ToggleBG.h>
#include "aString.H"
#include "mogl.h"
#include "DialogData.h"
#include <X11/GLw/GLwMDrawA.h>
Include dependency graph for mogl.C:

Classes

struct  WINDOW_REC
 

Macros

#define down_width   16
 
#define down_height   16
 
#define up_width   16
 
#define up_height   16
 
#define right_width   16
 
#define right_height   16
 
#define left_width   16
 
#define left_height   16
 
#define zp_width   16
 
#define zp_height   16
 
#define zm_width   16
 
#define zm_height   16
 
#define yrotp_width   16
 
#define yrotp_height   16
 
#define yrotm_width   16
 
#define yrotm_height   16
 
#define xrotp_width   16
 
#define xrotp_height   16
 
#define xrotm_width   16
 
#define xrotm_height   16
 
#define zrotp_width   16
 
#define zrotp_height   16
 
#define zrotm_width   16
 
#define zrotm_height   16
 
#define zoom_in_width   16
 
#define zoom_in_height   16
 
#define zoom_out_width   16
 
#define zoom_out_height   16
 
#define reset_width   16
 
#define reset_height   16
 
#define rotpnt_width   16
 
#define rotpnt_height   16
 
#define SC   (char *)(const char *)
 
#define clipPlane(plane, i)
 
#define clipPlaneIsOn(plane)   *(clippingPlaneInfo->clippingPlaneIsOn+(plane))
 

Typedefs

typedef float real
 

Functions

void showHardcopyDialog (Widget pb, XtPointer client_data, XtPointer call_data)
 
int checkGLError ()
 
void toggled (Widget widget, XtPointer client_data, XtPointer call_data)
 
void detectOverlaySupport (Display *dpy, Visual *overlayVisual, int *overlayDepth, Colormap *overlayColormap)
 
void clippingPlanesDialog (Widget pb, XtPointer client_data, XtPointer call_data)
 
void annotateDialog (Widget pb, XtPointer client_data, XtPointer call_data)
 
void viewCharacteristicsDialog (Widget pb, XtPointer client_data, XtPointer call_data)
 
void draw (Widget w)
 
void graphicsInit (Widget w, XtPointer data, XtPointer callData)
 
void exposeOrResize (Widget w, XtPointer data, XtPointer callData)
 
void map_state_changed (Widget w, XtPointer data, XEvent *event, Boolean *cont)
 
void popupCallback (Widget menuItem, XtPointer client_data, XtPointer call_data)
 
void exec_cmd (Widget widget, XtPointer client_data, XtPointer call_data)
 
void inputCommand (Widget cmd_widget, XtPointer client_data, XtPointer call_data)
 
void postIt (Widget cmd_widget, XtPointer client_data, XEvent *event, char *dum)
 
void buttonCallback (Widget widget, XtPointer client_data, XtPointer call_data)
 
void eventLoop ()
 
void drawAreaInput (Widget w, XtPointer clientData, XtPointer callData)
 
void graphics_setFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)
 
void graphics_setOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)
 
void graphics_setOrthoKeepAspectRatio (GLdouble aRatio, GLdouble magFactor, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)
 
void graphics_setPerspective (GLdouble fovy, GLdouble aspect, GLdouble near, GLdouble far)
 
void moglDisplay (int win)
 
void setMenuNameChosen (const char *answer)
 
void setMenuChosen (const int &menuItem, char *answer)
 
void getCursor (real &x, real &y)
 
void moglInit (int &argc, char *argv[], const aString &windowTitle, aString fileMenuItems[], aString helpMenuItems[], WindowProperties &wProp)
 
void moglOpenFileSB (char *extension)
 
void moglCloseFileSB ()
 
void moglCreateMessageDialog (aString msg, MessageTypeEnum type)
 
int moglSetTitle (int win_number, const aString &windowTitle)
 
int makeGraphicsWindow (const aString &windowTitle, aString fileMenuItems[], aString helpMenuItems[], ClippingPlaneInfo &clippingPlaneInfo, ViewCharacteristics &viewChar, DialogData &hardCopyDialog, PullDownMenu &optionMenu, WindowProperties &wProp, int directRendering)
 
int destroyGraphicsWindow (int win_number)
 
void moglSetSensitive (int win_number, int trueOrFalse)
 
void moglSetButtonSensitive (int win_number, int btn, int trueOrFalse)
 
void moglBuildUserButtons (const aString buttonCommand[], const aString buttonLabel[], int win_number)
 
void moglBuildUserMenu (const aString menuName[], const aString menuTitle, int win_number)
 
void moglSetViewFunction (MOGL_VIEW_FUNCTION viewFunction_)
 
void moglSetFunctions (GL_GraphicsInterface *giPointer, MOGL_DISPLAY_FUNCTION displayFunc, MOGL_RESIZE_FUNCTION resizeFunc)
 
int moglMakeCurrent (int win)
 
int moglGetInfo (Display *&dpy_, XVisualInfo *&vi, GLXContext &cx)
 
int moglGetNWindows ()
 
int moglGetCurrentWindow ()
 
void moglResetContext ()
 
void moglAppendCommandHistory (const aString &answer)
 
void moglSetPrompt (const aString &prompt)
 
void moglBuildPopup (const aString menu[])
 
int moglGetAnswer (aString &answer, const aString prompt, PickInfo *pick_, int blocking)
 
void moglGetWindowSize (int &width, int &height, int win)
 
void moglPostDisplay (int win)
 
bool moglRotationKeysPressed (int win_number)
 
void moglPollEvents ()
 
void getRubberBandBoxCorners (real &xMin, real &xMax, real &yMin, real &yMax)
 
void clipPlaneOnOff (Widget widget, XtPointer clinet_data, XtPointer call_data)
 
void scaleCallback (Widget widget, XtPointer clinet_data, XtPointer call_data)
 
void changeNormal (Widget widget, XtPointer clinet_data, XtPointer call_data)
 
void positionDialog (Widget dialog, XtPointer client_data, XtPointer call_data)
 
void annotateOnOff (Widget widget, XtPointer clinet_data, XtPointer call_data)
 
void annotateText (Widget widget, XtPointer clinet_data, XtPointer call_data)
 
void moglPrintRotPnt (real x, real y, real z, int win_number)
 
void moglPrintLineWidth (real lw, int win_number)
 
void moglPrintFractionOfScreen (real fraction, int win_number)
 
void backgroundCallback (Widget menuItem, XtPointer client_data, XtPointer call_data)
 
void foregroundCallback (Widget menuItem, XtPointer client_data, XtPointer call_data)
 

Variables

XGCValues gcValues
 
MOGL_DISPLAY_FUNCTIONdisplayFunction = display
 
MOGL_RESIZE_FUNCTIONresizeFunction = resize
 
MOGL_VIEW_FUNCTIONviewFunction = NULL
 

Macro Definition Documentation

#define clipPlane (   plane,
 
)
Value:
*(clippingPlaneInfo->clippingPlaneEquation+(i) \
+(plane)*4)

Referenced by clippingPlanesDialog().

#define clipPlaneIsOn (   plane)    *(clippingPlaneInfo->clippingPlaneIsOn+(plane))

Referenced by clippingPlanesDialog().

#define down_height   16

Referenced by moglInit().

#define down_width   16

Referenced by moglInit().

#define left_height   16

Referenced by moglInit().

#define left_width   16

Referenced by moglInit().

#define reset_height   16

Referenced by moglInit().

#define reset_width   16

Referenced by moglInit().

#define right_height   16

Referenced by moglInit().

#define right_width   16

Referenced by moglInit().

#define rotpnt_height   16

Referenced by moglInit().

#define rotpnt_width   16

Referenced by moglInit().

#define SC   (char *)(const char *)
#define up_height   16

Referenced by moglInit().

#define up_width   16

Referenced by moglInit().

#define xrotm_height   16

Referenced by moglInit().

#define xrotm_width   16

Referenced by moglInit().

#define xrotp_height   16

Referenced by moglInit().

#define xrotp_width   16

Referenced by moglInit().

#define yrotm_height   16

Referenced by moglInit().

#define yrotm_width   16

Referenced by moglInit().

#define yrotp_height   16

Referenced by moglInit().

#define yrotp_width   16

Referenced by moglInit().

#define zm_height   16

Referenced by moglInit().

#define zm_width   16

Referenced by moglInit().

#define zoom_in_height   16

Referenced by moglInit().

#define zoom_in_width   16

Referenced by moglInit().

#define zoom_out_height   16

Referenced by moglInit().

#define zoom_out_width   16

Referenced by moglInit().

#define zp_height   16

Referenced by moglInit().

#define zp_width   16

Referenced by moglInit().

#define zrotm_height   16

Referenced by moglInit().

#define zrotm_width   16

Referenced by moglInit().

#define zrotp_height   16

Referenced by moglInit().

#define zrotp_width   16

Referenced by moglInit().

Typedef Documentation

typedef float real

Function Documentation

void annotateDialog ( Widget  pb,
XtPointer  client_data,
XtPointer  call_data 
)
void annotateOnOff ( Widget  widget,
XtPointer  clinet_data,
XtPointer  call_data 
)

References setMenuChosen().

Referenced by annotateDialog().

void annotateText ( Widget  widget,
XtPointer  clinet_data,
XtPointer  call_data 
)

References setMenuChosen().

Referenced by annotateDialog().

void backgroundCallback ( Widget  menuItem,
XtPointer  client_data,
XtPointer  call_data 
)
void buttonCallback ( Widget  widget,
XtPointer  client_data,
XtPointer  call_data 
)

References NULL, setMenuNameChosen(), and TRUE.

Referenced by makeGraphicsWindow().

void changeNormal ( Widget  widget,
XtPointer  clinet_data,
XtPointer  call_data 
)

References pow(), setMenuChosen(), and sScanF().

Referenced by clippingPlanesDialog().

int checkGLError ( )
void clippingPlanesDialog ( Widget  pb,
XtPointer  client_data,
XtPointer  call_data 
)
void clipPlaneOnOff ( Widget  widget,
XtPointer  clinet_data,
XtPointer  call_data 
)

References setMenuChosen().

Referenced by clippingPlanesDialog().

int destroyGraphicsWindow ( int  win_number)
void detectOverlaySupport ( Display *  dpy,
Visual *  overlayVisual,
int *  overlayDepth,
Colormap *  overlayColormap 
)

Referenced by moglInit().

void draw ( Widget  w)
void drawAreaInput ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
void eventLoop ( )
void exec_cmd ( Widget  widget,
XtPointer  client_data,
XtPointer  call_data 
)

References NULL, setMenuNameChosen(), and TRUE.

Referenced by moglInit().

void exposeOrResize ( Widget  w,
XtPointer  data,
XtPointer  callData 
)
void foregroundCallback ( Widget  menuItem,
XtPointer  client_data,
XtPointer  call_data 
)
void getCursor ( real x,
real y 
)

References eventLoop().

void getRubberBandBoxCorners ( real xMin,
real xMax,
real yMin,
real yMax 
)

References eventLoop(), NULL, and viewFunction.

void graphics_setFrustum ( GLdouble  left,
GLdouble  right,
GLdouble  bottom,
GLdouble  top,
GLdouble  near,
GLdouble  far 
)
void graphics_setOrtho ( GLdouble  left,
GLdouble  right,
GLdouble  bottom,
GLdouble  top,
GLdouble  near,
GLdouble  far 
)
void graphics_setOrthoKeepAspectRatio ( GLdouble  aRatio,
GLdouble  magFactor,
GLdouble  left,
GLdouble  right,
GLdouble  bottom,
GLdouble  top,
GLdouble  near,
GLdouble  far 
)
void graphics_setPerspective ( GLdouble  fovy,
GLdouble  aspect,
GLdouble  near,
GLdouble  far 
)
void graphicsInit ( Widget  w,
XtPointer  data,
XtPointer  callData 
)
void inputCommand ( Widget  cmd_widget,
XtPointer  client_data,
XtPointer  call_data 
)
int makeGraphicsWindow ( const aString windowTitle,
aString  fileMenuItems[],
aString  helpMenuItems[],
ClippingPlaneInfo clippingPlaneInfo,
ViewCharacteristics viewChar,
DialogData hardCopyDialog,
PullDownMenu optionMenu,
WindowProperties wProp,
int  directRendering 
)
void map_state_changed ( Widget  w,
XtPointer  data,
XEvent *  event,
Boolean *  cont 
)

Referenced by makeGraphicsWindow().

void moglAppendCommandHistory ( const aString answer)

References max(), NULL, and SC.

void moglBuildPopup ( const aString  menu[])

References FALSE, WINDOW_REC::mainw, NULL, and postIt().

void moglBuildUserButtons ( const aString  buttonCommand[],
const aString  buttonLabel[],
int  win_number 
)
void moglBuildUserMenu ( const aString  menuName[],
const aString  menuTitle,
int  win_number 
)
void moglCloseFileSB ( )

References NULL.

void moglCreateMessageDialog ( aString  msg,
MessageTypeEnum  type 
)
void moglDisplay ( int  win)

References draw(), and plotStuff().

int moglGetAnswer ( aString answer,
const aString  prompt,
PickInfo pick_,
int  blocking 
)
int moglGetCurrentWindow ( )
int moglGetInfo ( Display *&  dpy_,
XVisualInfo *&  vi,
GLXContext &  cx 
)

References WINDOW_REC::cx, and WINDOW_REC::vi.

int moglGetNWindows ( )
void moglGetWindowSize ( int &  width,
int &  height,
int  win 
)

References NULL, and WINDOW_REC::plotStuff.

void moglInit ( int &  argc,
char *  argv[],
const aString windowTitle,
aString  fileMenuItems[],
aString  helpMenuItems[],
WindowProperties wProp 
)
int moglMakeCurrent ( int  win)

References checkGLError(), ERROR, OK, and plotStuff().

void moglOpenFileSB ( char *  extension)

References NULL.

void moglPollEvents ( )
void moglPostDisplay ( int  win)

References WINDOW_REC::postDisplay, and TRUE.

void moglPrintFractionOfScreen ( real  fraction,
int  win_number 
)
void moglPrintLineWidth ( real  lw,
int  win_number 
)
void moglPrintRotPnt ( real  x,
real  y,
real  z,
int  win_number 
)
void moglResetContext ( )
bool moglRotationKeysPressed ( int  win_number)

References WINDOW_REC::toplevel.

void moglSetButtonSensitive ( int  win_number,
int  btn,
int  trueOrFalse 
)
void moglSetFunctions ( GL_GraphicsInterface giPointer,
MOGL_DISPLAY_FUNCTION  displayFunc,
MOGL_RESIZE_FUNCTION  resizeFunc 
)

References displayFunction, and resizeFunction.

void moglSetPrompt ( const aString prompt)

References NULL, and SC.

void moglSetSensitive ( int  win_number,
int  trueOrFalse 
)
int moglSetTitle ( int  win_number,
const aString windowTitle 
)

References ERROR, NULL, OK, SC, and WINDOW_REC::toplevel.

void moglSetViewFunction ( MOGL_VIEW_FUNCTION  viewFunction_)

References viewFunction.

void popupCallback ( Widget  menuItem,
XtPointer  client_data,
XtPointer  call_data 
)
void positionDialog ( Widget  dialog,
XtPointer  client_data,
XtPointer  call_data 
)

Referenced by DialogData::openDialog().

void postIt ( Widget  cmd_widget,
XtPointer  client_data,
XEvent *  event,
char *  dum 
)

Referenced by moglBuildPopup(), and moglGetAnswer().

void scaleCallback ( Widget  widget,
XtPointer  clinet_data,
XtPointer  call_data 
)

References setMenuChosen().

Referenced by clippingPlanesDialog().

void setMenuChosen ( const int &  menuItem,
char *  answer 
)
void setMenuNameChosen ( const char *  answer)
void showHardcopyDialog ( Widget  pb,
XtPointer  client_data,
XtPointer  call_data 
)

Referenced by makeGraphicsWindow().

void toggled ( Widget  widget,
XtPointer  client_data,
XtPointer  call_data 
)
void viewCharacteristicsDialog ( Widget  pb,
XtPointer  client_data,
XtPointer  call_data 
)

Variable Documentation

MOGL_DISPLAY_FUNCTION* displayFunction = display

Referenced by draw(), and moglSetFunctions().

XGCValues gcValues
MOGL_RESIZE_FUNCTION* resizeFunction = resize

Referenced by exposeOrResize(), and moglSetFunctions().

MOGL_VIEW_FUNCTION* viewFunction = NULL