Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

WindowFramework Class Reference

#include <windowFramework.h>

Inheritance diagram for WindowFramework:

TypedReferenceCount TypedObject ReferenceCount List of all members.

Public Types

enum  BackgroundType {
  BT_other = 0, BT_default, BT_gray, BT_black,
  BT_none
}

Public Member Functions

virtual ~WindowFramework ()
INLINE PandaFrameworkget_panda_framework () const
INLINE GraphicsWindowget_graphics_window () const
const NodePathget_camera_group ()
INLINE int get_num_cameras () const
INLINE Cameraget_camera (int n) const
const NodePathget_render ()
const NodePathget_render_2d ()
const NodePathget_aspect_2d ()
const NodePathget_mouse ()
void enable_keyboard ()
void setup_trackball ()
void center_trackball (const NodePath &object)
bool load_models (const NodePath &parent, int argc, char *argv[], int first_arg=1)
bool load_models (const NodePath &parent, const pvector< Filename > &files)
NodePath load_model (const NodePath &parent, Filename filename)
NodePath load_default_model (const NodePath &parent)
void loop_animations ()
void set_wireframe (bool enable)
void set_texture (bool enable)
void set_two_sided (bool enable)
void set_one_sided_reverse (bool enable)
void set_lighting (bool enable)
void set_background_type (BackgroundType type)
INLINE bool get_wireframe () const
INLINE bool get_texture () const
INLINE bool get_two_sided () const
INLINE bool get_one_sided_reverse () const
INLINE bool get_lighting () const
INLINE BackgroundType get_background_type () const
virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()

Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()

Protected Member Functions

 WindowFramework (PandaFramework *panda_framework)
GraphicsWindowopen_window (const WindowProperties &props, GraphicsEngine *engine, GraphicsPipe *pipe)
void close_window ()
 PT (Camera) make_camera()
void setup_lights ()

Private Types

typedef pvector< PT(CameraCameras )

Private Member Functions

 PT (PandaNode) load_image_as_model(const Filename &filename)
 PT (GraphicsWindow) _window
 PT (Trackball) _trackball

Private Attributes

PandaFramework_panda_framework
NodePath _camera_group
Cameras _cameras
NodePath _render
NodePath _render_2d
NodePath _aspect_2d
AnimControlCollection _anim_controls
NodePath _mouse
AmbientLight_alight
DirectionalLight_dlight
bool _got_keyboard
bool _got_trackball
bool _got_lights
bool _wireframe_enabled
bool _texture_enabled
bool _two_sided_enabled
bool _one_sided_reverse_enabled
bool _lighting_enabled
BackgroundType _background_type

Static Private Attributes

TypeHandle _type_handle

Friends

class PandaFramework

Member Typedef Documentation

typedef pvector< PT(Camera) WindowFramework::Cameras) [private]
 

Definition at line 114 of file windowFramework.h.


Member Enumeration Documentation

enum WindowFramework::BackgroundType
 

Enumeration values:
BT_other 
BT_default 
BT_gray 
BT_black 
BT_none 

Definition at line 80 of file windowFramework.h.

Referenced by PandaFramework::event_comma().


Constructor & Destructor Documentation

WindowFramework::WindowFramework PandaFramework panda_framework  )  [protected]
 

Definition at line 63 of file windowFramework.cxx.

References _alight, _background_type, _dlight, _got_keyboard, _got_lights, _got_trackball, _lighting_enabled, _one_sided_reverse_enabled, _texture_enabled, _two_sided_enabled, _wireframe_enabled, BT_default, and NULL.

WindowFramework::~WindowFramework  )  [virtual]
 

Definition at line 85 of file windowFramework.cxx.

References close_window().


Member Function Documentation

void WindowFramework::center_trackball const NodePath object  ) 
 

Definition at line 347 of file windowFramework.cxx.

References _cameras, ctan(), DCAST, deg_2_rad(), distance(), GeometricBoundingVolume::get_class_type(), Lens::get_default_far(), Lens::get_default_near(), Lens::get_fov(), NULL, PT(), Lens::set_far(), and Lens::set_near().

Referenced by PandaFramework::event_c().

void WindowFramework::close_window  )  [protected]
 

Definition at line 125 of file windowFramework.cxx.

