pub struct GeometryDocument { /* private fields */ }Expand description
Owns object-local mesh definitions and their placed occurrences for one
loaded model. Every successful admission advances Self::revision;
every refusal leaves the document unchanged.
Implementations§
Source§impl GeometryDocument
impl GeometryDocument
Sourcepub fn add_retained_extrusion(
&mut self,
recipe: RetainedExtrusion,
) -> Result<RetainedDefinitionHandle, RetainedRefusal>
pub fn add_retained_extrusion( &mut self, recipe: RetainedExtrusion, ) -> Result<RetainedDefinitionHandle, RetainedRefusal>
Encodes and retains one captured authored extrusion. Refuses every
source the request encoding cannot represent exactly; see
RetainedRefusal and SweepPayload for the supported families.
Sourcepub fn add_retained_swept_disk(
&mut self,
recipe: RetainedSweptDisk,
) -> Result<RetainedDefinitionHandle, RetainedRefusal>
pub fn add_retained_swept_disk( &mut self, recipe: RetainedSweptDisk, ) -> Result<RetainedDefinitionHandle, RetainedRefusal>
Encodes and retains one captured authored swept disk. Refuses every
source wire format 2 cannot represent exactly; see retained_disk’s
module documentation for the supported family.
pub fn retained_recipe( &self, handle: RetainedDefinitionHandle, ) -> Result<&RetainedRecipe, DocumentError>
pub fn retained_payload( &self, handle: RetainedDefinitionHandle, ) -> Result<&SweepPayload, DocumentError>
Sourcepub fn prepare_retained(
&self,
definition: RetainedDefinitionHandle,
worker_incarnation: u64,
) -> Result<RetainedRequest, RetainedRefusal>
pub fn prepare_retained( &self, definition: RetainedDefinitionHandle, worker_incarnation: u64, ) -> Result<RetainedRequest, RetainedRefusal>
Snapshots definition for the worker incarnation the caller selected.
Sourcepub fn validate_retained_completion(
&self,
packet: &RetainedCompletion,
live_worker_incarnation: u64,
) -> Result<(), RetainedRefusal>
pub fn validate_retained_completion( &self, packet: &RetainedCompletion, live_worker_incarnation: u64, ) -> Result<(), RetainedRefusal>
Host-trusted bookkeeping check, not origin authentication: the caller states which worker incarnation it observes as live.
Sourcepub fn publish_retained_display(
&mut self,
packet: &RetainedCompletion,
live_worker_incarnation: u64,
contract: RetainedDisplayContract,
occurrences: &[(u32, [f64; 16])],
) -> Result<(DefinitionHandle, Vec<OccurrenceHandle>), RetainedRefusal>
pub fn publish_retained_display( &mut self, packet: &RetainedCompletion, live_worker_incarnation: u64, contract: RetainedDisplayContract, occurrences: &[(u32, [f64; 16])], ) -> Result<(DefinitionHandle, Vec<OccurrenceHandle>), RetainedRefusal>
Deliberate, atomic retained -> display conversion. Validates the completion, the display claim, the narrowed mesh, every occurrence (row-major, evaluation frame -> caller’s model frame) and the revision budget before changing anything. The result is an ordinary display definition attributed to the solid: a display approximation, never authored geometry. Publishing advances the revision, so every other outstanding request of this document becomes stale.
Source§impl GeometryDocument
impl GeometryDocument
Sourcepub fn new() -> Self
pub fn new() -> Self
A fresh empty document at revision 0 with a process-unique identity (unique for the first 2^64 documents of a process).
pub fn id(&self) -> DocumentId
Sourcepub fn add_mesh_definition(
&mut self,
source_entity_id: u32,
mesh: Mesh,
) -> Result<DefinitionHandle, DocumentError>
pub fn add_mesh_definition( &mut self, source_entity_id: u32, mesh: Mesh, ) -> Result<DefinitionHandle, DocumentError>
Takes ownership of an existing discrete mesh as an object-local display
approximation, attributed to source_entity_id.
Refuses DocumentError::InvalidMesh for incomplete triples, non-finite
values, mismatched normals or out-of-range indices, and
DocumentError::UnsupportedFrame for a mesh carrying a non-zero
origin, an applied RTC offset, a placement or instancing metadata: the
caller must move that frame into an occurrence explicitly. Shape checks
only prevent malformed buffer access; no topology is qualified.
Sourcepub fn mesh(&self, handle: DefinitionHandle) -> Result<&Mesh, DocumentError>
pub fn mesh(&self, handle: DefinitionHandle) -> Result<&Mesh, DocumentError>
The admitted display mesh, borrowed from the document.
pub fn source_entity_id( &self, handle: DefinitionHandle, ) -> Result<u32, DocumentError>
Sourcepub fn add_occurrence(
&mut self,
definition: DefinitionHandle,
source_entity_id: u32,
local_to_model: [f64; 16],
) -> Result<OccurrenceHandle, DocumentError>
pub fn add_occurrence( &mut self, definition: DefinitionHandle, source_entity_id: u32, local_to_model: [f64; 16], ) -> Result<OccurrenceHandle, DocumentError>
Places definition into the caller’s model frame.
Refuses DocumentError::WrongDocument for a foreign definition and
DocumentError::InvalidTransform for a non-finite, projective or
singular local_to_model (row-major).
pub fn occurrence( &self, handle: OccurrenceHandle, ) -> Result<&Occurrence, DocumentError>
Trait Implementations§
Source§impl Debug for GeometryDocument
impl Debug for GeometryDocument
Auto Trait Implementations§
impl Freeze for GeometryDocument
impl RefUnwindSafe for GeometryDocument
impl Send for GeometryDocument
impl Sync for GeometryDocument
impl Unpin for GeometryDocument
impl UnwindSafe for GeometryDocument
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.