Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

XFileMaterial Class Reference

This represents an X file "material", which consists of a color, lighting, and/or texture specification. More...

#include <xFileMaterial.h>

List of all members.

Public Member Functions

 XFileMaterial ()
 ~XFileMaterial ()
void set_from_egg (EggPrimitive *egg_prim)
 Sets the structure up from the indicated egg data.

void apply_to_egg (EggPrimitive *egg_prim, XFileToEggConverter *converter)
 Applies the properties in the material to the indicated egg primitive.

int compare_to (const XFileMaterial &other) const
bool has_material () const
 Returns true if this material represents something meaningful, or false if the default material is sufficient.

bool has_texture () const
 Returns true if this material includes a texture map, false otherwise.

void make_material_data (Datagram &raw_data)
 Fills the datagram with the raw data for the DX Material template.

void make_texture_data (Datagram &raw_data)
 Fills the datagram with the raw data for the DX TextureFilename template.

bool read_material_data (const Datagram &raw_data)
 Fills the structure based on the raw data from the Material template.

bool read_texture_data (const Datagram &raw_data)
 Fills the structure based on the raw data from the TextureFilename template.


Private Attributes

Colorf _face_color
float _power
RGBColorf _specular_color
RGBColorf _emissive_color
Filename _texture
bool _has_material
bool _has_texture


Detailed Description

This represents an X file "material", which consists of a color, lighting, and/or texture specification.

Definition at line 42 of file xFileMaterial.h.


Constructor & Destructor Documentation

XFileMaterial::XFileMaterial  ) 
 

Definition at line 40 of file xFileMaterial.cxx.

XFileMaterial::~XFileMaterial  ) 
 

Definition at line 58 of file xFileMaterial.cxx.

References _face_color, _has_material, EggPrimitive::get_color(), EggPrimitive::has_color(), and EggPrimitive::has_material().


Member Function Documentation

void XFileMaterial::apply_to_egg EggPrimitive egg_prim,
XFileToEggConverter converter
 

Applies the properties in the material to the indicated egg primitive.

Definition at line 117 of file xFileMaterial.cxx.

int XFileMaterial::compare_to const XFileMaterial &  other  )  const
 

Definition at line 157 of file xFileMaterial.cxx.

bool XFileMaterial::has_material  )  const
 

Returns true if this material represents something meaningful, or false if the default material is sufficient.

Definition at line 188 of file xFileMaterial.cxx.

References _emissive_color, _face_color, _power, _specular_color, Datagram::add_float32(), and Datagram::clear().

Referenced by XFileMesh::add_normal().

bool XFileMaterial::has_texture  )  const
 

Returns true if this material includes a texture map, false otherwise.

Definition at line 203 of file xFileMaterial.cxx.

References _texture, Datagram::clear(), and Filename::to_os_specific().

void XFileMaterial::make_material_data Datagram raw_data  ) 
 

Fills the datagram with the raw data for the DX Material template.

Definition at line 218 of file xFileMaterial.cxx.

void XFileMaterial::make_texture_data Datagram raw_data  ) 
 

Fills the datagram with the raw data for the DX TextureFilename template.

Definition at line 244 of file xFileMaterial.cxx.

References _emissive_color, _face_color, _has_material, _power, _specular_color, DatagramIterator::get_float32(), DatagramIterator::get_remaining_size(), and nout.

bool XFileMaterial::read_material_data const Datagram raw_data  ) 
 

Fills the structure based on the raw data from the Material template.

Definition at line 286 of file xFileMaterial.cxx.

References _has_texture, _texture, and nout.

Referenced by XFileToEggConverter::convert_mesh_material_list().

bool XFileMaterial::read_texture_data const Datagram raw_data  ) 
 

Fills the structure based on the raw data from the TextureFilename template.

Definition at line 321 of file xFileMaterial.cxx.

void XFileMaterial::set_from_egg EggPrimitive egg_prim  ) 
 

Sets the structure up from the indicated egg data.

Definition at line 70 of file xFileMaterial.cxx.

References _face_color.

Referenced by XFileMesh::add_normal().


Member Data Documentation

RGBColorf XFileMaterial::_emissive_color [private]
 

Definition at line 65 of file xFileMaterial.h.

Referenced by has_material(), and make_texture_data().

Colorf XFileMaterial::_face_color [private]
 

Definition at line 62 of file xFileMaterial.h.

Referenced by has_material(), make_texture_data(), set_from_egg(), and ~XFileMaterial().

bool XFileMaterial::_has_material [private]
 

Definition at line 68 of file xFileMaterial.h.

Referenced by make_texture_data(), and ~XFileMaterial().

bool XFileMaterial::_has_texture [private]
 

Definition at line 69 of file xFileMaterial.h.

Referenced by read_material_data().

float XFileMaterial::_power [private]
 

Definition at line 63 of file xFileMaterial.h.

Referenced by has_material(), and make_texture_data().

RGBColorf XFileMaterial::_specular_color [private]
 

Definition at line 64 of file xFileMaterial.h.

Referenced by has_material(), and make_texture_data().

Filename XFileMaterial::_texture [private]
 

Definition at line 66 of file xFileMaterial.h.

Referenced by has_texture(), and read_material_data().


The documentation for this class was generated from the following files:
Generated on Fri May 2 03:28:09 2003 for Panda-Tool by doxygen1.3