任意の形状を表す抽象基本クラス。通常、Shape は
説明
| この型の新しいオブジェクトを作成します。 |
| この (または子の) 形状に含まれる境界線またはアウトラインの色。 |
| この形状とその子の色。 |
| この Shape およびその子のすべてを描画する |
| オブジェクトのオプションの親を返します。 |
| この ShapeContainerBase とその |
| この |
| この Shape を |
| この |
| このオプションが false に設定されている場合、この Shape は描画されず、ポインタ イベントも受信しません。 |
| 回転を適用してこのオブジェクトの |
| スケールを適用してこのオブジェクトの |
| このオブジェクトの |
| 平行移動を適用してこのオブジェクトの |
| 平行移動を適用してこのオブジェクトの |
| 境界制約 (ローカル座標系) をこの Shape に適用します。 |
| 境界制約 (ローカル座標系) をこの Shape とその子すべてに適用します。 |
| この形状またはそのいずれかの子にポイントが含まれているかどうかを判定します。 |
| この形状を親から切り離します。 |
| このオブジェクトの可視表現を描画します。 |
| 与えられた述語に適合する最も近いグラフィックの祖先を返します。 |
| 他のイベントから |
| イベントの座標を修正して、子 |
| このオブジェクトの現在の |
| このオブジェクトの座標系をその親の座標系に変換した場合の、「下」向きベクトルの方向を計算します。 |
| ピクセルのサイズをローカル座標単位で取得します。 |
| グラフィック階層内における指定された祖先に対する |
| グラフィック階層のルートにあるオブジェクトを基準とし、Visual の位置を取得します。 |
| 親の座標系におけるこの |
| 形状ルートである祖先の座標系における、このオブジェクトの起点を取得します。 |
| ローカル座標系におけるこの Shape の四角形のレンダリング境界を計算します。 |
| 形状ルートである祖先の座標系における、この形状の四角形のレンダリング境界を計算します。 |
| ローカル座標系におけるこの Shape の四角形のレイアウト境界を計算します。 |
| このオブジェクトの座標系をその親の座標系に変換した場合の、「右」向きベクトルの方向を計算します。 |
| このオブジェクトのローカル座標系における、このオブジェクトとその子の四角形のレンダリング境界を計算します。 |
| 形状ルートである祖先の座標系における、このオブジェクトと子の四角形のレンダリング境界を取得します。 |
| このオブジェクトのローカル座標系における、このオブジェクトとその子の四角形のレイアウト境界を計算します。 |
| グラフィック階層に含まれる指定上位オブジェクトの座標フレームでこのオブジェクトの左上隅のロケーションを見つけます。 |
| このオブジェクトの座標系から形状ルートである祖先の座標系への累積変換を返します。 |
| このオブジェクトで値が変更されたオプションについて、オプションの変更ハンドラを呼び出します。 |
| このオブジェクトの上に選択アフォーダンスを描画します。 |
| 線の太さの値を数量化するユーティリティ プロシージャです。 |
| 描画する |
| 再描画する |
| このオブジェクトの |
| ポイントがこの Shape 内にあるかどうかを判定します。 |
| ポリゴンがこの Shape と交差するかどうかを判定します。 |
| 回転を設定してこのオブジェクトの |
| スケールを設定してこのオブジェクトの |
| このオブジェクトの |
| 親を基準にした平行移動を設定してこのオブジェクトの |
| このオブジェクトに値する |
| このオブジェクトの |
| このオブジェクトのグラフィック階層のルートにあるオブジェクトの座標系からこのオブジェクトの座標系に座標を変換します。 |
| このオブジェクトの形状ルートである祖先の座標系からこのオブジェクトのローカル座標系に変換された point を返します。 |
| このオブジェクトのローカル座標系から形状ルートである祖先の座標系に変換された point を返します。 |
| このオブジェクトの座標系から |
| このオブジェクトの座標系からこのオブジェクトのグラフィック階層のルートにあるオブジェクトの座標系に座標を変換します。 |
| このオブジェクトの形状ルートである祖先の座標系からこのオブジェクトのローカル座標系に変換された vector を返します。 |
| このオブジェクトのローカル座標系から形状ルートである祖先の座標系に変換された vector を返します。 |
この型の新しいオブジェクトを作成します。
注意事項
この (または子の) 形状に含まれる境界線またはアウトラインの色。
注意事項
この形状とその子の色。
説明
注意事項
この Shape およびその子のすべてを描画する
説明
例
| 例: Shape.draw-operation の使用 | |
![]() | |
{import * from CURL.GUI.SHAPES}
{import * from CURL.LANGUAGE.MATH-CONSTANT}
{let constant random:Random = {Random}}
{let constant frequency:Frequency = 30fps}
{let constant period:Time = 1 / frequency}
{let constant acceleration:Acceleration2d =
{Acceleration2d 0(m/s^2), 0.1(m/s^2)}
}
{let constant group:ShapeGroup =
{ShapeGroup
draw-operation = DrawOperation.source
}
}
{let constant canvas:Canvas =
{Canvas
width = 6cm,
height = 6cm,
background = "black",
group
}
}
{let constant host-rendering-display:CheckButton =
{CheckButton
label = "use-host-rendering?",
enabled? = false,
value = canvas.use-host-rendering?
}
}
{let constant advanced-operations-display:CheckButton =
{CheckButton
label = "support-advanced-draw-operations?",
enabled? = false,
value = canvas.support-advanced-draw-operations?
}
}
{for i = 0 below 5 do
let constant opacity:float = {random.next-float} * 0.5f + 0.25f
{group.add
{RectangleShape
{GRect 7mm, 7mm, 8mm, 8mm},
color =
{Color.from-rgb
(4 - i) / 4,
0.1,
i / 4,
opacity = opacity
},
user-data = 1 / ({random.next-float} * 1s + 3s),
translation = {Distance2d 0m, i * 5cm / 4 + .5cm},
{TextShape
{format "%0.1f", opacity},
color = "white"
}
}
}
}
{let time:Time = 0s}
{let timer-button:CommandButton =
{CommandButton
label = "Start animation!",
{on Action at cb:CommandButton do
{if timer.enabled? then
set timer.enabled? = false
set cb.label = "Start animation!"
else
set timer.repeat = 600
set timer.enabled? = true
set cb.label = "Stop animation!"
}
}
}
}
{let timer:Timer =
{Timer
enabled? = false,
frequency = frequency,
{on TimerEvent at t:Timer do
{if t.repeat == 0 then
set timer-button.label = "Start animation!"
set timer.enabled? = false
}
{inc time, period}
let constant shapes:{Array-of Shape} =
group.shape-children
{for shape in group.shape-children do
let constant f:Frequency =
shape.user-data asa Frequency
let constant (x:Distance, y:Distance) =
{shape.get-origin-in-shape-parent}
{shape.set-translation-in-parent
((0.5 + 0.5 *
{cos time * 2rad * pi * f + pi * 1rad}) *
canvas.actual-width),
y
}
}
}
}
}
{value canvas}
{VBox
host-rendering-display,
advanced-operations-display
}
{value timer-button}
{RadioFrame
{VBox
spacing = 4pt,
{RadioButton radio-value = DrawOperation.source, value = true},
{RadioButton radio-value = DrawOperation.accumulate},
{RadioButton radio-value = DrawOperation.add},
{RadioButton radio-value = DrawOperation.blend},
{RadioButton radio-value = DrawOperation.blend-premultiply},
{RadioButton radio-value = DrawOperation.invert-destination},
{RadioButton radio-value = DrawOperation.invert-source},
{RadioButton radio-value = DrawOperation.mask}
},
{on ValueFinished at rf:RadioFrame do
let constant op:DrawOperation = rf.value asa DrawOperation
set group.draw-operation = op
{if op == DrawOperation.source or
op == DrawOperation.mask
then
set canvas.use-host-rendering? = true
set canvas.support-advanced-draw-operations? = false
else
set canvas.use-host-rendering? = false
set canvas.support-advanced-draw-operations? =
not (op == DrawOperation.source or
op == DrawOperation.mask or
op == DrawOperation.blend)
}
set host-rendering-display.value =
canvas.use-host-rendering?
set advanced-operations-display.value =
canvas.support-advanced-draw-operations?
}
}
|
オブジェクトのオプションの親を返します。
戻り値
オーバーライド
この ShapeContainerBase とその
注意事項
この
この Shape を
説明
この
説明
このオプションが false に設定されている場合、この Shape は描画されず、ポインタ イベントも受信しません。
回転を適用してこのオブジェクトの
例
| 例 | |
![]() | |
{import * from CURL.GUI.SHAPES}
{let shape:Shape =
{RectangleShape
translation = {Distance2d .5in, .5in},
{GRect .25in, .25in, .25in, .25in}
}
}
{Canvas width = 1in, height = 1in, border-width = 1px, shape}
{CommandButton
label = "\{apply-rotation 15deg\}",
{on Action do {shape.apply-rotation 15deg}}
}
|
スケールを適用してこのオブジェクトの
例
| 例 | |
![]() | |
{import * from CURL.GUI.SHAPES}
{let shape:Shape =
{RectangleShape
translation = {Distance2d .5in, .5in},
{GRect .25in, .25in, .25in, .25in}
}
}
{Canvas width = 1in, height = 1in, border-width = 1px, shape}
{CommandButton
label = "\{apply-scale 1.2, 1.1\}",
{on Action do {shape.apply-scale 1.2, 1.1}}
}
|
このオブジェクトの
注意事項
例
| 例 | |
![]() | |
{import * from CURL.GUI.SHAPES}
{let shape:Shape =
{RectangleShape
translation = {Distance2d .5in, .5in},
{GRect .25in, .25in, .25in, .25in}
}
}
{Canvas width = 1in, height = 1in, border-width = 1px, shape}
{let transformation:Transformation2d = {Transformation2d}}
{transformation.local-rotate 15deg}
{transformation.local-translate 1mm, 0mm}
{CommandButton
label = "\{apply-transformation transformation\}",
{on Action do {shape.apply-transformation transformation}}
}
|
平行移動を適用してこのオブジェクトの
例
| 例 | |
![]() | |
{import * from CURL.GUI.SHAPES}
{let shape:Shape =
{RectangleShape
translation = {Distance2d .5in, .5in},
{GRect .25in, .25in, .25in, .25in}
}
}
{Canvas width = 1in, height = 1in, border-width = 1px, shape}
{CommandButton
label = "\{apply-translation 2mm, 1mm\}",
{on Action do {shape.apply-translation 2mm, 1mm}}
}
|
平行移動を適用してこのオブジェクトの
注意事項
例
| 例 | |
![]() | |
{import * from CURL.GUI.SHAPES}
{let shape:Shape =
{RectangleShape
translation = {Distance2d .5in, .5in},
rotation = 45deg,
{GRect .25in, .25in, .25in, .25in}
}
}
{Canvas width = 1in, height = 1in, border-width = 1px, shape}
{CommandButton
label = "\{apply-translation 2mm, 0mm\}",
{on Action do {shape.apply-translation 2mm, 0mm}}
}
{CommandButton
label = "\{apply-translation-in-parent 2mm, 0mm\}",
{on Action do {shape.apply-translation-in-parent 2mm, 0mm}}
}
|
境界制約 (ローカル座標系) をこの Shape に適用します。
説明
注意事項
境界制約 (ローカル座標系) をこの Shape とその子すべてに適用します。
説明
この形状またはそのいずれかの子にポイントが含まれているかどうかを判定します。
説明
オーバーライド
この形状を親から切り離します。
説明