My Documents/Codes/MD++.svn/trunk/src/display_win.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include "glut.h"
#include <pthread.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include "general.h"
#include <math.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>

Go to the source code of this file.

Classes

struct  GlutXmotion
struct  XEvent
class  SYWindow
struct  SYWindow::YPoint
struct  SYWindow::YLine
struct  SYWindow::ZInd
struct  SYWindow::EventInfo
struct  SYWindow::Extent
struct  SYWindow::XformMap
struct  SYWindow::Xform
struct  SYWindow::Dlists
class  YWindow

Defines

#define nUSE_X
#define _DISPLAY_VERSION   1.05
#define GLUT_STATIC
#define KEY_ESCAPE   27
#define KEY_RETURN   13
#define KEY_BACKSPACE   8
#define KEY_ARROW_LEFT   100
#define KEY_ARROW_UP   101
#define KEY_ARROW_RIGHT   102
#define KEY_ARROW_DOWN   103
#define DEPTH   32
#define DEPTH_REAL   8
#define RGB   RGB32
#define GETRED   RED32
#define GETGREEN   GREEN32
#define GETBLUE   BLUE32
#define RGB32(R, G, B)   ((unsigned)(R)<<16)+((unsigned)(G)<<8)+((unsigned)(B))
#define RGB16(R, G, B)   ((unsigned)((R)&0xF8)<<8)+((unsigned)((G)&0xF8)<<3)+((unsigned)((B)>>3))
#define RGBany(R, G, B)
#define RED32(C)   (((C&0xFF0000)>>16)*1.0/(0x00FF))
#define GREEN32(C)   (((C&0xFF00)>>8)*1.0/(0x00FF))
#define BLUE32(C)   (((C&0x00FF)*1.0/(0x00FF)))
#define RED16(C)   (((C&0xF800)>>11)*1.0/(0x001F))
#define GREEN16(C)   (((C&0x07C0)>>6)*1.0/(0x001F))
#define BLUE16(C)   (((C&0x001F)*1.0/(0x001F)))
#define REDany(C)   (((C&CCT[0][3])>>CCT[0][4])*1.0/(CCT[0][5]))
#define GREENany(C)   (((C&CCT[1][3])>>CCT[1][4])*1.0/(CCT[1][5]))
#define BLUEany(C)   (((C&CCT[2][3])>>CCT[2][4])*1.0/(CCT[2][5]))

Typedefs

typedef char KeySym

Enumerations

enum  WindowAction {
  WINDOW_ACTION_NONE, WINDOW_ACTION_SCALE, WINDOW_ACTION_SCALE_X, WINDOW_ACTION_SCALE_Y,
  WINDOW_ACTION_SCALE_Z, WINDOW_ACTION_ROTATE_XY, WINDOW_ACTION_ROTATE_X, WINDOW_ACTION_ROTATE_Y,
  WINDOW_ACTION_ROTATE_Z, WINDOW_ACTION_TRANSLATE_XY, WINDOW_ACTION_TRANSLATE_X, WINDOW_ACTION_TRANSLATE_Y,
  WINDOW_ACTION_TRANSLATE_Z, WINDOW_ACTION_LOOKAT, WINDOW_ACTION_PICK, WINDOW_ACTION_KEY_PRESS,
  WINDOW_ACTION_MAX
}
enum  EventButtonId {
  BUTTON_UNKNOWN, BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT,
  BUTTON_SHIFT_LEFT, BUTTON_SHIFT_MIDDLE, BUTTON_SHIFT_RIGHT, BUTTON_CTRL_LEFT,
  BUTTON_CTRL_MIDDLE, BUTTON_CTRL_RIGHT, BUTTON_MAX
}
enum  EventButtonState { EVENT_BUTTON_STATE_NONE, EVENT_BUTTON_STATE_SHIFT, EVENT_BUTTON_STATE_CONTROL, EVENT_BUTTON_STATE_CONTROL_SHIFT }
enum  EventType {
  EVENT_NONE, EVENT_BUTTON_PRESS, EVENT_BUTTON_RELEASE, EVENT_MOUSE_MOTION,
  EVENT_WINDOW_EXPOSE, EVENT_KEY_PRESS, EVENT_KEY_RELEASE
}
enum  SphereRep {
  SPHERE_REP_DISC, SPHERE_REP_DOT, SPHERE_REP_POINT, SPHERE_REP_LINE,
  SPHERE_REP_SOLID
}
enum  { MaxPoints = 40000, MaxLines = 5000, rInterval = 50, DSCLEN = 30 }

