pub struct Element {
pub shape: ShapeKind,
pub pos: Position,
pub look: StyleAttr,
pub orientation: Orientation,
}
Fields
shape: ShapeKind
pos: Position
look: StyleAttr
orientation: Orientation
Implementations
sourceimpl Element
impl Element
pub fn create(
shape: ShapeKind,
look: StyleAttr,
orientation: Orientation,
size: Point
) -> Element
pub fn create_connector(
label: &str,
look: &StyleAttr,
dir: Orientation
) -> Element
pub fn empty_connector(dir: Orientation) -> Element
pub fn move_to(&mut self, to: Point)
Trait Implementations
sourceimpl Renderable for Element
impl Renderable for Element
sourcefn render(&self, debug: bool, canvas: &mut dyn RenderBackend)
fn render(&self, debug: bool, canvas: &mut dyn RenderBackend)
Render the shape into a canvas.
If \p debug is set then extra markers will be rendered. Read more
sourcefn get_connector_location(
&self,
from: Point,
force: f64,
port: &Option<String>
) -> (Point, Point)
fn get_connector_location(
&self,
from: Point,
force: f64,
port: &Option<String>
) -> (Point, Point)
\Return the coordinate for the connection point of an arrow that’s
coming from the direction of \p from.
The format of the path is (x, y, cx, cy), where cx and cy, are the
control points of the bezier curve.
\p force is the magnitude of the edge direction.
\p port is the optional port name (for named records). Read more
sourcefn get_passthrough_path(
&self,
_from: Point,
_to: Point,
_force: f64
) -> (Point, Point)
fn get_passthrough_path(
&self,
_from: Point,
_to: Point,
_force: f64
) -> (Point, Point)
Computes the coordinate for the connection point of an arrow that’s
passing through this edge.
coming from the direction of \p from.
\returns the bezier path in the format (x, y, cx, cy), where cx and cy,
are the control points for the entry path of the bezier curve. The exit
path is assumed to be the mirror point for the center (first point).
\p force is the magnitude of the edge direction.
This works with the get_connector_location method for drawing edges. Read more
sourceimpl Visible for Element
impl Visible for Element
sourcefn position_mut(&mut self) -> &mut Position
fn position_mut(&mut self) -> &mut Position
\return the mutable reference to the Position of the shape.
sourcefn is_connector(&self) -> bool
fn is_connector(&self) -> bool
Return true if the element is a connector.
Auto Trait Implementations
impl RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnwindSafe for Element
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more