References _alight, _camera_group, _dlight, _got_keyboard, _got_lights, _got_trackball, _lighting_enabled, _mouse, _one_sided_reverse_enabled, _render, _render_2d, _texture_enabled, _two_sided_enabled, _wireframe_enabled, NULL, and NodePath::remove_node().

Referenced by PandaFramework::close_all_windows(), PandaFramework::close_window(), and ~WindowFramework().

void WindowFramework::enable_keyboard  ) 
 

Definition at line 292 of file windowFramework.cxx.

References _got_keyboard, ModifierButtons::add_button(), KeyboardButton::alt(), NodePath::attach_new_node(), KeyboardButton::control(), get_mouse(), PT(), and KeyboardButton::shift().

Referenced by event_W(), and main().

virtual TypeHandle WindowFramework::force_init_type void   )  [inline, virtual]
 

Reimplemented from TypedReferenceCount.

Definition at line 152 of file windowFramework.h.

References ReferenceCount::get_class_type(), and TypedReferenceCount::init_type().

const NodePath & WindowFramework::get_aspect_2d  ) 
 

Definition at line 242 of file windowFramework.cxx.

References _aspect_2d, aspect_ratio, NodePath::attach_new_node(), get_render_2d(), WindowProperties::get_x_size(), WindowProperties::get_y_size(), WindowProperties::has_size(), NodePath::is_empty(), and NodePath::set_scale().

INLINE BackgroundType WindowFramework::get_background_type  )  const
 

Referenced by PandaFramework::event_comma().

INLINE Camera* WindowFramework::get_camera int  n  )  const
 

Referenced by event_T().

const NodePath & WindowFramework::get_camera_group  ) 
 

Definition at line 153 of file windowFramework.cxx.

References _camera_group, NodePath::attach_new_node(), get_render(), and NodePath::is_empty().

Referenced by setup_lights(), and setup_trackball().

TypeHandle WindowFramework::get_class_type void   )  [inline, static]
 

Reimplemented from ReferenceCount.

Definition at line 141 of file windowFramework.h.

INLINE GraphicsWindow* WindowFramework::get_graphics_window  )  const
 

Referenced by PandaFramework::all_windows_closed(), PandaFramework::close_all_windows(), PandaFramework::close_window(), and event_T().

INLINE bool WindowFramework::get_lighting  )  const
 

Referenced by PandaFramework::event_l().

const NodePath & WindowFramework::get_mouse  ) 
 

Definition at line 274 of file windowFramework.cxx.

References _mouse, _panda_framework, data_root, PandaFramework::get_data_root(), and NodePath::is_empty().

Referenced by enable_keyboard(), and setup_trackball().

INLINE int WindowFramework::get_num_cameras  )  const
 

INLINE bool WindowFramework::get_one_sided_reverse  )  const
 

Referenced by PandaFramework::event_i().

INLINE PandaFramework* WindowFramework::get_panda_framework  )  const
 

const NodePath & WindowFramework::get_render  ) 
 

Definition at line 166 of file windowFramework.cxx.

References _render, NodePath::is_empty(), and NodePath::set_two_sided().

Referenced by event_T(), event_W(), get_camera_group(), load_gridded_models(), load_models(), loop_animations(), main(), set_lighting(), set_one_sided_reverse(), set_texture(), set_two_sided(), and set_wireframe().

const NodePath & WindowFramework::get_render_2d  ) 
 

Definition at line 182 of file windowFramework.cxx.

References _render_2d, NodePath::attach_new_node(), CPT, NodePath::is_empty(), RenderAttrib::M_none, NodePath::node(), PT(), PandaNode::set_attrib(), NodePath::set_material_off(), and NodePath::set_two_sided().

Referenced by get_aspect_2d().

INLINE bool WindowFramework::get_texture  )  const
 

Referenced by PandaFramework::event_t().

INLINE bool WindowFramework::get_two_sided  )  const
 

Referenced by PandaFramework::event_b().

virtual TypeHandle WindowFramework::get_type void   )  const [inline, virtual]
 

Reimplemented from TypedReferenceCount.

Definition at line 149 of file windowFramework.h.

References ReferenceCount::get_class_type().

INLINE bool WindowFramework::get_wireframe  )  const
 

Referenced by PandaFramework::event_w().

void WindowFramework::init_type void   )  [inline, static]
 

Reimplemented from TypedReferenceCount.

Definition at line 144 of file windowFramework.h.

