Click or drag to resize
AB4D logo

ReaderObj Class

ReaderObj can read 3D models from obj files.
Inheritance Hierarchy
SystemObject
  Ab3dReaderObj

Namespace: Ab3d
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public class ReaderObj

The ReaderObj type exposes the following members.

Constructors
 NameDescription
Public methodReaderObj Constructor
Top
Properties
 NameDescription
Public propertyBitmapCacheOption Gets or sets a BitmapCacheOption that is used when creating bitmaps from files. Default value is OnLoad that caches the image in memory at load time (this does not lock the image file name).
Public propertyDetectEncodingFromByteOrderMarks Indicates whether to look for byte order marks at the beginning of the file to detect the text encoding (using in StreamReader constructor). Default value is true.
Public propertyErrors Gets a list of errors that occur during obj file loading.
Public propertyIgnoreErrors Gets or sets a Boolean that specifies if errors are ignored and reader tries to read as much data as possible. The error texts are written to Errors list.
Public propertyNamedObjects Gets a dictionary that can be used to get a 3D object by its name (key = name, value = Model3D)
Public propertyParentModelVisual3D ParentModelVisual3D need to be set in case the obj files will support reading 3D lines. The property need to be set the ModelVisual3D that will be the parent for the read 3D models.
Public propertyReadPolygonIndices Gets or sets a Boolean that specifies if PolygonIndicesProperty is set to the created MeshGeometry3D objects. This property defines the indexes of positions that define mesh polygons. This property is used only when the assimp scene was not read with Triangulation post process and when the Ab3d.PowerToys library is referenced. Default value is false.
Public propertyResolveResourceFunc Gets or sets a Func that returns stream from the specified resource name. This can be used to read resources from stream. The returned stream will be closed by the ReaderObj.
Top
Methods
 NameDescription
Public methodReadFile Reads the objFileName file and returns the ObjFileData object.
Public methodReadModel3D(String) Reads the 3D models from objFileName file and returns the 3d models as Model3DGroup or GeomentryModel3D. Textures directory is the same as obj file directory.
Public methodReadModel3D(Stream, FuncString, Stream) Reads the 3D models from stream and returns the 3d models as Model3DGroup or GeomentryModel3D. When the obj file have any additional resources (materials and textures), the resolveResourceFunc must be set a method that converts the resource name into Stream.
Public methodReadModel3D(Stream, FuncString, Stream, Material) Reads the 3D models from stream and returns the 3d models as Model3DGroup or GeomentryModel3D. When the obj file have any additional resources (materials and textures), the resolveResourceFunc must be set a method that converts the resource name into Stream.
Public methodReadModel3D(String, String, Material) Reads the 3D models from objFileName file and returns the 3d models as Model3DGroup or GeomentryModel3D.
Public methodReadStream Reads the obj file from specified stream and returns the ObjFileData object.
Top
See Also