OSDN Git Service

modify javadoc format.
[mikutoga/TogaGem.git] / src / main / java / jp / sfjp / mikutoga / pmd / parser / PmdMaterialHandler.java
1 /*
2  * PMD material information handler
3  *
4  * License : The MIT License
5  * Copyright(c) 2010 MikuToga Partners
6  */
7
8 package jp.sfjp.mikutoga.pmd.parser;
9
10 import jp.sfjp.mikutoga.bin.parser.LoopHandler;
11 import jp.sfjp.mikutoga.bin.parser.MmdFormatException;
12 import jp.sfjp.mikutoga.bin.parser.ParseStage;
13
14 /**
15  * PMDモデルの各種材質情報の通知用ハンドラ。
16  * 色空間はsRGB?
17  */
18 public interface PmdMaterialHandler extends LoopHandler {
19
20     /** 材質抽出ループ。 */
21     ParseStage MATERIAL_LIST = new ParseStage();
22
23     /**
24      * 材質の拡散光成分の通知を受け取る。
25      *
26      * <p>{@link #MATERIAL_LIST}ループの構成要素。
27      *
28      * @param red 0.0~1.0の範囲の赤成分
29      * @param green 0.0~1.0の範囲の緑成分
30      * @param blue 0.0~1.0の範囲の青成分
31      * @param alpha 0.0(透明)~1.0(不透明)のアルファ値。
32      * @throws MmdFormatException 不正フォーマットによる
33      *     パース処理の中断をパーサに指示
34      */
35     void pmdMaterialDiffuse(float red, float green, float blue,
36                                float alpha )
37             throws MmdFormatException;
38
39     /**
40      * 材質の反射光成分の通知を受け取る。
41      *
42      * <p>{@link #MATERIAL_LIST}ループの構成要素。
43      *
44      * @param red 0.0~1.0の範囲の赤成分
45      * @param green 0.0~1.0の範囲の緑成分
46      * @param blue 0.0~1.0の範囲の青成分
47      * @param shininess 光沢強度(1~15ぐらい)
48      * @throws MmdFormatException 不正フォーマットによる
49      *     パース処理の中断をパーサに指示
50      */
51     void pmdMaterialSpecular(float red, float green, float blue,
52                                 float shininess)
53             throws MmdFormatException;
54
55     /**
56      * 材質の環境色成分の通知を受け取る。
57      *
58      * <p>{@link #MATERIAL_LIST}ループの構成要素。
59      *
60      * @param red 0.0~1.0の範囲の赤成分
61      * @param green 0.0~1.0の範囲の緑成分
62      * @param blue 0.0~1.0の範囲の青成分
63      * @throws MmdFormatException 不正フォーマットによる
64      *     パース処理の中断をパーサに指示
65      */
66     void pmdMaterialAmbient(float red, float green, float blue)
67             throws MmdFormatException;
68
69     /**
70      * シェーディング情報の通知を受け取る。
71      *
72      * <p>{@link #MATERIAL_LIST}ループの構成要素。
73      *
74      * @param toonIdx トゥーンファイル番号。
75      *     0ならtoon01.bmp。9ならtoon10.bmp。0xffならtoon0.bmp。
76      * @param textureFile テクスチャファイル名。
77      *     無ければ空文字。
78      * @param sphereFile スフィアマップファイル名。
79      *     無ければ空文字。
80      * @throws MmdFormatException 不正フォーマットによる
81      *     パース処理の中断をパーサに指示
82      */
83     void pmdMaterialShading(int toonIdx,
84                                String textureFile, String sphereFile )
85             throws MmdFormatException;
86
87     /**
88      * 材質情報の通知を受け取る。
89      *
90      * <p>{@link #MATERIAL_LIST}ループの構成要素。
91      *
92      * @param hasEdge エッジを表示するならtrue
93      * @param vertexNum 面頂点数。
94      *     3の倍数のはず。
95      *     3で割ると、材質に属する面の数を表す。
96      *
97      *     <p>通算した面数を面情報通知順と突き合わせることにより、
98      *     材質に属する面の集合を得ることが可能。
99      *
100      * @throws MmdFormatException 不正フォーマットによる
101      *     パース処理の中断をパーサに指示
102      * @see PmdShapeHandler#pmdSurfaceTriangle(int, int, int)
103      */
104     void pmdMaterialInfo(boolean hasEdge, int vertexNum)
105             throws MmdFormatException;
106
107 }