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

TexturePlacement Class Reference

#include <texturePlacement.h>

Inheritance diagram for TexturePlacement:

TypedWritable TypedObject List of all members.

Public Member Functions

 TexturePlacement (TextureImage *texture, PaletteGroup *group)
 ~TexturePlacement ()
const string & get_name () const
TextureImageget_texture () const
const TexturePropertiesget_properties () const
PaletteGroupget_group () const
void add_egg (TextureReference *reference)
void remove_egg (TextureReference *reference)
void mark_eggs_stale ()
void set_dest (DestTextureImage *dest)
DestTextureImageget_dest () const
bool determine_size ()
bool is_size_known () const
OmitReason get_omit_reason () const
int get_x_size () const
int get_y_size () const
double get_uv_area () const
bool is_placed () const
PaletteImageget_image () const
PalettePageget_page () const
int get_placed_x () const
int get_placed_y () const
int get_placed_x_size () const
int get_placed_y_size () const
double get_placed_uv_area () const
void place_at (PaletteImage *image, int x, int y)
void force_replace ()
void omit_solitary ()
void not_solitary ()
bool intersects (int x, int y, int x_size, int y_size)
void compute_tex_matrix (LMatrix3d &transform)
void write_placed (ostream &out, int indent_level=0)
bool is_filled () const
void mark_unfilled ()
void fill_image (PNMImage &image)
void flag_error_image (PNMImage &image)
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_TexturePlacement (const FactoryParams &params)

Private Types

typedef pset< TextureReference * > References

Private Member Functions

 TexturePlacement ()
void compute_size_from_uvs (const TexCoordd &min_uv, const TexCoordd &max_uv)

Private Attributes

TextureImage_texture
PaletteGroup_group
PaletteImage_image
DestTextureImage_dest
bool _has_uvs
bool _size_known
TexturePosition _position
bool _is_filled
TexturePosition _placed
OmitReason _omit_reason
References _references
int _num_references

Static Private Attributes

TypeHandle _type_handle

Member Typedef Documentation

typedef pset<TextureReference *> TexturePlacement::References [private]
 

Definition at line 116 of file texturePlacement.h.


Constructor & Destructor Documentation

TexturePlacement::TexturePlacement  )  [private]
 

Definition at line 44 of file texturePlacement.cxx.

References _dest, _group, _has_uvs, _image, _is_filled, _omit_reason, _size_known, _texture, NULL, and OR_none.

TexturePlacement::TexturePlacement TextureImage texture,
PaletteGroup group
 

Definition at line 61 of file texturePlacement.cxx.

References _dest, _has_uvs, _image, _is_filled, _omit_reason, _size_known, NULL, OR_unknown, OR_working, and texture.

TexturePlacement::~TexturePlacement  ) 
 

Definition at line 86 of file texturePlacement.cxx.

References _group, _references, TextureReference::clear_placement(), TextureReference::get_placement(), nassertv, and PaletteGroup::unplace().


Member Function Documentation

void TexturePlacement::add_egg TextureReference reference  ) 
 

Definition at line 149 of file texturePlacement.cxx.

References _references, and TextureReference::mark_egg_stale().

Referenced by TextureReference::set_placement().

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

Reimplemented from TypedWritable.

Definition at line 978 of file texturePlacement.cxx.

References _dest, _group, _image, _num_references, _references, _texture, TypedWritable::complete_pointers(), DCAST_INTO_R, index, and NULL.

void TexturePlacement::compute_size_from_uvs const TexCoordd min_uv,
const TexCoordd max_uv
[private]
 

Definition at line 893 of file texturePlacement.cxx.

References TexturePosition::_margin, TexturePosition::_max_uv, TexturePosition::_min_uv, _position, _size_known, _texture, TexturePosition::_x_size, TexturePosition::_y_size, TextureImage::get_margin(), ImageFile::get_x_size(), ImageFile::get_y_size(), and TexCoordd.

Referenced by determine_size().

void TexturePlacement::compute_tex_matrix LMatrix3d &  transform  ) 
 

Definition at line 674 of file texturePlacement.cxx.

