Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

BaseJOTapp Class Reference

The base class for a Jot application. More...

#include <base_jotapp.H>

Inheritance diagram for BaseJOTapp:

Inheritance graph
[legend]
Collaboration diagram for BaseJOTapp:

Collaboration graph
[legend]
List of all members.

Render Mode Menu Related Functions

bool menu_is_shown ()
void show_menu ()
void hide_menu ()
void toggle_menu ()
static void activate_button (Cstr_ptr &file)
static void update_button (Cstr_ptr &file)
static void toggle_button (Cstr_ptr &file)
static void deactivate_button ()

Hooks to be overriden/extended by subclasses

virtual void clean_on_exit ()
virtual void print_usage () const
virtual void init_top ()
virtual void init_world ()
virtual void init_view (WINDOW &window)
virtual void init_camera (CVIEWptr &v)
virtual void init_buttons (CVIEWptr &v)
virtual void init_scene ()
virtual void load_scene ()
virtual bool load_jot_file (Cstr_ptr &file)
virtual bool load_sm_file (Cstr_ptr &file)
virtual bool load_obj_file (Cstr_ptr &file)
virtual BMESHnew_mesh () const
virtual GEOMnew_geom (BMESH *mesh, Cstr_ptr &name) const
bool create_mesh (BMESH *mesh, Cstr_ptr &file) const
virtual void init_win_cb (WINDOW &win)
virtual void init_dev_cb (WINDOW &win)
virtual void init_interact_cb (WINDOW &win)
virtual void init_menu (WINDOW &win)
virtual void init_kbd (WINDOW &win)
virtual void init_kbd_nav (WINDOW &win)
virtual void init_pens (WINDOW &win)
virtual void init_cam_manip (WINDOW &win)
virtual void init_obj_manip (WINDOW &)
virtual void init_fsa ()

Public Member Functions

 BaseJOTapp (int argc, char **argv)
 BaseJOTapp (Cstr_ptr &name)
virtual ~BaseJOTapp ()
virtual void init ()
virtual void Run ()

Static Public Member Functions

static BaseJOTappinstance ()
static WINDOWwindow (int i=0)
static void Clean_On_Exit ()

Protected Attributes

str_ptr _prog_name
char ** _argv
int _argc
int _wins_to_map
EaselManager _easel_manager
PenManager_pen_manager
KeyMenu_key_menu
WORLDptr _world
ARRAY< FD_EVENT * > _events
ARRAY< ICON2D * > _buttons

Static Protected Attributes

static BaseJOTapp_instance = 0
static ARRAY< WINDOW * > _windows = 0

Private Attributes

int cam_num

Classes

class  WINDOW

Detailed Description

The base class for a Jot application.

Definition at line 56 of file base_jotapp.H.


Constructor & Destructor Documentation

BaseJOTapp::BaseJOTapp int  argc,
char **  argv
 

Definition at line 43 of file base_jotapp.C.

References _instance, and Clean_On_Exit().

BaseJOTapp::BaseJOTapp Cstr_ptr &  name  ) 
 

Definition at line 60 of file base_jotapp.C.

References _instance, and Clean_On_Exit().

virtual BaseJOTapp::~BaseJOTapp  )  [inline, virtual]
 

Definition at line 92 of file base_jotapp.H.

References FD_MANAGER::mgr(), and FD_MANAGER::rem_timeout().


Member Function Documentation

void BaseJOTapp::activate_button Cstr_ptr &  file  )  [static]
 

Definition at line 536 of file base_jotapp.C.

References _buttons, instance(), and ARRAY< T >::num().

Referenced by Cam_int_fp::down2(), and Cam_int_edit::down2().

int BaseJOTapp::button_toggle const Event ,
State *& 
[static]
 

Callback to toggle camera buttons.

Definition at line 968 of file base_jotapp.C.

References _buttons, instance(), and ARRAY< T >::num().

Referenced by init_kbd(), Cam_int_fp::toggle_buttons(), and Cam_int_edit::toggle_buttons().

int BaseJOTapp::cam_switch const Event ,
State *& 
[static]
 

Callback to switch cam mode.

Definition at line 914 of file base_jotapp.C.

References _buttons, BaseJOTapp::WINDOW::_cam1, BaseJOTapp::WINDOW::_cam2, BaseJOTapp::WINDOW::_cam3, BaseJOTapp::WINDOW::_start, cam_num, Interactor< T, EVENT, STATE >::entry(), instance(), ARRAY< T >::num(), and window().