Functions

void display (void)
void event_Butp (int button, int state, int x, int y)
void event_Butr (int mx, int my, EventButtonId button_id)
void event_IdleProc ()
void event_KeyboardProc (unsigned char ch, int x, int y)
void event_Motion (int x, int y)
void event_SpecialProc (int key, int x, int y)
void event_WinObjGet (int win, int *p)
void event_WinReshape (int width, int height)
void opengl_SurfGenSphere (SphereRep dtype, float radius, int slices, int stacks)
void viewport_Set (int win, int w, int h)
void delay (long sec, long usec)

Variables

unsigned long colorconvert_16 [3][6]
unsigned long colorconvert_32 [3][6]


Define Documentation

#define _DISPLAY_VERSION   1.05

Definition at line 14 of file display_win.h.

#define BLUE16 (  )     (((C&0x001F)*1.0/(0x001F)))

Definition at line 217 of file display_win.h.

#define BLUE32 (  )     (((C&0x00FF)*1.0/(0x00FF)))

Definition at line 213 of file display_win.h.

#define BLUEany (  )     (((C&CCT[2][3])>>CCT[2][4])*1.0/(CCT[2][5]))

Definition at line 221 of file display_win.h.

#define DEPTH   32

Definition at line 188 of file display_win.h.

#define DEPTH_REAL   8

Definition at line 191 of file display_win.h.

#define GETBLUE   BLUE32

Definition at line 201 of file display_win.h.

#define GETGREEN   GREEN32

Definition at line 200 of file display_win.h.

#define GETRED   RED32

Definition at line 199 of file display_win.h.

#define GLUT_STATIC

Definition at line 38 of file display_win.h.

#define GREEN16 (  )     (((C&0x07C0)>>6)*1.0/(0x001F))

Definition at line 216 of file display_win.h.

#define GREEN32 (  )     (((C&0xFF00)>>8)*1.0/(0x00FF))

Definition at line 212 of file display_win.h.

#define GREENany (  )     (((C&CCT[1][3])>>CCT[1][4])*1.0/(CCT[1][5]))

Definition at line 220 of file display_win.h.

#define KEY_ARROW_DOWN   103

Definition at line 52 of file display_win.h.

#define KEY_ARROW_LEFT   100

Definition at line 49 of file display_win.h.

#define KEY_ARROW_RIGHT   102

Definition at line 51 of file display_win.h.

#define KEY_ARROW_UP   101

Definition at line 50 of file display_win.h.

#define KEY_BACKSPACE   8

Definition at line 47 of file display_win.h.

#define KEY_ESCAPE   27

Definition at line 45 of file display_win.h.

Referenced by event_KeyboardProc().

#define KEY_RETURN   13

Definition at line 46 of file display_win.h.

#define nUSE_X

Definition at line 12 of file display_win.h.

#define RED16 (  )     (((C&0xF800)>>11)*1.0/(0x001F))

Definition at line 215 of file display_win.h.

#define RED32 (  )     (((C&0xFF0000)>>16)*1.0/(0x00FF))

Definition at line 211 of file display_win.h.

#define REDany (  )     (((C&CCT[0][3])>>CCT[0][4])*1.0/(CCT[0][5]))

Definition at line 219 of file display_win.h.

#define RGB   RGB32

Definition at line 198 of file display_win.h.

#define RGB16 ( R,
G,
B   )     ((unsigned)((R)&0xF8)<<8)+((unsigned)((G)&0xF8)<<3)+((unsigned)((B)>>3))

Definition at line 205 of file display_win.h.

#define RGB32 ( R,
G,
B   )     ((unsigned)(R)<<16)+((unsigned)(G)<<8)+((unsigned)(B))

Definition at line 204 of file display_win.h.

#define RGBany ( R,
G,
B   ) 

Value:

((((unsigned)(R)&CCT[0][0])<<CCT[0][1])>>CCT[0][2])\
                       +((((unsigned)(G)&CCT[1][0])<<CCT[1][1])>>CCT[1][2])\
                       +((((unsigned)(B)&CCT[2][0])<<CCT[2][1])>>CCT[2][2])

Definition at line 207 of file display_win.h.


Typedef Documentation

typedef char KeySym

Definition at line 128 of file display_win.h.


Enumeration Type Documentation

anonymous enum

Enumerator:
MaxPoints 
MaxLines 
rInterval 
DSCLEN 

Definition at line 226 of file display_win.h.

