Panda3D
 All Classes Functions Variables Enumerations
bamWriter.I
1 // Filename: bamWriter.I
2 // Created by: jason (08Jun00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: BamWriter::get_target
18 // Access: Published
19 // Description: Returns the current target of the BamWriter as set by
20 // set_target() or the constructor.
21 ////////////////////////////////////////////////////////////////////
24  return _target;
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: BamWriter::get_filename
29 // Access: Published
30 // Description: If a BAM is a file, then the BamWriter should
31 // contain the name of the file. This enables the
32 // writer to convert pathnames in the BAM to relative
33 // to the directory containing the BAM.
34 ////////////////////////////////////////////////////////////////////
35 INLINE const Filename &BamWriter::
36 get_filename() const {
37  if (_target != (DatagramSink *)NULL) {
38  return _target->get_filename();
39  }
40  static const Filename empty_filename;
41  return empty_filename;
42 }
43 
44 ////////////////////////////////////////////////////////////////////
45 // Function: BamWriter::get_file_endian
46 // Access: Published
47 // Description: Returns the endian preference indicated by the Bam
48 // file currently being written. This does not imply
49 // that every number is stored using the indicated
50 // convention, but individual objects may choose to
51 // respect this flag when recording data.
52 ////////////////////////////////////////////////////////////////////
53 INLINE BamWriter::BamEndian BamWriter::
54 get_file_endian() const {
55  return _file_endian;
56 }
57 
58 ////////////////////////////////////////////////////////////////////
59 // Function: BamWriter::get_file_stdfloat_double
60 // Access: Published
61 // Description: Returns true if the file will store all "standard"
62 // floats as 64-bit doubles, or false if they are 32-bit
63 // floats. This isn't runtime settable; it's based on
64 // the compilation flags of the version of Panda that
65 // generated this file.
66 ////////////////////////////////////////////////////////////////////
67 INLINE bool BamWriter::
69  return _file_stdfloat_double;
70 }
71 
72 ////////////////////////////////////////////////////////////////////
73 // Function: BamWriter::get_file_texture_mode
74 // Access: Published
75 // Description: Returns the BamTextureMode preference indicated by
76 // the Bam file currently being written. Texture
77 // objects written to this Bam file will be encoded
78 // according to the specified mode.
79 ////////////////////////////////////////////////////////////////////
80 INLINE BamWriter::BamTextureMode BamWriter::
82  return _file_texture_mode;
83 }
84 
85 ////////////////////////////////////////////////////////////////////
86 // Function: BamWriter::set_file_texture_mode
87 // Access: Published
88 // Description: Changes the BamTextureMode preference for
89 // the Bam file currently being written. Texture
90 // objects written to this Bam file will be encoded
91 // according to the specified mode.
92 ////////////////////////////////////////////////////////////////////
93 INLINE void BamWriter::
94 set_file_texture_mode(BamTextureMode file_texture_mode) {
95  _file_texture_mode = file_texture_mode;
96 }
bool get_file_stdfloat_double() const
Returns true if the file will store all "standard" floats as 64-bit doubles, or false if they are 32-...
Definition: bamWriter.I:68
BamEndian get_file_endian() const
Returns the endian preference indicated by the Bam file currently being written.
Definition: bamWriter.I:54
void set_file_texture_mode(BamTextureMode file_texture_mode)
Changes the BamTextureMode preference for the Bam file currently being written.
Definition: bamWriter.I:94
This class defines the abstract interface to sending datagrams to any target, whether it be into a fi...
Definition: datagramSink.h:32
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
virtual const Filename & get_filename()
Returns the filename that provides the target for these datagrams, if any, or empty string if the dat...
const Filename & get_filename() const
If a BAM is a file, then the BamWriter should contain the name of the file.
Definition: bamWriter.I:36
BamTextureMode get_file_texture_mode() const
Returns the BamTextureMode preference indicated by the Bam file currently being written.
Definition: bamWriter.I:81
DatagramSink * get_target()
Returns the current target of the BamWriter as set by set_target() or the constructor.
Definition: bamWriter.I:23