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

TextureReference Class Reference

#include <textureReference.h>

Inheritance diagram for TextureReference:

TypedWritable TypedObject List of all members.

Public Member Functions

 TextureReference ()
 ~TextureReference ()
void from_egg (EggFile *egg_file, EggData *data, EggTexture *egg_tex)
EggFileget_egg_file () const
SourceTextureImageget_source () const
TextureImageget_texture () const
bool has_uvs () const
const TexCoorddget_min_uv () const
const TexCoorddget_max_uv () const
EggTexture::WrapMode get_wrap_u () const
EggTexture::WrapMode get_wrap_v () const
void set_placement (TexturePlacement *placement)
void clear_placement ()
TexturePlacementget_placement () const
void mark_egg_stale ()
void update_egg ()
void apply_properties_to_source ()
void output (ostream &out) const
void write (ostream &out, int indent_level=0) const
virtual void write_datagram (BamWriter *writer, Datagram &datagram)
virtual int complete_pointers (TypedWritable **p_list, BamReader *manager)
virtual TypeHandle get_type () const

Static Public Member Functions

void register_with_read_factory ()
TypeHandle get_class_type ()
void init_type ()

Protected Member Functions

void fillin (DatagramIterator &scan, BamReader *manager)

Static Protected Member Functions

TypedWritablemake_TextureReference (const FactoryParams &params)

Private Member Functions

void get_uv_range (EggGroupNode *group, Palettizer::RemapUV remap)
void update_uv_range (EggGroupNode *group, Palettizer::RemapUV remap)
bool get_geom_uvs (EggPrimitive *geom, TexCoordd &geom_min_uv, TexCoordd &geom_max_uv)
void translate_geom_uvs (EggPrimitive *geom, const TexCoordd &trans) const

Static Private Member Functions

void collect_uv (bool &any_uvs, TexCoordd &min_uv, TexCoordd &max_uv, const TexCoordd &got_min_uv, const TexCoordd &got_max_uv)
LVector2d translate_uv (const TexCoordd &min_uv, const TexCoordd &max_uv)

Private Attributes

EggFile_egg_file
EggTexture_egg_tex
EggData_egg_data
LMatrix3d _tex_mat
LMatrix3d _inv_tex_mat
SourceTextureImage_source_texture
TexturePlacement_placement
bool _uses_alpha
bool _any_uvs
TexCoordd _min_uv
TexCoordd _max_uv
EggTexture::WrapMode _wrap_u
EggTexture::WrapMode _wrap_v
TextureProperties _properties

Static Private Attributes

TypeHandle _type_handle

Constructor & Destructor Documentation

TextureReference::TextureReference  ) 
 

Definition at line 51 of file textureReference.cxx.

References _any_uvs, _egg_file, _egg_tex, _inv_tex_mat, _max_uv, _min_uv, _placement, _source_texture, _tex_mat, _uses_alpha, _wrap_u, _wrap_v, NULL, and EggTexture::WM_unspecified.

TextureReference::~TextureReference  ) 
 

Definition at line 72 of file textureReference.cxx.

References clear_placement().


Member Function Documentation

void TextureReference::apply_properties_to_source  ) 
 

Definition at line 381 of file textureReference.cxx.

References _properties, _source_texture, nassertv, NULL, and ImageFile::update_properties().

Referenced by EggFile::apply_properties_to_source().

void TextureReference::clear_placement  ) 
 

Definition at line 256 of file textureReference.cxx.

References NULL, and set_placement().

Referenced by TexturePlacement::~TexturePlacement(), and ~TextureReference().

void TextureReference::collect_uv bool &  any_uvs,
TexCoordd min_uv,
TexCoordd max_uv,
const TexCoordd got_min_uv,
const TexCoordd got_max_uv
[static, private]
 

Definition at line 682 of file textureReference.cxx.

Referenced by get_geom_uvs(), get_uv_range(), and update_uv_range().

int TextureReference::complete_pointers TypedWritable **  p_list,
BamReader manager
[virtual]
 

Reimplemented from TypedWritable.

Definition at line 764 of file textureReference.cxx.

References _egg_file, _placement, _properties, _source_texture, TextureProperties::complete_pointers(), TypedWritable::complete_pointers(), DCAST_INTO_R, and NULL.

void TextureReference::fillin DatagramIterator scan,
BamReader manager
[protected]
 

Reimplemented from TypedWritable.

Definition at line 814 of file textureReference.cxx.

References _any_uvs, _inv_tex_mat, _max_uv, _min_uv, _properties, _tex_mat, _uses_alpha, _wrap_u, _wrap_v, TextureProperties::fillin(), TypedWritable::fillin(), DatagramIterator::get_bool(), DatagramIterator::get_float64(), DatagramIterator::get_int32(), and BamReader::read_pointer().