References TypedObject::get_class_type(), TypedReferenceCount::init_type(), and register_type().

Referenced by ConfigureFn().

NodePath WindowFramework::load_default_model const NodePath parent  ) 
 

Definition at line 528 of file windowFramework.cxx.

References GeomNode::add_geom(), NodePath::attach_new_node(), Colorf, CPT, Texture::FT_linear, G_PER_PRIM, G_PER_VERTEX, TexturePool::load_texture(), NULL, PT(), PointerToArray< unsigned short >::push_back(), PointerToArray< Colorf >::push_back(), PointerToArray< Normalf >::push_back(), PointerToArray< TexCoordf >::push_back(), PointerToArray< Vertexf >::push_back(), Texture::set_magfilter(), Texture::set_minfilter(), tex, and TexCoordf.

Referenced by main().

NodePath WindowFramework::load_model const NodePath parent,
Filename  filename
 

Definition at line 475 of file windowFramework.cxx.

References NodePath::attach_new_node(), PNMFileTypeRegistry::get_ptr(), LoaderFileTypeRegistry::get_ptr(), PNMFileTypeRegistry::get_type_from_extension(), LoaderFileTypeRegistry::get_type_from_extension(), loader, NodePath::not_found(), NULL, PT(), and search().

Referenced by load_gridded_models(), and load_models().

bool WindowFramework::load_models const NodePath parent,
const pvector< Filename > &  files
 

Definition at line 450 of file windowFramework.cxx.

References get_render(), NodePath::is_empty(), load_model(), and render.

bool WindowFramework::load_models const NodePath parent,
int  argc,
char *  argv[],
int  first_arg = 1
 

Definition at line 430 of file windowFramework.cxx.

References NULL.

Referenced by main().

void WindowFramework::loop_animations  ) 
 

Definition at line 576 of file windowFramework.cxx.

References _anim_controls, auto_bind(), get_render(), and AnimControlCollection::loop_all().

Referenced by main().

GraphicsWindow * WindowFramework::open_window const WindowProperties props,
GraphicsEngine engine,
GraphicsPipe pipe
[protected]
 

Definition at line 96 of file windowFramework.cxx.

References _background_type, GraphicsEngine::make_window(), NULL, PT(), and set_background_type().

WindowFramework::PT Trackball   )  [private]
 

WindowFramework::PT GraphicsWindow   )  [private]
 

WindowFramework::PT PandaNode   )  const [private]
 

WindowFramework::PT Camera   )  [protected]
 

Referenced by center_trackball(), enable_keyboard(), get_render_2d(), load_default_model(), load_model(), open_window(), and setup_trackball().

void WindowFramework::set_background_type BackgroundType  type  ) 
 

Definition at line 727 of file windowFramework.cxx.

References _background_type, BT_black, BT_default, BT_gray, BT_none, BT_other, Colorf, NULL, type, win_background_b, win_background_g, and win_background_r.

Referenced by PandaFramework::event_comma(), open_window(), and PandaFramework::set_background_type().

void WindowFramework::set_lighting bool  enable  ) 
 

Definition at line 698 of file windowFramework.cxx.

References _alight, _dlight, _got_lights, _lighting_enabled, LightAttrib::get_class_type(), get_render(), LightAttrib::O_add, render, and setup_lights().

Referenced by PandaFramework::event_l(), and PandaFramework::set_lighting().

void WindowFramework::set_one_sided_reverse bool  enable  ) 
 

Definition at line 672 of file windowFramework.cxx.

References _one_sided_reverse_enabled, _two_sided_enabled, _wireframe_enabled, CPT, get_render(), and render.

Referenced by PandaFramework::event_i().

void WindowFramework::set_texture bool  enable  ) 
 

Definition at line 622 of file windowFramework.cxx.

References _texture_enabled, get_render(), override_priority, and render.

Referenced by PandaFramework::event_t(), and PandaFramework::set_texture().

void WindowFramework::set_two_sided bool  enable  ) 
 

Definition at line 645 of file windowFramework.cxx.

References _one_sided_reverse_enabled, _two_sided_enabled, _wireframe_enabled, get_render(), override_priority, and render.

Referenced by PandaFramework::event_b(), and PandaFramework::set_two_sided().

void WindowFramework::set_wireframe bool  enable  ) 
 

Definition at line 591 of file windowFramework.cxx.

