Panda3D
|
00001 // Filename: loaderFileType.h 00002 // Created by: drose (20Jun00) 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 LOADERFILETYPE_H 00016 #define LOADERFILETYPE_H 00017 00018 #include "pandabase.h" 00019 00020 #include "typedObject.h" 00021 #include "filename.h" 00022 #include "pandaNode.h" 00023 #include "pointerTo.h" 00024 #include "dSearchPath.h" 00025 00026 class LoaderOptions; 00027 class BamCacheRecord; 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Class : LoaderFileType 00031 // Description : This is the base class for a family of scene-graph 00032 // file types that the Loader supports. Each kind of 00033 // loader that's available should define a corresponding 00034 // LoaderFileType object and register itself. 00035 //////////////////////////////////////////////////////////////////// 00036 class EXPCL_PANDA_PGRAPH LoaderFileType : public TypedObject { 00037 protected: 00038 LoaderFileType(); 00039 00040 public: 00041 virtual ~LoaderFileType(); 00042 00043 PUBLISHED: 00044 virtual string get_name() const=0; 00045 virtual string get_extension() const=0; 00046 virtual string get_additional_extensions() const; 00047 virtual bool supports_compressed() const; 00048 00049 virtual bool get_allow_disk_cache(const LoaderOptions &options) const; 00050 virtual bool get_allow_ram_cache(const LoaderOptions &options) const; 00051 00052 public: 00053 virtual PT(PandaNode) load_file(const Filename &path, const LoaderOptions &options, 00054 BamCacheRecord *record) const; 00055 00056 protected: 00057 int _no_cache_flags; 00058 00059 public: 00060 static TypeHandle get_class_type() { 00061 return _type_handle; 00062 } 00063 static void init_type() { 00064 TypedObject::init_type(); 00065 register_type(_type_handle, "LoaderFileType", 00066 TypedObject::get_class_type()); 00067 } 00068 virtual TypeHandle get_type() const { 00069 return get_class_type(); 00070 } 00071 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00072 00073 private: 00074 static TypeHandle _type_handle; 00075 }; 00076 00077 #endif 00078