35 std::string LoaderFileTypeBam::
43 std::string LoaderFileTypeBam::
44 get_extension()
const {
83 if (record !=
nullptr) {
87 bool report_errors = (options.get_flags() & LoaderOptions::LF_report_errors) != 0;
90 if (!bam_file.
open_read(path, report_errors)) {
93 bam_file.
get_reader()->set_loader_options(options);
94 time_t timestamp = bam_file.
get_reader()->get_source()->get_timestamp();
96 PT(
PandaNode) node = bam_file.read_node(report_errors);
97 if (node !=
nullptr && node->is_of_type(ModelRoot::get_class_type())) {
110 bool LoaderFileTypeBam::
115 bool report_errors = (options.get_flags() & LoaderOptions::LF_report_errors) != 0;
119 if (bam_file.
open_write(path, report_errors)) {
The principle public interface to reading and writing Bam disk files.
A node of this type is created automatically at the root of each model file that is loaded.
bool write_object(const TypedWritable *object)
Writes the indicated object to the Bam file.
A basic node of the scene graph or data graph.
bool open_read(const Filename &bam_filename, bool report_errors=true)
Attempts to open the indicated filename for reading.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Specifies parameters that may be passed to the loader.
virtual bool supports_load() const
Returns true if the file type can be used to load files, and load_file() is supported.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void close()
Closes the input or output stream.
virtual bool supports_save() const
Returns true if the file type can be used to save files, and save_file() is supported.
virtual bool supports_compressed() const
Returns true if this file type can transparently load compressed files (with a .pz or ....
The name of a file, such as a texture file or an Egg file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_reader
Returns the BamReader in charge of performing the read operations.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
set_timestamp
Sets the timestamp of the file on disk that was read for this model.
void add_dependent_file(const Filename &pathname)
Adds the indicated file to the list of files that will be loaded to generate the data in this record.
bool open_write(const Filename &bam_filename, bool report_errors=true)
Attempts to open the indicated file for writing.
TypeHandle is the identifier used to differentiate C++ class types.
set_fullpath
Sets the full pathname of the model represented by this node, as found on disk.