Panda3D
|
This corresponds to a particular assignment of a TextureImage with a PaletteGroup, and specifically describes which PaletteImage (if any), and where on the PaletteImage, the TextureImage has been assigned to. More...
#include "texturePlacement.h"
Public Types | |
typedef pvector< TextureImage * > | TextureSwaps |
Public Member Functions | |
TexturePlacement (TextureImage *texture, PaletteGroup *group) | |
void | add_egg (TextureReference *reference) |
Records the fact that a particular egg file is using this particular TexturePlacement. | |
virtual ReferenceCount * | as_reference_count () |
Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
virtual int | complete_pointers (TypedWritable **p_list, BamReader *manager) |
Called after the object is otherwise completely read from a Bam file, this function's job is to store the pointers that were retrieved from the Bam file for each pointer object written. | |
void | compute_tex_matrix (LMatrix3d &transform) |
Stores in the indicated matrix the appropriate texture matrix transform for the new placement of the texture. | |
bool | determine_size () |
Attempts to determine the appropriate size of the texture for the given placement. | |
string | encode_to_bam_stream () const |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string. | |
bool | encode_to_bam_stream (string &data, BamWriter *writer=NULL) const |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. | |
void | fill_image (PNMImage &image) |
Fills in the rectangle of the palette image represented by the texture placement with the image pixels. | |
void | fill_swapped_image (PNMImage &image, int index) |
Fills in the rectangle of the swapped palette image represented by the texture placement with the image pixels. | |
virtual void | finalize (BamReader *manager) |
Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed. | |
void | flag_error_image (PNMImage &image) |
Sets the rectangle of the palette image represented by the texture placement to red, to represent a missing texture. | |
virtual TypeHandle | force_init_type () |
void | force_replace () |
Removes the texture from its particular PaletteImage, but does not remove it from the PaletteGroup. | |
UpdateSeq | get_bam_modified () const |
Returns the current bam_modified counter. | |
int | get_best_parent_from_Set (const std::set< int > &) const |
DestTextureImage * | get_dest () const |
Returns the DestTextureImage that corresponds to this texture as it was copied to the install directory. | |
PaletteGroup * | get_group () const |
Returns the group that this placement represents. | |
PaletteImage * | get_image () const |
Returns the particular PaletteImage on which the texture has been placed. | |
const string & | get_name () const |
Returns the name of the texture that this placement represents. | |
OmitReason | get_omit_reason () const |
Returns the reason the texture has been omitted from a palette image, or OR_none if it has not. | |
PalettePage * | get_page () const |
Returns the particular PalettePage on which the texture has been placed. | |
double | get_placed_uv_area () const |
Returns the total area of the rectangle occupied by the UV minmax box, as it has been placed. | |
int | get_placed_x () const |
Returns the X pixel at which the texture has been placed within its PaletteImage. | |
int | get_placed_x_size () const |
Returns the size in the X dimension, in pixels, of the texture image as it has been placed within the palette. | |
int | get_placed_y () const |
Returns the Y pixel at which the texture has been placed within its PaletteImage. | |
int | get_placed_y_size () const |
Returns the size in the Y dimension, in pixels, of the texture image as it has been placed within the palette. | |
const TextureProperties & | get_properties () const |
Returns the grouping properties of the image. | |
TextureImage * | get_texture () const |
Returns the texture that this placement represents. | |
virtual TypeHandle | get_type () const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
double | get_uv_area () const |
Returns the total area of the rectangle occupied by the UV minmax box, in UV coordinates. | |
int | get_x_size () const |
Returns the size in the X dimension, in pixels, of the texture image as it must appear in the palette. | |
int | get_y_size () const |
Returns the size in the Y dimension, in pixels, of the texture image as it must appear in the palette. | |
bool | intersects (int x, int y, int x_size, int y_size) |
Returns true if the particular position this texture has been assigned to overlaps the rectangle whose top left corner is at x, y and whose size is given by x_size, y_size, or false otherwise. | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. | |
bool | is_filled () const |
Returns true if the texture has been filled (i.e. | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. | |
bool | is_placed () const |
Returns true if the texture has been placed on a palette image, false otherwise. | |
bool | is_size_known () const |
Returns true if the texture's size is known, false otherwise. | |
void | mark_bam_modified () |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. | |
void | mark_eggs_stale () |
Marks all the egg files that reference this placement stale. | |
void | mark_unfilled () |
Marks the texture as unfilled, so that it will need to be copied into the palette image again. | |
void | not_solitary () |
Indicates that the texture, formerly indicated as solitary, is now no longer. | |
void | omit_solitary () |
Sets the omit reason (returned by get_omit()) to OR_solitary, indicating that the palettized version of the texture should not be used because it is the only texture on a PaletteImage. | |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr) |
void | operator delete[] (void *, void *) |
void | operator delete[] (void *ptr) |
void * | operator new (size_t size) |
void * | operator new (size_t size, void *ptr) |
void * | operator new[] (size_t size) |
void * | operator new[] (size_t size, void *ptr) |
void | place_at (PaletteImage *image, int x, int y) |
Assigns the texture to a particular position within the indicated PaletteImage. | |
void | remove_egg (TextureReference *reference) |
Notes that a particular egg file is no longer using this particular TexturePlacement. | |
virtual bool | require_fully_complete () const |
Some objects require all of their nested pointers to have been completed before the objects themselves can be completed. | |
void | set_dest (DestTextureImage *dest) |
Sets the DestTextureImage that corresponds to this texture as it was copied to the install directory. | |
virtual void | update_bam_nested (BamWriter *manager) |
Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates. | |
virtual void | write_datagram (BamWriter *writer, Datagram &datagram) |
Fills the indicated datagram up with a binary representation of the current object, in preparation for writing to a Bam file. | |
void | write_placed (ostream &out, int indent_level=0) |
Writes the placement position information on a line by itself. | |
Static Public Member Functions | |
static bool | decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, const string &data, BamReader *reader=NULL) |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string. | |
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. | |
static void | register_with_read_factory () |
Registers the current object as something that can be read from a Bam file. | |
Public Attributes | |
TextureSwaps | _textureSwaps |
Static Public Attributes | |
static TypedWritable *const | Null = (TypedWritable*)0L |
Protected Member Functions | |
void | fillin (DatagramIterator &scan, BamReader *manager) |
Reads the binary data from the given datagram iterator, which was written by a previous call to write_datagram(). | |
Static Protected Member Functions | |
static TypedWritable * | make_TexturePlacement (const FactoryParams ¶ms) |
This method is called by the BamReader when an object of this type is encountered in a Bam file; it should allocate and return a new object with all the data read. |
This corresponds to a particular assignment of a TextureImage with a PaletteGroup, and specifically describes which PaletteImage (if any), and where on the PaletteImage, the TextureImage has been assigned to.
Definition at line 45 of file texturePlacement.h.
void TexturePlacement::add_egg | ( | TextureReference * | reference | ) |
Records the fact that a particular egg file is using this particular TexturePlacement.
Definition at line 145 of file texturePlacement.cxx.
References TextureReference::mark_egg_stale().
Referenced by TextureReference::set_placement().
ReferenceCount * TypedWritable::as_reference_count | ( | ) | [virtual, inherited] |
Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type.
Reimplemented in PandaNode, and TypedWritableReferenceCount.
Definition at line 155 of file typedWritable.cxx.
Referenced by BamReader::change_pointer(), BamReader::register_change_this(), and BamReader::resolve().
TypedObject * TypedObject::as_typed_object | ( | ) | [inline, inherited] |
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition at line 99 of file typedObject.I.
const TypedObject * TypedObject::as_typed_object | ( | ) | const [inline, inherited] |
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition at line 110 of file typedObject.I.
int TexturePlacement::complete_pointers | ( | TypedWritable ** | p_list, |
BamReader * | manager | ||
) | [virtual] |
Called after the object is otherwise completely read from a Bam file, this function's job is to store the pointers that were retrieved from the Bam file for each pointer object written.
The return value is the number of pointers processed from the list.
Reimplemented from TypedWritable.
Definition at line 1127 of file texturePlacement.cxx.
void TexturePlacement::compute_tex_matrix | ( | LMatrix3d & | transform | ) |
Stores in the indicated matrix the appropriate texture matrix transform for the new placement of the texture.
Definition at line 700 of file texturePlacement.cxx.
References ImageFile::get_x_size(), ImageFile::get_y_size(), LMatrix3d::ident_mat(), is_placed(), LMatrix3d::scale_mat(), and LMatrix3d::translate_mat().
Referenced by fill_image(), fill_swapped_image(), and TextureReference::update_egg().
bool TypedWritable::decode_raw_from_bam_stream | ( | TypedWritable *& | ptr, |
ReferenceCount *& | ref_ptr, | ||
const string & | data, | ||
BamReader * | reader = NULL |
||
) | [static, inherited] |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string.
Returns true on success, false on on error.
This variant sets the TypedWritable and ReferenceCount pointers separately; both are pointers to the same object. The reference count is not incremented; it is the caller's responsibility to manage the reference count.
Note that this method cannot be used to retrieve objects that do not inherit from ReferenceCount, because these objects cannot persist beyond the lifetime of the BamReader that reads them. To retrieve these objects from a bam stream, you must construct a BamReader directly.
If you happen to know that the particular object in question inherits from TypedWritableReferenceCount or PandaNode, consider calling the variant of decode_from_bam_stream() defined for those methods, which presents a simpler interface.
Definition at line 353 of file typedWritable.cxx.
References BamReader::init(), DatagramInputFile::open(), DatagramInputFile::read_header(), BamReader::read_object(), ReferenceCount::ref(), BamReader::resolve(), BamReader::set_source(), and ReferenceCount::unref().
bool TexturePlacement::determine_size | ( | ) |
Attempts to determine the appropriate size of the texture for the given placement.
This is based on the UV range of the egg files that reference the texture. Returns true on success, or false if the texture size cannot be determined (e.g. the texture file is unknown).
After this returns true, get_x_size() and get_y_size() may safely be called.
Definition at line 226 of file texturePlacement.cxx.
References force_replace(), TextureImage::get_coverage_threshold(), TextureReference::get_max_uv(), TextureReference::get_min_uv(), TextureImage::get_omit(), TextureImage::get_txa_wrap_u(), TextureImage::get_txa_wrap_v(), get_uv_area(), TextureReference::get_wrap_u(), TextureReference::get_wrap_v(), TextureReference::has_uvs(), PaletteGroup::is_none_texture_swap(), is_placed(), ImageFile::is_size_known(), and mark_eggs_stale().
Referenced by TextureImage::determine_placement_size(), and PaletteGroup::update_unknown_textures().
bool TypedWritable::encode_to_bam_stream | ( | string & | data, |
BamWriter * | writer = NULL |
||
) | const [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
Returns true on success, false on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
Definition at line 283 of file typedWritable.cxx.
References BamWriter::init(), DatagramOutputFile::open(), BamWriter::set_target(), DatagramOutputFile::write_header(), and BamWriter::write_object().
string TypedWritable::encode_to_bam_stream | ( | ) | const [inline, inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.
Returns empty string on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
Definition at line 86 of file typedWritable.I.
void TexturePlacement::fill_image | ( | PNMImage & | image | ) |
Fills in the rectangle of the palette image represented by the texture placement with the image pixels.
Definition at line 797 of file texturePlacement.cxx.
References compute_tex_matrix(), flag_error_image(), PNMImageHeader::get_maxval(), PNMImageHeader::get_num_channels(), ImageFile::get_x_size(), ImageFile::get_y_size(), PNMImageHeader::has_alpha(), is_placed(), PNMImage::is_valid(), PNMImage::quick_filter_from(), TextureImage::read_source_image(), TextureImage::release_source_image(), PNMImage::set_alpha(), and PNMImage::set_xel().
Referenced by PaletteImage::update_image().
void TexturePlacement::fill_swapped_image | ( | PNMImage & | image, |
int | index | ||
) |
Fills in the rectangle of the swapped palette image represented by the texture placement with the image pixels.
Definition at line 897 of file texturePlacement.cxx.
References compute_tex_matrix(), flag_error_image(), PNMImageHeader::get_maxval(), PNMImageHeader::get_num_channels(), ImageFile::get_x_size(), ImageFile::get_y_size(), PNMImageHeader::has_alpha(), is_placed(), PNMImage::is_valid(), PNMImage::quick_filter_from(), TextureImage::read_source_image(), TextureImage::release_source_image(), PNMImage::set_alpha(), and PNMImage::set_xel().
Referenced by PaletteImage::update_image().
void TexturePlacement::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [protected, virtual] |
Reads the binary data from the given datagram iterator, which was written by a previous call to write_datagram().
Reimplemented from TypedWritable.
Definition at line 1195 of file texturePlacement.cxx.
References TexturePosition::fillin(), DatagramIterator::get_bool(), DatagramIterator::get_int32(), BamReader::read_pointer(), and BamReader::read_pointers().
Referenced by make_TexturePlacement().
void TypedWritable::finalize | ( | BamReader * | manager | ) | [virtual, inherited] |
Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.
Reimplemented in PartBundle, Geom, GeomPrimitive, GeomVertexArrayData, GeomVertexArrayFormat, GeomVertexData, InternalName, GeomNode, LightAttrib, RenderAttrib, RenderEffect, RenderEffects, RenderState, PaletteGroup, and Palettizer.
Definition at line 145 of file typedWritable.cxx.
Referenced by BamReader::finalize_now().
void TexturePlacement::flag_error_image | ( | PNMImage & | image | ) |
Sets the rectangle of the palette image represented by the texture placement to red, to represent a missing texture.
Definition at line 999 of file texturePlacement.cxx.
References PNMImageHeader::has_alpha(), is_placed(), PNMImage::set_alpha_val(), and PNMImage::set_xel_val().
Referenced by fill_image(), and fill_swapped_image().
void TexturePlacement::force_replace | ( | ) |
Removes the texture from its particular PaletteImage, but does not remove it from the PaletteGroup.
It will be re-placed when the PaletteGroup::place_all() is called.
Definition at line 625 of file texturePlacement.cxx.
References mark_eggs_stale(), and PaletteImage::unplace().
Referenced by determine_size(), and PaletteImage::reset_image().
UpdateSeq TypedWritable::get_bam_modified | ( | ) | const [inline, inherited] |
Returns the current bam_modified counter.
This counter is normally incremented automatically whenever the object is modified.
Definition at line 66 of file typedWritable.I.
Referenced by BamWriter::consider_update(), and BamWriter::write_pointer().
DestTextureImage * TexturePlacement::get_dest | ( | ) | const |
Returns the DestTextureImage that corresponds to this texture as it was copied to the install directory.
Definition at line 208 of file texturePlacement.cxx.
Referenced by TextureMemoryCounter::add_placement(), TextureReference::update_egg(), and TextureImage::write_scale_info().
PaletteGroup * TexturePlacement::get_group | ( | ) | const |
Returns the group that this placement represents.
Definition at line 134 of file texturePlacement.cxx.
Referenced by EggFile::choose_placements(), and PaletteGroup::unplace().
PaletteImage * TexturePlacement::get_image | ( | ) | const |
Returns the particular PaletteImage on which the texture has been placed.
Definition at line 512 of file texturePlacement.cxx.
References is_placed().
Referenced by TextureMemoryCounter::add_placement(), PalettePage::unplace(), PaletteImage::unplace(), TextureReference::update_egg(), and TextureImage::write_scale_info().
const string & TexturePlacement::get_name | ( | ) | const |
Returns the name of the texture that this placement represents.
Definition at line 104 of file texturePlacement.cxx.
Referenced by SortPlacementBySize::operator()().
OmitReason TexturePlacement::get_omit_reason | ( | ) | const |
Returns the reason the texture has been omitted from a palette image, or OR_none if it has not.
Definition at line 442 of file texturePlacement.cxx.
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 |
Returns the particular PalettePage on which the texture has been placed.
Definition at line 524 of file texturePlacement.cxx.
References PaletteImage::get_page(), and is_placed().
Referenced by PalettePage::unplace(), and PaletteGroup::unplace().
double TexturePlacement::get_placed_uv_area | ( | ) | const |
Returns the total area of the rectangle occupied by the UV minmax box, as it has been placed.
See also get_uv_area().
Definition at line 589 of file texturePlacement.cxx.
References is_placed().
Referenced by write_placed().
int TexturePlacement::get_placed_x | ( | ) | const |
Returns the X pixel at which the texture has been placed within its PaletteImage.
It is an error to call this unless is_placed() returns true.
Definition at line 537 of file texturePlacement.cxx.
References is_placed().
Referenced by write_placed().
int TexturePlacement::get_placed_x_size | ( | ) | const |
Returns the size in the X dimension, in pixels, of the texture image as it has been placed within the palette.
Definition at line 563 of file texturePlacement.cxx.
References is_placed().
Referenced by TextureMemoryCounter::add_placement(), PaletteImage::count_coverage(), PaletteImage::count_utilization(), and write_placed().
int TexturePlacement::get_placed_y | ( | ) | const |
Returns the Y pixel at which the texture has been placed within its PaletteImage.
It is an error to call this unless is_placed() returns true.
Definition at line 550 of file texturePlacement.cxx.
References is_placed().
Referenced by write_placed().
int TexturePlacement::get_placed_y_size | ( | ) | const |
Returns the size in the Y dimension, in pixels, of the texture image as it has been placed within the palette.
Definition at line 576 of file texturePlacement.cxx.
References is_placed().
Referenced by TextureMemoryCounter::add_placement(), PaletteImage::count_coverage(), PaletteImage::count_utilization(), and write_placed().
const TextureProperties & TexturePlacement::get_properties | ( | ) | const |
Returns the grouping properties of the image.
Definition at line 124 of file texturePlacement.cxx.
References ImageFile::get_properties().
Referenced by PaletteGroup::place_all().
TextureImage * TexturePlacement::get_texture | ( | ) | const |
Returns the texture that this placement represents.
Definition at line 114 of file texturePlacement.cxx.
Referenced by TextureMemoryCounter::add_placement(), PaletteImage::count_coverage(), PaletteImage::update_image(), PaletteGroup::update_unknown_textures(), PaletteGroup::write_image_info(), and write_placed().
int TypedObject::get_type_index | ( | ) | const [inline, inherited] |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
This is equivalent to get_type().get_index().
Definition at line 52 of file typedObject.I.
References TypeHandle::get_index().
double TexturePlacement::get_uv_area | ( | ) | const |
Returns the total area of the rectangle occupied by the UV minmax box, in UV coordinates.
1.0 is the entire texture; values greater than 1 imply the texture repeats.
Definition at line 483 of file texturePlacement.cxx.
Referenced by determine_size(), and PaletteGroup::write_image_info().
int TexturePlacement::get_x_size | ( | ) | const |
Returns the size in the X dimension, in pixels, of the texture image as it must appear in the palette.
This accounts for any growing or shrinking of the texture due to the UV coordinate range.
Definition at line 455 of file texturePlacement.cxx.
Referenced by SortPlacementBySize::operator()(), PaletteImage::place(), and PaletteGroup::write_image_info().
int TexturePlacement::get_y_size | ( | ) | const |
Returns the size in the Y dimension, in pixels, of the texture image as it must appear in the palette.
This accounts for any growing or shrinking of the texture due to the UV coordinate range.
Definition at line 469 of file texturePlacement.cxx.
Referenced by SortPlacementBySize::operator()(), PaletteImage::place(), and PaletteGroup::write_image_info().
static void TexturePlacement::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from TypedWritable.
Definition at line 141 of file texturePlacement.h.
bool TexturePlacement::intersects | ( | int | x, |
int | y, | ||
int | x_size, | ||
int | y_size | ||
) |
Returns true if the particular position this texture has been assigned to overlaps the rectangle whose top left corner is at x, y and whose size is given by x_size, y_size, or false otherwise.
Definition at line 679 of file texturePlacement.cxx.
References is_placed().
bool TypedObject::is_exact_type | ( | TypeHandle | handle | ) | const [inline, inherited] |
Returns true if the current object is the indicated type exactly.
Definition at line 74 of file typedObject.I.
References TypeHandle::get_name().
Referenced by GraphicsStateGuardian::async_reload_texture(), PortalNode::combine_with(), PandaNode::combine_with(), GeomNode::combine_with(), CollisionNode::combine_with(), Character::combine_with(), PGItem::cull_callback(), FactoryParams::get_param_of_type(), CollisionHandlerPusher::handle_entries(), SceneGraphReducer::r_flatten(), ConnectionWriter::send(), FltToEggLevelState::set_transform(), and VirtualFileSystem::unmount().
bool TexturePlacement::is_filled | ( | ) | const |
Returns true if the texture has been filled (i.e.
fill_image() has been called) since it was placed.
Definition at line 774 of file texturePlacement.cxx.
Referenced by PaletteImage::update_image().
bool TypedObject::is_of_type | ( | TypeHandle | handle | ) | const [inline, inherited] |
Returns true if the current object is or derives from the indicated type.
Definition at line 63 of file typedObject.I.
References TypeHandle::is_derived_from().
Referenced by EggSliderData::add_back_pointer(), EggJointData::add_back_pointer(), CIntervalManager::add_c_interval(), XFileNode::add_child(), CollisionTraverser::add_collider(), CollisionHandlerPhysical::add_collider(), EggXfmSAnim::add_data(), CharacterJointBundle::add_node(), NonlinearImager::add_screen(), EggGroupNode::apply_first_attribute(), EggGroupNode::apply_last_attribute(), DeferredNodeProperty::apply_to_node(), RecorderController::begin_playback(), NodePath::clear_clip_plane(), EggGroupNode::clear_connected_shading(), NodePath::clear_light(), EggBase::convert_paths(), NodePath::decode_from_bam_stream(), VrpnClient::disconnect_device(), PhysicsManager::do_physics(), GraphicsStateGuardian::fetch_specified_part(), EggRenderState::fill_state(), AnimBundleNode::find_anim_bundle(), EggGroupNode::find_coordsys_entry(), XFile::find_data_object(), Character::find_joint(), EggGroupNode::find_materials(), Character::find_slider(), XFile::find_template(), EggGroupNode::find_textures(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggGroupNode::force_filenames(), EggJointData::force_initial_rest_frame(), WindowFramework::get_aspect_2d(), EggPoolUniquifier::get_category(), EggGroupUniquifier::get_category(), EggGroupNode::get_connected_shading(), PandaFramework::get_mouse(), FactoryParams::get_param_of_type(), EggGroupNode::has_absolute_pathnames(), NodePath::has_clip_plane(), NodePath::has_clip_plane_off(), NodePath::has_light(), PandaFramework::hide_collision_solids(), x11GraphicsWindow::open_window(), eglGraphicsWindow::open_window(), EggNode::parse_egg(), CharacterMaker::part_to_node(), EggGroupNode::post_apply_flat_attribute(), EggBinner::prepare_node(), PortalClipper::prepare_portal(), NodePath::project_texture(), EggMatrixTablePointer::quantize_channels(), ParametricCurveCollection::r_add_curves(), SceneGraphReducer::r_collect_vertex_data(), EggGroupNode::r_load_externals(), EggGroupNode::rebuild_vertex_pools(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::remove_invalid_primitives(), EggGroupNode::remove_unused_vertices(), EggLoader::reparent_decals(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), EggGroupNode::resolve_filenames(), EggGroupNode::reverse_vertex_ordering(), NodePath::set_clip_plane(), NodePath::set_clip_plane_off(), NodePath::set_light(), ProjectionScreen::set_projector(), NonlinearImager::set_source_camera(), EggXfmSAnim::set_value(), NonlinearImager::set_viewer_camera(), PandaFramework::show_collision_solids(), BamCache::store(), XFileToEggConverter::strip_nodes(), EggGroupNode::strip_normals(), DataGraphTraverser::traverse(), DataGraphTraverser::traverse_below(), EggGroupNode::triangulate_polygons(), EggGroupNode::unify_attributes(), EggNameUniquifier::uniquify(), NodeCullCallbackData::upcall(), PhysicsCollisionHandler::validate_target(), EggXfmSAnim::write(), EggGroup::write(), EggToDXFLayer::write_3d_face(), and EggToDXFLayer::write_entities().
bool TexturePlacement::is_placed | ( | ) | const |
Returns true if the texture has been placed on a palette image, false otherwise.
This will generally be true if get_omit_reason() returns OR_none or OR_solitary and false otherwise.
Definition at line 501 of file texturePlacement.cxx.
Referenced by compute_tex_matrix(), determine_size(), fill_image(), fill_swapped_image(), 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 |
Returns true if the texture's size is known, false otherwise.
Usually this can only be false after determine_size() has been called there is something wrong with the texture (in which case the placement will automatically omit itself from the palette anyway).
Definition at line 431 of file texturePlacement.cxx.
Referenced by PaletteImage::place(), and PaletteGroup::update_unknown_textures().
TypedWritable * TexturePlacement::make_TexturePlacement | ( | const FactoryParams & | params | ) | [static, protected] |
This method is called by the BamReader when an object of this type is encountered in a Bam file; it should allocate and return a new object with all the data read.
Definition at line 1177 of file texturePlacement.cxx.
References fillin().
Referenced by register_with_read_factory().
void TypedWritable::mark_bam_modified | ( | ) | [inline, inherited] |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.
This should normally not need to be called by user code; it should be called internally when the object has been changed in a way that legitimately requires its retransmission to any connected clients.
Definition at line 54 of file typedWritable.I.
Referenced by PandaNode::add_child(), PandaNode::add_stashed(), PandaNode::adjust_draw_mask(), PandaNode::apply_attribs_to_vertices(), PandaNode::clear_attrib(), PandaNode::clear_effect(), PandaNode::clear_tag(), PandaNode::copy_all_properties(), PandaNode::copy_tags(), PandaNode::disable_cull_callback(), PandaNode::force_bounds_stale(), PandaNode::remove_all_children(), PandaNode::remove_child(), PandaNode::remove_stashed(), PandaNode::reset_all_prev_transform(), PandaNode::reset_prev_transform(), PandaNode::set_attrib(), PandaNode::set_bounds(), PandaNode::set_bounds_type(), PandaNode::set_cull_callback(), PandaNode::set_effect(), PandaNode::set_effects(), PandaNode::set_final(), PandaNode::set_internal_bounds(), PandaNode::set_into_collide_mask(), PandaNode::set_prev_transform(), PandaNode::set_state(), PandaNode::set_tag(), PandaNode::set_transform(), PandaNode::stash_child(), and PandaNode::unstash_child().
void TexturePlacement::mark_eggs_stale | ( | ) |
Marks all the egg files that reference this placement stale.
Presumably this is called after moving the texture around in the palette or something.
Definition at line 181 of file texturePlacement.cxx.
References TextureReference::mark_egg_stale().
Referenced by determine_size(), force_replace(), not_solitary(), omit_solitary(), and PaletteImage::update_filename().
void TexturePlacement::mark_unfilled | ( | ) |
Marks the texture as unfilled, so that it will need to be copied into the palette image again.
Definition at line 785 of file texturePlacement.cxx.
Referenced by TextureImage::post_txa_file(), and PaletteImage::update_image().
void TexturePlacement::not_solitary | ( | ) |
Indicates that the texture, formerly indicated as solitary, is now no longer.
Definition at line 662 of file texturePlacement.cxx.
References is_placed(), and mark_eggs_stale().
Referenced by PaletteImage::check_solitary().
void TexturePlacement::omit_solitary | ( | ) |
Sets the omit reason (returned by get_omit()) to OR_solitary, indicating that the palettized version of the texture should not be used because it is the only texture on a PaletteImage.
However, the texture is still considered placed, and is_placed() will return true.
Definition at line 647 of file texturePlacement.cxx.
References is_placed(), and mark_eggs_stale().
Referenced by PaletteImage::check_solitary().
void TexturePlacement::place_at | ( | PaletteImage * | image, |
int | x, | ||
int | y | ||
) |
Assigns the texture to a particular position within the indicated PaletteImage.
It is an error to call this if the texture has already been placed elsewhere.
Definition at line 604 of file texturePlacement.cxx.
References is_placed().
Referenced by PaletteImage::place().
void TexturePlacement::register_with_read_factory | ( | ) | [static] |
Registers the current object as something that can be read from a Bam file.
Definition at line 1075 of file texturePlacement.cxx.
References BamReader::get_factory(), and make_TexturePlacement().
void TexturePlacement::remove_egg | ( | TextureReference * | reference | ) |
Notes that a particular egg file is no longer using this particular TexturePlacement.
Definition at line 164 of file texturePlacement.cxx.
References TextureReference::mark_egg_stale().
Referenced by EggFile::remove_egg(), and TextureReference::set_placement().
bool TypedWritable::require_fully_complete | ( | ) | const [virtual, inherited] |
Some objects require all of their nested pointers to have been completed before the objects themselves can be completed.
If this is the case, override this method to return true, and be careful with circular references (which would make the object unreadable from a bam file).
Reimplemented in GeomVertexData, ClipPlaneAttrib, and RenderEffects.
Definition at line 118 of file typedWritable.cxx.
void TexturePlacement::set_dest | ( | DestTextureImage * | dest | ) |
Sets the DestTextureImage that corresponds to this texture as it was copied to the install directory.
Definition at line 197 of file texturePlacement.cxx.
Referenced by TextureImage::copy_unplaced().
void TypedWritable::update_bam_nested | ( | BamWriter * | manager | ) | [virtual, inherited] |
Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates.
Reimplemented in CFDoCullCommand, and PandaNode.
Definition at line 77 of file typedWritable.cxx.
Fills the indicated datagram up with a binary representation of the current object, in preparation for writing to a Bam file.
Reimplemented from TypedWritable.
Definition at line 1088 of file texturePlacement.cxx.
References Datagram::add_bool(), Datagram::add_int32(), TexturePosition::write_datagram(), and BamWriter::write_pointer().
void TexturePlacement::write_placed | ( | ostream & | out, |
int | indent_level = 0 |
||
) |
Writes the placement position information on a line by itself.
Definition at line 741 of file texturePlacement.cxx.
References get_placed_uv_area(), get_placed_x(), get_placed_x_size(), get_placed_y(), get_placed_y_size(), get_texture(), and is_placed().
Referenced by PaletteImage::write_placements().