Referenced by make_TextureReference().

void TextureReference::from_egg EggFile egg_file,
EggData data,
EggTexture egg_tex
 

Definition at line 83 of file textureReference.cxx.

References TextureProperties::_anisotropic_degree, _egg_data, _egg_file, _egg_tex, TextureProperties::_format, _inv_tex_mat, TextureProperties::_magfilter, TextureProperties::_minfilter, _properties, Palettizer::_remap_uv, _source_texture, _tex_mat, _uses_alpha, _wrap_u, _wrap_v, EggRenderMode::AlphaMode, EggRenderMode::AM_off, EggRenderMode::AM_unspecified, data, EggTexture::get_alpha_file_channel(), EggTexture::get_alpha_filename(), EggRenderMode::get_alpha_mode(), EggTexture::get_anisotropic_degree(), Filename::get_basename_wo_extension(), EggFilenameNode::get_filename(), EggTexture::get_format(), EggTexture::get_magfilter(), EggTexture::get_minfilter(), ImageFile::get_num_channels(), SourceTextureImage::get_size(), Palettizer::get_texture(), EggTexture::get_transform(), get_uv_range(), EggTexture::has_alpha_channel(), EggTexture::has_alpha_filename(), EggTexture::has_transform(), pal, texture, and ImageFile::update_properties().

TypeHandle TextureReference::get_class_type void   )  [inline, static]
 

Reimplemented from TypedObject.

Definition at line 117 of file textureReference.h.

References _type_handle.

Referenced by get_type(), and register_with_read_factory().

EggFile * TextureReference::get_egg_file  )  const
 

Definition at line 143 of file textureReference.cxx.

References _egg_file.

bool TextureReference::get_geom_uvs EggPrimitive geom,
TexCoordd geom_min_uv,
TexCoordd geom_max_uv
[private]
 

Definition at line 634 of file textureReference.cxx.

References _tex_mat, EggPrimitive::begin(), collect_uv(), EggPrimitive::end(), EggAttributes::get_uv(), EggAttributes::has_uv(), EggPrimitive::iterator, and TexCoordd.

Referenced by get_uv_range(), and update_uv_range().

const TexCoordd & TextureReference::get_max_uv  )  const
 

Definition at line 201 of file textureReference.cxx.

References _any_uvs, _max_uv, and nassertr.

Referenced by TexturePlacement::determine_size().

const TexCoordd & TextureReference::get_min_uv  )  const
 

Definition at line 189 of file textureReference.cxx.

References _any_uvs, _min_uv, and nassertr.

Referenced by TexturePlacement::determine_size().

TexturePlacement * TextureReference::get_placement  )  const
 

Definition at line 269 of file textureReference.cxx.

References _placement.

Referenced by EggFile::choose_placements(), EggFile::remove_egg(), and TexturePlacement::~TexturePlacement().

SourceTextureImage * TextureReference::get_source  )  const
 

Definition at line 154 of file textureReference.cxx.

References _source_texture.

Referenced by EggFile::build_cross_links().

TextureImage * TextureReference::get_texture  )  const
 

Definition at line 164 of file textureReference.cxx.

References _source_texture, SourceTextureImage::get_texture(), nassertr, and NULL.

Referenced by EggFile::build_cross_links(), EggFile::choose_placements(), update_egg(), and write().

virtual TypeHandle TextureReference::get_type void   )  const [inline, virtual]
 

Reimplemented from TypedWritable.

Definition at line 125 of file textureReference.h.

References get_class_type().

void TextureReference::get_uv_range EggGroupNode group,
Palettizer::RemapUV  remap
[private]
 

Definition at line 471 of file textureReference.cxx.

References _any_uvs, _egg_tex, _max_uv, _min_uv, Palettizer::_remap_char_uv, _tex_mat, EggGroupNode::begin(), collect_uv(), DCAST, DCAST_INTO_V, EggGroup::DT_none, EggGroupNode::end(), EggGroupNode::get_class_type(), EggPrimitive::get_class_type(), EggNurbsSurface::get_class_type(), EggGroup::get_class_type(), EggGroup::get_dart_type(), get_geom_uvs(), EggPrimitive::get_texture(), EggPrimitive::has_texture(), TypedObject::is_of_type(), EggGroupNode::iterator, pal, Palettizer::RU_group, Palettizer::RU_poly, TexCoordd, and translate_uv().

Referenced by from_egg().

EggTexture::WrapMode TextureReference::get_wrap_u  )  const
 

