Struct re_viewer_context::TimeDragValue
source · pub struct TimeDragValue {
pub range: RangeInclusive<i64>,
base_time: Option<i64>,
unit_factor: i64,
unit_symbol: &'static str,
abs_range: RangeInclusive<i64>,
rel_range: RangeInclusive<i64>,
}
Expand description
Drag value widget for editing time values for both sequence and temporal timelines.
Compute and store various information about the time range related to how the UI should behave.
Fields§
§range: RangeInclusive<i64>
Allowed range for value.
base_time: Option<i64>
For ranges with large offsets (e.g. log_time
), this is a rounded time just before the
first logged data, which can be used as offset in the UI.
unit_factor: i64
For temporal timelines, this is a nice unit factor to use.
unit_symbol: &'static str
For temporal timelines, this is the unit symbol to display.
abs_range: RangeInclusive<i64>
This is a nice range of absolute times to use when editing an absolute time. The boundaries are extended to the nearest rounded unit to minimize glitches.
rel_range: RangeInclusive<i64>
This is a nice range of relative times to use when editing an absolute time. The boundaries are extended to the nearest rounded unit to minimize glitches.
Implementations§
source§impl TimeDragValue
impl TimeDragValue
pub fn from_time_histogram(times: &TimeHistogram) -> Self
pub fn from_time_range(range: RangeInclusive<i64>) -> Self
sourcepub fn sequence_drag_value_ui(
&self,
ui: &mut Ui,
value: &mut TimeInt,
absolute: bool,
low_bound_override: Option<TimeInt>
) -> Response
pub fn sequence_drag_value_ui( &self, ui: &mut Ui, value: &mut TimeInt, absolute: bool, low_bound_override: Option<TimeInt> ) -> Response
Show a sequence drag value widget.
sourcepub fn temporal_drag_value_ui(
&self,
ui: &mut Ui,
value: &mut TimeInt,
absolute: bool,
low_bound_override: Option<TimeInt>,
time_zone_for_timestamps: TimeZone
) -> (Response, Option<Response>)
pub fn temporal_drag_value_ui( &self, ui: &mut Ui, value: &mut TimeInt, absolute: bool, low_bound_override: Option<TimeInt>, time_zone_for_timestamps: TimeZone ) -> (Response, Option<Response>)
Show a temporal drag value widget.
Feature rich:
- scale to the proper units
- display the base time if any
- etc.
Returns a tuple of the [egui::DragValue
]’s [egui::Response
], and the base time label’s
[egui::Response
], if any.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TimeDragValue
impl RefUnwindSafe for TimeDragValue
impl Send for TimeDragValue
impl Sync for TimeDragValue
impl Unpin for TimeDragValue
impl UnwindSafe for TimeDragValue
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for 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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request