SaveOptions
Inheritance: java.lang.Object, com.aspose.threed.IOConfig
public class SaveOptions extends IOConfig
さまざまなタイプのファイル保存オプションを構成するための基底クラス
メソッド
| メソッド | 説明 |
|---|---|
| equals(Object arg0) | |
| getClass() | |
| getEncoding() | テキストベースのファイルのデフォルトエンコーディングを取得します。 |
| getExportTextures() | シーンで使用されているテクスチャを出力ディレクトリにコピーしようとします。 |
| getFileFormat() | 現在の保存/読み込みオプションで指定されたファイル形式を取得します。 |
| getFileName() | エクスポート/インポートシーンのファイル名。 |
| getFileSystem() | ロード/セーブ時に外部依存関係を管理する方法をユーザーが処理できるようにします。 |
| getFileSystemFactory() | FileSystem のファクトリークラスを取得します。 |
| getLookupPaths() | OBJ のような一部のファイルは外部ファイルに依存しており、検索パスにより Aspose.3D が外部ファイルを読み込むために探すことができます。 |
| hashCode() | |
| notify() | |
| notifyAll() | |
| setEncoding(Charset value) | テキストベースのファイルのデフォルトエンコーディングを設定します。 |
| setExportTextures(boolean value) | シーンで使用されているテクスチャを出力ディレクトリにコピーしようとします。 |
| setFileName(String value) | エクスポート/インポートシーンのファイル名。 |
| setFileSystem(FileSystem value) | ロード/セーブ時に外部依存関係を管理する方法をユーザーが処理できるようにします。 |
| setFileSystemFactory(FileSystemFactory value) | FileSystem のファクトリークラスを設定します。 |
| setLookupPaths(ArrayList | OBJ のような一部のファイルは外部ファイルに依存しており、検索パスにより Aspose.3D が外部ファイルを読み込むために探すことができます。 |
| toString() | |
| wait() | |
| wait(long arg0) | |
| wait(long arg0, int arg1) |
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| arg0 | java.lang.Object |
Returns: boolean
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getEncoding()
public Charset getEncoding()
テキストベースのファイルのデフォルトエンコーディングを取得します。デフォルト値は null で、インポーター/エクスポーターが使用するエンコーディングを決定します。
Returns: java.nio.charset.Charset - テキストベースのファイルのデフォルトエンコーディングです。デフォルト値は null で、インポーター/エクスポーターが使用するエンコーディングを決定します。
getExportTextures()
public boolean getExportTextures()
シーンで使用されているテクスチャを出力ディレクトリにコピーしようとします。
Returns: boolean - シーンで使用されているテクスチャを出力ディレクトリにコピーしようとします。
getFileFormat()
public FileFormat getFileFormat()
現在の保存/読み込みオプションで指定されたファイル形式を取得します。
Returns: FileFormat - the file format that specified in current Save/Load option.
getFileName()
public String getFileName()
エクスポート/インポートシーンのファイル名です。これはオプションですが、OBJ のマテリアルのような外部アセットをシリアライズする際に便利です。
Returns: java.lang.String - エクスポート/インポートシーンのファイル名です。これはオプションですが、OBJ のマテリアルのような外部アセットをシリアライズする際に便利です。
getFileSystem()
public FileSystem getFileSystem()
ロード/セーブ時に外部依存関係を管理する方法をユーザーが処理できるようにします。
Returns: FileSystem - Allow user to handle how to manage the external dependencies during load/save. Example: The default FileSystem is LocalFileSystem, it is not safe in environment like server side, But you can override the file system access by specifying a different implementation. Aspose.3D provides different FileSystem implementation like:
- Memory-based file system
- Directory-based file system
- Dummy file system
- Zip file system
また、独自の実装を使用することもできます。
Scene scene = new Scene();
var material = new PhongMaterial();
var boxNode = scene.getRootNode().createChildNode(new Box());
boxNode.setMaterial(material);
var opt = new ObjSaveOptions();
var memFs = new HashMap<string, MemoryStream>();
opt.setFileSystem(FileSystem.createMemoryFileSystem(memFs));
opt.setFileName("output.obj");
try(var output = new ByteArrayOutputStream()) {
scene.save(output, opt);
//The material will be written to variable memFs named output.mtl
var materialInBytes = memFs["output.mtl"].toArray();
}
getFileSystemFactory()
public static FileSystemFactory getFileSystemFactory()
FileSystem のファクトリークラスを取得します。デフォルトのファクトリーは com.aspose.threed.LocalFileSystem を作成しますが、サーバー環境には適していません。
Returns: FileSystemFactory - the factory class for FileSystem. The default factory will create com.aspose.threed.LocalFileSystem which is not suitable for server environment. Example: The default FileSystem in SaveOptions/LoadOptions is directory-based file system, You can override the default implementation by specify it through IOConfig.FileSystemFactory:
IOConfig.setFileSystemFactory(new FileSystemFactory() {
@Override
public FileSystem call() {
return FileSystem.createDummyFileSystem();
}
});
Scene scene = new Scene();
var material = new PhongMaterial();
var boxNode = scene.getRootNode().createChildNode(new Box());
boxNode.setMaterial(material);
//opt.FileSystem would be dummy file system now
var opt = new ObjSaveOptions();
scene.Save("output.obj", opt);
//the material file output.mtl will not be written to any places because we've configured a dummy file system as default implementation.
getLookupPaths()
public ArrayList<String> getLookupPaths()
OBJ のような一部のファイルは外部ファイルに依存しており、検索パスにより Aspose.3D が外部ファイルを読み込むために探すことができます。
Returns: java.util.ArrayList<java.lang.String> - OBJ のような一部のファイルは外部ファイルに依存しており、検索パスにより Aspose.3D が外部ファイルを探してロードできるようになります。Example: 以下のコードは、テクスチャの検索パスを手動で指定する方法を示しており、インポーターが見つけられるようにします
var opt = new ObjLoadOptions();
//Specify the lookup paths, so the textures can be located.
opt.getLookupPaths().add("textures");
var scene = Scene.fromFile("input.obj", opt);
scene.save("output.glb");
hashCode()
public native int hashCode()
Returns: int
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
setEncoding(Charset value)
public void setEncoding(Charset value)
テキストベースのファイルのデフォルトエンコーディングを設定します。デフォルト値は null で、インポーター/エクスポーターが使用するエンコーディングを決定することを意味します。
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| 値 | java.nio.charset.Charset | 新しい値 |
setExportTextures(boolean value)
public void setExportTextures(boolean value)
シーンで使用されているテクスチャを出力ディレクトリにコピーしようとします。
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| 値 | boolean | 新しい値 |
setFileName(String value)
public void setFileName(String value)
エクスポート/インポートシーンのファイル名です。これはオプションですが、OBJ のマテリアルのような外部アセットをシリアライズする際に便利です。
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| 値 | java.lang.String | 新しい値 |
setFileSystem(FileSystem value)
public void setFileSystem(FileSystem value)
ロード/セーブ時に外部依存関係を管理する方法をユーザーが処理できるようにします。
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| value | FileSystem |
- Memory-based file system
- Directory-based file system
- Dummy file system
- Zip file system
また、独自の実装を使用することもできます。
Scene scene = new Scene();
var material = new PhongMaterial();
var boxNode = scene.getRootNode().createChildNode(new Box());
boxNode.setMaterial(material);
var opt = new ObjSaveOptions();
var memFs = new HashMap<string, MemoryStream>();
opt.setFileSystem(FileSystem.createMemoryFileSystem(memFs));
opt.setFileName("output.obj");
try(var output = new ByteArrayOutputStream()) {
scene.save(output, opt);
//The material will be written to variable memFs named output.mtl
var materialInBytes = memFs["output.mtl"].toArray();
}
``` |
### setFileSystemFactory(FileSystemFactory value) {#setFileSystemFactory-com.aspose.threed.FileSystemFactory-}
public static void setFileSystemFactory(FileSystemFactory value)
FileSystem のファクトリークラスを設定します。デフォルトのファクトリーは com.aspose.threed.LocalFileSystem を作成しますが、サーバー環境には適していません。
**Parameters:**
| パラメーター | 型 | 説明 |
| --- | --- | --- |
| | value | [FileSystemFactory](../../com.aspose.threed/filesystemfactory) | 新しい値 **Example:** SaveOptions/LoadOptions のデフォルト FileSystem はディレクトリベースのファイルシステムです。IOConfig.FileSystemFactory を介して指定することでデフォルトの実装をオーバーライドできます: |
IOConfig.setFileSystemFactory(new FileSystemFactory() { @Override public FileSystem call() { return FileSystem.createDummyFileSystem(); } });
Scene scene = new Scene();
var material = new PhongMaterial();
var boxNode = scene.getRootNode().createChildNode(new Box());
boxNode.setMaterial(material);
//opt.FileSystem would be dummy file system now
var opt = new ObjSaveOptions();
scene.Save("output.obj", opt);
//the material file output.mtl will not be written to any places because we've configured a dummy file system as default implementation.
### setLookupPaths(ArrayList<String> value) {#setLookupPaths-java.util.ArrayList-java.lang.String--}
public void setLookupPaths(ArrayList
OBJ のような一部のファイルは外部ファイルに依存しており、検索パスにより Aspose.3D が外部ファイルを読み込むために探すことができます。
**Parameters:**
| パラメーター | 型 | 説明 |
| --- | --- | --- |
| | 値 | java.util.ArrayList<java.lang.String> | 新しい値 **Example:** 以下のコードは、テクスチャの検索パスを手動で指定する方法を示しており、インポーターが見つけられるようにします |
var opt = new ObjLoadOptions(); //Specify the lookup paths, so the textures can be located. opt.getLookupPaths().add(“textures”); var scene = Scene.fromFile(“input.obj”, opt); scene.save(“output.glb”);
### toString() {#toString--}
public String toString()
**Returns:**
java.lang.String
### wait() {#wait--}
public final void wait()
### wait(long arg0) {#wait-long-}
public final void wait(long arg0)
**Parameters:**
| パラメーター | 型 | 説明 |
| --- | --- | --- |
| arg0 | long | |
### wait(long arg0, int arg1) {#wait-long-int-}
public final void wait(long arg0, int arg1)
**Parameters:**
| パラメーター | 型 | 説明 |
| --- | --- | --- |
| arg0 | long | |
| arg1 | int | |