Panda3D
loaderFileTypeAssimp.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file loaderFileTypeAssimp.h
10  * @author rdb
11  * @date 2011-03-29
12  */
13 
14 #ifndef LOADERFILETYPEASSIMP_H
15 #define LOADERFILETYPEASSIMP_H
16 
17 #include "config_assimp.h"
18 #include "loaderFileType.h"
19 
20 class AssimpLoader;
21 
22 /**
23  * This defines the Loader interface that uses the Assimp library to load
24  * various model formats.
25  */
26 class EXPCL_ASSIMP LoaderFileTypeAssimp : public LoaderFileType {
27 public:
29  virtual ~LoaderFileTypeAssimp();
30 
31  virtual std::string get_name() const;
32  virtual std::string get_extension() const;
33  virtual std::string get_additional_extensions() const;
34  virtual bool supports_compressed() const;
35 
36  virtual PT(PandaNode) load_file(const Filename &path, const LoaderOptions &options,
37  BamCacheRecord *record) const;
38 
39 public:
40  AssimpLoader *_loader;
41 
42 public:
43  static TypeHandle get_class_type() {
44  return _type_handle;
45  }
46  static void init_type() {
47  LoaderFileType::init_type();
48  register_type(_type_handle, "LoaderFileTypeAssimp",
49  LoaderFileType::get_class_type());
50  }
51  virtual TypeHandle get_type() const {
52  return get_class_type();
53  }
54  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
55 
56 private:
57  static TypeHandle _type_handle;
58 };
59 
60 #endif
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
virtual std::string get_additional_extensions() const
Returns a space-separated list of extension, in addition to the one returned by get_extension(),...
Specifies parameters that may be passed to the loader.
Definition: loaderOptions.h:23
This defines the Loader interface that uses the Assimp library to load various model formats.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:39
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_compressed() const
Returns true if this file type can transparently load compressed files (with a .pz or ....
This is the base class for a family of scene-graph file types that the Loader supports.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
Class that interfaces with Assimp and builds Panda nodes to represent the Assimp structures.
Definition: assimpLoader.h:44