Struct re_types::archetypes::Clear
source · pub struct Clear {
pub is_recursive: ClearIsRecursive,
}Expand description
Archetype: Empties all the components of an entity.
Example
Flat
ⓘ
//! Log a batch of 3D arrows.
use rerun::external::glam;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let (rec, storage) =
rerun::RecordingStreamBuilder::new("rerun_example_clear_simple").memory()?;
#[rustfmt::skip]
let (vectors, origins, colors) = (
[glam::Vec3::X, glam::Vec3::NEG_Y, glam::Vec3::NEG_X, glam::Vec3::Y],
[(-0.5, 0.5, 0.0), (0.5, 0.5, 0.0), (0.5, -0.5, 0.0), (-0.5, -0.5, 0.0)],
[(200, 0, 0), (0, 200, 0), (0, 0, 200), (200, 0, 200)],
);
// Log a handful of arrows.
for (i, ((vector, origin), color)) in vectors.into_iter().zip(origins).zip(colors).enumerate() {
rec.log(
format!("arrows/{i}"),
&rerun::Arrows3D::from_vectors([vector])
.with_origins([origin])
.with_colors([rerun::Color::from_rgb(color.0, color.1, color.2)]),
)?;
}
// Now clear them, one by one on each tick.
for i in 0..vectors.len() {
rec.log(format!("arrows/{i}"), &rerun::Clear::flat())?;
}
rerun::native_viewer::show(storage.take())?;
Ok(())
}Fields§
§is_recursive: ClearIsRecursiveImplementations§
Trait Implementations§
source§impl Archetype for Clear
impl Archetype for Clear
§type Indicator = GenericIndicatorComponent<Clear>
type Indicator = GenericIndicatorComponent<Clear>
The associated indicator component, whose presence indicates that the high-level
archetype-based APIs were used to log the data. Read more
source§fn name() -> ArchetypeName
fn name() -> ArchetypeName
The fully-qualified name of this archetype, e.g.
rerun.archetypes.Points2D.source§fn indicator() -> MaybeOwnedComponentBatch<'static>
fn indicator() -> MaybeOwnedComponentBatch<'static>
source§fn required_components() -> Cow<'static, [ComponentName]>
fn required_components() -> Cow<'static, [ComponentName]>
Returns the names of all components that must be provided by the user when constructing
this archetype.
source§fn recommended_components() -> Cow<'static, [ComponentName]>
fn recommended_components() -> Cow<'static, [ComponentName]>
Returns the names of all components that should be provided by the user when constructing
this archetype.
source§fn optional_components() -> Cow<'static, [ComponentName]>
fn optional_components() -> Cow<'static, [ComponentName]>
Returns the names of all components that may be provided by the user when constructing
this archetype.
source§fn all_components() -> Cow<'static, [ComponentName]>
fn all_components() -> Cow<'static, [ComponentName]>
Returns the names of all components that must, should and may be provided by the user when
constructing this archetype. Read more
source§fn from_arrow(
arrow_data: impl IntoIterator<Item = (Field, Box<dyn Array>)>
) -> DeserializationResult<Self>
fn from_arrow( arrow_data: impl IntoIterator<Item = (Field, Box<dyn Array>)> ) -> DeserializationResult<Self>
Given an iterator of Arrow arrays and their respective field metadata, deserializes them
into this archetype. Read more
source§impl AsComponents for Clear
impl AsComponents for Clear
source§fn as_component_batches(&self) -> Vec<MaybeOwnedComponentBatch<'_>>
fn as_component_batches(&self) -> Vec<MaybeOwnedComponentBatch<'_>>
Exposes the object’s contents as a set of
ComponentBatchs. Read moresource§fn num_instances(&self) -> usize
fn num_instances(&self) -> usize
The number of instances in each batch. Read more
source§impl PartialEq for Clear
impl PartialEq for Clear
impl Eq for Clear
impl StructuralEq for Clear
impl StructuralPartialEq for Clear
Auto Trait Implementations§
impl RefUnwindSafe for Clear
impl Send for Clear
impl Sync for Clear
impl Unpin for Clear
impl UnwindSafe for Clear
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