Panda3D
Public Member Functions | Static Public Member Functions | List of all members
LwoInputFile Class Reference

A specialization of IffInputFile to handle reading a Lightwave Object file. More...

#include "lwoInputFile.h"

Inheritance diagram for LwoInputFile:
IffInputFile TypedObject MemoryBase

Public Member Functions

virtual TypeHandle force_init_type ()
 
Filename get_filename ()
 Reads a Lightwave platform-neutral filename and converts it to a Panda platform-neutral filename. More...
 
double get_lwo_version () const
 Returns the version of the Lightwave file being read. More...
 
virtual TypeHandle get_type () const
 
LVecBase3 get_vec3 ()
 Reads a three-component vector of floats. More...
 
int get_vx ()
 Reads a Lightwave variable-length index. More...
 
void set_lwo_version (double version)
 Changes the version number reported for the Lightwave file. More...
 
- Public Member Functions inherited from IffInputFile
void align ()
 If the current file pointer is not positioned on an even-byte boundary, reads and discards one byte so that it is. More...
 
PN_stdfloat get_be_float32 ()
 Extracts a 32-bit big-endian single-precision floating-point number. More...
 
int16_t get_be_int16 ()
 Extracts a signed 16-bit big-endian integer. More...
 
int32_t get_be_int32 ()
 Extracts a signed 32-bit big-endian integer. More...
 
uint16_t get_be_uint16 ()
 Extracts an unsigned 16-bit big-endian integer. More...
 
uint32_t get_be_uint32 ()
 Extracts an unsigned 32-bit big-endian integer. More...
 
size_t get_bytes_read () const
 Returns the number of bytes read so far from the input file. More...
 
const Filenameget_filename () const
 Returns the filename that the InputFile is currently opened on, if available. More...
 
IffId get_id ()
 Extracts a 4-character IFF ID. More...
 
int8_t get_int8 ()
 Extracts a signed 8-bit integer. More...
 
std::string get_string ()
 Extracts a null-terminated string. More...
 
uint8_t get_uint8 ()
 Extracts an unsigned 8-bit integer. More...
 
bool is_eof () const
 Returns true if the last read operation failed because of reaching EOF, false otherwise. More...
 
bool open_read (Filename filename)
 Attempts to open the indicated filename for reading. More...
 
 PT (IffChunk) get_chunk()
 
 PT (IffChunk) get_subchunk(IffChunk *context)
 
bool read_byte (char &byte)
 Reads a single byte. More...
 
bool read_bytes (Datagram &datagram, int length)
 Reads a series of bytes, and stores them in the indicated Datagram. More...
 
void set_filename (const Filename &filename)
 Indicates the filename that the InputFile is currently opened on. More...
 
void set_input (std::istream *input, bool owns_istream)
 Sets up the input to use an arbitrary istream. More...
 
bool skip_bytes (int length)
 Reads a series of bytes, but does not store them. More...
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)=default
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
TypedObjectoperator= (const TypedObject &copy)=default
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from IffInputFile
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle get_class_type ()
 
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96. More...
 

Additional Inherited Members

- Public Attributes inherited from TypedObject
 get_type
 

Detailed Description

A specialization of IffInputFile to handle reading a Lightwave Object file.

Definition at line 26 of file lwoInputFile.h.

Member Function Documentation

◆ get_filename()

Filename LwoInputFile::get_filename ( )

Reads a Lightwave platform-neutral filename and converts it to a Panda platform-neutral filename.

Definition at line 79 of file lwoInputFile.cxx.

References IffInputFile::get_string().

◆ get_lwo_version()

double LwoInputFile::get_lwo_version ( ) const
inline

Returns the version of the Lightwave file being read.

This is unknown until the header record has been read; then it will be set by the header.

Definition at line 19 of file lwoInputFile.I.

◆ get_vec3()

LVecBase3 LwoInputFile::get_vec3 ( )

Reads a three-component vector of floats.

Definition at line 66 of file lwoInputFile.cxx.

References IffInputFile::get_be_float32().

◆ get_vx()

int LwoInputFile::get_vx ( )

Reads a Lightwave variable-length index.

This is either a 2-byte or 4-byte integer.

Definition at line 50 of file lwoInputFile.cxx.

References IffInputFile::get_be_uint16().

◆ set_lwo_version()

void LwoInputFile::set_lwo_version ( double  lwo_version)
inline

Changes the version number reported for the Lightwave file.

Normally this is only called by LwoHeader as it is read.

Definition at line 29 of file lwoInputFile.I.


The documentation for this class was generated from the following files: