44
55namespace MeshIO . Formats . Fbx
66{
7- public class FbxReader : ReaderBase
7+ /// <summary>
8+ /// Provides functionality for reading and parsing FBX files or streams into scene objects.
9+ /// </summary>
10+ /// <remarks>
11+ /// The <see cref="FbxReader"/> supports reading FBX data from both file paths and streams. It exposes options for
12+ /// controlling the reading process via the Options property. Notifications and warnings encountered during reading can
13+ /// be handled by subscribing to the OnNotification event or by providing a notification handler.
14+ /// </remarks>
15+ public class FbxReader : SceneReader
816 {
17+ /// <summary>
18+ /// Gets the options used to control the behavior of the FBX reader.
19+ /// </summary>
20+ /// <remarks>Use this property to configure how FBX files are read, such as specifying import settings or
21+ /// handling of specific data types. The options are read-only; to modify them, update the properties of the returned
22+ /// <see cref="FbxReaderOptions"/> instance.</remarks>
923 public FbxReaderOptions Options { get ; } = new FbxReaderOptions ( ) ;
1024
1125 /// <summary>
12- /// Initializes a new instance of the <see cref=" FbxReader"/> class for the specified file .
26+ /// Initializes a new instance of the FbxReader class for reading FBX files from the specified path .
1327 /// </summary>
14- /// <param name="path">The complete file path to read from</param>
15- public FbxReader ( string path ) : base ( File . OpenRead ( path ) ) { }
28+ /// <param name="path">The file system path to the FBX file to be read. Cannot be null or empty.</param>
29+ /// <param name="notification">An optional delegate to receive notifications or warnings during the reading process. If null, notifications are not
30+ /// raised.</param>
31+ public FbxReader ( string path , NotificationEventHandler notification = null )
32+ : base ( path , notification ) { }
1633
1734 /// <summary>
18- /// Initializes a new instance of the <see cref=" FbxReader"/> class for the specified stream.
35+ /// Initializes a new instance of the FbxReader class to read FBX data from the specified stream.
1936 /// </summary>
20- /// <param name="stream">The stream to read from</param>
21- public FbxReader ( Stream stream ) : base ( stream ) { }
37+ /// <remarks>The caller is responsible for managing the lifetime of the provided stream. The FbxReader does not
38+ /// close or dispose the stream when finished.</remarks>
39+ /// <param name="stream">The input stream containing FBX data to be read. The stream must be readable and positioned at the start of the FBX
40+ /// content.</param>
41+ /// <param name="notification">An optional event handler for receiving notifications or warnings during the reading process. If null, notifications
42+ /// are not raised.</param>
43+ public FbxReader ( Stream stream , NotificationEventHandler notification = null )
44+ : base ( stream , notification ) { }
2245
2346 /// <summary>
2447 /// Read a fbx file into an scene
@@ -52,17 +75,15 @@ public static Scene Read(Stream stream, NotificationEventHandler notificationHan
5275 public FbxRootNode Parse ( )
5376 {
5477 FbxRootNode root ;
55- using ( IFbxParser parser = getParser ( this . _stream , this . Options ) )
78+ using ( IFbxParser parser = getParser ( this . _stream . Stream , this . Options ) )
5679 {
5780 root = parser . Parse ( ) ;
5881 }
5982
6083 return root ;
6184 }
6285
63- /// <summary>
64- /// Read the FBX file
65- /// </summary>
86+ /// <inheritdoc/>
6687 public override Scene Read ( )
6788 {
6889 FbxRootNode root = this . Parse ( ) ;
@@ -87,4 +108,4 @@ private static IFbxParser getParser(Stream stream, FbxReaderOptions options)
87108 return parser ;
88109 }
89110 }
90- }
111+ }
0 commit comments