Skip to main content

Text

Struct Text 

Source
pub struct Text {
    pub common: EntityCommon,
    pub value: String,
    pub insertion_point: Vector3,
    pub alignment_point: Option<Vector3>,
    pub height: f64,
    pub rotation: f64,
    pub width_factor: f64,
    pub oblique_angle: f64,
    pub style: String,
    pub horizontal_alignment: TextHorizontalAlignment,
    pub vertical_alignment: TextVerticalAlignment,
    pub normal: Vector3,
}
Expand description

A single-line text entity

Fields§

§common: EntityCommon

Common entity data

§value: String

Text content

§insertion_point: Vector3

Insertion point (first alignment point)

§alignment_point: Option<Vector3>

Second alignment point (for aligned/fit text)

§height: f64

Text height

§rotation: f64

Rotation angle in radians

§width_factor: f64

Width scale factor

§oblique_angle: f64

Oblique angle in radians

§style: String

Text style name

§horizontal_alignment: TextHorizontalAlignment

Horizontal alignment

§vertical_alignment: TextVerticalAlignment

Vertical alignment

§normal: Vector3

Normal vector

Implementations§

Source§

impl Text

Source

pub fn new() -> Self

Create a new text entity

Source

pub fn with_value(value: impl Into<String>, position: Vector3) -> Self

Create a new text with value and position

Source

pub fn with_height(self, height: f64) -> Self

Set the text height

Source

pub fn with_rotation(self, rotation: f64) -> Self

Set the rotation angle

Trait Implementations§

Source§

impl Clone for Text

Source§

fn clone(&self) -> Text

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Text

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Text

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Entity for Text

Source§

fn handle(&self) -> Handle

Get the entity’s unique handle
Source§

fn set_handle(&mut self, handle: Handle)

Set the entity’s handle
Source§

fn layer(&self) -> &str

Get the entity’s layer name
Source§

fn set_layer(&mut self, layer: String)

Set the entity’s layer name
Source§

fn color(&self) -> Color

Get the entity’s color
Source§

fn set_color(&mut self, color: Color)

Set the entity’s color
Source§

fn line_weight(&self) -> LineWeight

Get the entity’s line weight
Source§

fn set_line_weight(&mut self, weight: LineWeight)

Set the entity’s line weight
Source§

fn transparency(&self) -> Transparency

Get the entity’s transparency
Source§

fn set_transparency(&mut self, transparency: Transparency)

Set the entity’s transparency
Source§

fn is_invisible(&self) -> bool

Check if the entity is invisible
Source§

fn set_invisible(&mut self, invisible: bool)

Set the entity’s visibility
Source§

fn bounding_box(&self) -> BoundingBox3D

Get the bounding box of the entity
Source§

fn translate(&mut self, offset: Vector3)

Transform the entity by a translation vector
Source§

fn entity_type(&self) -> &'static str

Get the entity type name
Source§

fn apply_transform(&mut self, transform: &Transform)

Apply a general transform to the entity Read more
Source§

fn apply_mirror(&mut self, transform: &Transform)

Apply a mirror transform with entity-specific corrections Read more
Source§

fn apply_rotation(&mut self, axis: Vector3, angle: f64)

Apply rotation around an axis
Source§

fn apply_scaling(&mut self, scale: f64)

Apply uniform scaling
Source§

fn apply_scaling_xyz(&mut self, scale: Vector3)

Apply non-uniform scaling
Source§

fn apply_scaling_with_origin(&mut self, scale: Vector3, origin: Vector3)

Apply scaling with a specific origin point
Source§

fn mirror_x(&mut self)

Mirror the entity across the YZ plane (negate X coordinates)
Source§

fn mirror_y(&mut self)

Mirror the entity across the XZ plane (negate Y coordinates)
Source§

fn mirror_z(&mut self)

Mirror the entity across the XY plane (negate Z coordinates)
Source§

fn mirror_about_line(&mut self, p1: Vector3, p2: Vector3)

Mirror the entity across a line defined by two points (in the XY plane)
Source§

fn mirror_about_plane(&mut self, point: Vector3, normal: Vector3)

Mirror the entity across an arbitrary plane
Source§

impl PartialEq for Text

Source§

fn eq(&self, other: &Text) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Text

Auto Trait Implementations§

§

impl Freeze for Text

§

impl RefUnwindSafe for Text

§

impl Send for Text

§

impl Sync for Text

§

impl Unpin for Text

§

impl UnsafeUnpin for Text

§

impl UnwindSafe for Text

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.