Panda3D
Loading...
Searching...
No Matches
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
20TypeHandle LoaderFileTypeEgg::_type_handle;
21
22/**
23 *
24 */
25LoaderFileTypeEgg::
26LoaderFileTypeEgg() {
27}
28
29/**
30 *
31 */
32std::string LoaderFileTypeEgg::
33get_name() const {
34 return "Egg";
35}
36
37/**
38 *
39 */
40std::string LoaderFileTypeEgg::
41get_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 */
50supports_compressed() const {
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 */
60supports_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 */
70supports_save() const {
71 return true;
72}
73
74/**
75 *
76 */
77PT(PandaNode) LoaderFileTypeEgg::
78load_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 */
87bool LoaderFileTypeEgg::
88save_file(const Filename &path, const LoaderOptions &options,
89 PandaNode *node) const {
90 return save_egg_file(path, node);
91}
An instance of this class is written to the front of a Bam or Txo file to make the file a cached inst...
The name of a file, such as a texture file or an Egg file.
Definition filename.h:44
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 or ....
virtual bool supports_save() const
Returns true if the file type can be used to save files, and save_file() is supported.
Specifies parameters that may be passed to the loader.
A basic node of the scene graph or data graph.
Definition pandaNode.h:65
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.