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

GraphicsPipeSelection Class Reference

This maintains a list of GraphicsPipes by type that are available for creation. More...

#include <graphicsPipeSelection.h>

List of all members.

Public Types

typedef PointerTo< GraphicsPipePipeConstructorFunc ()

Public Member Functions

int get_num_pipe_types () const
 Returns the number of different types of GraphicsPipes that are available to create through this interface.

TypeHandle get_pipe_type (int n) const
 Returns the nth type of GraphicsPipe available through this interface.

void print_pipe_types () const
 Writes a list of the currently known GraphicsPipe types to nout, for the user's information.

PointerTo< GraphicsPipemake_pipe (TypeHandle type)
 Creates a new GraphicsPipe of the indicated type (or a type more specific than the indicated type, if necessary) and returns it.

PointerTo< GraphicsPipemake_default_pipe ()
 Creates a new GraphicsPipe of some arbitrary type.

int get_num_aux_modules () const
 Returns the number of display modules that are still to be loaded.

void load_aux_modules ()
 Loads all the modules named in the aux-display Configrc variable, making as many graphics pipes as possible available.

bool add_pipe_type (TypeHandle type, PipeConstructorFunc *func)
 Adds a new kind of GraphicsPipe to the list of available pipes for creation.


Static Public Member Functions

GraphicsPipeSelection * get_global_ptr ()
 Returns a pointer to the one global GraphicsPipeSelection object.


Protected Member Functions

 GraphicsPipeSelection ()
 ~GraphicsPipeSelection ()

Private Types

typedef pvector< PipeTypePipeTypes
typedef pset< string > DisplayModules

Private Member Functions

void load_default_module () const
 Conditionally calls do_load_default_module(), if it has not been called before.

void do_load_default_module ()
 Loads the particular display module listed in the load-display Configrc variable, which should default the default pipe time.

void load_named_module (const string &name)
 Loads the indicated display module by looking for a matching .dll or .so file.


Private Attributes

PipeTypes _pipe_types
Mutex _lock
DisplayModules _display_modules
string _default_display_module
string _default_pipe_name
bool _default_module_loaded

Static Private Attributes

GraphicsPipeSelection * _global_ptr = NULL


Detailed Description

This maintains a list of GraphicsPipes by type that are available for creation.

Normally there is one default interactive GraphicsPipe, and possibly other types available as well.

Definition at line 48 of file graphicsPipeSelection.h.


Member Typedef Documentation

typedef pset<string> GraphicsPipeSelection::DisplayModules [private]
 

Definition at line 85 of file graphicsPipeSelection.h.

typedef PointerTo< GraphicsPipe > GraphicsPipeSelection::PipeConstructorFunc()
 

Definition at line 67 of file graphicsPipeSelection.h.

typedef pvector<PipeType> GraphicsPipeSelection::PipeTypes [private]
 

Definition at line 81 of file graphicsPipeSelection.h.


Constructor & Destructor Documentation

GraphicsPipeSelection::GraphicsPipeSelection  )  [protected]
 

Definition at line 39 of file graphicsPipeSelection.cxx.

References _display_modules.

GraphicsPipeSelection::~GraphicsPipeSelection  )  [protected]
 

Definition at line 87 of file graphicsPipeSelection.cxx.

References _lock, _pipe_types, and load_default_module().


Member Function Documentation

bool GraphicsPipeSelection::add_pipe_type TypeHandle  type,
PipeConstructorFunc func
 

Adds a new kind of GraphicsPipe to the list of available pipes for creation.

Normally, this is called at static init type by the various shared libraries as they are linked in. Returns true on success, false on failure.

Definition at line 317 of file graphicsPipeSelection.cxx.

void GraphicsPipeSelection::do_load_default_module  )  [private]
 

Loads the particular display module listed in the load-display Configrc variable, which should default the default pipe time.

If this string is empty or "*", loads all modules named in aux-display.

Definition at line 360 of file graphicsPipeSelection.cxx.

GraphicsPipeSelection * GraphicsPipeSelection::get_global_ptr  )  [inline, static]
 

Returns a pointer to the one global GraphicsPipeSelection object.

Definition at line 52 of file graphicsPipeSelection.I.

References _default_module_loaded, and INLINE.

Referenced by PandaFramework::show_collision_solids().

int GraphicsPipeSelection::get_num_aux_modules  )  const [inline]
 

Returns the number of display modules that are still to be loaded.

If this is nonzero, then calling load_aux_modules() will likely increase the number of GraphicsPipes available.

Definition at line 37 of file graphicsPipeSelection.I.

References _global_ptr, INLINE, and NULL.

int GraphicsPipeSelection::get_num_pipe_types  )  const
 

Returns the number of different types of GraphicsPipes that are available to create through this interface.

Definition at line 103 of file graphicsPipeSelection.cxx.

References _lock, _pipe_types, and load_default_module().

TypeHandle GraphicsPipeSelection::get_pipe_type int  n  )  const
 

Returns the nth type of GraphicsPipe available through this interface.

Definition at line 125 of file graphicsPipeSelection.cxx.

References _display_modules, _lock, _pipe_types, GraphicsPipeSelection::PipeType::_type, load_default_module(), and nout.

void GraphicsPipeSelection::load_aux_modules  ) 
 

Loads all the modules named in the aux-display Configrc variable, making as many graphics pipes as possible available.

Definition at line 290 of file graphicsPipeSelection.cxx.

void GraphicsPipeSelection::load_default_module  )  const [inline, private]
 

Conditionally calls do_load_default_module(), if it has not been called before.

Definition at line 70 of file graphicsPipeSelection.I.

Referenced by get_num_pipe_types(), get_pipe_type(), print_pipe_types(), and ~GraphicsPipeSelection().

void GraphicsPipeSelection::load_named_module const string &  name  )  [private]
 

Loads the indicated display module by looking for a matching .dll or .so file.

Definition at line 383 of file graphicsPipeSelection.cxx.

PointerTo< GraphicsPipe > GraphicsPipeSelection::make_default_pipe  ) 
 

Creates a new GraphicsPipe of some arbitrary type.

The user may specify a preference using the Configrc file; otherwise, one will be chosen arbitrarily.

Definition at line 229 of file graphicsPipeSelection.cxx.

Referenced by PandaFramework::show_collision_solids().

PointerTo< GraphicsPipe > GraphicsPipeSelection::make_pipe TypeHandle  type  ) 
 

Creates a new GraphicsPipe of the indicated type (or a type more specific than the indicated type, if necessary) and returns it.

Returns NULL if the type cannot be matched.

Definition at line 182 of file graphicsPipeSelection.cxx.

void GraphicsPipeSelection::print_pipe_types  )  const
 

Writes a list of the currently known GraphicsPipe types to nout, for the user's information.

Definition at line 149 of file graphicsPipeSelection.cxx.

References GraphicsPipeSelection::PipeType::_constructor, _lock, _pipe_types, GraphicsPipeSelection::PipeType::_type, TypeHandle::is_derived_from(), load_default_module(), NULL, and PT.

Referenced by PandaFramework::show_collision_solids().


Member Data Documentation

string GraphicsPipeSelection::_default_display_module [private]
 

Definition at line 87 of file graphicsPipeSelection.h.

bool GraphicsPipeSelection::_default_module_loaded [private]
 

Definition at line 89 of file graphicsPipeSelection.h.

Referenced by get_global_ptr().

string GraphicsPipeSelection::_default_pipe_name [private]
 

Definition at line 88 of file graphicsPipeSelection.h.

DisplayModules GraphicsPipeSelection::_display_modules [private]
 

Definition at line 86 of file graphicsPipeSelection.h.

Referenced by get_pipe_type(), and GraphicsPipeSelection().

GraphicsPipeSelection * GraphicsPipeSelection::_global_ptr = NULL [static, private]
 

Definition at line 29 of file graphicsPipeSelection.cxx.

Referenced by get_num_aux_modules().

Mutex GraphicsPipeSelection::_lock [private]
 

Definition at line 83 of file graphicsPipeSelection.h.

Referenced by get_num_pipe_types(), get_pipe_type(), print_pipe_types(), and ~GraphicsPipeSelection().

PipeTypes GraphicsPipeSelection::_pipe_types [private]
 

Definition at line 82 of file graphicsPipeSelection.h.

Referenced by get_num_pipe_types(), get_pipe_type(), print_pipe_types(), and ~GraphicsPipeSelection().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:51:22 2003 for Panda by doxygen1.3