42class EXPCL_PANDA_PGRAPH Loader :
public TypedReferenceCount,
public Namable {
51 class EXPCL_PANDA_PGRAPH Results {
54 INLINE Results(
const Results ©);
55 INLINE
void operator = (
const Results ©);
69 typedef pvector<ConsiderFile> Files;
73 explicit Loader(
const std::string &name =
"loader");
88 INLINE
void load_async(
AsyncTask *request);
99 virtual void output(std::ostream &out)
const;
113 static void make_global_ptr();
116 std::string _task_chain;
118 static void load_file_types();
119 static bool _file_types_loaded;
121 static PT(Loader) _global_ptr;
127 static void init_type() {
128 TypedReferenceCount::init_type();
129 Namable::init_type();
131 TypedReferenceCount::get_class_type(),
132 Namable::get_class_type());
134 virtual TypeHandle get_type()
const {
135 return get_class_type();
137 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
140 static TypeHandle _type_handle;
142 friend class ModelLoadRequest;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A class to manage a loose queue of isolated tasks, which can be performed either synchronously (in th...
This class represents a concrete task performed by an AsyncManager.
The name of a file, such as a texture file or an Egg file.
This is the base class for a family of scene-graph file types that the Loader supports.
Specifies parameters that may be passed to the loader.
void add_file(const Filename &file, LoaderFileType *type)
Adds a new file to the result list.
get_file
Returns the nth file on the result list.
get_num_files
Returns the number of files on the result list.
get_file_type
Returns the file type of the nth file on the result list.
void clear()
Removes all the files from the list.
static Loader * get_global_ptr()
Returns a pointer to the global Loader.
PointerTo< AsyncTask > make_async_save_request(const Filename &filename, const LoaderOptions &options, PandaNode *node)
Returns a new AsyncTask object suitable for adding to save_async() to start an asynchronous model sav...
PointerTo< AsyncTask > make_async_request(const Filename &filename, const LoaderOptions &options=LoaderOptions())
Returns a new AsyncTask object suitable for adding to load_async() to start an asynchronous model loa...
void save_async(AsyncTask *request)
Begins an asynchronous save request.
void set_task_chain(const std::string &task_chain)
Specifies the task chain that is used for asynchronous loads.
AsyncTaskManager * get_task_manager() const
Returns the task manager that is used for asynchronous loads.
const std::string & get_task_chain() const
Returns the task chain that is used for asynchronous loads.
bool save_sync(const Filename &filename, const LoaderOptions &options, PandaNode *node) const
Saves the file immediately, waiting for it to complete.
void set_task_manager(AsyncTaskManager *task_manager)
Specifies the task manager that is used for asynchronous loads.
void stop_threads()
Stop any threads used for asynchronous loads.
PointerTo< PandaNode > load_bam_stream(std::istream &in)
Attempts to read a bam file from the indicated stream and return the scene graph defined there.
bool remove(AsyncTask *task)
Removes a pending asynchronous load request.
void output(std::ostream &out) const
Outputs the Namable.
A basic node of the scene graph or data graph.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...