Eaagles::BasicGL::GlutDisplay Class Reference

Inherits Eaagles::BasicGL::LcDisplay.

Inheritance diagram for Eaagles::BasicGL::GlutDisplay:

Inheritance graph
[legend]
Collaboration diagram for Eaagles::BasicGL::GlutDisplay:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GlutDisplay ()
int createWindow ()
int createSubWindow (const int mainWin)
int getWindowId () const
bool isWindowId (const int id) const
unsigned int getIdleSleepTime () const
virtual bool setIdleSleepTime (const unsigned int ms)
virtual void swapbuffers ()
virtual void configureIt ()
virtual void mouseEvent (const int button, const int state, const int x, const int y)
virtual void passiveMotionEvent (const int x, const int y)
virtual void mouseMotionEvent (const int x, const int y)
virtual void reset ()
bool setSlotFullScreen (const Basic::LcNumber *const msg)
bool setSlotIdleSleepTime (const Basic::LcNumber *const msg)
virtual bool event (const int event, Basic::LcObject *const obj=0)
bool isFullScreen ()
virtual void reshapeIt (int w, int h)
virtual bool setResizeWindows (const bool x)

Protected Member Functions

bool setSlotResizeWindows (const Basic::LcNumber *const msg)
virtual bool onEscKey ()
void specialEvent (const int key)
LcGraphicpick (const int item=-1)
void printSelectBuffer (const GLuint sbuff[], const int size)
void clearSelectBuffer (GLuint sbuff[], const int size)
LcGraphicfindSelected (const GLuint sbuff[], const int size, const int item=0)

Static Protected Member Functions

static bool registerGlutDisplay (const int id, GlutDisplay *const display)
static bool unregisterGlutDisplay (const int id)
static GlutDisplayfindRegisteredGlutDisplay (const int id)
static int findRegisteredWinId (const GlutDisplay *dp)

Private Types

enum  { MAX_DISPLAYS = 500 }

Static Private Member Functions

static void drawFuncCB ()
static void reshapeItCB (int w, int h)
static void idleCB ()
static void keyboardFuncCB (unsigned char key, int x, int y)
static void specialFuncCB (int key, int x, int y)
static void mouseFuncCB (int button, int state, int x, int y)
static void passiveMotionFuncCB (int x, int y)
static void motionFuncCB (int x, int y)

Private Attributes

int winId
bool fullScreenFlg
unsigned int idleSleepTimeMS
int numDisplaysToResize
bool okToResize

Static Private Attributes

static const float CLICK_TIME
static int idList [MAX_DISPLAYS]
static GlutDisplaydisplayList [MAX_DISPLAYS]
static int numGlutDisplays
static osg::Vec4 ratios [MAX_DISPLAYS]

Detailed Description

  Manages the LcDisplay as a GLUT Window

    Slots:
       fullScreen     (LcNumber)  Flag to set full screen mode  -- Main windows only --
       idleSleepTime  (LcNumber)  Idle callback sleep time (MS) -- Main windows only --
    


Member Enumeration Documentation

anonymous enum [private]

Maximum number of GlutDisplay classes.

Enumerator:
MAX_DISPLAYS 


Constructor & Destructor Documentation

Eaagles::BasicGL::GlutDisplay::GlutDisplay (  ) 


Member Function Documentation

int Eaagles::BasicGL::GlutDisplay::createWindow (  ) 

Creates the screen for the main window. Will create any sub-displays (windows).

int Eaagles::BasicGL::GlutDisplay::createSubWindow ( const int  mainWin  ) 

Creates the screen for a subwindow.

int Eaagles::BasicGL::GlutDisplay::getWindowId (  )  const [inline]

Returns winId (the window id).

bool Eaagles::BasicGL::GlutDisplay::isWindowId ( const int  id  )  const [inline]

Returns true if id == winId (the active window), else false.

unsigned int Eaagles::BasicGL::GlutDisplay::getIdleSleepTime (  )  const [inline]

Returns the idle callback's sleep time.

bool Eaagles::BasicGL::GlutDisplay::setIdleSleepTime ( const unsigned int  ms  )  [virtual]

Sets the idle callback's sleep time.

void Eaagles::BasicGL::GlutDisplay::swapbuffers (  )  [virtual]

Calls the function glutSwapBuffers().

Reimplemented from Eaagles::BasicGL::LcDisplay.

void Eaagles::BasicGL::GlutDisplay::configureIt (  )  [virtual]

Configures the display.

void Eaagles::BasicGL::GlutDisplay::mouseEvent ( const int  button,
const int  state,
const int  x,
const int  y 
) [virtual]

Event function for graphic selection for LcComponent interface.

Reimplemented from Eaagles::BasicGL::LcDisplay.

void Eaagles::BasicGL::GlutDisplay::passiveMotionEvent ( const int  x,
const int  y 
) [virtual]

This is an passive mouse motion call back event function for the LcComponent interface.

void Eaagles::BasicGL::GlutDisplay::mouseMotionEvent ( const int  x,
const int  y 
) [virtual]

Mouse motion event with either key pressed.

void Eaagles::BasicGL::GlutDisplay::reset (  )  [virtual]

Resets the parameters.

Reimplemented from Eaagles::BasicGL::LcDisplay.

bool Eaagles::BasicGL::GlutDisplay::setSlotFullScreen ( const Basic::LcNumber *const  msg  ) 

Slot table function for setting full screen.

bool Eaagles::BasicGL::GlutDisplay::setSlotIdleSleepTime ( const Basic::LcNumber *const  msg  ) 

Slot table function for setting idle sleep time.

virtual bool Eaagles::BasicGL::GlutDisplay::event ( const int  event,
Basic::LcObject *const   obj = 0 
) [virtual]

