pub struct UserShape {
pub model: String,
pub config: Config,
pub flip_z: bool,
pub mirror_x: bool,
/* private fields */
}Expand description
面に付ける利用者定義の形(モデルの名前・設定・裏返しの向きと、準備した形)。系ファイルには名前・設定・向きを 書き、読むときに登録から作り直す
Fields§
§model: String§config: Config§flip_z: boolz について裏返した(矢高の符号が逆)
mirror_x: boolx について映した(x の向きが逆)
Implementations§
Source§impl UserShape
impl UserShape
Sourcepub fn new(model: &str, config: Config) -> Result<UserShape>
pub fn new(model: &str, config: Config) -> Result<UserShape>
今の拡張の表(crate::ext::current)のモデル model を設定 config で準備する(裏返しなし)
Sourcepub fn instance(&self) -> &dyn ShapeInstance
pub fn instance(&self) -> &dyn ShapeInstance
準備した形(裏返しを含まない、モデルが返したまま)
Sourcepub fn dsag(&self, key: &str, x: f64, y: f64) -> Option<[f64; 3]>
pub fn dsag(&self, key: &str, x: f64, y: f64) -> Option<[f64; 3]>
裏返しを含めた、項目 key による微分(ShapeInstance::dsag)
Sourcepub fn has_phase(&self) -> bool
pub fn has_phase(&self) -> bool
位相を持つか(ShapeInstance::phase)
Sourcepub fn phase(&self, x: f64, y: f64) -> Option<(f64, f64, f64)>
pub fn phase(&self, x: f64, y: f64) -> Option<(f64, f64, f64)>
裏返しを含めた位相と勾配(位相を持たなければ None)。z の裏返しでは変えず、x の映しは x の向きを替える
Sourcepub fn has_jones(&self) -> bool
pub fn has_jones(&self) -> bool
Jones を持つか(頂点・0.55 µm で ShapeInstance::jones が Some)
Sourcepub fn jones(&self, x: f64, y: f64, wl_um: f64) -> Option<[C64; 4]>
pub fn jones(&self, x: f64, y: f64, wl_um: f64) -> Option<[C64; 4]>
裏返しを含めた Jones 行列: z の裏返しでは変えず、x の映しは映した点の行列の B・C の符号を替える
Sourcepub fn paraxial_dphi(&self, h: f64) -> f64
pub fn paraxial_dphi(&self, h: f64) -> f64
頂点での位相の 2 階 ∂²Φ/∂y² [rad/mm²](近軸の屈折力に足す分。幅 h の勾配の中心差分)。位相なしは 0
Sourcepub fn with_value(&self, key: &str, v: f64) -> Result<UserShape>
pub fn with_value(&self, key: &str, v: f64) -> Result<UserShape>
項目 key を値 v にして作り直したもの(向きはそのまま)
Sourcepub fn paraxial_curv(&self, h: f64) -> f64
pub fn paraxial_curv(&self, h: f64) -> f64
頂点での矢高の 2 階 ∂²z/∂y²(近軸の曲率に足す分。幅 h [mm] の勾配の中心差分、paraxial_step)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UserShape
impl<'de> Deserialize<'de> for UserShape
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 JsonSchema for UserShape
impl JsonSchema for UserShape
Source§fn json_schema(g: &mut SchemaGenerator) -> Schema
fn json_schema(g: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for UserShape
impl !UnwindSafe for UserShape
impl Freeze for UserShape
impl Send for UserShape
impl Sync for UserShape
impl Unpin for UserShape
impl UnsafeUnpin for UserShape
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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