References _two_sided_enabled, _wireframe_enabled, CPT, get_render(), override_priority, and render.

Referenced by PandaFramework::event_w(), and PandaFramework::set_wireframe().

void WindowFramework::setup_lights  )  [protected]
 

Definition at line 809 of file windowFramework.cxx.

References _alight, _dlight, _got_lights, NodePath::attach_new_node(), Colorf, and get_camera_group().

Referenced by set_lighting().

void WindowFramework::setup_trackball  ) 
 

Definition at line 319 of file windowFramework.cxx.

References _got_trackball, NodePath::attach_new_node(), get_camera_group(), get_mouse(), NodePath::node(), PT(), Transform2SG::set_node(), and tball2cam.

Referenced by event_W(), and main().


Friends And Related Function Documentation

friend class PandaFramework [friend]
 

Definition at line 157 of file windowFramework.h.


Member Data Documentation

AmbientLight* WindowFramework::_alight [private]
 

Definition at line 125 of file windowFramework.h.

Referenced by close_window(), set_lighting(), setup_lights(), and WindowFramework().

AnimControlCollection WindowFramework::_anim_controls [private]
 

Definition at line 120 of file windowFramework.h.

Referenced by loop_animations().

NodePath WindowFramework::_aspect_2d [private]
 

Definition at line 119 of file windowFramework.h.

Referenced by get_aspect_2d().

BackgroundType WindowFramework::_background_type [private]
 

Definition at line 138 of file windowFramework.h.

Referenced by open_window(), set_background_type(), and WindowFramework().

NodePath WindowFramework::_camera_group [private]
 

Definition at line 113 of file windowFramework.h.

Referenced by close_window(), and get_camera_group().

Cameras WindowFramework::_cameras [private]
 

Definition at line 115 of file windowFramework.h.

Referenced by center_trackball().

DirectionalLight* WindowFramework::_dlight [private]
 

Definition at line 126 of file windowFramework.h.

Referenced by close_window(), set_lighting(), setup_lights(), and WindowFramework().

bool WindowFramework::_got_keyboard [private]
 

Definition at line 128 of file windowFramework.h.

Referenced by close_window(), enable_keyboard(), and WindowFramework().

bool WindowFramework::_got_lights [private]
 

Definition at line 130 of file windowFramework.h.

Referenced by close_window(), set_lighting(), setup_lights(), and WindowFramework().

bool WindowFramework::_got_trackball [private]
 

Definition at line 129 of file windowFramework.h.

Referenced by close_window(), setup_trackball(), and WindowFramework().

bool WindowFramework::_lighting_enabled [private]
 

Definition at line 136 of file windowFramework.h.

Referenced by close_window(), set_lighting(), and WindowFramework().

NodePath WindowFramework::_mouse [private]
 

Definition at line 122 of file windowFramework.h.

Referenced by close_window(), and get_mouse().

bool WindowFramework::_one_sided_reverse_enabled [private]
 

Definition at line 135 of file windowFramework.h.

Referenced by close_window(), set_one_sided_reverse(), set_two_sided(), and WindowFramework().

PandaFramework* WindowFramework::_panda_framework [private]
 

Definition at line 110 of file windowFramework.h.

Referenced by get_mouse().

NodePath WindowFramework::_render [private]
 

Definition at line 117 of file windowFramework.h.

Referenced by close_window(), and get_render().

NodePath WindowFramework::_render_2d [private]
 

Definition at line 118 of file windowFramework.h.

Referenced by close_window(), and get_render_2d().

bool WindowFramework::_texture_enabled [private]
 

Definition at line 133 of file windowFramework.h.

Referenced by close_window(), set_texture(), and WindowFramework().

bool WindowFramework::_two_sided_enabled [private]
 

Definition at line 134 of file windowFramework.h.

Referenced by close_window(), set_one_sided_reverse(), set_two_sided(), set_wireframe(), and WindowFramework().

TypeHandle WindowFramework::_type_handle [static, private]
 

Reimplemented from TypedReferenceCount.

Definition at line 55 of file windowFramework.cxx.

bool WindowFramework::_wireframe_enabled [private]
 

Definition at line 132 of file windowFramework.h.

Referenced by close_window(), set_one_sided_reverse(), set_two_sided(), set_wireframe(), and WindowFramework().


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 00:14:05 2003 for Panda by doxygen1.3