Event function for the LcComponent interface.

Reimplemented from Eaagles::Basic::LcComponent.

bool Eaagles::BasicGL::GlutDisplay::isFullScreen (  )  [inline]

Returns true if full screen flag is true.

void Eaagles::BasicGL::GlutDisplay::reshapeIt ( int  w,
int  h 
) [virtual]

Function for reshaping subdisplays.

Reimplemented from Eaagles::BasicGL::LcDisplay.

bool Eaagles::BasicGL::GlutDisplay::setResizeWindows ( const bool  x  )  [virtual]

Sets the flag okToResize.

bool Eaagles::BasicGL::GlutDisplay::setSlotResizeWindows ( const Basic::LcNumber *const  msg  )  [protected]

Calls the method setResizeWindows.

bool Eaagles::BasicGL::GlutDisplay::onEscKey (  )  [protected, virtual]

Exits with 0.

void Eaagles::BasicGL::GlutDisplay::specialEvent ( const int  key  )  [protected]

bool Eaagles::BasicGL::GlutDisplay::registerGlutDisplay ( const int  id,
GlutDisplay *const  display 
) [static, protected]

Registers (add to list) this GlutDisplay & GLUT window ID.

bool Eaagles::BasicGL::GlutDisplay::unregisterGlutDisplay ( const int  id  )  [static, protected]

Unregisters (remove from list) this GLUT window ID.

GlutDisplay * Eaagles::BasicGL::GlutDisplay::findRegisteredGlutDisplay ( const int  id  )  [static, protected]

Finds the GlutDisplay for this GLUT window ID.

int Eaagles::BasicGL::GlutDisplay::findRegisteredWinId ( const GlutDisplay dp  )  [static, protected]

Finds the GLUT window ID for this GlutDisplay.

LcGraphic * Eaagles::BasicGL::GlutDisplay::pick ( const int  item = -1  )  [protected]

Perform for select/pick operation; returns the selected (picked) graphic or zero(0) if nothing was selected. 1) When item == 0, returns nearest (by depth buffer) selected entry. 2) When item < 0, returns furthest (by depth buffer) selected entry. 3) When item > 0, returns the item'th selected entry or the first entry if there are less than 'item' entries 4) Returns zero(0) when there are no entries in the select buffer or if the LcGraphic for the select ID is not found..

void Eaagles::BasicGL::GlutDisplay::printSelectBuffer ( const GLuint  sbuff[],
const int  size 
) [protected]

Prints the selection buffer.

void Eaagles::BasicGL::GlutDisplay::clearSelectBuffer ( GLuint  sbuff[],
const int  size 
) [protected]

Clears the pick select buffer.

LcGraphic * Eaagles::BasicGL::GlutDisplay::findSelected ( const GLuint  sbuff[],
const int  size,
const int  item = 0 
) [protected]

Finds the selected graphic from the 'select buffer'. 1) When item == 0, returns nearest (by depth buffer) entry. 2) When item < 0, returns furthest (by depth buffer) entry. 3) When item > 0, returns the item'th selected entry or the first entry if there are less than 'item' entries 4) Returns zero(0) when there are no entries in the select buffer or if the LcGraphic for the select ID is not found.

void Eaagles::BasicGL::GlutDisplay::drawFuncCB (  )  [static, private]

Draw callback.

std::cout << "GlutDisplay::drawFuncCB(): id = " << id << ", p = " << p << std::endl;

void Eaagles::BasicGL::GlutDisplay::reshapeItCB ( int  w,
int  h 
) [static, private]

Reshape callback.

void Eaagles::BasicGL::GlutDisplay::idleCB (  )  [static, private]

Default idle function.

void Eaagles::BasicGL::GlutDisplay::keyboardFuncCB ( unsigned char  key,
int  x,
int  y 
) [static, private]

Handle keyboard events.

void Eaagles::BasicGL::GlutDisplay::specialFuncCB ( int  key,
int  x,
int  y 
) [static, private]

Handle special function key events.

void Eaagles::BasicGL::GlutDisplay::mouseFuncCB ( int  button,
int  state,
int  x,
int  y 
) [static, private]

Handle mouse events.

void Eaagles::BasicGL::GlutDisplay::passiveMotionFuncCB ( int  x,
int  y 
) [static, private]

Callback for passive mouse motion event.

void Eaagles::BasicGL::GlutDisplay::motionFuncCB ( int  x,
int  y 
) [static, private]

Handle mouse movement when either mouse key is pressed.


Member Data Documentation

const float Eaagles::BasicGL::GlutDisplay::CLICK_TIME [static, private]

int Eaagles::BasicGL::GlutDisplay::winId [private]

Window ID.

bool Eaagles::BasicGL::GlutDisplay::fullScreenFlg [private]

Full screen flag (main window only).

unsigned int Eaagles::BasicGL::GlutDisplay::idleSleepTimeMS [private]

Idle callback sleep time (MS).

int Eaagles::BasicGL::GlutDisplay::idList [static, private]

List of window IDs.

GlutDisplay * Eaagles::BasicGL::GlutDisplay::displayList [static, private]

Display List.

int Eaagles::BasicGL::GlutDisplay::numGlutDisplays [static, private]

Number of GlutDisplays.

osg::Vec4 Eaagles::BasicGL::GlutDisplay::ratios [static, private]

ratios of our subdisplays

int Eaagles::BasicGL::GlutDisplay::numDisplaysToResize [private]

number of displays to resize

bool Eaagles::BasicGL::GlutDisplay::okToResize [private]

Flag to indicate window resize capability.


Generated on Tue Dec 19 16:26:43 2006 for Eaagles by  doxygen 1.5.0