References _image, TexturePosition::_margin, TexturePosition::_max_uv, TexturePosition::_min_uv, _placed, TexturePosition::_x, TexturePosition::_x_size, TexturePosition::_y, TexturePosition::_y_size, ImageFile::get_x_size(), ImageFile::get_y_size(), is_placed(), nassertv, s, t, TexCoordd, and transform.

Referenced by fill_image(), and TextureReference::update_egg().

bool TexturePlacement::determine_size  ) 
 

Definition at line 230 of file texturePlacement.cxx.

References _has_uvs, _is_filled, TexturePosition::_max_uv, TexturePosition::_min_uv, _omit_reason, Palettizer::_pal_x_size, Palettizer::_pal_y_size, _placed, _position, _references, Palettizer::_round_fuzz, Palettizer::_round_unit, Palettizer::_round_uvs, _texture, TexturePosition::_wrap_u, TexturePosition::_wrap_v, TexturePosition::_x_size, TexturePosition::_y_size, compute_size_from_uvs(), force_replace(), TextureImage::get_coverage_threshold(), TextureReference::get_max_uv(), TextureReference::get_min_uv(), TextureImage::get_omit(), get_uv_area(), TextureReference::get_wrap_u(), TextureReference::get_wrap_v(), TextureReference::has_uvs(), is_placed(), ImageFile::is_size_known(), mark_eggs_stale(), n, nassertr, OR_coverage, OR_omitted, OR_size, OR_unknown, OR_working, pal, TexCoordd, EggTexture::WM_clamp, EggTexture::WM_repeat, and x.

Referenced by TextureImage::determine_placement_size(), and PaletteGroup::update_unknown_textures().

void TexturePlacement::fill_image PNMImage image  ) 
 

Definition at line 771 of file texturePlacement.cxx.

References _image, _is_filled, _placed, _texture, TexturePosition::_wrap_u, TexturePosition::_wrap_v, TexturePosition::_x, TexturePosition::_x_size, TexturePosition::_y, TexturePosition::_y_size, alpha, compute_tex_matrix(), flag_error_image(), PNMImage::get_alpha(), PNMImageHeader::get_maxval(), PNMImageHeader::get_num_channels(), ImageFile::get_x_size(), PNMImage::get_xel(), ImageFile::get_y_size(), PNMImageHeader::has_alpha(), image, is_placed(), PNMImage::is_valid(), nassertv, PNMImage::quick_filter_from(), TextureImage::read_source_image(), TexCoordd, transform, EggTexture::WM_clamp, x, and y.

Referenced by PaletteImage::get_image(), and PaletteImage::update_image().

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

Reimplemented from TypedWritable.

Definition at line 1039 of file texturePlacement.cxx.

References _has_uvs, _is_filled, _num_references, _omit_reason, _placed, _position, _size_known, TexturePosition::fillin(), TypedWritable::fillin(), DatagramIterator::get_bool(), DatagramIterator::get_int32(), BamReader::read_pointer(), and BamReader::read_pointers().

Referenced by make_TexturePlacement().

void TexturePlacement::flag_error_image PNMImage image  ) 
 

Definition at line 868 of file texturePlacement.cxx.

References _placed, TexturePosition::_x, TexturePosition::_x_size, TexturePosition::_y, TexturePosition::_y_size, image, is_placed(), nassertv, x, and y.

Referenced by fill_image().

void TexturePlacement::force_replace  ) 
 

Definition at line 599 of file texturePlacement.cxx.

References _image, _omit_reason, mark_eggs_stale(), NULL, OR_none, OR_working, and PaletteImage::unplace().

Referenced by determine_size(), and PaletteImage::reset_image().

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

Reimplemented from TypedObject.

Definition at line 136 of file texturePlacement.h.

References _type_handle.

Referenced by get_type(), and register_with_read_factory().

DestTextureImage * TexturePlacement::get_dest  )  const
 

Definition at line 212 of file texturePlacement.cxx.

References _dest.

Referenced by TextureMemoryCounter::add_placement(), TextureReference::update_egg(), and TextureImage::write_scale_info().

PaletteGroup * TexturePlacement::get_group  )  const
 

Definition at line 138 of file texturePlacement.cxx.

