dcmodel 用お絵描きサムネイル作成スクリプト
Authors : | Yukiko YAMADA, Yasuhiro MORIKAWA, Shin-ichi TAKEHIRO
|
Version : | $Id: dcmodel-thum.rb,v 1.31 2007/05/22
05:13:14 morikawa Exp $
|
Source : | $Source:
/GFD_Dennou_Club/ftp/arch/dcmodel/cvsroot/dcmodel-tools/dcmodel-thum.rb,v $
|
Overview
実験結果 (主に dcmodel のモデル群によって得られた結果を描画したもの)
を手っ取り早くサムネイル化して表示するための クラスライブラリです。
NetCDF などの流体データから画像を作成する作業に関しては別途
行う必要があります。このクラスライブラリはあくまで、HTML を記述する (特に
TABLE タグ等を記述する) 労力を低減することを目的としています。
このファイル自体は、クラスライブラリ本体に加え、
クラスを用いたサンプルスクリプトを出力するためのメソッドも記載
されています。使い方に関しては Usage を参照ください。
Operation Environment
本プログラムは、ruby 1.8.2 (2005-01-10) [i386-linux] での
動作を確認しています。
なお、ruby 1.6.7 (2002-03-19) [i386-linux] でならば、 pathname.rb を
RUBYPATH の通ったところに置けば動作します。
Usage
まず、画像ファイル置き場として figdir を、サムネイル作成の
ための情報置き場として thum-src ディレクトリを作成します。 そして thum-src
ディレクトリへ移動した後、このスクリプト本体 を実行してください。
$ mkdir figdir thum-src
$ cd thum-src
$ ruby dcmodel-thum.rb
すると、サンプルとなる Ruby スクリプトが出力されます。
次にそのスクリプトを実行します。
$ ruby dcmodel-thum-make.rb
すると、../sample_thum.htm などのようなファイルが生成されるはずです。
そのファイルにチュートリアルが載っているので、これより以降の
詳しい手順はそちらを参照してください。 同様に sample_thum.txt
というファイルも作成れます。
そちらはサムネイルの個々の画像用のコメント等を記述するファイルです。
大雑把な流れは以下のようになります。
- dcmodel-thum.rb を実行して
dcmodel-thum-make.rb を作成。
- dcmodel-thum-make.rb を編集。(主に、サムネイル HTML のスタイルなどを設定)
- sample_thum.txt を編集
- dcmodel-thum-make.rb を再度実行
なお、生成された Ruby スクリプトは本スクリプトに依存おり、
生成される際に絶対パスで本スクリプトを指定するようになります。
本スクリプトの移動や他のホストでの利用の際には注意しましょう。
Desctiption
このプログラムの内部仕様に関しては、この Ruby スクリプトに RDoc を
使うと見やすいドキュメントが生成されるでしょう。
$ rdoc --op doc --title DCModelThumbnail --charset euc-jp --inline-source --line-numbers --all dcmodel-thum.rb
機能の拡張以外にも、外部から別箇呼べるメソッドもあるので、
参考にしてください。
Future Plans
- rttool を用いた DCModelThumbnail.rt2html を作成する。
- DCModelThumbnail.rd2html
において、現在 rd2html-ext-lib の使用が
必須になっているが、ライブラリが存在するかサーチする必要があるだろう。
サーチして存在しない場合は、Warning を発して rd2html-lib を用いるか、
エラーを吐くようにする。
Notes
今のところ、特になし。
Acknowledgements
本プログラムは、 dcphoto.pl <www.ep.sci.hokudai.ac.jp/~totera/official/program/dcphoto/>
Ver 1.02 - 写真用 HTML作成スクリプト (Chihiro MITSUDA) を元に ruby
で作成された ape-thum.rb (Yukiko YAMADA) を dcmodel の開発者が
共有できるように改良したものです。そのオリジナルは <www.gfd-dennou.org/library/dcmodel/ClipBoard/dcmodel-thum_2005-04-06/>
(Yukiko Yamada) です。 これはちょうど本プログラムのバージョン 1.1
に対応します。
History
These entries is generated by CVS automatically. So don‘t add new
information manually. (But please adjust old log format to latest log
format manually, if format gap between them causes).
$Log: dcmodel-thum.rb,v $ Revision 1.31
2007/05/22 05:13:14 morikawa
- Documents are modified again.
- ドキュメントの再度の修正.
Revision 1.30 2007/05/22 05:11:19 morikawa
- Documents are modified.
- ドキュメントの修正.
Revision 1.29 2007/05/22 05:00:31 morikawa
- Documents are modified.
- Hyperlinks with RD label between header, thumbnail, footer are available.
- ドキュメントの修正.
- RD ラベルに対するハイパーリンクをヘッダ, サムネイル, フッタ間で 可能にする.
Revision 1.28 2006/02/11 19:48:19 morikawa
- A misprint of tutorial is modified.
- チュートリアルの誤植を修正.
Revision 1.27 2006/02/11 17:25:14 morikawa
- Messages can be added to footer.
- フッターにメッセージを追加できるよう修正.
Revision 1.26 2006/02/11 13:49:13 morikawa
- URL of web site of RD is modified.
- RD に関する Web サイトの URL を修正.
Revision 1.25 2006/02/11 13:39:48 morikawa
- URL of dcmodel site is modified.
- "blankfig" is added. This is a flag for nodisplay of file names.
- A display of file names is controlled by giving the modifier "b".
- In "dcmodel-thumb-make.rb", a format of comments is changed to
trailing comments.
- dcmodel のページの URL を修正.
- ファイル非表示用のフラグ blankfig を追加.
- 修飾子に b を与えることで, そのファイル名の表示を抑止.
- dcmodel-thumb-make.rb の各インスタンスに関するコメントの書式をトレイ
リングコメントに変更.
Revision 1.24 2005/12/09 07:45:36 morikawa
- If "DCModelThumbnail.convert_overwrite" is false, modified time
of files are checked too.
- フラグ DCModelThumbnail.convert_overwrite のチェックの際,
ファイルの存在だけでなく, タイムスタンプでチェックするよう修正.
Revision 1.23 2005/12/09 07:23:12 morikawa
- "DCModelThumbnail.convert_overwrite" is added. If this variable
is false and converted files are exist, convert command is not executed.
- convert コマンドが実行される, 既に出力先のファイルがある場合に上書きする
ためのフラグ DCModelThumbnail.convert_overwrite を追加. これが false
の場合, 出力先のファイルが存在する時は変換コマンドの 実行をスキップする.
Revision 1.22 2005/12/07 14:57:31 yukiko
- Fixed bug which cannot generate of thumbnail figures when the
"thumb.headlimit" is specified
- "thumb.headlimit" を指定すると convert 出来ないバグを修正
Revision 1.21 2005/11/09 10:43:15 morikawa
Revision 1.20 2005/11/05 01:06:32 takepiro
- Regular expression for extracting tailing suffix from the figure filenames
modified.
- 画像ファイルの拡張子を取りだす正規表現を変更した。
Revision 1.19 2005/11/02 03:50:29 morikawa
- When the label of the info file is "title" or
"message", images are not converted.
- 情報ファイルのラベルが "title", "message"
の場合には画像変換 しないよう修正.
Revision 1.18 2005/11/02 00:59:59 takepiro
- Cheking the status of thumnail generation process.
- サムネイル画像生成プロセスステータスのチェックを追加.
Revision 1.17 2005/11/01 09:31:00 morikawa
- New instance variable "convert_cmd" is added to change
"convert" command by users.
- The command for image conversion is checked.
- Messages in process of conversion are decorated.
- The SIGEN file for the directory for thumbnail images is created
automatically.
- "Maintainer" in SIGEN file is specified to account name when
"gate-toroku-system" is not available.
- convert コマンドをユーザレベルで変更できるよう新たなインスタンス 変数
convert_cmd を追加.
- 画像変換ツールの有無をチェックする機能を追加.
- 画像変換中のメッセージを装飾.
- サムネイル画像置き場ディレクトリの SIGEN ファイルを作成するようにし た.
- gate システムからユーザ名を取得できない場合, アカウント名を SIGEN
ファイルに書き出すよう修正.
Revision 1.16 2005/11/01 06:46:24 takepiro
- Automatic generation of thumbnail figures implemented.
- Each one page can be extracted as a thumbnail from each animation file,
such as gif-anime.
- サムネイル画像の自動生成機能を追加した。
- アニメーションファイル(gif-anime 等)から 1
ページを取りだしてサムネイル化できるようにした。
Revision 1.15 2005/10/31 02:41:34 morikawa
Revision 1.14 2005/05/25 15:54:32 morikawa
- Enable to specify whether to allow search of robots by
DCModelThumbnail.norobots .
- Allow search of robots by default.
- Add to tutorial about generation of SIGEN file.
- Add to tutorial about search of robots.
- HTML のロボット検索を許可するかどうか指定できるようにした。
- デフォルトでロボット検索を許可するようにした。
- SIGEN ファイル生成に関してチュートリアルにも記載した。
- ロボット検索の指定に関してチュートリアルにも記載した。
Revision 1.13 2005/05/15 20:21:51 morikawa
- Use "ruby1.8" instead of "ruby" in dcmodel-thum-make.rb
. (This should be modified by modification before).
Revision 1.12 2005/05/15 19:58:29 morikawa
- Use "ruby1.8" instead of "ruby". (This program depends
on pathname.rb that is included ruby 1.8).
Revision 1.11 2005/04/30 20:30:37 morikawa
- Create SIGEN file automatically.
Revision 1.10 2005/04/30 18:54:24 morikawa
Revision 1.9 2005/04/30 18:18:02 morikawa
Revision 1.8 2005/04/30 17:50:05 morikawa
Revision 1.7 2005/04/30 09:43:19 morikawa
- In "info_get", when multi-line input, permit input ":".
Revision 1.6 2005/04/30 09:07:14 morikawa
- In "info_make", cause error if any image files are not found.
Revision 1.5 2005/04/21 13:03:17 morikawa
Revision 1.4 2005/04/21 12:57:23 morikawa
Revision 1.3 2005/04/21 09:24:06 morikawa
- Add "Operation Environment"
- Output detail sample messages.
- In DCModelThumbnail.rd2html
, modify to remove only "^=begin" and "^=end"
- Add Comment for sample rb script.
- Output Help message when argument is given.
Revision 1.2 2005/04/19 20:32:19 morikawa
- Modify internal structure.
- Revise for "rdoc" documentation format.
- RD format context is supported.
- Add various options in "infofile".
- Use "keyword substitution" in CVS for version control.
Revision 1.1 2005/04/19 19:54:23 morikawa
- This script generate Thumbnail HTML for calculation result figures. The
author of the original is Yukiko Yamada. She rename her
"ape-thum.rb" to "dcmodel-thum.rb" for sharing by
dcmodel developers and users.