pub struct DensityMeshGenerator { /* private fields */ }
Expand description
Generate density mesh with region changes. For now it recalculates mesh from whole density map data.
Implementations§
Source§impl DensityMeshGenerator
impl DensityMeshGenerator
Sourcepub fn new(
points: Vec<Coord>,
map: DensityMap,
settings: GenerateDensityMeshSettings,
) -> Self
pub fn new( points: Vec<Coord>, map: DensityMap, settings: GenerateDensityMeshSettings, ) -> Self
Sourcepub fn map(&self) -> &DensityMap
pub fn map(&self) -> &DensityMap
Get inner density map.
Sourcepub fn mesh(&self) -> Option<&DensityMesh>
pub fn mesh(&self) -> Option<&DensityMesh>
Get inner density mesh if one is already generated.
pub fn into_mesh(self) -> Option<DensityMesh>
Sourcepub fn in_progress(&self) -> bool
pub fn in_progress(&self) -> bool
Tells if there are changes left to process.
Sourcepub fn change_map(
&mut self,
col: usize,
row: usize,
width: usize,
height: usize,
data: Vec<u8>,
settings: GenerateDensityMeshSettings,
) -> Result<(), DensityMapError>
pub fn change_map( &mut self, col: usize, row: usize, width: usize, height: usize, data: Vec<u8>, settings: GenerateDensityMeshSettings, ) -> Result<(), DensityMapError>
Add map change to the pending queue.
§Arguments
col
- Density map destination column.row
- Density map destination row.width
- Source data unscaled width.height
- Source data unscaled height.data
- Source data buffer.settings
- Density mesh generation settings applied for this change.
§Returns
Ok if successful or density map error.
Sourcepub fn process(&mut self) -> Result<ProcessStatus, GenerateDensityMeshError>
pub fn process(&mut self) -> Result<ProcessStatus, GenerateDensityMeshError>
Sourcepub fn process_wait(&mut self) -> Result<(), GenerateDensityMeshError>
pub fn process_wait(&mut self) -> Result<(), GenerateDensityMeshError>
Sourcepub fn process_wait_timeout(
&mut self,
timeout: Duration,
) -> Result<ProcessStatus, GenerateDensityMeshError>
pub fn process_wait_timeout( &mut self, timeout: Duration, ) -> Result<ProcessStatus, GenerateDensityMeshError>
Sourcepub fn process_wait_tracked<F>(
&mut self,
f: F,
) -> Result<(), GenerateDensityMeshError>
pub fn process_wait_tracked<F>( &mut self, f: F, ) -> Result<(), GenerateDensityMeshError>
Sourcepub fn process_wait_timeout_tracked<F>(
&mut self,
f: F,
timeout: Duration,
) -> Result<ProcessStatus, GenerateDensityMeshError>
pub fn process_wait_timeout_tracked<F>( &mut self, f: F, timeout: Duration, ) -> Result<ProcessStatus, GenerateDensityMeshError>
Trait Implementations§
Source§impl Clone for DensityMeshGenerator
impl Clone for DensityMeshGenerator
Source§fn clone(&self) -> DensityMeshGenerator
fn clone(&self) -> DensityMeshGenerator
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DensityMeshGenerator
impl Debug for DensityMeshGenerator
Source§impl<'de> Deserialize<'de> for DensityMeshGenerator
impl<'de> Deserialize<'de> for DensityMeshGenerator
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DensityMeshGenerator
impl PartialEq for DensityMeshGenerator
Source§impl Serialize for DensityMeshGenerator
impl Serialize for DensityMeshGenerator
impl StructuralPartialEq for DensityMeshGenerator
Auto Trait Implementations§
impl Freeze for DensityMeshGenerator
impl RefUnwindSafe for DensityMeshGenerator
impl Send for DensityMeshGenerator
impl Sync for DensityMeshGenerator
impl Unpin for DensityMeshGenerator
impl UnwindSafe for DensityMeshGenerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more