Panda3D
eggAnimPreload.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 eggAnimPreload.cxx
10  * @author drose
11  * @date 2008-08-06
12  */
13 
14 #include "eggAnimPreload.h"
15 
16 #include "string_utils.h"
17 #include "indent.h"
18 
19 TypeHandle EggAnimPreload::_type_handle;
20 
21 /**
22  * Writes the table and all of its children to the indicated output stream in
23  * Egg format.
24  */
26 write(std::ostream &out, int indent_level) const {
27  test_under_integrity();
28 
29  write_header(out, indent_level, "<AnimPreload>");
30 
31  if (has_fps()) {
32  indent(out, indent_level + 2)
33  << "<Scalar> fps { " << get_fps() << " }\n";
34  }
35 
36  if (has_num_frames()) {
37  indent(out, indent_level + 2)
38  << "<Scalar> frames { " << get_num_frames() << " }\n";
39  }
40 
41  indent(out, indent_level) << "}\n";
42 }
virtual void write(std::ostream &out, int indent_level) const
Writes the table and all of its children to the indicated output stream in Egg format.
void write_header(std::ostream &out, int indent_level, const char *egg_keyword) const
Writes the first line of the egg object, e.g.
double get_fps() const
This is only valid if has_fps() returns true.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int get_num_frames() const
This is only valid if has_num_frames() returns true.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition: indent.cxx:20
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.