Definition at line 213 of file textureReference.cxx.

References _wrap_u.

Referenced by TexturePlacement::determine_size().

EggTexture::WrapMode TextureReference::get_wrap_v  )  const
 

Definition at line 224 of file textureReference.cxx.

References _wrap_v.

Referenced by TexturePlacement::determine_size().

bool TextureReference::has_uvs  )  const
 

Definition at line 178 of file textureReference.cxx.

References _any_uvs.

Referenced by TexturePlacement::determine_size().

void TextureReference::init_type void   )  [inline, static]
 

Reimplemented from TypedWritable.

Definition at line 120 of file textureReference.h.

References _type_handle, TypedObject::get_class_type(), TypedWritable::init_type(), and register_type().

Referenced by ConfigureFn().

TypedWritable * TextureReference::make_TextureReference const FactoryParams params  )  [static, protected]
 

Definition at line 796 of file textureReference.cxx.

References fillin(), params, and parse_params().

Referenced by register_with_read_factory().

void TextureReference::mark_egg_stale  ) 
 

Definition at line 280 of file textureReference.cxx.

References _egg_file, EggFile::mark_stale(), and NULL.

Referenced by TexturePlacement::add_egg(), TexturePlacement::mark_eggs_stale(), and TexturePlacement::remove_egg().

void TextureReference::output ostream &  out  )  const
 

Definition at line 392 of file textureReference.cxx.

References _source_texture.

void TextureReference::register_with_read_factory  )  [static]
 

Definition at line 717 of file textureReference.cxx.

References get_class_type(), BamReader::get_factory(), and make_TextureReference().

Referenced by ConfigureFn().

void TextureReference::set_placement TexturePlacement placement  ) 
 

Definition at line 236 of file textureReference.cxx.

References _placement, TexturePlacement::add_egg(), NULL, and TexturePlacement::remove_egg().

Referenced by EggFile::choose_placements(), and clear_placement().

void TextureReference::translate_geom_uvs EggPrimitive geom,
const TexCoordd trans
const [private]
 

Definition at line 657 of file textureReference.cxx.

References EggPrimitive::begin(), EggVertex::copy_grefs_from(), EggVertexPool::create_unique_vertex(), EggPrimitive::end(), EggVertex::get_pool(), EggAttributes::get_uv(), EggVertex::gref_size(), EggAttributes::has_uv(), EggPrimitive::iterator, EggPrimitive::replace(), and EggAttributes::set_uv().

Referenced by update_uv_range().

LVector2d TextureReference::translate_uv const TexCoordd min_uv,
const TexCoordd max_uv
[static, private]
 

Definition at line 705 of file textureReference.cxx.

References TexCoordd.

Referenced by get_uv_range(), and update_uv_range().

void TextureReference::update_egg  ) 
 

Definition at line 294 of file textureReference.cxx.

References _egg_data, _egg_tex, _placement, Palettizer::_remap_uv, _tex_mat, EggRenderMode::AlphaMode, EggRenderMode::AM_unspecified, TexturePlacement::compute_tex_matrix(), Filename::get_basename(), TexturePlacement::get_dest(), EggFilenameNode::get_filename(), TexturePlacement::get_image(), TexturePlacement::get_omit_reason(), get_texture(), EggTexture::has_alpha_channel(), image, nassertv, NULL, OR_none, OR_unknown, pal, EggRenderMode::set_alpha_mode(), EggFilenameNode::set_filename(), EggTexture::set_transform(), EggTexture::set_wrap_mode(), EggTexture::set_wrap_u(), EggTexture::set_wrap_v(), texture, ImageFile::update_egg_tex(), update_uv_range(), EggTexture::WM_clamp, and EggTexture::WM_unspecified.

Referenced by EggFile::update_egg().

void TextureReference::update_uv_range EggGroupNode group,
Palettizer::RemapUV  remap
[private]
 

Definition at line 560 of file textureReference.cxx.

References _egg_tex, _inv_tex_mat, Palettizer::_remap_char_uv, EggGroupNode::begin(), collect_uv(), DCAST, DCAST_INTO_V, EggGroup::DT_none, EggGroupNode::end(), EggGroupNode::get_class_type(), EggPrimitive::get_class_type(), EggNurbsSurface::get_class_type(), EggGroup::get_class_type(), EggGroup::get_dart_type(), get_geom_uvs(), EggPrimitive::get_texture(), EggPrimitive::has_texture(), TypedObject::is_of_type(), EggGroupNode::iterator, pal, Palettizer::RU_group, Palettizer::RU_never, Palettizer::RU_poly, TexCoordd, translate_geom_uvs(), and translate_uv().

