========= Exporting ========= The MFC Sandbox can export to the HOOPS Visualize native format, HSF (HOOPS Stream File), which is a visualization-only format. Additionally, a few 2D images formats are available as well as 2D and 3D PDF. Exporting an HSF file is as simple as calling `HPS::Stream::File::Export `_ with a few parameters. The sandbox will look for a model in its segment tree, and if it finds one, it will export that model tree to the file: .. literalinclude:: /source/CProgressDialog.cpp :language: cpp :start-after: //! [on_timer_export] :end-before: //! [on_timer_export] Notice that in this example, we are using a modal progress dialog to watch the export. It polls the associated `HPS::Stream::ExportNotifier `_ for status, and will try to draw the scene once it is no longer in progress. Other file formats use different exporters and export notifiers, so be sure to use one appropriate for the model you're working with. For example, to export your scene to a JPEG, use `HPS::Image::File::Export `_ with an `ExportOptionsKit `_ configured for JPEG. Exporting to 2D PDF is similar to HSF, except we use `HPS::Hardcopy::File::Export `_: .. literalinclude:: /source/CHPSView.cpp :language: cpp :start-after: //! [export_2d_pdf] :end-before: //! [export_2d_pdf] When exporting 3D PDFs, you need to specify where the HOOPS Publish resource dir is located. Normally this is going to be */resource/bin*. Note that when exporting in 3D, you must provide a valid HPS::SprocketPath `_, which is a special type of `HPS::KeyPath `_ which can be employed when you're using a view hierarchy. .. literalinclude:: /source/CHPSView.cpp :language: cpp :start-after: //! [export_3d_pdf] :end-before: //! [export_3d_pdf]