Skip to main content

EntityCommon

Struct EntityCommon 

Source
pub struct EntityCommon {
Show 19 fields pub handle: Handle, pub layer: String, pub color: Color, pub line_weight: LineWeight, pub linetype: String, pub linetype_scale: f64, pub transparency: Transparency, pub invisible: bool, pub extended_data: ExtendedData, pub graphic_data: Option<Vec<u8>>, pub reactors: Vec<Handle>, pub xdictionary_handle: Option<Handle>, pub owner_handle: Handle, pub material_flags: u8, pub material_handle: Option<Handle>, pub shadow_flags: u8, pub plotstyle_flags: u8, pub plotstyle_handle: Option<Handle>, pub entity_mode: Option<u8>,
}
Expand description

Common entity data shared by all entities

Fields§

§handle: Handle

Unique handle

§layer: String

Layer name

§color: Color

Color

§line_weight: LineWeight

Line weight

§linetype: String

Linetype name (empty string = “ByLayer”)

§linetype_scale: f64

Linetype scale factor (default 1.0)

§transparency: Transparency

Transparency

§invisible: bool

Visibility flag

§extended_data: ExtendedData

Extended data (XDATA)

§graphic_data: Option<Vec<u8>>

Raw entity graphic data bytes (stored for DWG round-trip; None otherwise).

§reactors: Vec<Handle>

Reactor handles — objects attached as reactors ({ACAD_REACTORS})

§xdictionary_handle: Option<Handle>

Extended dictionary handle ({ACAD_XDICTIONARY}) — hard-owner handle to a Dictionary

§owner_handle: Handle

Owner handle (soft pointer, code 330)

§material_flags: u8

Material flags (BB: 00=bylayer, 01=byblock, 10=reserved, 11=handle) — R2007+

§material_handle: Option<Handle>

Material handle (only valid when material_flags == 0b11) — R2007+

§shadow_flags: u8

Shadow flags (RC) — R2007+

§plotstyle_flags: u8

Plotstyle flags (BB: 00=bylayer, 01=byblock, 10=reserved, 11=handle) — R2000+

§plotstyle_handle: Option<Handle>

Plotstyle handle (only valid when plotstyle_flags == 0b11) — R2000+

§entity_mode: Option<u8>

Entity mode (0=owned, 1=paper, 2=model) — raw DWG value for round-trip

Implementations§

Source§

impl EntityCommon

Source

pub fn new() -> Self

Create new common entity data with defaults

Source

pub fn with_layer(layer: impl Into<String>) -> Self

Create with a specific layer

Source

pub fn has_linetype(&self) -> bool

Check whether a linetype name is set (not empty and not “ByLayer”)

Trait Implementations§

Source§

impl Clone for EntityCommon

Source§

fn clone(&self) -> EntityCommon

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 EntityCommon

Source§

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

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

impl Default for EntityCommon

Source§

fn default() -> Self

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

impl PartialEq for EntityCommon

Source§

fn eq(&self, other: &EntityCommon) -> 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 EntityCommon

Auto Trait Implementations§

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.