瀏覽代碼

Rename base to core

Kevin Lee 1 年之前
父節點
當前提交
777889d903

+ 2 - 2
src/ezcad/objects/circle.rs

@@ -5,11 +5,11 @@ use crate::{
     types::{Field, Point, F64, U32},
 };
 
-use super::ObjectBase;
+use super::ObjectCore;
 
 #[derive(BinRead, BinWrite, Debug)]
 pub struct Circle {
-    pub base: ObjectBase,
+    pub core: ObjectCore,
     #[brw(magic(6u32))] // Number of following fields in struct
     pub origin: FieldOf<Point>,
     pub radius: F64,

+ 2 - 2
src/ezcad/objects/ellipse.rs

@@ -5,11 +5,11 @@ use crate::{
     types::{Field, Point, F64, U32},
 };
 
-use super::ObjectBase;
+use super::ObjectCore;
 
 #[derive(BinRead, BinWrite, Debug)]
 pub struct Ellipse {
-    pub base: ObjectBase,
+    pub core: ObjectCore,
     #[brw(magic(8u32))] // Number of following fields in struct
     pub clockwise: U32,
     pub corner_a: FieldOf<Point>,

+ 2 - 2
src/ezcad/objects/hatch.rs

@@ -10,7 +10,7 @@ use crate::{
     types::{Field, WString, F64, U32},
 };
 
-use super::{line::Lines, Object, ObjectBase};
+use super::{line::Lines, Object, ObjectCore};
 
 #[bitfield(bits = 32)]
 #[derive(BinRead, BinWrite, Debug, Copy, Clone)]
@@ -83,7 +83,7 @@ pub struct HatchSettings2 {
 
 #[derive(BinRead, BinWrite, Debug)]
 pub struct Hatch {
-    pub base: ObjectBase,
+    pub core: ObjectCore,
     pub outline: ArrayOf<Object>,
     pub settings_1: HatchSettings1,
     pub settings_2: HatchSettings2,

+ 2 - 2
src/ezcad/objects/line.rs

@@ -2,7 +2,7 @@ use binrw::{BinRead, BinWrite};
 
 use crate::{array_of::ArrayOf, types::Point};
 
-use super::ObjectBase;
+use super::ObjectCore;
 
 #[derive(BinRead, BinWrite, Debug)]
 pub enum LineType {
@@ -16,6 +16,6 @@ pub enum LineType {
 
 #[derive(BinRead, BinWrite, Debug)]
 pub struct Lines {
-    pub base: ObjectBase,
+    pub core: ObjectCore,
     pub lines: ArrayOf<LineType, u64>,
 }

+ 2 - 1
src/ezcad/objects/mod.rs

@@ -32,9 +32,10 @@ pub struct ObjectFlags {
     __: B14,
 }
 
+/// Core properties defined for all object types
 #[derive(BinRead, BinWrite, Debug)]
 #[brw(magic(17u32))]
-pub struct ObjectBase {
+pub struct ObjectCore {
     pub pen: U32,
     pub obj_type: FieldOf<ObjectType>,
     pub flags: FieldOf<ObjectFlags>,

+ 2 - 2
src/ezcad/objects/polygon.rs

@@ -5,11 +5,11 @@ use crate::{
     types::{Field, Point, F64, U32},
 };
 
-use super::ObjectBase;
+use super::ObjectCore;
 
 #[derive(BinRead, BinWrite, Debug)]
 pub struct Polygon {
-    pub base: ObjectBase,
+    pub core: ObjectCore,
     #[brw(magic(10u32))] // Number of following fields in struct
     pub invert_shape: U32,
     pub corner_a: FieldOf<Point>,

+ 2 - 2
src/ezcad/objects/rectangle.rs

@@ -5,11 +5,11 @@ use crate::{
     types::{Field, Point, F64},
 };
 
-use super::ObjectBase;
+use super::ObjectCore;
 
 #[derive(BinRead, BinWrite, Debug)]
 pub struct Rectangle {
-    pub base: ObjectBase,
+    pub core: ObjectCore,
     #[brw(magic(8u32))] // Number of following fields in struct
     pub corner_a: FieldOf<Point>,
     pub corner_b: FieldOf<Point>,