References _group.

Referenced by EggFile::choose_placements(), DestTextureImage::DestTextureImage(), and PaletteGroup::unplace().

PaletteImage * TexturePlacement::get_image  )  const
 

Definition at line 486 of file texturePlacement.cxx.

References _image, is_placed(), nassertr, and NULL.

Referenced by TextureMemoryCounter::add_placement(), PalettePage::unplace(), PaletteImage::unplace(), TextureReference::update_egg(), and TextureImage::write_scale_info().

const string & TexturePlacement::get_name  )  const
 

Definition at line 108 of file texturePlacement.cxx.

References _texture, and Namable::get_name().

OmitReason TexturePlacement::get_omit_reason  )  const
 

Definition at line 416 of file texturePlacement.cxx.

References _omit_reason.

Referenced by TextureMemoryCounter::add_placement(), PaletteImage::check_solitary(), TextureImage::copy_unplaced(), PalettePage::place(), PaletteGroup::place_all(), TextureReference::update_egg(), PaletteGroup::write_image_info(), and TextureImage::write_scale_info().

PalettePage * TexturePlacement::get_page  )  const
 

Definition at line 498 of file texturePlacement.cxx.

References _image, PaletteImage::get_page(), is_placed(), nassertr, and NULL.

Referenced by PalettePage::unplace(), and PaletteGroup::unplace().

double TexturePlacement::get_placed_uv_area  )  const
 

Definition at line 563 of file texturePlacement.cxx.

References TexturePosition::_max_uv, TexturePosition::_min_uv, _placed, is_placed(), nassertr, and TexCoordd.

Referenced by write_placed().

int TexturePlacement::get_placed_x  )  const
 

Definition at line 511 of file texturePlacement.cxx.

References _placed, TexturePosition::_x, is_placed(), and nassertr.

Referenced by PaletteImage::ClearedRegion::ClearedRegion(), PaletteImage::find_hole(), and write_placed().

int TexturePlacement::get_placed_x_size  )  const
 

Definition at line 537 of file texturePlacement.cxx.

References _placed, TexturePosition::_x_size, is_placed(), and nassertr.

Referenced by TextureMemoryCounter::add_placement(), PaletteImage::ClearedRegion::ClearedRegion(), PaletteImage::count_coverage(), PaletteImage::count_utilization(), PaletteImage::find_hole(), and write_placed().

int TexturePlacement::get_placed_y  )  const
 

Definition at line 524 of file texturePlacement.cxx.

References _placed, TexturePosition::_y, is_placed(), and nassertr.

Referenced by PaletteImage::ClearedRegion::ClearedRegion(), PaletteImage::find_hole(), and write_placed().

int TexturePlacement::get_placed_y_size  )  const
 

Definition at line 550 of file texturePlacement.cxx.

References _placed, TexturePosition::_y_size, is_placed(), and nassertr.

Referenced by TextureMemoryCounter::add_placement(), PaletteImage::ClearedRegion::ClearedRegion(), PaletteImage::count_coverage(), PaletteImage::count_utilization(), PaletteImage::find_hole(), and write_placed().

const TextureProperties & TexturePlacement::get_properties  )  const
 

Definition at line 128 of file texturePlacement.cxx.

References _texture, and ImageFile::get_properties().

Referenced by PaletteGroup::place_all().

TextureImage * TexturePlacement::get_texture  )  const
 

Definition at line 118 of file texturePlacement.cxx.

References _texture.

Referenced by TextureMemoryCounter::add_placement(), PaletteImage::count_coverage(), DestTextureImage::DestTextureImage(), PaletteImage::update_image(), PaletteGroup::update_unknown_textures(), PaletteGroup::write_image_info(), and write_placed().

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

Reimplemented from TypedWritable.

Definition at line 144 of file texturePlacement.h.

References get_class_type().

double TexturePlacement::get_uv_area  )  const
 

Definition at line 457 of file texturePlacement.cxx.

References _has_uvs, TexturePosition::_max_uv, TexturePosition::_min_uv, _position, and TexCoordd.

Referenced by determine_size(), and PaletteGroup::write_image_info().

