FF517 ポスト処理関数-レジェンド
 
 ◆ 概要 ◆

FieldView固有の機能へのアクセスを提供するポスト処理関数について説明します。ここでは、ポスト処理関数のうち、レジェンド(Legend)の生成を行う関数について説明します。
※関数の入力引数としてリストされたテーブルの値は、必ずしも必要ではありません。 ほとんどの場合、入力にフィールドが指定されていない場合、そのフィールドのデフォルト値が使用されます。

 ◆ 詳細 ◆
 

FVXレジェンド

サーフェスおよびRakeのビジュアライゼーションパネルのLegendタブ上でのインタラクティブなレジェンド生成(”Working with FieldView” のChapter 2 FieldView Interface - Visualization Panels - Legend Tab Controlsを参照)をFVXで行うことができます。 2つのフィールドshow_legendとlegend(テーブル)はComp、Coord、Iso、Boundary、Streamlines、Particle Pathsの入力テーブルとクエリテーブルに含まれます。のビジュアライゼーションパネルのLegendタブのShow Legendチェックボックスと同様、フィールドshow_legendは、デフォルトではオフです。show_legendがオンの場合、scalar_funcフィールドで定義されているカレントのスカラー関数の凡例が表示されます。scalar_funcが "none"の場合、エラーが発生します。

FVX_Legends
このテーブルはcreate_coord、create_boundary、create_comp、create_iso、create_streamline、read_particle_pathに適用可能なレジェンドのFVXによる指定方法を示しています。
入力フィールド データ型 コメント デフォルト値
show_legend string “on” または “off” “off”
legend table    
type string “spectrum” または “contour” n/a
spectrum table スペクトル表示を制御するパラメータ  
border string “on” または “off” “off”
colorbar string “on” または “off” “on”
horizontal string “yes” または “no” “no”
num_labels number レジェンドのラベル数に対応する2〜52の整数 2
contour table    
labels_per_line string “single” または “multi”
typeが "spectrum"の場合、contourサブテーブルは無視されます
“single”
labels string “on” または “off” “on”
labels_parameters table    
size number フォントサイズを選択する1〜100の整数 10
coloring number
または
string
“white”, “black”, または 1~8の数字  
decimal_places number レジェンドのラベルの有効桁数を指定する0〜6の整数 3
numerical_format string “floating_point”, “exponential” または “powers_of_ten” “floating_point”
font string “lee”, “lee bold”, “lee italic”, “lee bold italic”, “leemono”, “leemono bold”, “leemono italic”, “leemono bold italic”, “leese”, “leese bold”, “roman sans serif”, “roman”, “italics”, “script” “lee”
relative_position table レジェンドの左上隅の位置の-1と1の間で正規化されたXとYの表示座標 XとYの両方とも0.85
scale_height number レジェンドの垂直スケーリングを指定する実数値 1
scale_width number レジェンドの水平スケーリングを指定する実数値 1
annotation string “on” または “off” “on”
annotation_parameters table    
position string “top”, “bottom”, “left”, “right” “top”
title table デフォルトは%%SCALAR_FUNC  
size number フォントサイズを選択する1〜100の整数 10
color number
または
string
“white”, “black”, または 1~8の数字  
text string レジェンドのメインタイトル n/a
font string “lee”, “lee bold”, “lee italic”, “lee bold italic”, “leemono”, “leemono bold”, “leemono italic”, “leemono bold italic”, “leese”, “leese bold”, “roman sans serif”, “roman”, “italics”, “script” “lee”
subtitle table デフォルトは%%CURRENT n/a
size number フォントサイズを選択する1〜100の整数 8
color number
または
string
“white”, “black”, または 1~8の数字  
text string レジェンドのサブタイトル  
font string “lee”, “lee bold”, “lee italic”, “lee bold italic”, “leemono”, “leemono bold”, “leemono italic”, “leemono bold italic”, “leese”, “leese bold”, “roman sans serif”, “roman”, “italics”, “script” “lee”
frame string “on” または “off” “off”
background string “on” または “off” “off”

レジェンドのtypeが“spectrum”(デフォルト)の場合、spectrumサブテーブル中で、colorbarがon(デフォルト)かoffか、borderがonかoff(デフォルト)か、レジェンド表示がhorizontalかどうか(デフォルトはno)、ラベルの数num_labels(デフォルトは2、範囲は2〜52)を指定します。レジェンドのtypeが“contour”の場合、labels_per_lineには “single”(デフォルト)または “multi”を指定します。 この際、display_typeはcontour_linesでなければならないことに注意してください。contourタイプのレジェンドはサーフェスに対してのみに有効です。

