Panda3D

lwoSurfaceSmoothingAngle.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 lwoSurfaceSmoothingAngle.cxx
10 * @author drose
11 * @date 2001-04-24
12 */
13
14 #include "lwoSurfaceSmoothingAngle.h"
15 #include "lwoInputFile.h"
16
17 #include "dcast.h"
18 #include "indent.h"
19 #include "deg_2_rad.h"
20
21 TypeHandle LwoSurfaceSmoothingAngle::_type_handle;
22
23 /**
24 * Reads the data of the chunk in from the given input file, if possible. The
25 * ID and length of the chunk have already been read. stop_at is the byte
26 * position of the file to stop at (based on the current position at
27 * in->get_bytes_read()). Returns true on success, false otherwise.
28 */
29 bool LwoSurfaceSmoothingAngle::
30 read_iff(IffInputFile *in, size_t stop_at) {
31 LwoInputFile *lin = DCAST(LwoInputFile, in);
32
33 _angle = lin->get_be_float32();
34
35 return true;
36 }
37
38 /**
39 *
40 */
41 void LwoSurfaceSmoothingAngle::
42 write(std::ostream &out, int indent_level) const {
43 indent(out, indent_level)
44 << get_id() << " { angle = " << rad_2_deg(_angle) << " degrees }\n";
45 }
IffChunk::get_id
IffId get_id() const
Returns the ID associated with this chunk.
Definition: iffChunk.I:25
IffInputFile
A wrapper around an istream used for reading an IFF file.
Definition: iffInputFile.h:30
IffInputFile::get_be_float32
PN_stdfloat get_be_float32()
Extracts a 32-bit big-endian single-precision floating-point number.
Definition: iffInputFile.cxx:165
LwoInputFile
A specialization of IffInputFile to handle reading a Lightwave Object file.
Definition: lwoInputFile.h:26
LwoSurfaceSmoothingAngle::read_iff
virtual bool read_iff(IffInputFile *in, size_t stop_at)
Reads the data of the chunk in from the given input file, if possible.
Definition: lwoSurfaceSmoothingAngle.cxx:30
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
dcast.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
deg_2_rad.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
indent
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition: indent.cxx:20
indent.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
lwoInputFile.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
lwoSurfaceSmoothingAngle.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.