int TexturePlacement::get_x_size  )  const
 

Definition at line 429 of file texturePlacement.cxx.

References _position, _size_known, TexturePosition::_x_size, and nassertr.

Referenced by PaletteImage::place(), and PaletteGroup::write_image_info().

int TexturePlacement::get_y_size  )  const
 

Definition at line 443 of file texturePlacement.cxx.

References _position, _size_known, TexturePosition::_y_size, and nassertr.

Referenced by PaletteImage::place(), and PaletteGroup::write_image_info().

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

Reimplemented from TypedWritable.

Definition at line 139 of file texturePlacement.h.

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

Referenced by ConfigureFn().

bool TexturePlacement::intersects int  x,
int  y,
int  x_size,
int  y_size
 

Definition at line 653 of file texturePlacement.cxx.

References _placed, TexturePosition::_x, TexturePosition::_x_size, TexturePosition::_y, TexturePosition::_y_size, is_placed(), nassertr, x, and y.

Referenced by PaletteImage::find_overlap().

bool TexturePlacement::is_filled  )  const
 

Definition at line 748 of file texturePlacement.cxx.

References _is_filled.

Referenced by PaletteImage::update_image().

bool TexturePlacement::is_placed  )  const
 

Definition at line 475 of file texturePlacement.cxx.

References _image, and NULL.

Referenced by compute_tex_matrix(), determine_size(), fill_image(), PaletteImage::find_overlap(), flag_error_image(), get_image(), get_page(), get_placed_uv_area(), get_placed_x(), get_placed_x_size(), get_placed_y(), get_placed_y_size(), intersects(), not_solitary(), omit_solitary(), PaletteImage::place(), place_at(), PalettePage::unplace(), PaletteImage::unplace(), PaletteGroup::unplace(), and write_placed().

bool TexturePlacement::is_size_known  )  const
 

Definition at line 405 of file texturePlacement.cxx.

References _size_known.

Referenced by PaletteImage::place(), and PaletteGroup::update_unknown_textures().

TypedWritable * TexturePlacement::make_TexturePlacement const FactoryParams params  )  [static, protected]
 

Definition at line 1021 of file texturePlacement.cxx.

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

Referenced by register_with_read_factory().

void TexturePlacement::mark_eggs_stale  ) 
 

Definition at line 185 of file texturePlacement.cxx.

References _references, and TextureReference::mark_egg_stale().

Referenced by determine_size(), force_replace(), not_solitary(), and omit_solitary().

void TexturePlacement::mark_unfilled  ) 
 

Definition at line 759 of file texturePlacement.cxx.

References _is_filled.

Referenced by PaletteImage::update_image().

void TexturePlacement::not_solitary  ) 
 

Definition at line 636 of file texturePlacement.cxx.

References _omit_reason, is_placed(), mark_eggs_stale(), nassertv, and OR_none.

Referenced by PaletteImage::check_solitary().

void TexturePlacement::omit_solitary  ) 
 

Definition at line 621 of file texturePlacement.cxx.

References _omit_reason, is_placed(), mark_eggs_stale(), nassertv, and OR_solitary.

Referenced by PaletteImage::check_solitary().

void TexturePlacement::place_at PaletteImage image,
int  x,
int  y
 

Definition at line 578 of file texturePlacement.cxx.

References _image, _is_filled, _omit_reason, _placed, _position, _size_known, TexturePosition::_x, TexturePosition::_y, image, is_placed(), nassertv, OR_none, x, and y.

Referenced by PaletteImage::place().

void TexturePlacement::register_with_read_factory  )  [static]
 

Definition at line 932 of file texturePlacement.cxx.

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

Referenced by ConfigureFn().

void TexturePlacement::remove_egg TextureReference reference  ) 
 

Definition at line 168 of file texturePlacement.cxx.

References _references, and TextureReference::mark_egg_stale().

Referenced by EggFile::remove_egg(), and TextureReference::set_placement().

void TexturePlacement::set_dest DestTextureImage dest  ) 
 

Definition at line 201 of file texturePlacement.cxx.

References _dest.

Referenced by TextureImage::copy_unplaced().

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

Reimplemented from TypedWritable.