Referenced by Cam_int::down2(), Cam_int_fp::down2(), and Cam_int_edit::down2().

void BaseJOTapp::clean_on_exit  )  [protected, virtual]
 

Definition at line 78 of file base_jotapp.C.

References _events, ARRAY< T >::empty(), Config::get_var_bool(), and ARRAY< T >::pop().

Referenced by Clean_On_Exit().

static void BaseJOTapp::Clean_On_Exit  )  [inline, static]
 

Definition at line 84 of file base_jotapp.H.

References _instance, and clean_on_exit().

Referenced by BaseJOTapp().

bool BaseJOTapp::create_mesh BMESH mesh,
Cstr_ptr &  file
const [protected]
 

Definition at line 449 of file base_jotapp.C.

References BMESH::empty(), Config::get_var_bool(), new_geom(), BMESH::recenter(), and BMESH::set_center_of_interest().

Referenced by load_obj_file(), and load_sm_file().

Pen* BaseJOTapp::cur_pen  )  [inline]
 

Definition at line 110 of file base_jotapp.H.

References _pen_manager, and PenManager::cur_pen().

void BaseJOTapp::deactivate_button  )  [static]
 

Definition at line 562 of file base_jotapp.C.

References _buttons, instance(), and ARRAY< T >::num().

Referenced by Cam_int_fp::down2(), and Cam_int_edit::down2().

EaselManager& BaseJOTapp::easels  )  [inline]
 

Definition at line 103 of file base_jotapp.H.

References _easel_manager.

void BaseJOTapp::hide_menu  ) 
 

Note:
To support multiple windows, this code may need to be modified to determine which window's menu to work with.

Definition at line 889 of file base_jotapp.C.

References BaseJOTapp::WINDOW::_menu, MoveMenu::hide(), and window().

Referenced by toggle_menu().

void BaseJOTapp::icon  )  [protected, virtual]
 

Implements MAPPED_CB.

Definition at line 844 of file base_jotapp.C.

References FD_MANAGER::mgr(), and FD_MANAGER::rem_timeout().

void BaseJOTapp::init  )  [virtual]
 

Reimplemented in SMVIEWapp.

Definition at line 92 of file base_jotapp.C.

References _windows, Config::get_var_bool(), init_buttons(), init_camera(), init_dev_cb(), init_fsa(), init_interact_cb(), init_scene(), init_top(), init_view(), init_win_cb(), init_world(), j, load_scene(), ARRAY< T >::num(), VIEW::push(), IDRefImage::setup_bits(), the_time(), and VIEWS.

Referenced by SMVIEWapp::init(), and main().

void BaseJOTapp::init_buttons CVIEWptr &  v  )  [protected, virtual]
 

Definition at line 235 of file base_jotapp.C.

References _buttons, NETWORK, ARRAY< T >::push(), and hashvar< T >::set().

Referenced by init().

void BaseJOTapp::init_cam_manip WINDOW win  )  [protected, virtual]
 

Definition at line 677 of file base_jotapp.C.

References BaseJOTapp::WINDOW::_cam1, BaseJOTapp::WINDOW::_cam2, BaseJOTapp::WINDOW::_cam3, BaseJOTapp::WINDOW::_mouse_map, BaseJOTapp::WINDOW::_start, BaseJOTapp::WINDOW::_view, Evd::ANY, ButtonMapper::b1d(), ButtonMapper::b1dC(), ButtonMapper::b1u(), ButtonMapper::b2dC(), ButtonMapper::b2u(), ButtonMapper::b3d(), ButtonMapper::b3dC(), ButtonMapper::b3u(), Interactor< T, EVENT, STATE >::entry(), and ButtonMapper::mov().

Referenced by init_interact_cb().

void BaseJOTapp::init_camera CVIEWptr &  v  )  [protected, virtual]
 

Definition at line 203 of file base_jotapp.C.

References Config::get_var_bool(), and mlib::Wpt::Origin().

Referenced by init().

void BaseJOTapp::init_dev_cb WINDOW win  )  [protected, virtual]
 

Definition at line 598 of file base_jotapp.C.