レジェンドの位置はrelative_positionフィールドによって指定します。relative_positionフィールドは、XとYが-1と1の間で正規化された表示座標です(両方ともデフォルト0.85)。この正規化された表示座標はリスタートファイル(legend_xposとlegend_ypos)で使用される座標と同じものです。画面上の位置は、絶対ピクセル座標で定義されるAnnotationオブジェクトとは異なることに注意してください。

scale_widthとscale_heightはレジェンドの幅と高さをスケーリングする倍率です。どちらもデフォルトは1で、FieldViewで計算されたレジェンドのサイズに対応します。レジェンドサイズはインタラクティブに変更することもでき、色に関連するものを除くほとんどのレジェンド属性の影響を受けることに注意してください。レジェンドタイプがspectrumの場合のスケーリング条件は、次の規則を使用して決定されます。
・ colorbarをonにした場合、scale_widthとscale_heightの両方が適用されます。
・ colorbarをoffにした場合、horizontalフィールドがスケーリングを決定します。noに設定すると、scale_heightが適用され、scale_widthは無視されます。 yesに設定すると、scale_widthが適用され、scale_heightは無視されます。

レジェンドタイプがcontourの場合、scale_heightが適用され、scale_widthは無視されます。

labelsフィールドがon(デフォルト)の場合、labels_parametersサブテーブル中で、カラーリング(スカラー、白(デフォルト)、黒、または、1〜8の数字)、使用するフォント(上の表を参照)、数値ラベルのsize(デフォルト10、範囲1〜100)、 numerical_format(デフォルトはfloating_pointまたはexponential)、およびdecimal_places(小数点以下の桁数、デフォルト3、範囲0〜6)を指定します。

annotationフィールドがオン(デフォルト)の場合、annotation_parametersサブテーブル中で、タイトルおよびサブタイトルを指定できます。アノテーションの位置は、レジェンドのtop(デフォルト)、left、rightまたはbottomに設定できます。 タイトルのデフォルトテキストは%%SCALAR_FUNCです。 サブタイトルのデフォルトテキストはComp、Coord、Isoの場合、%%CURRENTです。 空の文字列を使用して、レジェンドからタイトルまたはサブタイトルを削除することもできます。デフォルトサイズは、タイトルが10、サブタイトルが8で、1〜100の範囲で指定します。タイトルとサブタイトルの色には、白(背景色が白でない場合はデフォルト)、黒(背景色が白である場合はデフォルト)または1〜8の数字を指定します。

レジェンドとその背景を囲むフレームはonまたはoff(デフォルト)に指定します。

コンプリートリスタートファイル保存時、ガイドFVXファイルには、サポートされている全ての可視化オブジェクトとともに表示されるレジェンドの完全な構文が含まれます。以下にその例を示します。

create_coord(   { show_legend = "on",
    legend = {
      type = "spectrum",

      relative_position = {
        0.85,
        0.85,
      }, -- relative_position

      scale_height = 1,
      scale_width = 1,

      frame = "off",
      background = "off",

      spectrum = {
        border = "off",
        colorbar = "on",
        horizontal = "no",
        num_labels = 2,
      }, -- spectrum

      labels = "on",
      labels_parameters = {
        size = 10,
        coloring = "white",
        decimal_places = 3,
        numerical_format = "floating_point",
        font = "lee",
      }, -- labels_parameters

      annotation = "on",
      annotation_parameters = {
        position = "top",
        title = {
          size = 10,
          color = "white",
          text = "%%SCALAR_FUNC",
          font = "lee",
        }, -- title
        subtitle = {
          size = 8,
          color = "white",
          text = "%%CURRENT",
          font = "lee",
        }, -- subtitle
      }, -- annotation_parameters
    }, -- legend

    display_type = "constant_shading",
    contours = "none",
    scalar_range = {
      min = 355.9788818359375,
      max = 1907.152587890625,
    }, -- scalar_range
    dataset = 1,
    scalar_func = "temperature",
    axis = "X",
    show_mesh = "off",
    X_axis = {
      current = -0.01,
    }, -- X_axis
  }
) -- coord_surfs[1]

・この資料の内容は予告なしに変更されることがあります。
・いかなる場合でも、この資料の内容およびその運用の結果に関しては一切の責任を負いません。
・この資料の一部または全部を無断で使用、作成することはできません。
All rights reserved by Vinas Co., Ltd.
sales@vinas.com