Referenced by update_egg().

void TextureReference::write ostream &  out,
int  indent_level = 0
const
 

Definition at line 402 of file textureReference.cxx.

References TextureProperties::_anisotropic_degree, TextureProperties::_format, _max_uv, _min_uv, TextureProperties::_minfilter, _properties, _wrap_u, _wrap_v, EggTexture::F_unspecified, EggTexture::FT_linear_mipmap_linear, EggTexture::FT_linear_mipmap_nearest, EggTexture::FT_nearest_mipmap_linear, EggTexture::FT_nearest_mipmap_nearest, Namable::get_name(), get_texture(), indent(), TexCoordd, and EggTexture::WM_unspecified.

Referenced by EggFile::write_texture_refs().

void TextureReference::write_datagram BamWriter writer,
Datagram datagram
[virtual]
 

Reimplemented from TypedWritable.

Definition at line 730 of file textureReference.cxx.

References _any_uvs, _egg_file, _inv_tex_mat, _max_uv, _min_uv, _placement, _properties, _source_texture, _tex_mat, _uses_alpha, _wrap_u, _wrap_v, Datagram::add_bool(), Datagram::add_float64(), Datagram::add_int32(), TextureProperties::write_datagram(), TypedWritable::write_datagram(), and writer().


Member Data Documentation

bool TextureReference::_any_uvs [private]
 

Definition at line 99 of file textureReference.h.

Referenced by fillin(), get_max_uv(), get_min_uv(), get_uv_range(), has_uvs(), TextureReference(), and write_datagram().

EggData* TextureReference::_egg_data [private]
 

Definition at line 91 of file textureReference.h.

Referenced by from_egg(), and update_egg().

EggFile* TextureReference::_egg_file [private]
 

Definition at line 89 of file textureReference.h.

Referenced by complete_pointers(), from_egg(), get_egg_file(), mark_egg_stale(), TextureReference(), and write_datagram().

EggTexture* TextureReference::_egg_tex [private]
 

Definition at line 90 of file textureReference.h.

Referenced by from_egg(), get_uv_range(), TextureReference(), update_egg(), and update_uv_range().

LMatrix3d TextureReference::_inv_tex_mat [private]
 

Definition at line 93 of file textureReference.h.

Referenced by fillin(), from_egg(), TextureReference(), update_uv_range(), and write_datagram().

TexCoordd TextureReference::_max_uv [private]
 

Definition at line 100 of file textureReference.h.

Referenced by fillin(), get_max_uv(), get_uv_range(), TextureReference(), write(), and write_datagram().

TexCoordd TextureReference::_min_uv [private]
 

Definition at line 100 of file textureReference.h.

Referenced by fillin(), get_min_uv(), get_uv_range(), TextureReference(), write(), and write_datagram().

TexturePlacement* TextureReference::_placement [private]
 

Definition at line 95 of file textureReference.h.

Referenced by complete_pointers(), get_placement(), set_placement(), TextureReference(), update_egg(), and write_datagram().

TextureProperties TextureReference::_properties [private]
 

Definition at line 103 of file textureReference.h.

Referenced by apply_properties_to_source(), complete_pointers(), fillin(), from_egg(), write(), and write_datagram().

SourceTextureImage* TextureReference::_source_texture [private]
 

Definition at line 94 of file textureReference.h.

Referenced by apply_properties_to_source(), complete_pointers(), from_egg(), get_source(), get_texture(), output(), TextureReference(), and write_datagram().

LMatrix3d TextureReference::_tex_mat [private]
 

Definition at line 93 of file textureReference.h.

Referenced by fillin(), from_egg(), get_geom_uvs(), get_uv_range(), TextureReference(), update_egg(), and write_datagram().

TypeHandle TextureReference::_type_handle [static, private]
 

Reimplemented from TypedWritable.

Definition at line 43 of file textureReference.cxx.

Referenced by get_class_type(), and init_type().

bool TextureReference::_uses_alpha [private]
 

Definition at line 97 of file textureReference.h.

Referenced by fillin(), from_egg(), TextureReference(), and write_datagram().

EggTexture::WrapMode TextureReference::_wrap_u [private]
 

Definition at line 101 of file textureReference.h.

Referenced by fillin(), from_egg(), get_wrap_u(), TextureReference(), write(), and write_datagram().

EggTexture::WrapMode TextureReference::_wrap_v [private]
 

Definition at line 101 of file textureReference.h.

Referenced by fillin(), from_egg(), get_wrap_v(), TextureReference(), write(), and write_datagram().


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 01:01:30 2003 for Panda-Tool by doxygen1.3