References BaseJOTapp::WINDOW::_mouse_map, BaseJOTapp::WINDOW::_win, Mouse::buttons(), WINSYS::mouse(), Mouse::pointer(), and ButtonMapper::set_devs().

Referenced by init().

void BaseJOTapp::init_fsa  )  [protected, virtual]
 

Reimplemented in SMVIEWapp.

Definition at line 769 of file base_jotapp.C.

References _windows, VIEWint_list::add(), and ARRAY< T >::num().

Referenced by init(), and SMVIEWapp::init_fsa().

void BaseJOTapp::init_interact_cb WINDOW win  )  [protected, virtual]
 

Definition at line 612 of file base_jotapp.C.

References BaseJOTapp::WINDOW::_menu, BaseJOTapp::WINDOW::_view, init_cam_manip(), init_kbd(), init_kbd_nav(), init_menu(), init_obj_manip(), and init_pens().

Referenced by init(), and SMVIEWapp::init_interact_cb().

void BaseJOTapp::init_kbd WINDOW win  )  [protected, virtual]
 

Definition at line 718 of file base_jotapp.C.

References _key_menu, BaseJOTapp::WINDOW::_start, KeyMenu::add_menu_item(), button_toggle(), keymenu_help_cb(), keymenu_quit_cb(), show_menu_cb(), and viewall().

Referenced by init_interact_cb(), TestSPSapp::init_kbd(), and SMVIEWapp::init_kbd().

void BaseJOTapp::init_kbd_nav WINDOW win  )  [protected, virtual]
 

Definition at line 760 of file base_jotapp.C.

References BaseJOTapp::WINDOW::_view.

Referenced by init_interact_cb().

void BaseJOTapp::init_menu WINDOW win  )  [protected, virtual]
 

Definition at line 654 of file base_jotapp.C.

References BaseJOTapp::WINDOW::_menu, BaseJOTapp::WINDOW::_view, BaseJOTapp::WINDOW::_win, add_render_styles(), Config::get_var_bool(), MoveMenu::hide(), MoveMenu::menu(), WINSYS::menu(), MoveMenu::move_local(), and MoveMenu::show().

Referenced by init_interact_cb().

virtual void BaseJOTapp::init_obj_manip WINDOW  )  [inline, protected, virtual]
 

Definition at line 224 of file base_jotapp.H.

Referenced by init_interact_cb().

void BaseJOTapp::init_pens WINDOW win  )  [protected, virtual]
 

Definition at line 742 of file base_jotapp.C.

References _pen_manager, and BaseJOTapp::WINDOW::_start.

Referenced by init_interact_cb().

void BaseJOTapp::init_scene  )  [protected, virtual]
 

Reimplemented in SMVIEWapp.

Definition at line 380 of file base_jotapp.C.

References IOManager::init().

Referenced by init(), and SMVIEWapp::init_scene().

void BaseJOTapp::init_top  )  [protected, virtual]
 

Definition at line 136 of file base_jotapp.C.

References _argc, _argv, _windows, _wins_to_map, WINSYS::create(), Config::get_var_int(), and new_window().

Referenced by init().

void BaseJOTapp::init_view WINDOW window  )  [protected, virtual]
 

Definition at line 170 of file base_jotapp.C.

References BaseJOTapp::WINDOW::_view, BaseJOTapp::WINDOW::_win, _world, Config::get_var_bool(), Color::get_var_color(), new_view(), and Color::tan().

Referenced by init().

void BaseJOTapp::init_win_cb WINDOW win  )  [protected, virtual]
 

Definition at line 586 of file base_jotapp.C.

References BaseJOTapp::WINDOW::_view, BaseJOTapp::WINDOW::_win, WINSYS::map_cb(), and WINSYS::setup().

Referenced by init().

void BaseJOTapp::init_world  )  [protected, virtual]
 

Definition at line 158 of file base_jotapp.C.

References _world.

Referenced by init().

static BaseJOTapp* BaseJOTapp::instance  )  [inline, static]
 

Definition at line 82 of file base_jotapp.H.

References _instance.

Referenced by activate_button(), button_toggle(), cam_switch(), deactivate_button(), keymenu_help_cb(), set_pen(), show_menu_cb(), toggle_button(), and update_button().

int BaseJOTapp::keymenu_help_cb const Event ,
State *& 
[static]
 

Callback to display KeyMenu help menu.

Definition at line 978 of file base_jotapp.C.

References _key_menu, KeyMenu::display_menu(), and instance().

Referenced by init_kbd().

int BaseJOTapp::keymenu_quit_cb const Event ,
State *& 
[static]
 

Callback to quit application.

Definition at line 1005 of file base_jotapp.C.

References err_msg(), Config::get_var_bool(), and STR::load_factor().

Referenced by init_kbd().

bool BaseJOTapp::load_jot_file Cstr_ptr &  file  )  [protected, virtual]
 

Definition at line 521 of file base_jotapp.C.

References NetStream::ascii_r, LOADobs::LOAD_ERROR_NONE, and LOADobs::notify_load_obs().

Referenced by load_scene().

bool BaseJOTapp::load_obj_file Cstr_ptr &  file  )  [protected, virtual]
 

Definition at line 493 of file base_jotapp.C.

References create_mesh(), OBJReader::get_mesh(), new_mesh(), and OBJReader::read().

Referenced by load_scene().

void BaseJOTapp::load_scene  )  [protected, virtual]
 

Reimplemented in TestSPSapp.

Definition at line 404 of file base_jotapp.C.

References _argc, _argv, _windows, GEOM::bbox(), DRAWN, BBOX::is_off_screen(), j, load_jot_file(), load_obj_file(), load_sm_file(), ARRAY< T >::num(), VIEW::peek(), pop_arg(), and print_usage().

Referenced by init(), and TestSPSapp::load_scene().

bool BaseJOTapp::load_sm_file Cstr_ptr &  file  )  [protected, virtual]
 

Definition at line 480 of file base_jotapp.C.

References create_mesh(), and new_mesh().

Referenced by load_scene().

void BaseJOTapp::mapped  )  [protected, virtual]
 

Implements MAPPED_CB.

Definition at line 830 of file base_jotapp.C.

References _wins_to_map, FD_MANAGER::add_timeout(), and FD_MANAGER::mgr().

bool BaseJOTapp::menu_is_shown  ) 
 

Note:
To support multiple windows, this code may need to be modified to determine which window's menu to work with.

Definition at line 855 of file base_jotapp.C.

References BaseJOTapp::WINDOW::_menu, MoveMenu::is_shown(), and window().

Referenced by toggle_menu().

GEOM * BaseJOTapp::new_geom BMESH mesh,
Cstr_ptr &  name
const [protected, virtual]
 

Definition at line 472 of file base_jotapp.C.

Referenced by create_mesh().

BMESH * BaseJOTapp::new_mesh  )  const [protected, virtual]
 

Definition at line 466 of file base_jotapp.C.

Referenced by load_obj_file(), and load_sm_file().

VIEWptr BaseJOTapp::new_view WINSYS win  )  [protected, virtual]
 

Definition at line 189 of file base_jotapp.C.

Referenced by init_view().

virtual WINDOW* BaseJOTapp::new_window WINSYS win  )  [inline, protected, virtual]
 

Reimplemented in SMVIEWapp.

Definition at line 170 of file base_jotapp.H.

Referenced by init_top().

void BaseJOTapp::next_pen  )  [inline]
 

Definition at line 111 of file base_jotapp.H.

References _pen_manager, and PenManager::next_pen().

Referenced by set_pen().

void BaseJOTapp::pop_arg  )  [protected]
 

Definition at line 803 of file base_jotapp.C.

References _argc, and _argv.

Referenced by load_scene().

void BaseJOTapp::prev_pen  )  [inline]
 

Definition at line 113 of file base_jotapp.H.

References _pen_manager, and PenManager::prev_pen().

Referenced by set_pen().

void BaseJOTapp::print_usage  )  const [protected, virtual]
 

Definition at line 387 of file base_jotapp.C.

References _prog_name.

Referenced by load_scene().

void BaseJOTapp::Run  )  [virtual]
 

Definition at line 781 of file base_jotapp.C.

References _windows, VIEWint_list::get(), FD_MANAGER::loop(), FD_MANAGER::mgr(), and ARRAY< T >::num().

Referenced by main().

void BaseJOTapp::show_menu  ) 
 

Note:
To support multiple windows, this code may need to be modified to determine which window's menu to work with.

Definition at line 867 of file base_jotapp.C.

References BaseJOTapp::WINDOW::_menu, MoveMenu::menu(), MoveMenu::move_local(), VIEW::peek(), MoveMenu::show(), and window().

