2 * shading information
\r
4 * License : The MIT License
\r
5 * Copyright(c) 2010 MikuToga Partners
\r
8 package jp.sourceforge.mikutoga.pmd;
\r
13 public class ShadeInfo {
\r
15 private ToonMap toonMap = new ToonMap();
\r
16 private int toonIdx;
\r
18 private String textureFileName = null;
\r
19 private String spheremapFileName = null;
\r
31 * @param map トゥーンマップ
\r
33 public void setToonMap(ToonMap map){
\r
42 public ToonMap getToonMap(){
\r
43 return this.toonMap;
\r
48 * @param idx トゥーンインデックス
\r
50 public void setToonIndex(int idx){
\r
57 * @return トゥーンインデックス値
\r
59 public int getToonIndex(){
\r
60 return this.toonIdx;
\r
64 * トゥーンインデックス値が有効か判定する。
\r
65 * 現時点では0から9までの値を有効とする。
\r
68 public boolean isValidToonIndex(){
\r
69 if(0 <= this.toonIdx && this.toonIdx <= 9) return true;
\r
76 * @throws IllegalStateException トゥーンマップが設定されていない。
\r
78 public String getToonFileName() throws IllegalStateException{
\r
79 if(this.toonMap == null) throw new IllegalStateException();
\r
80 String result = this.toonMap.getIndexedToon(this.toonIdx);
\r
86 * @param fileName テクスチャファイル名
\r
88 public void setTextureFileName(String fileName){
\r
89 this.textureFileName = fileName;
\r
95 * @return テクスチャファイル名
\r
97 public String getTextureFileName(){
\r
98 return this.textureFileName;
\r
102 * スフィアマップファイル名を設定する。
\r
103 * @param fileName スフィアマップファイル名
\r
105 public void setSpheremapFileName(String fileName){
\r
106 this.spheremapFileName = fileName;
\r
112 * @return スフィアマップファイル名
\r
114 public String getSpheremapFileName(){
\r
115 return this.spheremapFileName;
\r
120 * @return {@inheritDoc}
\r
123 public String toString(){
\r
124 StringBuilder result = new StringBuilder();
\r
126 result.append("toon(")
\r
127 .append(this.toonIdx)
\r
129 .append(getToonFileName())
\r
131 result.append("texture=")
\r
132 .append(this.textureFileName)
\r
134 result.append("sphere=")
\r
135 .append(this.spheremapFileName);
\r
137 return result.toString();
\r