Definition at line 945 of file texturePlacement.cxx.

References _dest, _group, _has_uvs, _image, _is_filled, _omit_reason, _placed, _position, _references, _size_known, _texture, Datagram::add_bool(), Datagram::add_int32(), TexturePosition::write_datagram(), TypedWritable::write_datagram(), and writer().

void TexturePlacement::write_placed ostream &  out,
int  indent_level = 0
 

Definition at line 715 of file texturePlacement.cxx.

References _placed, TexturePosition::_wrap_u, TexturePosition::_wrap_v, Namable::get_name(), get_placed_uv_area(), get_placed_x(), get_placed_x_size(), get_placed_y(), get_placed_y_size(), get_texture(), indent(), is_placed(), and EggTexture::WM_unspecified.

Referenced by PaletteImage::write_placements().


Member Data Documentation

DestTextureImage* TexturePlacement::_dest [private]
 

Definition at line 106 of file texturePlacement.h.

Referenced by complete_pointers(), get_dest(), set_dest(), TexturePlacement(), and write_datagram().

PaletteGroup* TexturePlacement::_group [private]
 

Definition at line 104 of file texturePlacement.h.

Referenced by complete_pointers(), get_group(), TexturePlacement(), write_datagram(), and ~TexturePlacement().

bool TexturePlacement::_has_uvs [private]
 

Definition at line 108 of file texturePlacement.h.

Referenced by determine_size(), fillin(), get_uv_area(), TexturePlacement(), and write_datagram().

PaletteImage* TexturePlacement::_image [private]
 

Definition at line 105 of file texturePlacement.h.

Referenced by complete_pointers(), compute_tex_matrix(), fill_image(), force_replace(), get_image(), get_page(), is_placed(), place_at(), TexturePlacement(), and write_datagram().

bool TexturePlacement::_is_filled [private]
 

Definition at line 112 of file texturePlacement.h.

Referenced by determine_size(), fill_image(), fillin(), is_filled(), mark_unfilled(), place_at(), TexturePlacement(), and write_datagram().

int TexturePlacement::_num_references [private]
 

Definition at line 133 of file texturePlacement.h.

Referenced by complete_pointers(), and fillin().

OmitReason TexturePlacement::_omit_reason [private]
 

Definition at line 114 of file texturePlacement.h.

Referenced by determine_size(), fillin(), force_replace(), get_omit_reason(), not_solitary(), omit_solitary(), place_at(), TexturePlacement(), and write_datagram().

TexturePosition TexturePlacement::_placed [private]
 

Definition at line 113 of file texturePlacement.h.

Referenced by compute_tex_matrix(), determine_size(), fill_image(), fillin(), flag_error_image(), get_placed_uv_area(), get_placed_x(), get_placed_x_size(), get_placed_y(), get_placed_y_size(), intersects(), place_at(), write_datagram(), and write_placed().

TexturePosition TexturePlacement::_position [private]
 

Definition at line 110 of file texturePlacement.h.

Referenced by compute_size_from_uvs(), determine_size(), fillin(), get_uv_area(), get_x_size(), get_y_size(), place_at(), and write_datagram().

References TexturePlacement::_references [private]
 

Definition at line 117 of file texturePlacement.h.

Referenced by add_egg(), complete_pointers(), determine_size(), mark_eggs_stale(), remove_egg(), write_datagram(), and ~TexturePlacement().

bool TexturePlacement::_size_known [private]
 

Definition at line 109 of file texturePlacement.h.

Referenced by compute_size_from_uvs(), fillin(), get_x_size(), get_y_size(), is_size_known(), place_at(), TexturePlacement(), and write_datagram().

TextureImage* TexturePlacement::_texture [private]
 

Definition at line 103 of file texturePlacement.h.

Referenced by complete_pointers(), compute_size_from_uvs(), determine_size(), fill_image(), get_name(), get_properties(), get_texture(), TexturePlacement(), and write_datagram().

TypeHandle TexturePlacement::_type_handle [static, private]
 

Reimplemented from TypedWritable.

Definition at line 35 of file texturePlacement.cxx.

Referenced by get_class_type(), and init_type().


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