view::Window Class Reference

Window contains Views, executes main loop, broadcasts draw events. More...

#include <_src_view_window.hh>

List of all members.

Public Types

enum  { MAIN_VIEW = true, NOT_MAIN_VIEW = false }
enum  eCamera { eCamera_3D, eCamera_2D }

Public Member Functions

CLASS_METHOD WindowGetInstance (void)
void Make (void)
void Reset (void)
void EnterMainLoop (void)
void AddView (shptr< View > view, const bool mainView=false)
shptr< ViewGetMainView (void)
bool SaveViewpoint (void)
bool RestoreViewpoint (void)
WidthHeight< int > GetWindowSize (void)
Rect< int > GetWindowRect (void)
Rect< int > GetWindowPosition (void)
uint GetFPS (void)
void OsgAddCamera (RefPtr< osg::Camera > camera, const eCamera cameraType=eCamera_3D, const bool mainView=NOT_MAIN_VIEW)
RefPtr< osgViewer::GraphicsWindow > OsgGetGraphicsWindow (void)
void OsgRegisterEventHandler (RefPtr< osgGA::GUIEventHandler > eventHandler)
void OsgSetStatsKey (const int key)

Private Types

typedef list< shptr< View > > Views

Private Member Functions

 Window (const Vector2 &pos, const WidthHeight< int > &wh, const string &title)
 ~Window ()
CLASS_METHOD WindowCreateInstance (void)
void ComputeFPS (const Milliseconds elapsedMilsec)
void DoOperation (void)
void DrawViewOutline (shptr< View > view, const RGBA outlineColor)

Private Attributes

CLASS_VAR WindowmsInstance
 there can be only one
RefPtr< osgViewer::Viewer > mViewer
 contains cameras
Views mViews
 Window contains one or more Views.
string mTitle
 window title
FPS mFPS
 frame rate
RefPtr
< osg::GraphicsContext::Traits > 
mTraits
RefPtr< osg::GraphicsContext > mGraphicsContext
RefPtr< osgViewer::GraphicsWindow > mGraphicsWindow
RefPtr< osg::Operation > mOperation
RefPtr0< osgViewer::StatsHandler > mStatsHandler
 statistics (might be disabled/NULL)
RefPtr< ManipulatormManipulator
 custom view manipulator (OSG specific)

Classes

struct  FPS
class  Operation


Detailed Description

Window contains Views, executes main loop, broadcasts draw events.

Member Typedef Documentation

typedef list<shptr<View> > view::Window::Views [private]


Member Enumeration Documentation

anonymous enum

Enumerator:
MAIN_VIEW 
NOT_MAIN_VIEW 

Enumerator:
eCamera_3D 
eCamera_2D 


Constructor & Destructor Documentation

view::Window::Window ( const Vector2 &  pos,
const WidthHeight< int > &  wh,
const string &  title 
) [private]

ctor/dtor.

view::Window::~Window (  )  [private]


Member Function Documentation

Window * view::Window::CreateInstance ( void   )  [private]

Singleton method. Parameters for creating a Window (size,title) come from the view module's conf file.

CLASS_METHOD Window& view::Window::GetInstance ( void   )  [inline]

void view::Window::Make ( void   ) 

Make the Window.

void view::Window::Reset ( void   ) 

Reset window.

void view::Window::EnterMainLoop ( void   ) 

Enter the main graphics loop.

void view::Window::AddView ( shptr< View view,
const bool  mainView = false 
)

shptr<View> view::Window::GetMainView ( void   )  [inline]

bool view::Window::SaveViewpoint ( void   ) 

Save/restore viewpoint to binary configuration file.

bool view::Window::RestoreViewpoint ( void   ) 

WidthHeight< int > view::Window::GetWindowSize ( void   ) 

Get size of window as a (width,height) pair.

Rect< int > view::Window::GetWindowRect ( void   ) 

Get size of window as a rectangle.

Returns:
Rect(0,0,w,h). Return value is similar to View::GetRect() and is independent of window's position.

Rect< int > view::Window::GetWindowPosition ( void   ) 

Get the position of window as screen coordinates of bottom-left and top-right corners. x1,y1,x2,y2 will all change as window is moved.

uint view::Window::GetFPS ( void   )  [inline]

void view::Window::OsgAddCamera ( RefPtr< osg::Camera >  camera,
const eCamera  cameraType = eCamera_3D,
const bool  mainView = NOT_MAIN_VIEW 
)

RefPtr< osgViewer::GraphicsWindow > view::Window::OsgGetGraphicsWindow ( void   ) 

OSG-specific.

void view::Window::OsgRegisterEventHandler ( RefPtr< osgGA::GUIEventHandler >  eventHandler  ) 

void view::Window::OsgSetStatsKey ( const int  key  ) 

Set which key toggles the statistics display.

void view::Window::ComputeFPS ( const Milliseconds  elapsedMilsec  )  [private]

void view::Window::DoOperation ( void   )  [private]

Called by OSG to let app do low-level graphics operations.

void view::Window::DrawViewOutline ( shptr< View view,
const RGBA  outlineColor 
) [private]


Member Data Documentation

there can be only one

RefPtr<osgViewer::Viewer> view::Window::mViewer [private]

contains cameras

Window contains one or more Views.

string view::Window::mTitle [private]

window title

frame rate

RefPtr<osg::GraphicsContext::Traits> view::Window::mTraits [private]

RefPtr<osg::GraphicsContext> view::Window::mGraphicsContext [private]

RefPtr<osgViewer::GraphicsWindow> view::Window::mGraphicsWindow [private]

RefPtr<osg::Operation> view::Window::mOperation [private]

RefPtr0<osgViewer::StatsHandler> view::Window::mStatsHandler [private]

statistics (might be disabled/NULL)

custom view manipulator (OSG specific)


The documentation for this class was generated from the following files:
Palomino Flight Simulator documents generated by doxygen 1.5.6 on Tue Sep 28 11:37:50 2010