Referenced by toggle_menu().

int BaseJOTapp::show_menu_cb const Event ,
State *& 
[static]
 

Callback to toggle showing render style menu.

Definition at line 989 of file base_jotapp.C.

References instance(), and toggle_menu().

Referenced by init_kbd().

void BaseJOTapp::timeout  )  [protected, virtual]
 

Implements FD_TIMEOUT.

Definition at line 816 of file base_jotapp.C.

References _world.

void BaseJOTapp::toggle_button Cstr_ptr &  file  )  [static]
 

Definition at line 572 of file base_jotapp.C.

References _buttons, instance(), and ARRAY< T >::num().

Referenced by Cam_int_fp::down2(), and Cam_int_fp::orbit().

void BaseJOTapp::toggle_menu  ) 
 

Definition at line 902 of file base_jotapp.C.

References hide_menu(), menu_is_shown(), and show_menu().

Referenced by show_menu_cb().

void BaseJOTapp::update_button Cstr_ptr &  file  )  [static]
 

Definition at line 549 of file base_jotapp.C.

References _buttons, instance(), and ARRAY< T >::num().

Referenced by Cam_int_fp::down2().

int BaseJOTapp::viewall const Event ,
State *& 
[static]
 

Callback to reset camera to fit whole scene in view:.

Definition at line 997 of file base_jotapp.C.

References VIEW::peek().

Referenced by init_kbd().

static WINDOW* BaseJOTapp::window int  i = 0  )  [inline, static]
 

Definition at line 83 of file base_jotapp.H.

References _windows.

Referenced by cam_switch(), hide_menu(), menu_is_shown(), and show_menu().


Member Data Documentation

int BaseJOTapp::_argc [protected]
 

Definition at line 249 of file base_jotapp.H.

Referenced by init_top(), load_scene(), and pop_arg().

char** BaseJOTapp::_argv [protected]
 

Definition at line 248 of file base_jotapp.H.

Referenced by init_top(), load_scene(), and pop_arg().

ARRAY<ICON2D *> BaseJOTapp::_buttons [protected]
 

Definition at line 259 of file base_jotapp.H.

Referenced by activate_button(), button_toggle(), cam_switch(), deactivate_button(), init_buttons(), toggle_button(), and update_button().

EaselManager BaseJOTapp::_easel_manager [protected]
 

Definition at line 254 of file base_jotapp.H.

Referenced by easels().

ARRAY<FD_EVENT *> BaseJOTapp::_events [protected]
 

Definition at line 258 of file base_jotapp.H.

Referenced by clean_on_exit().

BaseJOTapp * BaseJOTapp::_instance = 0 [static, protected]
 

Reimplemented in TestSPSapp.

Definition at line 244 of file base_jotapp.H.

Referenced by BaseJOTapp(), Clean_On_Exit(), and instance().

KeyMenu* BaseJOTapp::_key_menu [protected]
 

Definition at line 256 of file base_jotapp.H.

Referenced by TestSPSapp::init_kbd(), SMVIEWapp::init_kbd(), init_kbd(), and keymenu_help_cb().

PenManager* BaseJOTapp::_pen_manager [protected]
 

Definition at line 255 of file base_jotapp.H.

Referenced by cur_pen(), init_pens(), next_pen(), and prev_pen().

str_ptr BaseJOTapp::_prog_name [protected]
 

Definition at line 247 of file base_jotapp.H.

Referenced by print_usage().

ARRAY< BaseJOTapp::WINDOW * > BaseJOTapp::_windows = 0 [static, protected]
 

Definition at line 245 of file base_jotapp.H.

Referenced by init(), SMVIEWapp::init_fsa(), init_fsa(), SMVIEWapp::init_scene(), init_top(), load_scene(), Run(), and window().

int BaseJOTapp::_wins_to_map [protected]
 

Definition at line 250 of file base_jotapp.H.

Referenced by init_top(), and mapped().

WORLDptr BaseJOTapp::_world [protected]
 

Definition at line 257 of file base_jotapp.H.

Referenced by init_view(), init_world(), and timeout().

int BaseJOTapp::cam_num [private]
 

Definition at line 262 of file base_jotapp.H.

Referenced by cam_switch().


The documentation for this class was generated from the following files:
Generated on Mon Sep 18 11:44:22 2006 for jot by  doxygen 1.4.4