Panda3D
|
00001 // Filename: modelFlattenRequest.h 00002 // Created by: drose (30Mar07) 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 MODELFLATTENREQUEST 00016 #define MODELFLATTENREQUEST 00017 00018 #include "pandabase.h" 00019 00020 #include "asyncTask.h" 00021 #include "pandaNode.h" 00022 #include "pointerTo.h" 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : ModelFlattenRequest 00026 // Description : This class object manages a single asynchronous 00027 // request to flatten a model. The model will be 00028 // duplicated and flattened in a sub-thread (if 00029 // threading is available), without affecting the 00030 // original model; and when the result is done it may be 00031 // retrieved from this object. 00032 //////////////////////////////////////////////////////////////////// 00033 class EXPCL_PANDA_PGRAPH ModelFlattenRequest : public AsyncTask { 00034 public: 00035 ALLOC_DELETED_CHAIN(ModelFlattenRequest); 00036 00037 PUBLISHED: 00038 INLINE ModelFlattenRequest(PandaNode *orig); 00039 00040 INLINE PandaNode *get_orig() const; 00041 00042 INLINE bool is_ready() const; 00043 INLINE PandaNode *get_model() const; 00044 00045 protected: 00046 virtual DoneStatus do_task(); 00047 00048 private: 00049 PT(PandaNode) _orig; 00050 bool _is_ready; 00051 PT(PandaNode) _model; 00052 00053 public: 00054 static TypeHandle get_class_type() { 00055 return _type_handle; 00056 } 00057 static void init_type() { 00058 AsyncTask::init_type(); 00059 register_type(_type_handle, "ModelFlattenRequest", 00060 AsyncTask::get_class_type()); 00061 } 00062 virtual TypeHandle get_type() const { 00063 return get_class_type(); 00064 } 00065 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00066 00067 private: 00068 static TypeHandle _type_handle; 00069 }; 00070 00071 #include "modelFlattenRequest.I" 00072 00073 #endif