Lagrange
Loading...
Searching...
No Matches
AtlasEngine< Scalar, Index >::Impl< Scalar, Index > Struct Template Reference

Public Types

using Mesh
 
using NotificationFunc
 

Public Member Functions

 Impl (const Impl &)=delete
 
Imploperator= (const Impl &)=delete
 
void reset_atlas ()
 
 AtlasEngine ()
 
 AtlasEngine (const AtlasEngine &)=delete
 
 AtlasEngine (AtlasEngine &&) noexcept
 
AtlasEngineoperator= (const AtlasEngine &)=delete
 
AtlasEngineoperator= (AtlasEngine &&) noexcept
 
void add_mesh (const Mesh &mesh, const UnwrapOptions &options={})
 Add a mesh for unwrapping. Throws if any UV-only mesh has already been added.
 
void add_uv_mesh (const Mesh &mesh, const RepackOptions &options={})
 Add a mesh with existing UVs for repacking only. Throws if any unwrap mesh has been added.
 
void clear ()
 Reset the engine to its initial empty state.
 
void compute_charts (const ChartOptions &opts={})
 Compute charts. Valid only after at least one add_mesh() call.
 
void pack_charts (const PackOptions &opts)
 Pack charts. Valid after compute_charts() (unwrap path) or add_uv_mesh() (repack path).
 
void generate (const ChartOptions &chart_opts, const PackOptions &pack_opts)
 Convenience: compute_charts() + pack_charts().
 
void generate (const UnwrapOptions &opts)
 Convenience: compute_charts(opts.chart) + pack_charts(opts.packing).
 
Mesh extract_mesh (size_t mesh_index, MultiAtlasPolicy multi_atlas_policy, std::string_view output_uv_attribute_name, std::string_view output_atlas_attribute_name, std::string_view output_chart_attribute_name) const
 Read back the i-th input mesh with the new UVs applied as an indexed attribute.
 
size_t mesh_count () const
 Number of meshes added to the atlas.
 
uint32_t atlas_width () const
 Atlas tile width in pixels (0 before pack).
 
uint32_t atlas_height () const
 Atlas tile height in pixels (0 before pack).
 
uint32_t atlas_count () const
 Number of atlas tiles xatlas produced (0 before pack).
 
uint32_t chart_count () const
 Total number of charts (0 before chart computation).
 
float texels_per_unit () const
 Effective texels-per-unit value used by the most recent pack.
 
float utilization (uint32_t atlas_index) const
 Utilization of the given atlas tile (in [0, 1]).
 
void set_notification_func (NotificationFunc func)
 Set the optional progress callback. xatlas may invoke it from any thread.
 
void set_cancel (const std::atomic_bool *cancel)
 Set the optional cancellation flag.
 

Public Attributes

::xatlas::Atlas * atlas = nullptr
 
State state = State::Empty
 
std::vector< internal::MeshAdapterunwrap_adapters
 
std::vector< internal::UvMeshAdapteruv_adapters
 
std::vector< SurfaceMesh< Scalar, Index > > input_meshes
 
std::function< void(const std::string &, float)> notification_func
 
const std::atomic_bool * cancel = nullptr
 

The documentation for this struct was generated from the following file: