pub struct RectAnnotation {
pub annotation_data: AnnotationData,
pub from: AnchorPoint,
pub to: AnchorPoint,
pub rect: Rect,
}Fields§
§annotation_data: AnnotationData§from: AnchorPoint§to: AnchorPoint§rect: RectImplementations§
Source§impl RectAnnotation
impl RectAnnotation
pub(crate) fn new( id: Id, time_at_start: BigInt, time_at_end: BigInt, wave_from: Option<GraphicsY>, wave_to: Option<GraphicsY>, rect: Rect, num: i32, ) -> Self
pub fn get_id(&self) -> Id
pub fn get_pos( &self, waves: &WaveData, viewport: &Viewport, ctx: &DrawingContext<'_>, y_offset: f32, ) -> Option<Pos2>
fn resolve_y_positions( &mut self, waves: &WaveData, ) -> (Option<f32>, Option<f32>)
Sourcefn compute_rect(
&mut self,
from_y: f32,
to_y: f32,
waves: &WaveData,
ctx: &DrawingContext<'_>,
viewport_idx: usize,
theme: &SurferTheme,
y_offset: f32,
)
fn compute_rect( &mut self, from_y: f32, to_y: f32, waves: &WaveData, ctx: &DrawingContext<'_>, viewport_idx: usize, theme: &SurferTheme, y_offset: f32, )
Calculate the correct position of the rectangle on to the canvas.
Trait Implementations§
Source§impl Annotatable for RectAnnotation
impl Annotatable for RectAnnotation
fn get_id(&self) -> Id
fn get_type(&self) -> &str
fn set_name(&mut self, name: String)
fn get_name(&self) -> String
fn is_selected(&mut self)
fn set_visibility(&mut self, visible: bool)
fn show_comments(&self) -> bool
fn show_comment_box(&self) -> bool
fn set_show_comments(&mut self, show: bool)
fn get_comment_box(&self) -> Comment
fn get_comment_box_mut(&mut self) -> &mut Comment
fn get_messages(&self) -> Vec<CommentMessage>
fn is_visible(&self) -> bool
fn get_center_time(&self) -> BigInt
fn get_start_time(&self) -> BigInt
fn get_end_time(&self) -> BigInt
Source§fn is_attached(&self, removed_ref: &DisplayedItemRef) -> bool
fn is_attached(&self, removed_ref: &DisplayedItemRef) -> bool
Checks whether the annotation is attached to the given Item.
fn get_from_wave(&self) -> Option<GraphicsY>
fn get_to_wave(&self) -> Option<GraphicsY>
fn draw( &self, ui: &mut Ui, waves: &WaveData, viewport_idx: usize, ctx: &mut DrawingContext<'_>, theme: &SurferTheme, msgs: &mut Vec<Message>, y_offset: f32, to_screen: RectTransform, time_formatter: &TimeFormatter, )
fn get_comment_position( &self, viewport: &Viewport, ctx: &DrawingContext<'_>, waves: &WaveData, offset: f32, ) -> Pos2
fn get_time_info(&self, time_formatter: &TimeFormatter) -> String
fn draw_hover_info( &self, group_name: String, ui: &mut Ui, (time_start_str, time_end_str): (&str, &str), )
fn hide_annotation(&self, ui: &mut Ui, stroke: Stroke, center: Pos2) -> Rect
fn draw_comment_box( &self, ui: &mut Ui, viewport_idx: usize, msgs: &mut Vec<Message>, comment_position: Pos2, ) -> (Id, Comment)
fn update_comment_box(&mut self, comment: Comment)
Source§impl Clone for RectAnnotation
impl Clone for RectAnnotation
Source§fn clone(&self) -> RectAnnotation
fn clone(&self) -> RectAnnotation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de> Deserialize<'de> for RectAnnotation
impl<'de> Deserialize<'de> for RectAnnotation
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 Serialize for RectAnnotation
impl Serialize for RectAnnotation
Auto Trait Implementations§
impl Freeze for RectAnnotation
impl RefUnwindSafe for RectAnnotation
impl Send for RectAnnotation
impl Sync for RectAnnotation
impl Unpin for RectAnnotation
impl UnsafeUnpin for RectAnnotation
impl UnwindSafe for RectAnnotation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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