This guide explains how to use the functionality provided by the HOOPS/MFC Classes.
The HOOPS/MFC headers, export library, source code, and prebuilt release and debug DLLs are located in the /dev_tools/hoops_mfc subdirectories. The /dev_tools/hoops_mfc/source directory includes the Microsoft Developer Studio Project files to enable manual rebuilding on Windows.
The HOOPS/MFC component has been tested and is supported on all the major Windows platforms.
Within the HOOPS installation, you will find several versions of HOOPS/MFC available. Each variety offers different features that developers might find useful as a foundation for their application. Note that each library has specific linking and distribution requirements. The following is a list of the available libraries found in the <hoops>\Dev_Tools\hoops_mfc\lib\<platform> directory:
For developers with applications that do not use Unicode, the HOOPS/MFC library must be rebuilt manually with the correct preprocessor directives.
The CHoopsView object supports native Windows printing and print-preview, by providing a HOOPS/MFC-specific implementation of the CView::OnPrint virtual function. The associated HBaseView scene will be sent to the printer. Refer to the HOOPS/MVO startup segment structure.
The following CHoopsView class members provide additional HOOPS/MFC-specific control of the underlying printing logic:
If you needed to perform additional application-specific logic within the CHoopsView::OnPrint method, you could implement the function in your app-specific CHoopsView class, and call the base class, CHoopsView::OnPrint, to perform the HOOPS-specific printing.
The HOOPS/MFC-specific OnPrint logic is based on HOOPS/MVO output support, and therefore utilizes an overloaded version of the HOutputHandlerOptions class, called GDIExportInformation. This structure can be customized by modifying the CPrintInfo data as follows:
HOOPS/MVO output supports 'output to scale'. See Section 4.3.2 of the HOOPS/MVO Programming Guide for more info. The following example shows how we could print the scene with a specific scaling factor:
Generating raster output can require high memory footprint, particular on larger format devices. The following members of GDIExportInformation allow the developer to control how the raster output is generated:
If you wish to modify these values (rather than use the defaults), pass in a customer version of the GDIExportInformation structure into CHoopsView::OnPrint as follows:
The CHoopsView object supports Windows "Copy to Clipboard" by providing a HOOPS/MFC-specific implementation of the CView::OnEditCopy message map function. Similar to CHoopsView::OnPrint, the CHoopsView::OnEditCopy function will copy the associated HBaseView scene to the clipboard.
The following CHoopsView class members provide for control of the underlying clipboard logic:
If you needed to perform additional application-specific logic within the handling of the CHoopsView::OnEditCopy message, you could add this function to the message-map of your app-specific CHoopsView class, and call the base class, CHoopsView::OnEditCopy to perform the HOOPS-specific "Copy to Clipboard".
Windows palette management becomes a concern when using the HOOPS Visualize MSW driver for display on 8-bit systems, which should be quite rare considering that all computer displays support 24-bit or higher color.
Nonetheless, the HOOPS/MFC classes provide support for creating a Windows palette and sharing it among multiple CHoopsView objects, in order to support 8-bit color mode when using the MSW driver. Creation of the shareable palette is enabled by default, but the palette needs to be accessed and passed into each HOOPS/MVO View object during it's creation.
The shared palette is accessed via the CHoopsView::GetPalette function, and passed into HOOPS Visualize via the HBaseView object's constructor. The following code is used in the CMyHoopsView constructor to pass the shared palette to Visualize: