PlySaveOptions

Inheritance: java.lang.Object, com.aspose.threed.IOConfig, com.aspose.threed.SaveOptions

public class PlySaveOptions extends SaveOptions

导出场景为 PLY 文件的保存选项。

构造函数

构造函数描述
PlySaveOptions()构造函数 PlySaveOptions
PlySaveOptions(FileContentType contentType)构造函数 PlySaveOptions

方法

方法描述
equals(Object arg0)
getAxisSystem()获取导出 stl 文件中的坐标系。
getClass()
getColorComponents()顶点颜色的组件名称,默认值为 (“red”, “green”, “blue”)
getEncoding()获取基于文本的文件的默认编码。
getExportTextures()尝试将场景中使用的纹理复制到输出目录。
getFaceElement()面数据的元素名称,默认值为 “face”
getFaceProperty()面数据的属性名称,默认值为 “vertex_index”
getFileFormat()获取当前保存/加载选项中指定的文件格式。
getFileName()导出/导入场景的文件名。
getFileSystem()允许用户处理在加载/保存期间如何管理外部依赖项。
getFileSystemFactory()获取 FileSystem 的工厂类。
getFlipCoordinate()保存场景时翻转坐标,默认值为 true
getLookupPaths()某些文件(如 OBJ)依赖外部文件,查找路径将允许 Aspose.3D 查找并加载外部文件。
getNormalComponents()法线数据的组件名称,默认值为 (“nx”, “ny”, “nz”)
getPointCloud()将场景导出为点云,默认值为 false。
getPositionComponents()位置数据的组件名称,默认值为 (“x”, “y”, “z”)
getTextureCoordinateComponents()纹理坐标数据的组件名称,默认值为 (“u”, “v”)
getVertexElement()顶点数据的元素名称,默认值为 “vertex”
hashCode()
notify()
notifyAll()
setAxisSystem(AxisSystem value)设置导出 STL 文件中的坐标系。
setColorComponents(Tuple_3<String,String,String> value)顶点颜色的组件名称,默认值为 (“red”, “green”, “blue”)
setEncoding(Charset value)设置基于文本的文件的默认编码。
setExportTextures(boolean value)尝试将场景中使用的纹理复制到输出目录。
setFaceElement(String value)面数据的元素名称,默认值为 “face”
setFaceProperty(String value)面数据的属性名称,默认值为 “vertex_index”
setFileName(String value)导出/导入场景的文件名。
setFileSystem(FileSystem value)允许用户处理在加载/保存期间如何管理外部依赖项。
setFileSystemFactory(FileSystemFactory value)设置 FileSystem 的工厂类。
setFlipCoordinate(boolean value)保存场景时翻转坐标,默认值为 true
setLookupPaths(ArrayList value)某些文件(如 OBJ)依赖外部文件,查找路径将允许 Aspose.3D 查找并加载外部文件。
setNormalComponents(Tuple_3<String,String,String> value)法线数据的组件名称,默认值为 (“nx”, “ny”, “nz”)
setPointCloud(boolean value)将场景导出为点云,默认值为 false。
setPositionComponents(Tuple_3<String,String,String> value)位置数据的组件名称,默认值为 (“x”, “y”, “z”)
setTextureCoordinateComponents(Tuple_2<String,String> value)纹理坐标数据的组件名称,默认值为 (“u”, “v”)
setVertexElement(String value)顶点数据的元素名称,默认值为 “vertex”
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

PlySaveOptions()

public PlySaveOptions()

构造函数 PlySaveOptions

PlySaveOptions(FileContentType contentType)

public PlySaveOptions(FileContentType contentType)

构造函数 PlySaveOptions

Parameters:

参数类型描述
contentTypeFileContentType

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

参数类型描述
arg0java.lang.Object

Returns: 布尔

getAxisSystem()

public AxisSystem getAxisSystem()

获取导出 stl 文件中的坐标系。

Returns: AxisSystem - the axis system in the exported stl file. Remarks: FlipCoordinateSystem must be enabled to utilize this feature.

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getColorComponents()

public Tuple_3<String,String,String> getColorComponents()

顶点颜色的组件名称,默认值为 (“red”, “green”, “blue”)

Returns: com.aspose.threed.Tuple_3<java.lang.String,java.lang.String,java.lang.String> - 顶点颜色的组件名称,默认值为 (“red”, “green”, “blue”)

getEncoding()

public Charset getEncoding()

获取基于文本的文件的默认编码。默认值为 null,表示导入器/导出器将决定使用哪种编码。

Returns: java.nio.charset.Charset - 基于文本的文件的默认编码。默认值为 null,表示导入器/导出器将决定使用哪种编码。

getExportTextures()

public boolean getExportTextures()

尝试将场景中使用的纹理复制到输出目录。

Returns: boolean - 尝试将场景中使用的纹理复制到输出目录。

getFaceElement()

public String getFaceElement()

面数据的元素名称,默认值为 “face”

Returns: java.lang.String - 面数据的元素名称,默认值为 “face”

getFaceProperty()

public String getFaceProperty()

面数据的属性名称,默认值为 “vertex_index”

Returns: java.lang.String - 面数据的属性名称,默认值为 “vertex_index”

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.

getFlipCoordinate()

public boolean getFlipCoordinate()

保存场景时翻转坐标,默认值为 true

Returns: boolean - 保存场景时翻转坐标,默认值为 true

getLookupPaths()

public ArrayList<String> getLookupPaths()

某些文件(如 OBJ)依赖外部文件,查找路径将允许 Aspose.3D 查找并加载外部文件。

Returns: java.util.ArrayList<java.lang.String> - 某些文件(如 OBJ)依赖外部文件,查找路径将允许 Aspose.3D 查找并加载外部文件。示例: 以下代码展示了如何手动指定查找纹理,以便导入器能够找到。

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");

getNormalComponents()

public Tuple_3<String,String,String> getNormalComponents()

法线数据的组件名称,默认值为 (“nx”, “ny”, “nz”)

Returns: com.aspose.threed.Tuple_3<java.lang.String,java.lang.String,java.lang.String> - 法线数据的组件名称,默认值为 (“nx”, “ny”, “nz”)

getPointCloud()

public boolean getPointCloud()

将场景导出为点云,默认值为 false。

Returns: boolean - 将场景导出为点云,默认值为 false。

getPositionComponents()

public Tuple_3<String,String,String> getPositionComponents()

位置数据的组件名称,默认值为 (“x”, “y”, “z”)

Returns: com.aspose.threed.Tuple_3<java.lang.String,java.lang.String,java.lang.String> - 位置数据的组件名称,默认值为 (“x”, “y”, “z”)

getTextureCoordinateComponents()

public Tuple_2<String,String> getTextureCoordinateComponents()

纹理坐标数据的组件名称,默认值为 (“u”, “v”)

Returns: com.aspose.threed.Tuple_2<java.lang.String,java.lang.String> - 纹理坐标数据的组件名称,默认值为 (“u”, “v”)

getVertexElement()

public String getVertexElement()

顶点数据的元素名称,默认值为 “vertex”

Returns: java.lang.String - 顶点数据的元素名称,默认值为 “vertex”

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setAxisSystem(AxisSystem value)

public void setAxisSystem(AxisSystem value)

设置导出 STL 文件中的坐标系。

Parameters:

参数类型描述
valueAxisSystem新值 Remarks: 必须启用 FlipCoordinateSystem 才能使用此功能。

setColorComponents(Tuple_3<String,String,String> value)

public void setColorComponents(Tuple_3<String,String,String> value)

顶点颜色的组件名称,默认值为 (“red”, “green”, “blue”)

Parameters:

参数类型描述
com.aspose.threed.Tuple_3<java.lang.String,java.lang.String,java.lang.String>新值

setEncoding(Charset value)

public void setEncoding(Charset value)

设置基于文本文件的默认编码。默认值为 null,表示导入器/导出器将决定使用哪种编码。

Parameters:

参数类型描述
java.nio.charset.Charset新值

setExportTextures(boolean value)

public void setExportTextures(boolean value)

尝试将场景中使用的纹理复制到输出目录。

Parameters:

参数类型描述
布尔新值

setFaceElement(String value)

public void setFaceElement(String value)

面数据的元素名称,默认值为 “face”

Parameters:

参数类型描述
java.lang.String新值

setFaceProperty(String value)

public void setFaceProperty(String value)

面数据的属性名称,默认值为 “vertex_index”

Parameters:

参数类型描述
java.lang.String新值

setFileName(String value)

public void setFileName(String value)

导出/导入场景的文件名。此项是可选的,但在序列化外部资源(如 OBJ 的材质)时很有用。

Parameters:

参数类型描述
java.lang.String新值

setFileSystem(FileSystem value)

public void setFileSystem(FileSystem value)

允许用户处理在加载/保存期间如何管理外部依赖项。

Parameters:

参数类型描述
valueFileSystem
  • 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) | 新值 **示例:** 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.

### setFlipCoordinate(boolean value) {#setFlipCoordinate-boolean-}

public void setFlipCoordinate(boolean value)



保存场景时翻转坐标,默认值为 true

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| 值 | 布尔 | 新值 |

### setLookupPaths(ArrayList<String> value) {#setLookupPaths-java.util.ArrayList-java.lang.String--}

public void setLookupPaths(ArrayList value)



某些文件(如 OBJ)依赖外部文件,查找路径将允许 Aspose.3D 查找并加载外部文件。

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
|  | 值 | java.util.ArrayList<java.lang.String> | 新值 **示例:** 以下代码展示了如何手动指定查找纹理,以便导入器能够找到。 |

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”);


### setNormalComponents(Tuple_3<String,String,String> value) {#setNormalComponents-com.aspose.threed.Tuple-3-java.lang.String-java.lang.String-java.lang.String--}

public void setNormalComponents(Tuple_3<String,String,String> value)



法线数据的组件名称,默认值为 ("nx", "ny", "nz")

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| 值 | com.aspose.threed.Tuple_3<java.lang.String,java.lang.String,java.lang.String> | 新值 |

### setPointCloud(boolean value) {#setPointCloud-boolean-}

public void setPointCloud(boolean value)



将场景导出为点云,默认值为 false。

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| 值 | 布尔 | 新值 |

### setPositionComponents(Tuple_3<String,String,String> value) {#setPositionComponents-com.aspose.threed.Tuple-3-java.lang.String-java.lang.String-java.lang.String--}

public void setPositionComponents(Tuple_3<String,String,String> value)



位置数据的组件名称,默认值为 ("x", "y", "z")

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| 值 | com.aspose.threed.Tuple_3<java.lang.String,java.lang.String,java.lang.String> | 新值 |

### setTextureCoordinateComponents(Tuple_2<String,String> value) {#setTextureCoordinateComponents-com.aspose.threed.Tuple-2-java.lang.String-java.lang.String--}

public void setTextureCoordinateComponents(Tuple_2<String,String> value)



纹理坐标数据的组件名称,默认值为 ("u", "v")

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| 值 | com.aspose.threed.Tuple_2<java.lang.String,java.lang.String> | 新值 |

### setVertexElement(String value) {#setVertexElement-java.lang.String-}

public void setVertexElement(String value)



顶点数据的元素名称,默认值为 "vertex"

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| 值 | java.lang.String | 新值 |

### 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 |  |