0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

iRICデフォルトのカラーマップ設定について

Posted at

iRICもv4になり色々と新機能が追加されているので、ユーザーにもっと興味を持ってもらうためと自分の備忘録としてまとめます。

iRICのデフォルトカラーマップ設定はじつは色々ある

iRICにはデフォルトのカラーマップに関する設定がいくつかあります。

  1. プロジェクト毎のデフォルトカラーマップ設定(スカラー毎に設定
  2. ソルバー毎のデフォルトカラーマップ設定(スカラー毎に設定
  3. ユーザー個人のデフォルトカラーマップ設定
  4. デフォルトのデフォルトカラーマップ設定

デフォルト設定の優先度は上記の並び順通りとなっています。

これらの設定を組み合わせることで「可視化ウィンドウを開くたびに毎回同じ設定をさせられる。。。」なんて手間から開放されるので是非活用してみてください。

以下にそれぞれの設定方法と概要、実態をまとめましたが、小難しいので大体は読み飛ばしても構いません。

それぞれの設定の概要と実態

プロジェクト毎のデフォルトカラーマップ設定

最も優先度が高く、ユーザーが一番簡単に設定できるデフォルト設定です。

プロジェクト毎のデフォルトカラーマップ設定はユーザーが任意で設定可能で、カラーマップの設定画面でデフォルトに設定するをクリックすると、そのプロジェクト内でのデフォルトのカラーマップ設定をスカラー毎に設定することが出来ます。

image.png

実態について

この設定はiRICのプロジェクトの情報が保存されているproject.xmlに以下のように記載されています。
DefaultColorMapSettings要素がプロジェクト毎のデフォルトカラーマップ設定全体のくくりとなり、その中に子要素<ColorMapSetting>としてスカラー毎のデフォルトカラーマップ設定を記載しています。

<DefaultColorMapSettings>
    <ColorMapSetting name="Depth(m)" transitionMode="0" valueMode="1" autoValueRange="false" minValue="0.1" maxValue="13" fillUppeer="true" fillLower="false" colorTableMinValue="0" visible="true" direction="0" barAutoWidth="false" barWidth="30" barAlign="1" title="Depth(m)" autoNumberOfLabels="true" numberOfLabels="9" labelSkipRate="1" labelFormat="%5.2f" titleFont="Times New Roman,20,-1,5,50,0,0,0,0,0,Regular" labelFont="Times New Roman,20,-1,5,50,0,0,0,0,0,Regular" titleColor="#000000" labelColor="#000000" backgroundColor="#ffffff" backgroundOpacityEnabled="true" backgroundOpacityPercent="20" showBorder="true" position="4" horizontalMarginRatio="0.1224" verticalMarginRatio="0.094" autoSize="true" width="636" height="126">
        <Item value="0" color="#f7fbff" transparent="false"/>
        <Item value="0.125" color="#deebf7" transparent="false"/>
        <Item value="0.25" color="#c6dbef" transparent="false"/>
        <Item value="0.375" color="#9ecae1" transparent="false"/>
        <Item value="0.5" color="#6baed6" transparent="false"/>
        <Item value="0.625" color="#4292c6" transparent="false"/>
        <Item value="0.75" color="#2171b5" transparent="false"/>
        <Item value="0.875" color="#08519c" transparent="false"/>
        <Item value="1" color="#08306b" transparent="false"/>
    </ColorMapSetting>
</DefaultColorMapSettings>

プロジェクト毎のデフォルトカラーマップ設定はiRICのGUI上で容易に変更できるのでこのproject.xmlの中身までは気にすることはあまりないでしょう。

ソルバー毎のデフォルトカラーマップ設定

プロジェクト毎のデフォルト設定の次に優先される設定です。
ユーザーが扱うには少し複雑かもしれませんが、ソルバーの計算結果のスカラー毎に設定ができるため使いこなすことが出来れば非常に便利な機能です。

このデフォルト設定はソルバーの情報を定義しているdefinition.xmlに情報を記載して設定します。

実態について

実態としてはdefinition.xml内の<GridRelatedCondition>要素内に計算結果スカラー毎の要素<Output>を定義し、この中に<ColorMapSetting>または<EnumerateColorMapSetting>として定義されています。


<GridRelatedCondition>

<!-- 実数型のカラーマップ設定の例 -->
    <Output name="ElevationChange(m)" caption="ElevationChange(m)">
		<Definition valueType="real" position="node" />
		<ColorMapSetting transitionMode="0" valueMode="1" autoValueRange="true" minValue="0" maxValue="1" fillUppeer="true" fillLower="true" colorTableMinValue="0" visible="true" direction="1" barAutoWidth="false" barWidth="30" barAlign="2" title="title" autoNumberOfLabels="true" numberOfLabels="2" labelSkipRate="1" labelFormat="%5.2f" titleFont="Arial,14,-1,5,50,0,0,0,0,0,Regular" labelFont="Arial,14,-1,5,50,0,0,0,0,0,Regular" titleColor="#000000" labelColor="#000000" backgroundColor="#ffffff" backgroundOpacityEnabled="true" backgroundOpacityPercent="20" showBorder="true" position="7" horizontalMarginRatio="0" verticalMarginRatio="0.1" autoSize="true" width="300" height="200">
			<Item value="0.000000" color="#0000ff" transparent="false"/>
			<Item value="0.500000" color="#fffefe" transparent="false"/>
			<Item value="1.000000" color="#ff0000" transparent="false"/>
		</ColorMapSetting>
	</Output>

<!-- 整数型で列挙型のカラーマップ設定の例 -->
	<Output name="HABITAT_Fr_Classes" caption="HABITAT_Fr_Classes">
		<Definition position="node" valueType="integer">
			<Enumeration value="1" caption="Pool" />
			<Enumeration value="2" caption="Glide" />
			<Enumeration value="3" caption="Run" />
			<Enumeration value="4" caption="Riffle" />
			<Enumeration value="5" caption="Cascade/rapid" />
		</Definition>
		<EnumerateColorMapSetting visible="true" direction="1" barAutoWidth="false" barWidth="30" barAlign="1" title="HABITAT_Fr_Classes" titleFont="MS UI Gothic,14,-1,5,50,0,0,0,0,0" labelFont="MS UI Gothic,11,-1,5,50,0,0,0,0,0" titleColor="#000000" labelColor="#000000" backgroundColor="#ffffff" backgroundOpacityEnabled="true" backgroundOpacityPercent="20" showBorder="true" position="7" horizontalMarginRatio="0.01" verticalMarginRatio="0.15" autoSize="false" width="300" height="200">
			<Item value="1" color="#00007f" transparent="false"/>
			<Item value="2" color="#0000ff" transparent="false"/>
			<Item value="3" color="#ffff00" transparent="false"/>
			<Item value="4" color="#ffaa00" transparent="false"/>
			<Item value="5" color="#55ff7f" transparent="false"/>
		</EnumerateColorMapSetting>
	</Output>
</GridRelatedCondition>

この設定についてはソルバー開発者がdefinition.xml<GridRelatedCondition>に計算結果スカラー毎の要素<Output>を登録していない場合、ユーザーで追加しなければいけないので少し面倒ですが、以下の記事で<Output>登録の作業手順を紹介していますので挑戦したい方は読んでみてください。

https://qiita.com/starfieldKt/items/ee1b4822b4654adb54b3

definition.xmlの要素のリファレンスはこちらです。

https://iric-solver-dev-manual.readthedocs.io/ja/v4_jp/05/04_reference.html

ユーザー個人のデフォルトカラーマップ設定

プロジェクト毎、ソルバー毎の設定がされていない場合、この設定がデフォルトとして反映されます。
上記の2つとは違い、ここでの設定はスカラーごとには設定されず、実数型のスカラー全てに反映されます。

iRICをインストールした段階ではこれは設定されていないので、ユーザーが設定をする必要があります。
簡単な設定方法は好みのカララーマップ設定をiRIC上で調整し、IRICROOT/private/colormapsdefault.cmsettingという名前でカラーマップ設定ファイルを出力してください。

IRICROOTはiRICがインストールされているフォルダです)

実態について

実態はIRICROOT/private/colormapsに置かれているdefault.cmsettingというカラーマップ設定ファイルです。
default.cmsettingとうファイル名であればよいので、気に入ったカラーマップ設定をiRICからエクスポートしてdefault.cmsettingにリネームするだけで設定ができます。

詳しくは以下の記事で解説していますのでそちらを御覧ください。

https://qiita.com/starfieldKt/items/20ff99ab058e52e84b02#%E7%95%AA%E5%A4%96%E7%B7%A8%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E3%81%AE%E3%82%AB%E3%83%A9%E3%83%BC%E3%83%9E%E3%83%83%E3%83%97%E3%82%92%E5%A4%89%E6%9B%B4%E3%81%99%E3%82%8B

デフォルトのデフォルトカラーマップ設定

上記のデフォルト設定がすべてない際に読み込まれるデフォルトのカラーマップ設定です。
iRICをインストールした時点での初期のデフォルトカラーマップ設定になります。

見慣れた虹色のやつです。
特にユーザーがこの設定を変更することはありません
image.png

実態について

実態はIRICROOT/colormapsに置かれているdefault.cmsettingというカラーマップ設定ファイルです。

image.png

個人のデフォルト設定としてIRICROOT/private/colormaps/default.cmsettingを作成せず、こちらの設定を直接弄っても別に問題はありませんが、バックアップ的な意味でこちらは編集しないことをおすすめします。

カラーマップ設定の要素、属性について

ここまで4つのデフォルトカラーマップ設定の概要と実態について説明しました。

「プロジェクト毎の設定」と「ソルバー毎の設定」はそれぞれproject.xmldefinition.xmlに記載、
「ユーザー個人のデフォルト設定」と「デフォルトのデフォルト設定」については特定のディレクトリにdefault.cmsettingを配置するということで、カラーマップ設定の情報の持ち方はそれぞれでした。

ただし、カラーマップ設定の要素の書き方はすべて同じです。
実数型の場合は以下のようになりますが、これはカラーマップ設定ファイル(*.cmsetting)の中身そのものです。

<ColorMapSetting 
transitionMode="0" valueMode="1" autoValueRange="true" minValue="0" maxValue="1" fillUppeer="true" fillLower="true" colorTableMinValue="0" visible="true" direction="1" barAutoWidth="false" barWidth="30" barAlign="1" title="title" autoNumberOfLabels="true" numberOfLabels="2" labelFormat="%5.2f" titleFont="Century Gothic,14,-1,5,50,0,0,0,0,0,Regular" labelFont="Century Gothic,14,-1,5,50,0,0,0,0,0,Regular" titleColor="#000000" labelColor="#000000" backgroundColor="#ffffff" backgroundOpacity="20" position="7" horizontalMarginRatio="0" verticalMarginRatio="0.1" width="300" height="200">
    <Item value="0" color="#0000ff" transparent="false"/>
    <Item value="0.25" color="#00ffff" transparent="false"/>
    <Item value="0.5" color="#00ff00" transparent="false"/>
    <Item value="0.75" color="#ffff00" transparent="false"/>
    <Item value="1" color="#ff0000" transparent="false"/>
</ColorMapSetting>

この内容に興味があれば以下の記事の「【番外編2】カラーマップの設定ファイルの中身」を読んでみてください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?