Enumerator:
BUTTON_UNKNOWN 
BUTTON_LEFT 
BUTTON_MIDDLE 
BUTTON_RIGHT 
BUTTON_SHIFT_LEFT 
BUTTON_SHIFT_MIDDLE 
BUTTON_SHIFT_RIGHT 
BUTTON_CTRL_LEFT 
BUTTON_CTRL_MIDDLE 
BUTTON_CTRL_RIGHT 
BUTTON_MAX 

Definition at line 74 of file display_win.h.

Enumerator:
EVENT_BUTTON_STATE_NONE 
EVENT_BUTTON_STATE_SHIFT 
EVENT_BUTTON_STATE_CONTROL 
EVENT_BUTTON_STATE_CONTROL_SHIFT 

Definition at line 88 of file display_win.h.

enum EventType

Enumerator:
EVENT_NONE 
EVENT_BUTTON_PRESS 
EVENT_BUTTON_RELEASE 
EVENT_MOUSE_MOTION 
EVENT_WINDOW_EXPOSE 
EVENT_KEY_PRESS 
EVENT_KEY_RELEASE 

Definition at line 95 of file display_win.h.

enum SphereRep

Enumerator:
SPHERE_REP_DISC 
SPHERE_REP_DOT 
SPHERE_REP_POINT 
SPHERE_REP_LINE 
SPHERE_REP_SOLID 

Definition at line 105 of file display_win.h.

Enumerator:
WINDOW_ACTION_NONE 
WINDOW_ACTION_SCALE 
WINDOW_ACTION_SCALE_X 
WINDOW_ACTION_SCALE_Y 
WINDOW_ACTION_SCALE_Z 
WINDOW_ACTION_ROTATE_XY 
WINDOW_ACTION_ROTATE_X 
WINDOW_ACTION_ROTATE_Y 
WINDOW_ACTION_ROTATE_Z 
WINDOW_ACTION_TRANSLATE_XY 
WINDOW_ACTION_TRANSLATE_X 
WINDOW_ACTION_TRANSLATE_Y 
WINDOW_ACTION_TRANSLATE_Z 
WINDOW_ACTION_LOOKAT 
WINDOW_ACTION_PICK 
WINDOW_ACTION_KEY_PRESS 
WINDOW_ACTION_MAX 

Definition at line 54 of file display_win.h.


Function Documentation

void delay ( long  sec,
long  usec 
) [inline]

Definition at line 230 of file display_win.h.

References NULL.

void display ( void   ) 

void event_Butp ( int  button,
int  state,
int  x,
int  y 
)

void event_Butr ( int  mx,
int  my,
EventButtonId  button_id 
)

Definition at line 1076 of file display_win.cpp.

References EVENT_NONE, event_WinObjGet(), and WINDOW_ACTION_NONE.

Referenced by event_Butp().

void event_IdleProc (  ) 

Definition at line 892 of file display_win.cpp.

References num_win, and win_table.

void event_KeyboardProc ( unsigned char  ch,
int  x,
int  y 
)

Definition at line 791 of file display_win.cpp.

References display(), event_WinObjGet(), and KEY_ESCAPE.

void event_Motion ( int  x,
int  y 
)

Definition at line 1029 of file display_win.cpp.

References EVENT_MOUSE_MOTION, event_WinObjGet(), and WINDOW_ACTION_NONE.

void event_SpecialProc ( int  key,
int  x,
int  y 
)

Definition at line 854 of file display_win.cpp.

References event_WinObjGet().

void event_WinObjGet ( int  win,
int *  p 
)

void event_WinReshape ( int  width,
int  height 
)

Definition at line 721 of file display_win.cpp.

References event_WinObjGet(), and viewport_Set().

void opengl_SurfGenSphere ( SphereRep  dtype,
float  radius,
int  slices,
int  stacks 
)

Definition at line 554 of file display_win.cpp.

References M_PI, SPHERE_REP_LINE, and SPHERE_REP_POINT.

void viewport_Set ( int  win,
int  w,
int  h 
)

Definition at line 497 of file display_win.cpp.

References event_WinObjGet().

Referenced by event_WinReshape().


Variable Documentation

unsigned long colorconvert_16[3][6]

Definition at line 20 of file display.cpp.

Referenced by SYWindow::SYWindow().

unsigned long colorconvert_32[3][6]

Definition at line 23 of file display.cpp.

Referenced by SYWindow::SYWindow().


Generated on Tue Oct 28 15:21:09 2008 for MD++ by  doxygen 1.5.7.1