Panda3D
bamWriter.I
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 bamWriter.I
10  * @author jason
11  * @date 2000-06-08
12  */
13 
14 /**
15  * Returns the current target of the BamWriter as set by set_target() or the
16  * constructor.
17  */
18 INLINE DatagramSink *BamWriter::
19 get_target() {
20  return _target;
21 }
22 
23 /**
24  * If a BAM is a file, then the BamWriter should contain the name of the file.
25  * This enables the writer to convert pathnames in the BAM to relative to the
26  * directory containing the BAM.
27  */
28 INLINE const Filename &BamWriter::
29 get_filename() const {
30  if (_target != nullptr) {
31  return _target->get_filename();
32  }
33  static const Filename empty_filename;
34  return empty_filename;
35 }
36 
37 /**
38  * Returns the major version number of the Bam file currently being written.
39  */
40 INLINE int BamWriter::
42  return _file_major;
43 }
44 
45 /**
46  * Changes the minor .bam version to write. This should be called before
47  * init(). Each Panda version has only a fairly narrow range of versions it
48  * is able to write; consult the .bam documentation for more information.
49  */
50 INLINE void BamWriter::
51 set_file_minor_ver(int minor_ver) {
52  _file_minor = minor_ver;
53 }
54 
55 /**
56  * Returns the minor version number of the Bam file currently being written.
57  */
58 INLINE int BamWriter::
60  return _file_minor;
61 }
62 
63 /**
64  * Returns the endian preference indicated by the Bam file currently being
65  * written. This does not imply that every number is stored using the
66  * indicated convention, but individual objects may choose to respect this
67  * flag when recording data.
68  */
69 INLINE BamWriter::BamEndian BamWriter::
70 get_file_endian() const {
71  return _file_endian;
72 }
73 
74 /**
75  * Returns true if the file will store all "standard" floats as 64-bit
76  * doubles, or false if they are 32-bit floats. This isn't runtime settable;
77  * it's based on the compilation flags of the version of Panda that generated
78  * this file.
79  */
80 INLINE bool BamWriter::
81 get_file_stdfloat_double() const {
82  return _file_stdfloat_double;
83 }
84 
85 /**
86  * Returns the BamTextureMode preference indicated by the Bam file currently
87  * being written. Texture objects written to this Bam file will be encoded
88  * according to the specified mode.
89  */
90 INLINE BamWriter::BamTextureMode BamWriter::
91 get_file_texture_mode() const {
92  return _file_texture_mode;
93 }
94 
95 /**
96  * Changes the BamTextureMode preference for the Bam file currently being
97  * written. Texture objects written to this Bam file will be encoded
98  * according to the specified mode.
99  */
100 INLINE void BamWriter::
101 set_file_texture_mode(BamTextureMode file_texture_mode) {
102  _file_texture_mode = file_texture_mode;
103 }
104 
105 /**
106  * Returns the root node of the part of the scene graph we are currently
107  * writing out. This is used for determining what to make NodePaths relative
108  * to.
109  */
110 INLINE TypedWritable *BamWriter::
111 get_root_node() const {
112  return _root_node;
113 }
114 
115 /**
116  * Sets the root node of the part of the scene graph we are currently writing
117  * out. NodePaths written to this bam file will be relative to this node.
118  */
119 INLINE void BamWriter::
120 set_root_node(TypedWritable *root_node) {
121  _root_node = root_node;
122 }
set_root_node
Sets the root node of the part of the scene graph we are currently writing out.
Definition: bamWriter.h:96
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:35
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being written.
Definition: bamWriter.I:59
void set_file_texture_mode(BamTextureMode file_texture_mode)
Changes the BamTextureMode preference for the Bam file currently being written.
Definition: bamWriter.I:101
This class defines the abstract interface to sending datagrams to any target, whether it be into a fi...
Definition: datagramSink.h:29
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:39
void set_file_minor_ver(int minor_ver)
Changes the minor .bam version to write.
Definition: bamWriter.I:51
get_filename
Returns the filename that provides the target for these datagrams, if any, or empty string if the dat...
Definition: datagramSink.h:44
int get_file_major_ver() const
Returns the major version number of the Bam file currently being written.
Definition: bamWriter.I:41