Panda3D
|
00001 // Filename: modelLoadRequest.h 00002 // Created by: drose (29Aug06) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef MODELLOADREQUEST 00016 #define MODELLOADREQUEST 00017 00018 #include "pandabase.h" 00019 00020 #include "asyncTask.h" 00021 #include "filename.h" 00022 #include "loaderOptions.h" 00023 #include "pandaNode.h" 00024 #include "pointerTo.h" 00025 #include "loader.h" 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Class : ModelLoadRequest 00029 // Description : A class object that manages a single asynchronous 00030 // model load request. Create a new ModelLoadRequest, 00031 // and add it to the loader via load_async(), to begin 00032 // an asynchronous load. 00033 //////////////////////////////////////////////////////////////////// 00034 class EXPCL_PANDA_PGRAPH ModelLoadRequest : public AsyncTask { 00035 public: 00036 ALLOC_DELETED_CHAIN(ModelLoadRequest); 00037 00038 PUBLISHED: 00039 ModelLoadRequest(const string &name, 00040 const Filename &filename, 00041 const LoaderOptions &options, 00042 Loader *loader); 00043 00044 INLINE const Filename &get_filename() const; 00045 INLINE const LoaderOptions &get_options() const; 00046 INLINE Loader *get_loader() const; 00047 00048 INLINE bool is_ready() const; 00049 INLINE PandaNode *get_model() const; 00050 00051 protected: 00052 virtual DoneStatus do_task(); 00053 00054 private: 00055 Filename _filename; 00056 LoaderOptions _options; 00057 PT(Loader) _loader; 00058 bool _is_ready; 00059 PT(PandaNode) _model; 00060 00061 public: 00062 static TypeHandle get_class_type() { 00063 return _type_handle; 00064 } 00065 static void init_type() { 00066 AsyncTask::init_type(); 00067 register_type(_type_handle, "ModelLoadRequest", 00068 AsyncTask::get_class_type()); 00069 } 00070 virtual TypeHandle get_type() const { 00071 return get_class_type(); 00072 } 00073 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00074 00075 private: 00076 static TypeHandle _type_handle; 00077 }; 00078 00079 #include "modelLoadRequest.I" 00080 00081 #endif