Panda3D
lwoSurfaceSmoothingAngle.cxx
1 // Filename: lwoSurfaceSmoothingAngle.cxx
2 // Created by: drose (24Apr01)
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 #include "lwoSurfaceSmoothingAngle.h"
16 #include "lwoInputFile.h"
17 
18 #include "dcast.h"
19 #include "indent.h"
20 #include "deg_2_rad.h"
21 
22 TypeHandle LwoSurfaceSmoothingAngle::_type_handle;
23 
24 ////////////////////////////////////////////////////////////////////
25 // Function: LwoSurfaceSmoothingAngle::read_iff
26 // Access: Public, Virtual
27 // Description: Reads the data of the chunk in from the given input
28 // file, if possible. The ID and length of the chunk
29 // have already been read. stop_at is the byte position
30 // of the file to stop at (based on the current position
31 // at in->get_bytes_read()). Returns true on success,
32 // false otherwise.
33 ////////////////////////////////////////////////////////////////////
35 read_iff(IffInputFile *in, size_t stop_at) {
36  LwoInputFile *lin = DCAST(LwoInputFile, in);
37 
38  _angle = lin->get_be_float32();
39 
40  return true;
41 }
42 
43 ////////////////////////////////////////////////////////////////////
44 // Function: LwoSurfaceSmoothingAngle::write
45 // Access: Public, Virtual
46 // Description:
47 ////////////////////////////////////////////////////////////////////
48 void LwoSurfaceSmoothingAngle::
49 write(ostream &out, int indent_level) const {
50  indent(out, indent_level)
51  << get_id() << " { angle = " << rad_2_deg(_angle) << " degrees }\n";
52 }
A wrapper around an istream used for reading an IFF file.
Definition: iffInputFile.h:33
virtual bool read_iff(IffInputFile *in, size_t stop_at)
Reads the data of the chunk in from the given input file, if possible.
PN_stdfloat get_be_float32()
Extracts a 32-bit big-endian single-precision floating-point number.
A specialization of IffInputFile to handle reading a Lightwave Object file.
Definition: lwoInputFile.h:29
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
IffId get_id() const
Returns the ID associated with this chunk.
Definition: iffChunk.I:31