Panda3D
loaderFileTypeEgg.cxx
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 loaderFileTypeEgg.cxx
10  * @author drose
11  * @date 2000-06-20
12  */
13 
14 #include "loaderFileTypeEgg.h"
15 #include "load_egg_file.h"
16 #include "save_egg_file.h"
17 
18 #include "eggData.h"
19 
20 TypeHandle LoaderFileTypeEgg::_type_handle;
21 
22 /**
23  *
24  */
25 LoaderFileTypeEgg::
26 LoaderFileTypeEgg() {
27 }
28 
29 /**
30  *
31  */
32 std::string LoaderFileTypeEgg::
33 get_name() const {
34  return "Egg";
35 }
36 
37 /**
38  *
39  */
40 std::string LoaderFileTypeEgg::
41 get_extension() const {
42  return "egg";
43 }
44 
45 /**
46  * Returns true if this file type can transparently load compressed files
47  * (with a .pz or .gz extension), false otherwise.
48  */
51  return true;
52 }
53 
54 /**
55  * Returns true if the file type can be used to load files, and load_file() is
56  * supported. Returns false if load_file() is unimplemented and will always
57  * fail.
58  */
60 supports_load() const {
61  return true;
62 }
63 
64 /**
65  * Returns true if the file type can be used to save files, and save_file() is
66  * supported. Returns false if save_file() is unimplemented and will always
67  * fail.
68  */
70 supports_save() const {
71  return true;
72 }
73 
74 /**
75  *
76  */
77 PT(PandaNode) LoaderFileTypeEgg::
78 load_file(const Filename &path, const LoaderOptions &,
79  BamCacheRecord *record) const {
80  PT(PandaNode) result = load_egg_file(path, CS_default, record);
81  return result;
82 }
83 
84 /**
85  *
86  */
87 bool LoaderFileTypeEgg::
88 save_file(const Filename &path, const LoaderOptions &options,
89  PandaNode *node) const {
90  return save_egg_file(path, node);
91 }
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
bool save_egg_file(const Filename &filename, PandaNode *node, CoordinateSystem cs)
A convenience function; converts the indicated scene graph to an egg file and writes it to disk.
Specifies parameters that may be passed to the loader.
Definition: loaderOptions.h:23
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool supports_save() const
Returns true if the file type can be used to save files, and save_file() is supported.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool supports_load() const
Returns true if the file type can be used to load files, and load_file() is supported.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
virtual bool supports_compressed() const
Returns true if this file type can transparently load compressed files (with a .pz or ....