Transformation2d (クラス)
public final Transformation2d {inherits {Transformation2d-of Distance, SpatialFrequency, Distance2d, 0m, 0(1/m), 1m}}
インポート元: CURL.GUI.STANDARD. package 内で定義されています CURL.GRAPHICS._2D.UTIL.

ポイントを回転、スケール変更、およびある座標系から他の座標系への変換を行う 2 次元変換です。

説明

これらの変換はいつでも元に戻せます。

注意事項

ほとんどのメソッドはシグネチャを確認しなければなりませんが、Transformation2d は実に単純で使いやすいクラスです。

次の Curl コードの例では、いくつかの Transformation2d クラス メンバの使用法を示しています。
例: Transformation2d メソッドの使用
{value
    let transformation:Transformation2d = {Transformation2d}

    || Call each composition method on Transformation2d
    {transformation.local-scale 1.0, 1.0}
    {transformation.local-rotate 30deg}
    {transformation.local-translate -3in, 3in}
    {transformation.local-uniform-scale 2.0}
    
    let x:double = 1.0  let y:double = 1.0
    
    set (x,y) = {transformation.float-transform x, y}
    
    let x-distance:Distance = 1m
    let y-distance:Distance = 1m
    
    set (x-distance, y-distance) = 
        {transformation.transform x-distance, y-distance}
    
    let point:Distance2d = {Distance2d 1m, 1m}
    let transformed-point:Distance2d = 
        {transformation.transform-point point}

    {VBox
        {text Original location}, {hrule},
        {HBox {text x:\ \ }, x-distance}, 
        {HBox {text y:\ \ }, y-distance},
        {Fill height = 0.25cm},
        {text Transformation distances}, {hrule},
        {HBox {text x:\ \ }, transformation.dx},
        {HBox {text y:\ \ }, transformation.dy},
        {Fill height = 0.25cm},
        {text Final location}, {hrule},
        {HBox {text x:\ \ }, ((x *1m) - transformation.dx)},
        {HBox {text y:\ \ }, ((y *1m) - transformation.dy)}
    }
}

コンストラクタ
default:Transformation2d 型の新しいオブジェクトを作成します。
コンストラクタ public {Transformation2d.default}

プロパティ
プロパティ 継承 Transformation2d-of: angle, dx, dy, identity?, inverse, reflects-axes?

メソッド
clone:self と同じ変換データを含む self のような新しいオブジェクトを作成して返します。
public sealed {Transformation2d.clone}:Transformation2d
new-like-self:self と同じ型のオブジェクトを作成して返します。
public final {Transformation2d.new-like-self
}:{Transformation2d-of Distance, SpatialFrequency, Distance2d, 0m , 0(1/m), 1m }
メソッド 継承 Transformation2d-of: apply-local-transformation, clone-into, compose-clone, float-transform, get-inverse, get-matrix-as-doubles, get-scale-factors, global-translate, identity, inverse-transform, inverse-transform-point, inverse-transform-vector, local-rotate, local-scale, local-translate, local-uniform-scale, output-pretty, transform, transform-point, transform-vector
メソッド 継承 Object: object-describe, object-describe-for-debugging, object-serialize



コンストラクタ詳細
default (コンストラクタ)
public {Transformation2d.default}

Transformation2d 型の新しいオブジェクトを作成します。




プロパティ詳細


メソッド詳細
clone (メソッド)
public sealed {Transformation2d.clone}:Transformation2d

self と同じ変換データを含む self のような新しいオブジェクトを作成して返します。



new-like-self (メソッド)
public final {Transformation2d.new-like-self
}:{Transformation2d-of Distance, SpatialFrequency, Distance2d, 0m , 0(1/m), 1m }

self と同じ型のオブジェクトを作成して返します。

注意事項

返されるオブジェクトはそれ自身と同じ型ですが、同じデータは含んでいません。新しく返されたオブジェクトは、Transformation2d 型の場合、コンストラクタが直接使用されている場合と同じ状態になります。