Panda3D
loaderFileTypePandatool.h
1 // Filename: loaderFileTypePandatool.h
2 // Created by: drose (20Jun00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef LOADERFILETYPEPANDATOOL_H
16 #define LOADERFILETYPEPANDATOOL_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "loaderFileType.h"
21 
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : LoaderFileTypePandatool
27 // Description : This defines the Loader interface to files whose
28 // converters are defined within the Pandatool package
29 // and inherit from SomethingToEggConverter, like
30 // FltToEggConverter and LwoToEggConverter.
31 ////////////////////////////////////////////////////////////////////
32 class EXPCL_PTLOADER LoaderFileTypePandatool : public LoaderFileType {
33 public:
35  EggToSomethingConverter *saver = NULL);
36  virtual ~LoaderFileTypePandatool();
37 
38  virtual string get_name() const;
39  virtual string get_extension() const;
40  virtual string get_additional_extensions() const;
41  virtual bool supports_compressed() const;
42 
43  virtual bool supports_load() const;
44  virtual bool supports_save() const;
45 
46  virtual void resolve_filename(Filename &path) const;
47  virtual PT(PandaNode) load_file(const Filename &path, const LoaderOptions &options,
48  BamCacheRecord *record) const;
49  virtual bool save_file(const Filename &path, const LoaderOptions &options,
50  PandaNode *node) const;
51 
52 private:
53  SomethingToEggConverter *_loader;
55 
56 public:
57  static TypeHandle get_class_type() {
58  return _type_handle;
59  }
60  static void init_type() {
61  LoaderFileType::init_type();
62  register_type(_type_handle, "LoaderFileTypePandatool",
63  LoaderFileType::get_class_type());
64  }
65  virtual TypeHandle get_type() const {
66  return get_class_type();
67  }
68  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
69 
70 private:
71  static TypeHandle _type_handle;
72 };
73 
74 #endif
75 
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
Specifies parameters that may be passed to the loader.
Definition: loaderOptions.h:26
virtual string get_additional_extensions() const
Returns a space-separated list of extension, in addition to the one returned by get_extension(), that are recognized by this loader.
This is a base class for a family of converter classes that manage a conversion from egg format to so...
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
An instance of this class is written to the front of a Bam or Txo file to make the file a cached inst...
virtual bool supports_load() const
Returns true if the file type can be used to load files, and load_file() is supported.
virtual bool supports_compressed() const
Returns true if this file type can transparently load compressed files (with a .pz extension)...
virtual bool supports_save() const
Returns true if the file type can be used to save files, and save_file() is supported.
This is the base class for a family of scene-graph file types that the Loader supports.
This defines the Loader interface to files whose converters are defined within the Pandatool package ...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
This is a base class for a family of converter classes that manage a conversion from some file type t...